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
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.
#62
so you got the Astar resource in?
no problems?
and if you command them from console, they obey?
if so,
then in the same place that the AIPlayer::findCover was:
easy as that.
10/08/2009 (5:34 pm)
@Donnie,so you got the Astar resource in?
no problems?
and if you command them from console, they obey?
if so,
then in the same place that the AIPlayer::findCover was:
//If this is a bot, set its attention level
if (%obj.isbot == true)
{
AIPlayer::findCover(%obj, %sourceObject);//THIS PLACEinstead put this://If this is a bot, set its attention level
if (%obj.isbot == true)
{
%obj.findCoverFrom(%sourceObject);//THIS PLACEyour bot will now find a path out of sight of the sourceObject(the shooter)easy as that.
#63
10/08/2009 (7:26 pm)
Deepscratch, looks like we have a winner, that works great.....PERFECT.......Donnie
#64
I'm working on integrating the functions into the kit,
its a huge job though, lots of lines....
10/08/2009 (7:50 pm)
awesome.I'm working on integrating the functions into the kit,
its a huge job though, lots of lines....
#65
One thing I did do to get my guys moving again was to replace setMoveDestination to findPathTo in the aiplayer.cs file, if that helps deepscratch......
Also, any chance you get the AI to follow a specific path, like Path1 or something, or is this also in the integration works???
10/08/2009 (10:51 pm)
Deepscratch, Any hopes in sharing how you integrate the astar commands into the kit???.........DonnieOne thing I did do to get my guys moving again was to replace setMoveDestination to findPathTo in the aiplayer.cs file, if that helps deepscratch......
Also, any chance you get the AI to follow a specific path, like Path1 or something, or is this also in the integration works???
#66
I use this to score points when shooting my Aiplayer, put it in function Armor::damage, %sourceClient.incScore(10);........Gives me 10 points per shot.......Donnie
10/10/2009 (7:26 pm)
Anybody know how to score Aiplayer Kills, like player kills Aiplayer and scores 1 kill???I use this to score points when shooting my Aiplayer, put it in function Armor::damage, %sourceClient.incScore(10);........Gives me 10 points per shot.......Donnie
#67
Also there is a bug that was introduced in version 1.1 that can prevent bots from using paths properly. Here's how to fix it.
In aiPlayer.cs in function AIPlayer::spawn() change:
To:
This fix will be in the next update.
10/14/2009 (9:10 pm)
The new tutorial video is now in the original post.Also there is a bug that was introduced in version 1.1 that can prevent bots from using paths properly. Here's how to fix it.
In aiPlayer.cs in function AIPlayer::spawn() change:
//If the bot is pathed, have it go on its path soon
if (%obj.pathname !$= "")
%player.schedule($AISK_CREATION_DELAY, "followPath", %obj.pathname);To:
//If the bot is pathed, have it go on its path soon
if (%obj.pathname !$= "")
{
%player.action = "Holding";
%player.schedule($AISK_CREATION_DELAY, "followPath", %obj.pathname);
}This fix will be in the next update.
#68
10/15/2009 (1:12 pm)
Ya, thats why........Seems to work better now. Thanks Twisted
#69
is it possible to use your AI resource with T3D ???
Thank you,
Stefano.
10/25/2009 (7:47 am)
Hi,is it possible to use your AI resource with T3D ???
Thank you,
Stefano.
#70
10/25/2009 (12:19 pm)
I believe Twisted has said the kit includes install instructions for T3D.
#71
As Daniel said, there are T3D install instructions. Currently I don't own T3D Pro so all of my instructions and support are based off of the demo version.
It's likely (but not guaranteed) that I'll upgrade to T3D Artist once that is released. Because The Universal AI Starter Kit is entirely script based, I (and others) shouldn't need the source code to use the kit. And from what I've heard, the AI source code hasn't changed very much between TGEA and T3D so far (just like it didn't change much between TGE and TGEA).
10/25/2009 (7:31 pm)
@ StefanoAs Daniel said, there are T3D install instructions. Currently I don't own T3D Pro so all of my instructions and support are based off of the demo version.
It's likely (but not guaranteed) that I'll upgrade to T3D Artist once that is released. Because The Universal AI Starter Kit is entirely script based, I (and others) shouldn't need the source code to use the kit. And from what I've heard, the AI source code hasn't changed very much between TGEA and T3D so far (just like it didn't change much between TGE and TGEA).
#72
Twisted needs a complimentary Dev copy of T3D...c'mon, it's the least you can do for a guy who has spent close to a year developing an awesome AI tute and scripts for 2 products you're now discontinuing! We NEED him to update it for T3D ASAP. It's my humble opinion that this kind of info should be included in the docs but since it's not...the least you could do is get him a copy for free!
Now that I've put in a good word for ya and actually bought the kit myself...may I ask a few questions? lol
I'm new to Torque, never had TGE, barely cracked open TGEA to take a peak when suddenly T3D was announced. I bought the beta version then I got busy with other things and just waited for the final release and have just started working in T3D. I'm not a programmer at all so please bare (bear?) with me...
I got the bot working and chasing me around after a lot of hair-pulling and cussing. But, I have no clue how to make him a distinct character using his own datablock and all of that. You touch on it lightly in the beginning but to a noob non-programmer like me it's nearly greek. I realize this is somewhat out of the scope of your kit but I still need to know because, so help me, I don't see the details covered anywhere else either.
I have a new character/monster that has .dsq files for animations and all of that and seems to work fine.
What I don't get is the steps to make him an entity all his own without using the DefaultPlayer file. It's just fuzzy. I'm getting close I think.
"Change "DefaultPlayer" in the function's name to whatever the name of your datablock is going to be. After that, add your new datablock to aiPlayerDatablocks.cs making sure that the name of the datablock is unique, and the body type is valid; e.g. datablock PlayerData(UniqueName : ValidBody). Then set any AI specific per datablock variables that you wish to set; but none are required. Now simply set your datablock's name as the value of the block variable on your AIPlayerMarker and spawn the bot. "
What's a body type? Is that the name of the .dts file?
Do I just rename aiplayer.cs to a name I want for my character? Is aiplayer.cs just a placeholder name? Do I create a new one for each new AI I want?
Next problem is, I want him to throw an object at the player rather than shoot a gun. He already has an animation showing him throwing it called attack1. Do I call the object a weapon or ammo? How would I edit the scripts to make it work?
Thirdly, this is a multi-player game. Any clues as to what I 'might' have to do to make it all work?
Thanks a ton for any help!
10/28/2009 (1:05 am)
Attn GG...er TP, Twisted needs a complimentary Dev copy of T3D...c'mon, it's the least you can do for a guy who has spent close to a year developing an awesome AI tute and scripts for 2 products you're now discontinuing! We NEED him to update it for T3D ASAP. It's my humble opinion that this kind of info should be included in the docs but since it's not...the least you could do is get him a copy for free!
Now that I've put in a good word for ya and actually bought the kit myself...may I ask a few questions? lol
I'm new to Torque, never had TGE, barely cracked open TGEA to take a peak when suddenly T3D was announced. I bought the beta version then I got busy with other things and just waited for the final release and have just started working in T3D. I'm not a programmer at all so please bare (bear?) with me...
I got the bot working and chasing me around after a lot of hair-pulling and cussing. But, I have no clue how to make him a distinct character using his own datablock and all of that. You touch on it lightly in the beginning but to a noob non-programmer like me it's nearly greek. I realize this is somewhat out of the scope of your kit but I still need to know because, so help me, I don't see the details covered anywhere else either.
I have a new character/monster that has .dsq files for animations and all of that and seems to work fine.
What I don't get is the steps to make him an entity all his own without using the DefaultPlayer file. It's just fuzzy. I'm getting close I think.
"Change "DefaultPlayer" in the function's name to whatever the name of your datablock is going to be. After that, add your new datablock to aiPlayerDatablocks.cs making sure that the name of the datablock is unique, and the body type is valid; e.g. datablock PlayerData(UniqueName : ValidBody). Then set any AI specific per datablock variables that you wish to set; but none are required. Now simply set your datablock's name as the value of the block variable on your AIPlayerMarker and spawn the bot. "
What's a body type? Is that the name of the .dts file?
Do I just rename aiplayer.cs to a name I want for my character? Is aiplayer.cs just a placeholder name? Do I create a new one for each new AI I want?
Next problem is, I want him to throw an object at the player rather than shoot a gun. He already has an animation showing him throwing it called attack1. Do I call the object a weapon or ammo? How would I edit the scripts to make it work?
Thirdly, this is a multi-player game. Any clues as to what I 'might' have to do to make it all work?
Thanks a ton for any help!
#73
Actually making new datablocks for different types of bots is well within the scope of this kit.
In that context, a body type is another datablock which your new datablock will be based on. In most cases you should just use the player's datablock as the base.
How to make a new datablock:
-Open aiPlayerDatablocks.cs.
-Copy and paste all of the follow so that you two of each of them (of course copy/paste the whole thing and not just the names):
-In the function/datablock names above you'll see that all 3 have "DefaultPlayer" somewhere in the name. Change the word "DefaultPlayer" to another name that represents the new bot that you want to make. The name doesn't really matter as long as it's the same word in all 3 and doesn't any spaces or weird punctuation marks.
-In your new version of "datablock PlayerData()" that you just made, change the line:
-Then set your marker to use the new datablock and you're done. There’s no need to mess with aiPlayer.cs at all. I hope that made sense. I'll see about updating the "Characters" section of the usage instructions to be easier to find and follow.
It should be a weapon. The script to make the weapon work properly is out of the scope of this kit, do a search for adding new weapons and you should find something.
Honestly, I don't have any clues. As I say in the instructions, I haven't done any testing for multiplayer at all; none whatsoever. Which means, for all I know, it could already work fine as is. In fact it's more likely that it works fine already than that it doesn't work at all; but the most likely thing is that it works ok but still needs a few minor adjustments.
10/28/2009 (1:45 am)
Quote:I realize this is somewhat out of the scope of your kit but I still need to know because, so help me, I don't see the details covered anywhere else either.
Actually making new datablocks for different types of bots is well within the scope of this kit.
Quote:What's a body type? Is that the name of the .dts file?
In that context, a body type is another datablock which your new datablock will be based on. In most cases you should just use the player's datablock as the base.
Quote:Do I just rename aiplayer.cs to a name I want for my character? Is aiplayer.cs just a placeholder name? Do I create a new one for each new AI I want?
How to make a new datablock:
-Open aiPlayerDatablocks.cs.
-Copy and paste all of the follow so that you two of each of them (of course copy/paste the whole thing and not just the names):
datablock PlayerData(DefaultPlayer : PlayerBody) function DefaultPlayer::onReachDestination(%this, %obj) function DefaultPlayer::OnDamage(%this, %obj, %delta)
-In the function/datablock names above you'll see that all 3 have "DefaultPlayer" somewhere in the name. Change the word "DefaultPlayer" to another name that represents the new bot that you want to make. The name doesn't really matter as long as it's the same word in all 3 and doesn't any spaces or weird punctuation marks.
-In your new version of "datablock PlayerData()" that you just made, change the line:
shapeFile = "~/data/shapes/player/player.dts";To point to the dts file you'd like to use. You can also change the value of other variables as needed.
-Then set your marker to use the new datablock and you're done. There’s no need to mess with aiPlayer.cs at all. I hope that made sense. I'll see about updating the "Characters" section of the usage instructions to be easier to find and follow.
Quote:Do I call the object a weapon or ammo? How would I edit the scripts to make it work?
It should be a weapon. The script to make the weapon work properly is out of the scope of this kit, do a search for adding new weapons and you should find something.
Quote:Thirdly, this is a multi-player game. Any clues as to what I 'might' have to do to make it all work?
Honestly, I don't have any clues. As I say in the instructions, I haven't done any testing for multiplayer at all; none whatsoever. Which means, for all I know, it could already work fine as is. In fact it's more likely that it works fine already than that it doesn't work at all; but the most likely thing is that it works ok but still needs a few minor adjustments.
#74
10/28/2009 (2:02 pm)
I was wondering Twisted. If you wanted to do another simple update. Perhaps you could do each of the builds seperate instead of all combined together like that. The different modes like chase mode / turret / NPC. Just make them seperate just in case someone will only be using one type or something like that. Secondly it makes your script code much easier to read if you only have to look at just one type of style. Just and Idea no forcing or anything.
#75
So I'd put them in separate functions (or maybe even files in some cases) so it's easier to get rid of the unneeded ones? Yeah, I could do that to some of the behaviors. Thanks for the suggestion.
When you say "style" do you mean the formatting or the code itself?
If you mean formatting, I thought I was pretty good about keeping it the same in the 4 main script files (almost compulsively so). If you could be more specific about exactly what's out of place, I'll see about fixing it.
If you mean the code, in a few places I purposely used different ways to code the same thing. I did this to provide different examples of how things can be scripted. This makes The Universal AI Starter Kit a pretty good tool for learning about TorqueScript.
10/28/2009 (9:32 pm)
Quote:Perhaps you could do each of the builds seperate instead of all combined together like that. The different modes like chase mode / turret / NPC. Just make them seperate just in case someone will only be using one type or something like that.
So I'd put them in separate functions (or maybe even files in some cases) so it's easier to get rid of the unneeded ones? Yeah, I could do that to some of the behaviors. Thanks for the suggestion.
Quote:Secondly it makes your script code much easier to read if you only have to look at just one type of style.
When you say "style" do you mean the formatting or the code itself?
If you mean formatting, I thought I was pretty good about keeping it the same in the 4 main script files (almost compulsively so). If you could be more specific about exactly what's out of place, I'll see about fixing it.
If you mean the code, in a few places I purposely used different ways to code the same thing. I did this to provide different examples of how things can be scripted. This makes The Universal AI Starter Kit a pretty good tool for learning about TorqueScript.
#76
Breaking it up in functions may help, but what I noticed was as most people do, it was simply over commented.
if using default Torsion the color difference of the comments and the actual code is not much unless the user changes their default.
Turning comments to a dark grey color made a big difference.
10/28/2009 (9:55 pm)
I purchased the code and downloaded installed in T3D and ran into some errors, however I scraped it as I did find the code a little hard to read.Breaking it up in functions may help, but what I noticed was as most people do, it was simply over commented.
if using default Torsion the color difference of the comments and the actual code is not much unless the user changes their default.
Turning comments to a dark grey color made a big difference.
#77
10/28/2009 (10:59 pm)
Bought it. Installed it. Loving it. Want more!!!
#78
10/28/2009 (11:09 pm)
One thing I have noticed is that the bot does not play a death animation when killed. It simply freezes in place until respawn. Anyone else having this issue?
#79
So the main problem you've had was that the code had too many comments? If other people feel the same way, I could just delete some of the comments. A lot of my comments aren't really necessary anyway since I named everything fairly well; and if you know TorqueScript, it's not that hard to figure out what's going on most of the time.
@ Ilidrake
Yes, I also noticed that the death animations for the bots don't play in T3D (but they work fine in TGE and TGEA). I'll see about fixing that in the next release.
@ Everyone
The next version will likely be 1.2.0 but it probably won't be out for at least a month or two (so don't get too excited just yet).
EDIT- Nov. 12, 2009: I have fixed the death animation bug in my internal build and it will be included in the next release (whenever that is).
10/29/2009 (12:12 am)
@ RandySo the main problem you've had was that the code had too many comments? If other people feel the same way, I could just delete some of the comments. A lot of my comments aren't really necessary anyway since I named everything fairly well; and if you know TorqueScript, it's not that hard to figure out what's going on most of the time.
@ Ilidrake
Yes, I also noticed that the death animations for the bots don't play in T3D (but they work fine in TGE and TGEA). I'll see about fixing that in the next release.
@ Everyone
The next version will likely be 1.2.0 but it probably won't be out for at least a month or two (so don't get too excited just yet).
EDIT- Nov. 12, 2009: I have fixed the death animation bug in my internal build and it will be included in the next release (whenever that is).
#80
But I have been using computers everyday for almost 25 years, so my eyes are toast:)
10/29/2009 (12:20 am)
For me yes, but like you say you have everything named where it is easy to follow. But I have been using computers everyday for almost 25 years, so my eyes are toast:)
Torque Owner Donnie Hutson Jr