Game Development Community

The Universal AI Starter Kit

by Twisted Jenius · in General Add-On Discussion · 09/24/2009 (4:30 am) · 191 replies

If you have any pre-purchase questions about The Universal AI Starter Kit, post them here and I'll get back to you as soon as I can. If you have already purchased The UAISK and have a question, please post it in our private forum.

As of December 22, 2011 version 1.9.0 is the most recent version of The Universal AI Starter Kit.


Made with T3D 1.2 Chinatown demo and The UAISK version 1.9


Made with T3D 1.1 South Pacific demo and The UAISK version 1.8


Made with The UAISK version 1.7 + Arcane-FX 2


Made with The UAISK version 1.4


Made with The UAISK version 1.0


Made with The UAISK version 1.4


Made with The UAISK version 1.1

About the author

Developer of The Universal AI Starter Kit and Twisty's Asylum Escapades.

#41
09/29/2009 (6:44 am)
Federico, I am sure that the concepts behind the work by TJ would apply to Torque X, as there is a lot of overlap. You have to remember that C# is nothing like TorqueScript though ;)
#42
09/29/2009 (10:32 am)
Hey Twisted, I am glad that you were able to get this AI pack out just a month before they will be removing the 2 engines you support for sale. Any thoughts on what you will do once the sales stop for these engines and your AI kit will no longer be valid for future individuals (unless someone with a t3d writes a resource as tends to happen with these things.

www.garagegames.com/community/blog/view/18393/
#43
09/29/2009 (10:43 am)
Just minutes before I starting writing this reply, I just finished up making some "unofficial" T3D install instructions that I based off the new T3D demo. So while I'm still not sure when I'll officially start giving support for T3D (meaning I'm not sure when I will upgrade to T3D), soon it will be fairly easy to get the kit installed in T3D; even if I only give limited tech support after that.
#44
09/29/2009 (11:01 am)
awesome thats good news, out of this train wreck.
#45
10/02/2009 (12:49 am)
@Twisted, I have been experimenting with your kit for a while now, and am just finding the editor a bit dodgy, but your update should fix that :D

Anywho...with your update of this kit, could you include a pre-merged version of the kit with FPS Starter Kit with the levels in the video?

Also, could you include another pre-merged version but with the server-side melee system implemented and the demo level you show in the video set up as an example of exactly how the "RPG Demo" works?

From Max

PS. In the mean time, can you send me the RPG Demo folder setup with updated exe and demo mission? macz_202 [at] hotmail [dot] com
#46
10/02/2009 (8:38 am)
Editor improvements and a pre-merged version of the script (so that, if you're using a stock project, you can install the kit in a matter of second) will be in the next release. I'm going to try to be finished with the update by October 6. But recently GarageGames has been slow about updating 3rd party products; so even if I'm done on the 6th, it might be a while after that until you can download it.

As for the RPG demo, the two orcs that come out from behind the brush and changing the elf to the reaper were both done using triggers. The next update will include a function that will help you swap one bot for another, and then you'd just call that function from a trigger or NPC dialogue response. I still have the script that I used for the RPG demo, but I no longer have the mission file. But all that was in the mission file was 4 spawn markers and 2 triggers (plus everything that just comes with the stock version of that demo).
#47
10/02/2009 (9:10 am)
@Twisted, Well if you still have the scripts from the RPG Demo, and the compiled .exe with server-side melee...could you please send to me?

From Max

PS. email is stated above
#48
10/06/2009 (7:22 am)
hi Twisted
may i ask the AI Starter Kit can use for tgea 1.7.1 or 1.8.1 ?
need edit anything?
#49
10/06/2009 (11:34 am)
The stock TGEA version is made for 1.8.1. To use it with 1.7.X you might have to change around the file paths a little, but that should be the only change that is needed.
#50
10/06/2009 (6:36 pm)
The Universal AI Starter Kit version 1.1 can now be downloaded from the products section of your account. I should have a tutorial video and blog about it up in a few days.
#51
10/07/2009 (12:54 pm)
Hi, so installed, its spawning but its giving 2 spawns, and they arent responding.

edit: ok found the problem, apparently the spawner was replicated for some reason, not sure if it was user error, but deleted a bunch of copies.
#52
10/07/2009 (3:24 pm)
Excellent Update Twisted, Keep it coming.....How far are you from enabling Recast with it and will there be a guide on how to install Recast along with this excellent AI we now have? Also on the find cover issue, how close are we on that or the get health and ammo problem??I think if you did get Recast going, it would give us an easy way for the bots to find cover when shot ot shot at........Donnie
#53
10/07/2009 (6:10 pm)
@Donnie Hutson Jr.

To let everyone know my thoughts and plans on these various issues:

I am planning on adding in support for Recast and I'll have install instructions whenever it is released, but I have no time frame for when that work will be done. It may be months before that is complete, so don't get too excited just yet.

As for item retrieval, I'm not sure if I'll ever get around to fixing it. It's something that I'd like to see in the kit, but it's not my highest priority and I may not have time to fix it.

As for a cover system, I have never had or expressed any intention of adding a cover system into The Universal AI Starter Kit. This would be a customization which you would need to do yourself. The comments I made before about a cover system were to point you in the right direction to make your own system; they were not an indication of a system I plan to add in.

I was able to put out version 1.1 relatively quickly, but it's likely that future updates will take a bit longer.
#54
10/07/2009 (6:16 pm)
thats very awesome, as a point of interest, in a future update? could you add a onDeath drop function for say.. ammo or a piece of loot that can picked up by the player.
#55
10/07/2009 (6:38 pm)
@Edward,
its already there in your players functions...
#56
10/07/2009 (10:06 pm)
Recast can't wait, Iteam retrieve ok no prob...To bad about the cover system, I always thought it should of been apart of what your doing, but hey thats just me, I still love the pack.....Keep up the hard work.....Donnie
#57
10/07/2009 (10:52 pm)
there was work on a tactical ai kit, dont know whats coming with.
#58
10/08/2009 (1:03 pm)
Ya, I prob.. get that kit too....I love supporting the community and learning from them at the same time....I have installed Astar, but he said he's using Recast or will be anyways. Astar was easy to install, but using it with this kit, got confusing. I think deepscratch is using Astar and if you are deepscratch, can you give me alittle poinnter on how to send the bot for cover when damaged. I really think thats all their would be for a good impression for AI, doing what it does now, just seek cover when fired at or hit, thats all. Like I said I know he's not doing a cover system for his AI, But I would like to, with this kit, so if anyone has any script ideas please by all means let me know and if I find away to add it with this kit, I'll post it here for any users of this kit.......Donnie If thats ok with Twisted...

By the way I did see bryce do something like this in a post but don't know how to do it with this kit.......

function AIPlayer::findCover(%this, %attacker)
{
for (%i = 0; %i < 50; %i++)
{
%x = getRandom(-25, 25);
%x = firstWord(%this.getPosition()) + %x);
%y = getRandom(-25, 25);
%y = getWord(%this.getPosition(), 1) + %y);
%start = %x SPC %y SPC getTerrainHeight(%x SPC %y) + 3;
%end = %attacker.getWorldBoxCenter();
masks = $TypeMasks::InteriorObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticTSObjectType;
if (ContainerRayCast(%start, %end, %masks, %obj))
{
%cover = ContainerFindFirst($TypeMasks::InteriorObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticTSObjectType, %start, %end);
%intersect = getWords(%cover,1,3);
%newPos = VectorSub(%intersect, "0 -2 0"); // Move the point 2 units back
%this.setMoveDestination(%newPos);
return %cover;
}
else
{
if (%i >= 50) // If no cover at the end of the loop
{
%this.setAimObject(%attacker);
%this.singleShot(); // Not exactly single. More like slow auto.
}
}
}
}

I wonder if bryce might know or help.......Donnie
#59
10/08/2009 (2:54 pm)
@ Edward

To add in loot drops, in the OnDamage function in aiPlayerDatablocks.cs you'll see some code like:
if (%obj.getstate() $= "Dead")
   		%obj.action = "Dead";

Change that to something like:
if (%obj.getstate() $= "Dead")
    {
   		%obj.action = "Dead";

       new Item() {
          canSaveDynamicFields = "1";
          Enabled = "1";
          position = %obj.getPosition();
          rotation = %obj.rotation;
          scale = "1 1 1";
          dataBlock = "CrossbowAmmo";
          collideable = "0";
          static = "1";
          rotate = "1";
          rotate2 = "0";
       };
    }

That should give you a starting place.
#60
10/08/2009 (2:56 pm)
@Donnie Hutson Jr.

As I said, I'm not planning on creating a cover system. But I will support you guys making one as much as time will allow me to.

Note- I haven't tested this at all, so it may not work.

In the damage function in player.cs you'll see some code like:
//If this is a bot, set its attention level
   if (%obj.isbot == true)
   {

Inside that if add:
AIPlayer::findCover(%obj, %sourceObject);

Then put the following in aiPlayer.cs:

function AIPlayer::findCover(%this, %attacker)
{
    for (%i = 0; %i < 50; %i++)
    {
        //Get the bot's position plus a random ammount to use as the starting place
        %x = getRandom(-25, 25);
        %x = firstWord(%this.getPosition()) + %x);
        %y = getRandom(-25, 25);
        %y = getWord(%this.getPosition(), 1) + %y);
        %start = %x SPC %y SPC getTerrainHeight(%x SPC %y) + 3;
        //Get the attacker's position to use as the ending place
        %end = %attacker.getWorldBoxCenter();
        //Set the types of cover that can be used
        %masks = $TypeMasks::InteriorObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticTSObjectType;

        //Check if any cover was in between the start and end
        if (ContainerRayCast(%start, %end, %masks, %obj))
        {
            //If there was cover, get what it is
            %cover = ContainerFindFirst($TypeMasks::InteriorObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticTSObjectType, %start, %end);
            %intersect = getWords(%cover,1,3);
            //Move the cover point 2 units back
            %newPos = VectorSub(%intersect, "0 -2 0");
            //Set the bot to move to the cover point
            %this.setMoveDestination(%newPos);
            return %cover;
        }
        else
        {
            //If no cover at the end of the loop
            if (%i >= 50)
                %this.setAimObject(%attacker);
        }
    }
}

*I edited this post due to an error.