|
|
|
KC21  |
Beginner | Member since: 01.10.2011, 11:06 | Posts: 10 |
Likes: 0 |
| |
|
Post Topic: Enemy AI Posted 21.02.2012, 06:35 |
I am currently working on a custom map for Crysis 2 and I have meshed out my level and have moved on to AI. The map is primarily outdoor with a few indoor areas which are primarily sniper/advantage areas. I've been looking at the tutorials at sdk.crynet.dev/looking at levels and trying to apply it to the Crysis2 ModSDK.
I've been using AINavigationModifiers and AI Points, but they don't work at all (indoor or outdoor) and I am assuming that I messed up or need to create a FlowGraph for it, but I am not quite certain on how to go about it. Moreover, I've got an AI to follow really simple TagPoint to work and Forbidden areas, but is there anyway to make the enemy loop between TagPoints?
How could I get my enemies to:
1) Follow a path that loops (making them appear like they are protecting the perimeter) 2) Run at the player. 3) Jump/Climb areas since I have a bridge broken up into 4 parts where you need to jump in order to traverse. 4) Camp a sniper area and lay down like normal sniper position. (if possible).
Thanks.
|
|
|
|
|
|
|
|
 |
Cry-Spify  |
Crytek Staff Member | Member since: 20.07.2011, 10:22 | Posts: 489 | Location: Frankfurt am Main |
Likes: 1 |
| |
|
Post Topic: Re: Enemy AI Posted 21.02.2012, 12:35 |
Your navigation can be broken for several reasons, Please make sure that: 1. Your AINavigationModifier has the WaypointConnection property set to Auto-Dynamic and Height 0. 2. Make sure you Generate All AI (AI > Generate All AI). 3. Keep in mind that if the AI sees the player, they might start ignoring the flowgraph commands and do their own stuff. For the loop, there are two ways of achieving that: either you use Tagpoints and create the loop in flowgraph (see image - Please note that I used the GoToEx node to send the AI to the TagPoint) or you create an AIPath (AI > AIPath) And then you start it in FlowGraph with the property Loops set to -1. The image contains both examples. Choose one way or another to do it, not both  .
|
|
|
|
|
|
|
 |
Cry-Spify  |
Crytek Staff Member | Member since: 20.07.2011, 10:22 | Posts: 489 | Location: Frankfurt am Main |
Likes: 1 |
| |
|
Post Topic: Re: Enemy AI Posted 21.02.2012, 12:40 |
For the AI to run to the player, the setup would be something like this, depending on what is triggering this. In my example the AI goes to the player on Game start.
|
|
|
|
|
|
|
 |
Cry-Spify  |
Crytek Staff Member | Member since: 20.07.2011, 10:22 | Posts: 489 | Location: Frankfurt am Main |
Likes: 1 |
| |
|
Post Topic: Re: Enemy AI Posted 21.02.2012, 12:49 |
For the AI to climb, you need to use SmartObjects (AI > SmartObject). Place a SmartObject, go to SmartObjectClass property and select one type from the Navigation_Alien / Navigation_Human_Alien presets.
|
|
|
|
|
|
|
 |
Cry-Spify  |
Crytek Staff Member | Member since: 20.07.2011, 10:22 | Posts: 489 | Location: Frankfurt am Main |
Likes: 1 |
| |
|
Post Topic: Re: Enemy AI Posted 21.02.2012, 12:55 |
For the sniper thing, you can try using AI Execute in Flowgraph and choose an action. You can try different actions to see if any of them suits you.
|
|
|
|
|
|
|
KC21  |
Beginner | Member since: 01.10.2011, 11:06 | Posts: 10 |
Likes: 0 |
| |
|
Post Topic: Re: Enemy AI Posted 21.02.2012, 20:49 |
Is there anyway to test if the Smart Object is working?
Thank you very much for the help!
|
|
|
|
|
|
|
 |
Cry-Spify  |
Crytek Staff Member | Member since: 20.07.2011, 10:22 | Posts: 489 | Location: Frankfurt am Main |
Likes: 1 |
| |
|
Post Topic: Re: Enemy AI Posted 22.02.2012, 10:40 |
Well, the cylinders needs to be green on for the Smart objects to be valid.
|
|
|
|
|
|
|
KC21  |
Beginner | Member since: 01.10.2011, 11:06 | Posts: 10 |
Likes: 0 |
| |
|
Post Topic: Re: Enemy AI Posted 25.02.2012, 13:06 |
I've been setting up my AI for my level, but I am struggling a bit with how complex it has gotten. However, I keep staring at Crysis 2 levels and keep noticing that they use Waves and Territories + their maps don't have massive amounts of paths or tagpoints either, but they do use a lot of navigation modifiers (varying on the map).
I found that Waves and Territories are actually quite helpful for level designers to get AI working quickly (which is what I desperately need). If I do switch to that does that mean that I would only have to set up my Territories, Waves and navigation (ie cover, smart objects and nagivation modifiers) and give them areas to defend while my tagpoints and or path aren't very useful anymore?
Lastly, I've noticed that most AIs in Crysis 2 maps are assigned to defend a spot and not much pathing or waypoints are used. Is this done by setting a tagpoint as the "spot" to defend and choosing the proper action to assign to that? and does this also make the AI go back to that spot after they've lost trace of you?
Thanks a lot for the help!
|
|
|
|
|
|
|
 |
Cry-Spify  |
Crytek Staff Member | Member since: 20.07.2011, 10:22 | Posts: 489 | Location: Frankfurt am Main |
Likes: 1 |
| |
|
Post Topic: Re: Enemy AI Posted 27.02.2012, 13:56 |
Territories and Waves have nothing to do with navigation and paths. They help to control the spawning and the flowgraph logic associated to them in an easier manner.
Using Waves and Territories doesn't exclude the use of paths and TagPoints. You can still use them if you want/need to. We haven't used much paths and tagpoints because then the AI looks too scripted. With actions like defend they move more freely and natural. Yes, it is done by setting a TagPoint as the position to defend or whatever action is given. I'm not 100% sure, but I think when defending a position, the AI doesn't stay in that precise spot. They defend an area around that spot. So I think the answer would be: No, they are not going to that specific spot once they loose track of you. They will just stay in that general area.
|
|
|
|
|
|
|
KC21  |
Beginner | Member since: 01.10.2011, 11:06 | Posts: 10 |
Likes: 0 |
| |
|
Post Topic: Re: Enemy AI Posted 28.02.2012, 07:28 |
One last thing that I would like to know is how do you end a game once you've completed the mission? The examples at sdk.crydevnet.com show a Mission:EndLevel node, but that has either been replaced or taken out since I can't find it under Mission.
Thank you very much for the help!
|
|
|
|
|
|
|
 |
Cry-Spify  |
Crytek Staff Member | Member since: 20.07.2011, 10:22 | Posts: 489 | Location: Frankfurt am Main |
Likes: 1 |
| |
|
Post Topic: Re: Enemy AI Posted 28.02.2012, 12:40 |
It's still in Mission but now it's called EndLevelNew.
|
|
|
|
|
|
|
KC21  |
Beginner | Member since: 01.10.2011, 11:06 | Posts: 10 |
Likes: 0 |
| |
|
Post Topic: Re: Enemy AI Posted 29.02.2012, 11:40 |
It isn't there.. the only one that I've found that is anywhere related to it, would be LoadNextLevel unless there is a way to set it up that the next level would just be quit to level selection.
|
|
|
|
|
|
|
 |
Cry-Spify  |
Crytek Staff Member | Member since: 20.07.2011, 10:22 | Posts: 489 | Location: Frankfurt am Main |
Likes: 1 |
| |
|
Post Topic: Re: Enemy AI Posted 29.02.2012, 12:58 |
Oh, sorry. You are working on Crysis2 Mod, not Freee SDK...
In C2Mod try triggering LoadNextLevel with no level specified. It might do the trick. I'm not 100% sure.
|
|
|
|
|