View Full Version : Tutorial: Setup a simple AI
Callabrator
11-09-2007, 04:52 PM
Hey guys, I was able to reverse engineer some of the singleplayer stuff so I figured I'd share some of my new knowledge. There maybe a better way to do this, but this has worked for me. :)
The following is an outline of how to setup a spawning AI. You need to bounce back and forth between the UE and Kismet so I've specified what actions you need to do in each. Also, this assumes that you already have a simple level with a Marcus player spawn in it.
Set up the trigger:
Unreal Editor:
-Right click -> Add Actor -> Add Trigger -> hit ‘end’ key on keyboard to snap on ground
-Keep Trigger_0 selected
Kismet:
-Right click -> New Event -> New Event Using Trigger_0 -> Touch
-Right click -> New Variable -> New Player -> Marcus
-Drag link between Trigger_0’s “Instigator” and Marcus
Setup the AI:
Unreal Editor:
-Right click -> Add Actor -> Add PathNode -> hit ‘end’ key on keyboard to snap on ground. This is position where the AI will spawn.
-Keep PathNode_0 selected
Kismet:
-Right click -> New Action -> AI -> AI Factory
-Right click -> New Object Var using PathNode_0
-Drag link between AI Factory’s “Spawn Points” and PathNode_0
-Drag link between Trigger's "Touched" and AI Factory's "Spawn"
-In AI Factory’s properties click “SpawnPoints” and then click Add New Item icon (plus sign) on right
-In new item “[0]” click Use Current Selection In Browser icon (left arrow) on right
Finished! Now just run your level and move Marcus to the general area where you put your trigger. The AI should spawn and start shooting you.
brdempsey69
11-09-2007, 05:03 PM
I hope you'll forgive me for copying and pasting this and e-mailing this to myself as I'm at work right now.
Thanks for the tutorial.
Callabrator
11-09-2007, 05:15 PM
No worries! Hope it helps :)
dillydadally
11-09-2007, 05:16 PM
Hey, this is good stuff. You might want to put a link to it in the tutorial sticky thread. I think lots of people are wondering how to do this.
flip5577
11-09-2007, 05:18 PM
coolness! Glad you posted this. I was able to make enemies spawn and also team mates spawn, but they don't start shooting right away if they aren't close enough to notice each other. But when I shot one of the enemies all of the fighting commenced 8 ). Now I have the last bit to make them fight on their own!
Reverse
11-10-2007, 12:18 AM
Whats Kismet, and where do I get it?
If its with the game, where do I start it? :p
flip5577
11-10-2007, 12:44 AM
Kismet is like a plug and play sort of coding system. You can access it by clicking the green outlined K on the top bar.
Reverse
11-10-2007, 12:46 AM
Oh, okay.. Thanks :)
NeoNautica
11-10-2007, 01:10 AM
A note I think is important: AI seems to work better when you assign the AI Factory a CoverGroup (Actors > Info > CoverGroup). This tells the AI spawned from the factory that it should move around the nodes assigned to the CoverGroup. They do not venture outside of the group though!
Bonus Info! Easy way to add cover points to a cover group!
1. Add a covergroup actor to an area
2. Select the cover points you want added to the CoverGroup
3. Right click on the cover group and use Path Options > Complex Options > CoverGroup: Add Links
You can use the same method, but select a different final option to remove cover points from a group.
angusm
11-10-2007, 04:43 AM
Thanks Callabrator and to everyone else contributing tips, guides and tutorials to those of us rather new and inexperienced with map-making, modding etc.
sarge mat
11-10-2007, 08:17 AM
thanks mate i am going to run though this later
Razorwing
11-10-2007, 05:25 PM
ummm I can't find create player in kismet. :|
Razorwing
11-10-2007, 06:28 PM
oh nvm.. I got it.. but they just stand there for some odd reason. They don't even come at you..
MrSilent
11-10-2007, 06:31 PM
Add some cover points, the AI use those aswell as the player to move to and take cover.
Don't forget that bots like apples :) Aka Pathnodes.
Widunder
11-11-2007, 08:06 AM
This is probably a really stupid question, but I can't find where to do this: "-Right click -> New Player -> Marcus"
Where in the right click menu is it?
Picture:
http://student.gamemaker.nu/~marham050/stuff/KismetProblem.jpg
Reverse
11-11-2007, 10:04 AM
I belive its at "New Variable"
Widunder
11-11-2007, 10:09 AM
Haha, man I feel like an idiot. Thanks a lot =)
KIWIDOGGIE
11-11-2007, 12:16 PM
Video Tutorial Comming soon
Big thanks! I messed around with this and I made a map and I made 2 waves of monsters xD I also tested out the new botpathing, how do you guys like it? The wretches use the obsticles and the drones use the cover. =D
www.stinymedia.com/GoWPreviewAdams.wmv (adam is my name) xD
Callabrator
11-11-2007, 07:05 PM
I belive its at "New Variable"
Yup! You're right. I've fixed my original post. Sorry bout that. :)
Big thanks! I messed around with this and I made a map and I made 2 waves of monsters xD I also tested out the new botpathing, how do you guys like it? The wretches use the obsticles and the drones use the cover. =D
www.stinymedia.com/GoWPreviewAdams.wmv (adam is my name) xD
I woudl also like to point out that kismet is so fast for scripting, someone pmd me asking how long it took and the kismet part only took about 20 min, very efficient
KIWIDOGGIE
11-11-2007, 07:43 PM
Nice map :D
Your Video can be hosted by me xD
Taffer
11-12-2007, 02:46 PM
How do you choose what type of enemy is spawned at the pathnode?
Razorwing
11-12-2007, 02:52 PM
How do you choose what type of enemy is spawned at the pathnode?
yeah if you go to AI factory -> spawnsets-> +-> choose your enemy.
on another note.
I still can't get my enemies to come toward me.. >.< I don't know where this cover group thing is.. can someone tell me?
edit: ok I got the cover group thing.. where am I supposed to put it? It's not working >.<
Razorwing
11-12-2007, 03:54 PM
anyone? help?
Taffer
11-12-2007, 03:58 PM
I don't know what the difference in AI behavior between cover groups and cover links is, but all I had to do was place coverlinks all over the environment and the AI immediately started seeking me.
Razorwing
11-12-2007, 04:18 PM
I don't know what the difference in AI behavior between cover groups and cover links is, but all I had to do was place coverlinks all over the environment and the AI immediately started seeking me.
did you adjust anything in Kismet?.. and where do you get coverlinks?
Taffer
11-12-2007, 04:23 PM
Right click in one of the view windows, Add Actor -> Add Coverlink
For walls, you need to add two slots on each end of it, both connected to the same coverlink.
I just followed what the first page told me to do in Kismet.
Razorwing
11-12-2007, 04:30 PM
Right click in one of the view windows, Add Actor -> Add Coverlink
For walls, you need to add two slots on each end of it, both connected to the same coverlink.
I just followed what the first page told me to do in Kismet.
hmmm.. ok.. it's still not working for me. ok I'll layout my plan
]
P1] <----------------------------AI
]
So player is behind sand bags and I want the AI to run at him.
Razorwing
11-12-2007, 05:29 PM
help please? I'm really having trouble.
KIWIDOGGIE
11-12-2007, 06:02 PM
I will make a coverlink tutorial later.
Razorwing
11-12-2007, 11:45 PM
I will make a coverlink tutorial later.
ah awesome.
maddog
11-13-2007, 02:53 AM
My buddies and I enjoy playing Rainbow6:Vegas COOP terrorist hunt. I was looking to try to make some maps, sorta in that vein, where my two buddies and I could just run through a level of say 15 to 20 bad guys with the end goal being simply to kill all of them.
Is something like that going to be possible here with the gears level editor? I was looking here...
http://udn.epicgames.com/Three/GearsModHome.html
...and I couldn't really find a game mode that would suit that purpose. But judging from what you all are referring too, it looks like it's surely possible.
Can anyone offer any insight it to the best way possible to accomplish my goal?
Thanks in advanced,
MD
NewPCGamer
12-05-2007, 10:29 PM
pretty cool, but how can i choose what to spawn? if i wanted to spawn a berserker what would i have to do?
JonnyJackass
04-15-2009, 10:27 PM
I Wish I can do that i dont know what i want to major in I though level design but i want to see if i can do it lol. one look at Unreal editor I got over welmed lol
Hi Buddies,
i´m making a level for GoW right now but i have a problem. i have placed a minigun and a spawnpoint for the enemy right in front of the turret, but he dont use the gun...why?
what i have to do that he uses the minigun turret?
JUGGERNUT
07-29-2009, 05:56 PM
8bit, copy this code into kismit and add where to spawn and which gun.
Begin Object Class=SeqAct_AIUseTurret Name=SeqAct_AIUseTurret_0 Archetype=SeqAct_AIUseTurret'WarfareGame.Default__ SeqAct_AIUseTurret'
InputLinks(0)=(DrawY=2290)
OutputLinks(0)=(DrawY=2290)
VariableLinks(0)=(LinkedVariables=(SeqVar_Object'S eqVar_Object_59'),DrawX=6350)
VariableLinks(1)=(DrawX=6408)
ObjInstanceVersion=15
ParentSequence=Sequence'TURRET_USER'
ObjPosX=6312
ObjPosY=2256
DrawWidth=133
DrawHeight=61
Name="SeqAct_AIUseTurret_0"
ObjectArchetype=SeqAct_AIUseTurret'WarfareGame.Def ault__SeqAct_AIUseTurret'
End Object
Begin Object Class=SeqAct_AIFactory Name=SeqAct_AIFactory_0 Archetype=SeqAct_AIFactory'WarfareGame.Default__Se qAct_AIFactory'
SpawnSets(0)=(AIType=AIType_TroikaGunner,SpawnTota l=1,MaxAlive=1,PreviousAIType=AIType_TroikaGunner, VarLinkDescs=("Set 1 [1]","Set 1 [2]"),OutLinkDescs=("Spawn 1 [1]","Spawn 1 [2]"),bAssignMoveTarget=True,bAssignCoverGroups=True,W arPawnClass=Class'WarfareGameContent.Pawn_GeistTro ikaGunner',ControllerClass=Class'WarfareGame.WarAI _Locust',bAllowInventoryDrops=True,SquadName="Alpha",bAutoAcquireEnemy=True,bAutoNotifyEnemy=True)
InputLinks(0)=(DrawY=2277)
InputLinks(1)=(DrawY=2298)
InputLinks(2)=(DrawY=2319)
OutputLinks(0)=(Links=((LinkedOp=SeqAct_AIUseTurre t'SeqAct_AIUseTurret_0')),DrawY=2282)
OutputLinks(1)=(DrawY=2314)
OutputLinks(5)=(LinkDesc="Spawn 1 [1]",bHidden=True)
OutputLinks(6)=(LinkDesc="Spawn 1 [2]",bHidden=True)
VariableLinks(0)=(DrawX=6048)
VariableLinks(1)=(LinkedVariables=(SeqVar_Object'S eqVar_Object_59'),bHidden=False,DrawX=6119)
VariableLinks(2)=(ExpectedType=Class'Engine.SeqVar _Object',LinkDesc="Set 1 [1]",bWriteable=True,bHidden=True,MaxVars=255)
VariableLinks(3)=(ExpectedType=Class'Engine.SeqVar _Object',LinkDesc="Set 1 [2]",bWriteable=True,bHidden=True,MaxVars=255)
ObjInstanceVersion=31
ParentSequence=Sequence'TURRET_USER'
ObjPosX=6000
ObjPosY=2240
DrawWidth=179
DrawHeight=125
Name="SeqAct_AIFactory_0"
ObjectArchetype=SeqAct_AIFactory'WarfareGame.Defau lt__SeqAct_AIFactory'
End Object
Begin Object Class=SeqVar_Object Name=SeqVar_Object_59 Archetype=SeqVar_Object'Engine.Default__SeqVar_Obj ect'
ObjInstanceVersion=1
ParentSequence=Sequence'TURRET_USER'
ObjPosX=6120
ObjPosY=2448
DrawWidth=32
DrawHeight=32
Name="SeqVar_Object_59"
ObjectArchetype=SeqVar_Object'Engine.Default__SeqV ar_Object'
End Object
whohaw, man, this is...like...man.
question: where do i have to paste this text into?
i dont know where i can write text in kismet.
Taffer
08-02-2009, 06:41 AM
whohaw, man, this is...like...man.
question: where do i have to paste this text into?
i dont know where i can write text in kismet.
Yeah, I'm also interested where all of that text gets copied. I also need an AI to spawn on a turret.
Taffer
08-04-2009, 02:18 AM
Nevermind, I figured it out.
Once you spawn the Troika Gunner and setup the trigger and spawn point, you want to add SET TROIKA GUNNER in Kismet (look around, you'll find it). Link "All Spawned" from the AI Factory to "In" on the Set Troika Gunner. For turret, obviously create a variable for the turret, and for target, you'll need to link back to the troika gunner.
If you don't know how to link to the troika gunner, right-click on the AI Factory. Expose Variable, and go to SET 1. Link Set 1 to an object variable (create one, ??? by default is fine), and link the target to this same ??? variable.
Linkinworm
01-02-2011, 01:25 PM
thanks for this, i was getting sick of waiting for my friend to download my map so i could try it out, so muchbetter with horde 0.5 mode lol :P
trauma1337
02-10-2011, 05:38 AM
I recently started making a single player level for my portfolio for school and I have run into a problem with my Brumak spawn. I can get the Brumak to spawn fine and run around the map to my path nodes and attack the player. The problem I am running into is when the player dies and I click load last check point on the death screen the Brumak just falls to the floor and doesn't despawn or attack the player it jsut lays on the fly and makes noise. How do I make it so that when the player dies or the level resets the Brumak will despawn from its current position and respawn at its original spawn point or how do I make it so it just doesn't fall to the ground and do nothing after a players death?
This is my first time working with AI in unreal and am having trouble finding tutorials on it, if anyone knows of some good tutorials that would explain how to work with AI inside of GoW editor that would be great as well.
Thanks for your help!
Serenius
02-10-2011, 12:32 PM
You have to set up level streaming to pull this off. It's one of the tutorials on my to-do list.
Essentially you need your persistent level, then you want to set up the path nodes and scripting within a sub-level that gets streamed in via Kismet. Checkpoints will go in the persistent level. Every time the checkpoint is activated (i.e. player dies and restarts from last checkpoint) the scripting gets streamed in again, as it's all automatically dumped whenever you reload the level.
trauma1337
02-10-2011, 04:57 PM
Okay so I got the level streaming working and now the Brumak respawns once I die the only problem I have now is that the body of the old brumak is still in the level, how can I fix this? Another question do I have to rebuild paths every time I open up my level now in order to play in editor, that seems to be the only way I can get PIE to work is if I rebuild paths every time I open the level. Thank you for the help btw it is very much appreciated.
Serenius
02-10-2011, 05:31 PM
Are you spawning the Brumak within the scripting of the persistent level or the streamed level? It needs to be the latter.
trauma1337
02-10-2011, 07:19 PM
The Brumak is spawned in the streamed level, any ideas?
Serenius
02-10-2011, 07:50 PM
Try using the garbage collection node and see if that does anything. Is the body you're referring to the corpse upon the Brumak's death or the inanimate body just standing still? Worst case you could try to set up a node that upon player death that connects to the "Kill All" node of the AI Factory (leave kill via damage unchecked so the AI is simply destroyed and cleared out).
trauma1337
02-10-2011, 08:22 PM
The body I am reffering to is just like a ragdoll Brumak mesh that has no animation and does not attack it just lays on the ground and makes the Brumak growls, if I run up to the corpse I can move it around like its a physics object. How do I use the garbage collection node? Currently I have a Level Reset node plugged into the In box on the Force Garbage Collection node.
Here is a screenshot of what is going on:
http://s45.photobucket.com/albums/f91/trauma1337/?action=view¤t=brumak_probs.jpg
Update: I figured out the solution to the problems I have listed here, I was trying everything out with PIE when I tried it out ingame everything worked great, thanks for your help Serenius!
Powered by vBulletin® Version 4.1.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.