PDA

View Full Version : Questons about AI



wookash_b
10-18-2009, 02:20 PM
Hi I thought it will be better to have different questions in relevant topics rather than one topic with multiple questions about everything.

So here goes my first question. I set up a Patroller AI like in the video tutorial. But then I noticed that in his prpoperties he does not actually have any waypoints. So the question is how does the AI know which waypoints to go to?

wookash_b
10-18-2009, 04:13 PM
Right I think I got this figured out, please correct me if I am wrong on this one.

In order to make an AI character walk you need to create action chain object (it is a separate class of objects). In action chain object you can add many actions that will be executed, but the one you need to add to have AI walk between waypoints is act_ChangeWaypoint. In this action select the AI target and the first waypoint. Then in AI properties (trigger or sensor, however you plan to start your action) add act_Run and select the action chain you just created. Hopefully the AI will now walk from one waypoint to the other http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

vodka-kyo
10-19-2009, 02:51 AM
Yep seem's good.
In fact action_chain are not always necesary.
Just create waypoint linked, and use "change waypoint".
But your charaters can't fight and make fire without figth node.

seir
10-20-2009, 01:18 AM
We are using ActionChain to make scripting more readable. When Level Designer have a big map, he need to put a lot of actions in ActionChain and its name to remember what's going on in this AC.

About patroler AI:
Every AI have to have a waypoint with behavior set there. Also you need to use EndContition "FALSE" if AI have to do that all the time till death.

In "Patroler" selection there's OnAlarmLevel_High (when AI will hear player) the actions will spawn. These actions alarms this guy (SetAlarmLevel: Alarmed) and moves him to waypoint (ChangeWaypoint) where he have behavior "EditorAttack".

This guy is invisible on start and when you will enter sensor he will appear (Appear action), set his level to CALM and go to waypoint in which he is patroling http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

I know that's hard to understand, don't worry http://forums.ubi.com/groupee_common/emoticons/icon_wink.gif

wookash_b
10-20-2009, 02:21 PM
Well, I believe I have it figured out by trial and error http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif Thanks anyway.

wookash_b
10-24-2009, 03:18 PM
How do I create an AI that will follow the player? I attached a waypoint to the player and it works fine until the AI reaches the waypoint. After that AI will not follow the player anymore. What would be a better solution to create a following AI?

wookash_b
10-25-2009, 05:17 AM
I also tried attaching a sensor to the player and then when AI reaches the waypoint it will enter the sensor as well. So when player moves away, AI will leave the sensor and I added an onLeave action to change waypoint to the same waypoint (the one attached to player). The AI does not follow, so I guess this method is not working ;(

seir
10-28-2009, 02:46 AM
Create Trigger that will ChangeWaypoint under Condition: ObjectsDistance that AI will ChWP when the distance from Player to AI will be as set in condition.

wookash_b
10-29-2009, 03:29 PM
Originally posted by seir:
Create Trigger that will ChangeWaypoint under Condition: ObjectsDistance that AI will ChWP when the distance from Player to AI will be as set in condition.

I tried this as well and it also does not work. In the Trigger properties I added action to display a hint whenever AI should move again to the player. The hint is displayed at correct distance, but AI stands still.

So what happens is that AI can come to the waypoint attached to the player only once, AI follows until I stop and AI reaches the waypoint. After that when player moves AI will not follow, even though that conditions are good (hits are displayed) change waypoint action is not launched or there is something wrong with my settings, but it shouldn't be http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif What is the cChangeMode property for? I tried changint that but still no luck.

seir
10-30-2009, 06:41 AM
I'll try to make this scene as selection. It should work fine.

wookash_b
10-30-2009, 07:28 AM
Originally posted by seir:
I'll try to make this scene as selection. It should work fine.

What does this mean? Is it going to be a selection in the next version of the editor? Not sure I understand what you mean.

seir
10-31-2009, 11:18 AM
No, I'll try to do that at home and send it for you as a selection. You can also create selection for anything you want:

1) select objects to add to selection
2) go to "View > Selections" window
3) Create a new selection, give it a name and export it to file (<selection_name>.eds and <selection_name>.mis).

You can export every object from the map to other maps just by putting it into selections.

wookash_b
11-03-2009, 04:49 PM
Is it possible to create enemy that will fight the player with the chair? Or at least look like the AI is trying to hit player with a chair? I tried to set this up, but when I selected WeaponChair as primary the chair appears but AI cannot use it:

http://img9.imageshack.us/img9/4507/chairc.jpg

seir
11-04-2009, 02:37 AM
There's no animation for that kind of weapon.

wookash_b
01-17-2010, 04:34 AM
Hi I noticed that sometimes in my map and in other maps already published that I played, there is a bit of slowdown and freeze when the game makes AI appear. Say a player enters a sensor that makes some AI appear. And when player enters the sensor the game freezes for a second. I have not seen this in very empty maps, so I guess it has a lot to do with optimising the map and the amount of objects rendered, right? I still need to get the occluders in map. I hope this will help.

seir
01-17-2010, 08:20 AM
It's because physics of AIs. To solve that you have to appear 3-4 AIs at one time. If you have 8 AIs to appear create sensor that will look like that:

Sensor - "onEnter":
- Appear 4 AIs
- Wait 0.5 sec
- Appear 4 AIs

Make sure that other AIs that are not needed (on the other side of the map) are disabled. Also you should disable all the horses. These objects are FPS-eaters. I know that vodka-kyo and other mappers created maps with a lot of AIs and horses but on slow computers it caused slowdowns and crashes. Our LD team kept maximum of 8 AIs at one time and few horses. Also we had a lot of graphics so that was also a big load of things to render.

wookash_b
01-17-2010, 08:29 AM
I have noticed the slowdown when I spawn a neutral woman AI. Then in next action chain used later I spawn one enemy man AI. There is no slowdown here.

On a similar note: I think I am correct thinking that it is best to reduce the amount of objects that are LawmanASP. For example change all unnecessary barriers from LawmanASP to ModelObject. Is that correct?

seir
01-17-2010, 10:41 AM
Exactly. Look how much data is stored in LawmanASP class object. Reducing that objects that don't need physics to "ModelObject" is great idea.

Woman's dress is pushed by physics - that's why it happens. It also can happen with Ray (coat using physics to move).

wookash_b
01-17-2010, 11:04 AM
Thanks for the explanation http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

BurningGeneral
01-21-2010, 09:48 AM
1.) I've nearly the same problem. The screen freezes for some seconds everytime I have shooten enough enemies to use the concentration mode (when the cm sign shows up). Although I created an empty map with only 8 enemies on it, it freezes when after I've shooten 5 enemies and the cm sign should show up.

2.) Can I run an ActionChain on "mapstart"?

seir
01-21-2010, 12:07 PM
Originally posted by BurningGeneral:
1.) I've nearly the same problem. The screen freezes for some seconds everytime I have shooten enough enemies to use the concentration mode (when the cm sign shows up). Although I created an empty map with only 8 enemies on it, it freezes when after I've shooten 5 enemies and the cm sign should show up.

It's because engine is loading materials of highlighted enemies. You can try to:
- make sure that in PAK files there's a "characters" and "creatures" directory
- if not: backup your maps and reinstall Modding Package


2.) Can I run an ActionChain on "mapstart"?

Yes. In level settings there's a "OnLevelStart" field. There are already two actions that are spawning ambient sounds.

BurningGeneral
01-21-2010, 12:27 PM
1.) There is a "characters" and "creatures" directory in data0.pak and data1.pak. The game only freezes for about 3-5 seconds - it doesn't crash or anything like that. After 3-5 seconds you can go on playing

2.) According to the second question - I already tried that but the actions from the actionchains were not runned by the stystem - I used "act_Run" and in the ACs I had the action "act_Appear" twice. One for things to appear and one for things to disappear. But nothing appeared or disappeard on mapstart.

3.) By the way is there any possibility to completely deactivate the slowmo?

4.) How can I create rain? I tried to use act_TimeAndWeather but what should I type under m_Weather? And what's m_Time for?

seir
01-21-2010, 01:41 PM
Originally posted by BurningGeneral:
1.) There is a "characters" and "creatures" directory in data0.pak and data1.pak. The game only freezes for about 3-5 seconds - it doesn't crash or anything like that. After 3-5 seconds you can go on playing

Yes, I know that the directories are in data* packs. I was asking about normal directories not in PAK files. Maybe just reinstall Modding Package but create backup of "My Docs/COJBiB" folder.


2.) According to the second question - I already tried that but the actions from the actionchains were not runned by the stystem - I used "act_Run" and in the ACs I had the action "act_Appear" twice. One for things to appear and one for things to disappear. But nothing appeared or disappeard on mapstart.

Try to create something like this:
OnLevelStart Actions:
act_Wait 0,1
act_Ambient...
act_Appear

Just create "Wait" action with 0,1 value.


3.) By the way is there any possibility to completely deactivate the slowmo?

act_PlayerControl - check this action http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif


4.) How can I create rain? I tried to use act_TimeAndWeather but what should I type under m_Weather? And what's m_Time for?

It's a bit complicated but...:
- open your level in ChromED
- go to Level Settings > VarList
- at the bottom of the window there should be "Append" button - click on it
- in opened window go to "Scripts\VarList_Rain.scr" and in "Mode" field select "Add new variables only" - click OK
- now you're able to change "Rain Strength" set 0.7 to test it. You can change the value from 0.0 to 1.0. Now you need to apply fog to create some mood http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

The important thing is that the sun must be exactly in high noon when raining. The best way to do that is to copy whole VarList from MurderInUtah ("Data0.pak/Data/Maps/MurderInUtah/")

BurningGeneral
01-21-2010, 01:51 PM
First thanks for all the answers! http://forums.ubi.com/images/smilies/11.gif

1.) How can I start and stop the rain during the map - I don't need/want the rain all the time.+

2.) Where do I find the VarList in this folder and where do I have to paste it?

seir
01-21-2010, 03:50 PM
You mean how to copy the VarList from MurderInUtah level?
- open "MurderInUtah.scr" with Notepad
- select all text (CTRL + A)
- copy selected text to clipboard (CTRL + C)
- go to your map folder
create backup of "<MapName>.scr" file if something will go wrong
- open "<MapName>.scr" with Notepad
- select all the text (CTRL + A) and delete it (DEL)
- paste text from clipboard (CTRL + V)
- use "Replace" function (CTRL + H)
- in "Find" text type "MurderInUtah"
- in "Replace to" text type "<MapName>"
- click "Change everything"

This will change all information about MurderInUtah to your map. Save this file and run ChromED. You may see different ground textures (as seen on Chapter III in COJBiB). You need to go "Level Settings > VarList" and change it manually (open backup file and check what textures did you used).

You can change almost every parameter from VarList with action: "act_ChangeParams > ParamVarlist".

You have 5 types of fields to modity. Choose "VarFloat" to change numbers and "VarSting" to change text. "VarInteger" is also for numbers but not like in VarFloat ("0.5" or "21.222") but only full numbers like "1", "11" or "233". In rain parameter choose "VarFloat".

"Name" - name of this variable is "f_rain_strength" (to see the name of variable go to "Level Settings > VarLis"t, aim cursor at the name of the parameter and the name will show in the tooltip). Type this name to "Name" field.

"Value" is the value of rain. 0.0 is no rain, 0.5 is a little rain, 1.0 is full rain. FX and sound will be turned on automaticly.

"Time" [sec.] is the time to blend the value. If you will type "4" it will mean that the engine have 4 seconds to blend parameters between the values.

BurningGeneral
01-23-2010, 06:48 AM
How can I just set the atmosphere as like as in MurderInUtah level by just using act_ChangeParams > ParamVarlist? I already tiped nearly everything of the murderinutha.scr file into an ac and tried to change that during the game.
And now it looks like that:
http://www.bilder-hochladen.net/files/cvnl-w-jpg.html

seir
01-23-2010, 01:07 PM
I already told you how to copy parapeters from one SCR file to another and you're ignoring me and use action that supports only few of variables from VarList. Read it careful.

BurningGeneral
01-24-2010, 03:20 AM
1.) Yeah, but you said: "You can change almost every parameter from VarList with action: "act_ChangeParams > ParamVarlist"." and that's what I tried. Because I just want the atmosphere in one part of the map - not all the time.
According to copy parameters from one SCR file to another, it doesn't really work either. I already tried it (forgotten to wrote in the last post - sry for that!) and changed the names and corrected the terrain parameters but it doesn't work either - so I am really not ingnoring you!! http://forums.ubi.com/groupee_common/emoticons/icon_frown.gif Why should I - you now how to handle with Chromedit better than we all...

2.) You said it is important that the sun is exactly in high noon when raining. Because it doesn't really want to work with copying the SCR parameters and I don't need this atmosphere all the time during the map, how can I just change the sun to highnoon during the game (which are the parameters I have to change)? And why is it so important that it stands exactly in high noon? - just to get the right atmosphere?

3.) According to the rain, there doesn't appear any sound if I use changeparam > Varlist. I see the rain but there isn't any rain sound.

4.) I tried to change the parameter f_fog_far during game. The rain works without any difficulties (besides the sound) but the fog doesn't appear.

wookash_b
01-24-2010, 06:41 AM
Another AI question. I want to create a wagon ride, with player on the gatling gun and 2 AI in the front. The wagon ride should start after 2 AI in the front get in the wagon and when player mounts the gatling gun in the back. I have seen the selections you provided and I am aware how to set this up. However when I try to set it up with other AI waypoints I get strange results:

1) First of all I want the AI driver in the wagon to wait until other AI and player get into their positions on the wagon before he starts driving the wagon. So I want the driver to mount it, sit down and wait in the seat of the wagon. I tried using condition (cnd_Expression) with script to delay the bhv_DriveWagon, but it only caused the driver to stand up while on the wagon seat. I did not see any bhv_Wait behaviour. I also tried giving the wagon null Waypoint at the start and then give the wagon the first Waypoint after player mounts the gun, but then this causes one of the horses to play run animation while stationary.

How can I solve this? How can I delay the start of wagon ride until a certain action happens?

2) The passenger AI doesn't mount the wagon. I use the same Waypoint as in the selection (Waypoint->cMotion->mtGetInOutWagon). Problem is that AI never reaches that Waypoint. I set this as the last Waypoint for the AI, the other Waypoints are just Waypoints that AI runs along. So what I want to happen is that AI follows a path (walks or runs) and the end of the path is to mount the passenger seat of the wagon. I tried connecting the Waypoints by using the cNext field, it did not work. AI stops in the last Waypoint before the wagon one. I also tried detaching the wagon mount Waypoint from the others and setting it as the new Waypoint when AI reaches the last Waypoint in the path. This also did not work. How can I create such a path?

Would that have someting to do with the fact that my AI passenger is a woman? :P

Or maybe there needs to be a specific class for the AI to do that? The animations seem to be there yet, when I set woman AI to NewAIHumanCoJ2 class she just appears standing on the wagon.

One solution I found so far is to use behaviour to play "wagon bored" animation and it looks OK. I could use a fade in/fade out to cover the weird mounting of the woman passenger.

seir
01-24-2010, 08:23 AM
1.) Yeah, but you said: "You can change almost every parameter from VarList with action: "act_ChangeParams > ParamVarlist"." and that's what I tried. Because I just want the atmosphere in one part of the map - not all the time.

I exactly what variables in VarList are anabled to modify. I know other day to change atmosphere on the level. Weather and Day Time Settigns. I didn't used that because that was Environment Artist's job but I'll ask him tommorow how to set this and I'll post that. I already sent reminder to work http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif



According to copy parameters from one SCR file to another, it doesn't really work either. I already tried it (forgotten to wrote in the last post - sry for that!) and changed the names and corrected the terrain parameters but it doesn't work either - so I am really not ingnoring you!! Why should I - you now how to handle with Chromedit better than we all...

Sorry that I wrote that, I had a bad day and didn't get what exactly you did. Maybe your SCR replacement didn't succeed because you have your weather settings set in "Environment > Weather and Day Time Setting" menu. There should be script "weather_none.scr" set. This file can be found at "Data/Scripts" directory. Check that, it should solve that problem.


2.) You said it is important that the sun is exactly in high noon when raining. Because it doesn't really want to work with copying the SCR parameters and I don't need this atmosphere all the time during the map, how can I just change the sun to highnoon during the game (which are the parameters I have to change)? And why is it so important that it stands exactly in high noon? - just to get the right atmosphere?

We had to create rain in very simple system. We set the sun exactly at the top of the town and removed the shadow. In places where shadow should be there was no rain drips. Where the sun shoudn't cast shadow there will be water drips FX rendered. To do that you need to change "vsundir" and "vsunshadowdir". Also "i_lighting_sun_on" should be set to "0".


3.) According to the rain, there doesn't appear any sound if I use changeparam > Varlist. I see the rain but there isn't any rain sound.

To modify rain sound use action "act_InstantActions > InstantRainSndStrength".


4.) I tried ]to change the parameter f_fog_far during game. The rain works without any difficulties (besides the sound) but the fog doesn't appear.[/quote

VarList is a black magic for all of us except the author of this system. As I know you can set fog settings in "Weather and Day Time Settings" and change it in game with action "act_TimeAndWeather" but I will write a tutorial tomorrow after consulting this with Env. Artists.

BTW. Make sure that the value you typed is working in the editor. "f_fog_far" is "
VarFloat" so you have to set this in the acton.


Now wookash_b's questions:

[quote]Another AI question. I want to create a wagon ride, with player on the gatling gun and 2 AI in the front. The wagon ride should start after 2 AI in the front get in the wagon and when player mounts the gatling gun in the back. I have seen the selections you provided and I am aware how to set this up. However when I try to set it up with other AI waypoints I get strange results:

1) First of all I want the AI driver in the wagon to wait until other AI and player get into their positions on the wagon before he starts driving the wagon. So I want the driver to mount it, sit down and wait in the seat of the wagon. I tried using condition (cnd_Expression) with script to delay the bhv_DriveWagon, but it only caused the driver to stand up while on the wagon seat. I did not see any bhv_Wait behaviour. I also tried giving the wagon null Waypoint at the start and then give the wagon the first Waypoint after player mounts the gun, but then this causes one of the horses to play run animation while stationary.

How can I solve this? How can I delay the start of wagon ride until a certain action happens?

It looks like my system used on "Chapter III" where Thomas/Ray Coop had to wait for William and Player. This is how I did that:

Every AI have to report their position so the driver can report "act_Script"


Route of Wagon Driver:
- waypoint: mt_GetInWagon - FrontLeft
- Waypoint: mt_None with bhv_DriveWagon and act_Script (DriverOnWagon := 1)

Route of Wagon Passenger:
- waypoint: mt_GetInWagon - FrontRight (BackRight might work only for Stagecoach model)
- Waypoint: mt_None with bhv_DriveWagon and act_Script (PassengerOnWagon := 1)

Player settings:
- mount player in standar way and when player will be mounted run act_Script (PlayerOnWagon := 1)

Trigger settings:
- act_ChangeParams > ParamWagonSpeed to change speed of the wagon under condition:
cnd_AND:
- AND1: cnd_Expression: DriverOnWagon == 1
- AND2: cnd_Expression: PassengerOnWagon == 1
- AND3: cnd_Expression: PlayerOnWagon == 1

When all those conditions will be TRUE then the wagon will move.



2) The passenger AI doesn't mount the wagon. I use the same Waypoint as in the selection (Waypoint->cMotion->mtGetInOutWagon). Problem is that AI never reaches that Waypoint. I set this as the last Waypoint for the AI, the other Waypoints are just Waypoints that AI runs along. So what I want to happen is that AI follows a path (walks or runs) and the end of the path is to mount the passenger seat of the wagon. I tried connecting the Waypoints by using the cNext field, it did not work. AI stops in the last Waypoint before the wagon one. I also tried detaching the wagon mount Waypoint from the others and setting it as the new Waypoint when AI reaches the last Waypoint in the path. This also did not work. How can I create such a path?

Maybe there's no animation for this action. If not, try to use bhv_PlayAnim and try to "fake" this action and mount AI manually.


Would that have someting to do with the fact that my AI passenger is a woman? :P

Woman and Man anims are different. This can be the problem http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif


Or maybe there needs to be a specific class for the AI to do that? The animations seem to be there yet, when I set woman AI to NewAIHumanCoJ2 class she just appears standing on the wagon.

Nope, there is no other class for AI to drive wagon.


One solution I found so far is to use behaviour to play "wagon bored" animation and it looks OK. I could use a fade in/fade out to cover the weird mounting of the woman passenger.

Yes, you can do it like that...

wookash_b
01-24-2010, 09:20 AM
Thanks seir! If only I played around with act_ChangeParams > ParamWagonSpeed earlier... Silly me, why did I not realize that this is the action that starts wagon movement? http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

Anyway I got these issues resolved. And I will use the cutscene and fade in/out for the passenger. Thanks!

BurningGeneral
01-24-2010, 01:42 PM
I've bad days, too. http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif
So thanks for all the replies and that you planned to write a tutorial after consulting it with the Enviroment Artists.

I already checked some of your answers and I think I have still done something wrong.

1.) Seems that the sound of the rain still doesn't work if I try to use InstantRainSndStrength. I set it to "1" and then to "0,09" because there was written "<0,1>" in a textbox if you move the cursor over the parameter field. Both didn't work.

2.) I didn't try the SCR replacement again, because I just want to wait what the Enviroment Artists will say according to change these parameters during the game. I didn't really understand which numbers i have to set in vsundir and vsunshadowdir so I'm looking forward to your tutorial.

Only 6 days left. So I'm really happy that you are answering all my questions. Can understand if you are a bit stressed so don't care about. http://forums.ubi.com/images/smilies/11.gif

By the way - I cannot enter http://www.cojmodding.com.

seir
01-24-2010, 02:16 PM
Originally posted by BurningGeneral:
1.) Seems that the sound of the rain still doesn't work if I try to use InstantRainSndStrength. I set it to "1" and then to "0,09" because there was written "<0,1>" in a textbox if you move the cursor over the parameter field. Both didn't work.

Make sure that you typed te value with dot (.) and not with comma (,) as you typed here. I remember that I had a problem with rain on Chapter III. I think I had to set rain in VarList to "0" and then in "OnLevelStart" I had to run rain from VarList (ChangeParams > ParamVarlist) and change rain sound also from action.


2.) I didn't try the SCR replacement again, because I just want to wait what the Enviroment Artists will say according to change these parameters during the game. I didn't really understand which numbers i have to set in vsundir and vsunshadowdir so I'm looking forward to your tutorial.

OK, but you can try to set the "weather_none.scr" in "Weather And Day Time Settings".


Only 6 days left. So I'm really happy that you are answering all my questions. Can understand if you are a bit stressed so don't care about. http://forums.ubi.com/images/smilies/11.gif

By the way - I cannot enter http://www.cojmodding.com.

I don't know what happend, I'll ask webmaster what's wrong at monday.

wookash_b
01-24-2010, 02:47 PM
Now I have an issue with AI mounting a horse. Again I believe I have set up everything as in "Horse rider" selection. For some reason my AI (man) seems to just teleport on the horse rather than actually play the mount animation. Only once I have seen him mount the horse properly. I use Waypoint->cMotion->mt_Mount and point to a horse. What could I be doing wrong? Should the Waypoint be close or far from the horse? What detail could I be missing?

seir
01-24-2010, 04:37 PM
There's a field "Inmediate" or something like this. When this field is turned ON (TRUE) it means that AI will appear on horse. Turn it OFF (FALSE) to force AI to play mount animation.

wookash_b
01-24-2010, 04:53 PM
Originally posted by seir:
There's a field "Inmediate" or something like this. When this field is turned ON (TRUE) it means that AI will appear on horse. Turn it OFF (FALSE) to force AI to play mount animation.

I have this turned OFF, because that is how it is set in the "Horse Rider" selection. http://forums.ubi.com/groupee_common/emoticons/icon_frown.gif

seir
01-25-2010, 01:28 AM
Weird, I'll check that in ChromED.

EDIT:
I checked how it's made in Ghost Town level. There is a Calm Coop AI (!) that is walking off horse. Here's a list of WP:

- Waypoint: mt_HorseRide
- Waypoint: mt_Mount (Horse: <null>, Immediate <false&gthttp://forums.ubi.com/groupee_common/emoticons/icon_wink.gif
- Waypoint: mt_Move

BurningGeneral
01-26-2010, 07:15 AM
1.) What about the tutorial, sire? Sry that I set you a bit under pressure, but I relly need it before saturday.

2.) Why does the motion type walk > "calm" doesn't work? The Ai doesn't follow the waypoints if I use "calm" as motion type - because I need something slower than walk.

seir
01-26-2010, 12:30 PM
Originally posted by BurningGeneral:
1.) What about the tutorial, sire? Sry that I set you a bit under pressure, but I relly need it before saturday.

I know how to do it but I had no time to write a tutorial. I'll explain that to you now:

Every level created by ChromED Wizard have weather script already done. We will edit existing file instead of creating one from scratch. Go to your map directory and open "<MapName>_weather.scr" with WordPad (when you'll open it with Notepad you will see no breakspacing). First lines of the document should look like:

sub main() << start of weather script - don't change
{
set(0.000000) << initial weather value - don't change
{
description("Start");
varset()
{
LoopMode("smooth loop"); << type of the blending between values - don't change
VarFloat("f_fog_vol_opacity") << VarList variable name
{
val(0.000, 0.500000); << value in daytime "0" morning
val(0.250, 0.500000);
val(0.292, 0.500000);
val(0.333, 0.350000);
val(0.458, 0.000000); << value in daytime "0.45" almost high noon
val(0.667, 0.000000);
val(0.833, 0.000000);
val(0.958, 0.200000);
val(1.000, 0.500000); << value in daytime "1" night
}

And so on for all the variables. As you can see the parameter "f_fog_vol_opacity" have different values for different time of the day.

Scroll down the document and search for:

set(1.000000)
{
description("Start");
varset()
{
LoopMode("smooth loop");
VarFloat("f_fog_vol_opacity")
{
val(0.000, 0.500000);
val(0.250, 0.500000);
val(0.292, 0.500000);
val(0.333, 0.350000);
val(0.458, 0.000000);
val(0.667, 0.000000);
val(0.833, 0.000000);
val(0.958, 0.200000);
val(1.000, 0.500000);
}

This part is in the middle of the document. This is the second part of the weather. It's exactly the same and should be the same allways! If you will modify opacity of the fog in the first part you need to copy the value and paste it here, under the second weather part:

set(1.000000)
{
description("Start");

This is why the weather is blending properly. I don't know why programmers did that twice but it's working and leave it working http://forums.ubi.com/groupee_common/emoticons/icon_wink.gif Save your document and use action "act_TimeAndDay" to set time. Have fun!



2.) Why does the motion type walk > "calm" doesn't work? The Ai doesn't follow the waypoints if I use "calm" as motion type - because I need something slower than walk.

CALM AI on mt_Move (_WALK) should work fine. There is no slower animation.

BurningGeneral
01-26-2010, 12:58 PM
Thanks for that, sire. Now I understand.

1.) But what about the sound of the rain? How can I get it?

seir
01-26-2010, 03:30 PM
You don't have it with "f_rain_strength"? Try that InstantAction I told you.


BTW. it's "SEIR", not "SIRE" http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

BurningGeneral
01-26-2010, 03:58 PM
Don't know, why I wrote you name wronghttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gif - maybe because you are the leader of this forum so you are a kind of monarch of your own internet-kingdom:P...

According to the sound, I already tried what you said - it doesn't work on my map. But I found the parameter m_RainSoundPresent under MapSettings > Fields > cNatureParams<NatureParams>. If I check it to true, the sound will be already there on mapstart. How can I change this parameter during game?

seir
01-26-2010, 05:34 PM
With this "Rain Sound Present" now the action should work. I totally forgot about that parameter...

BurningGeneral
01-27-2010, 02:15 AM
Yeah, but I want to change the rain sound during the game. I don't want to have it on mapstart.

<span class="ev_code_RED">HOW CAN I CHANGE IT DURING THE MAP?</span> http://forums.ubi.com/groupee_common/emoticons/icon_confused.gif

If I check the "RainSoundPresent", the Sound will be enabled on start, what I do not want him to be.

seir
01-27-2010, 08:06 AM
You have to turn ON the "RainSoundPresent" to load the rain sound but you need also cut down the sound on the level start so go to "OnLevelStart" and use action "InstantSndStrength" (0 - no sound, 1 - sound).

BurningGeneral
01-27-2010, 09:00 AM
I already tried that but it doesn't work. Can you check it please?

seir
01-27-2010, 10:42 AM
Turn ON the "RainSoundPresent" in "Level Settings/Nature". Now you will see rain FX and you will hear the sound. Now when you will start action "InstantRainSndStrength" and set to "0". The sound will stop. Don't know where the problem is. I've checked that and it's OK.

One problem that I found is that when you will turn on the rain, you can't remove rain FX after stoping the rain and I can't find any resolution for this. Programmers created rain for Chapter III level and they didn't realize that someone could use their rain in any other way than on this level...

BurningGeneral
01-27-2010, 11:02 AM
Yeah that's the problem. I need to remove rain FX - can't I just play the rain soundfile by soundemitter or in music object?

seir
01-27-2010, 03:36 PM
Yes, this is the only resolution. You can use SoundEmitter with big distance and leave LoopCount on -1 - it means that the sound will loop forever.

BurningGeneral
01-27-2010, 04:07 PM
Doesn't work as good as I thought. The problem is that the acustic room makes it not able that the rain sound the same if you are going/turning around --> You always hear that the rainsound comes from a certain point.

Anyone another idea?

wookash_b
01-27-2010, 04:11 PM
I am setting up a wagon chase similar to the one in Weapon Transport level. Player is on a moving wagon with gatling, enemies attack on horses and on foot. I appear the AI and horse, tell AI to mount horse and then mt_HorseChase the waypoint attached to moving wagon. It all works fine apart from the fact that AI can hardly damage me. I wanted to use act_Damage when AI gets close to waypoint (using radius of the waypoint and act_Damage in actions for waypoint). But it does not work. Also, I tried to attach a sensor to wagon and do act_Damage when AI enters sensor. Still no luck. I am clueless how to get it to work. Is the mt_HorseChase the right thing to use here? Any tips how to get this done properly?

EDIT:

I changed AI property m_HorseChaseType to AGGRESSIVE and it seems to have fixed the problem. The AI gets very close to player now. But still shoots like crap http://forums.ubi.com/groupee_common/emoticons/icon_frown.gif Also I still cannot get act_Damage to work :/

seir
01-28-2010, 12:06 AM
Oh, the chases in Murder in Arkansas and Weapons Transport where one of the hardest mechanisms to implement. It works a bit different. I'll try to make a selection (or I think there is one already) with this action in the "new way". Your idea with "HorseChase" is from COJ1.

To make your Damage working try to make a trigger that will count distance from AI to player (cnd_ObjectsDistance). If the distance value will be less than about 500 cm then the action act_Damage will run.

seir
01-28-2010, 12:09 AM
BurningGeneral
You can use PlaySound without showing target so the sound will be played in player's head. You have to loop it somehow. Maybe on actionchain:

AC_RainLoop:
- PlaySound "Rain" (let's say our rain sound is 4 seconds long)
- Wait "4"
- Run "AC_RainLoop"

This will loop ActionChain http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif I think there's more simple way to loop it but I can't get better idea now.

wookash_b
01-28-2010, 06:53 AM
Originally posted by seir:
Oh, the chases in Murder in Arkansas and Weapons Transport where one of the hardest mechanisms to implement. It works a bit different. I'll try to make a selection (or I think there is one already) with this action in the "new way". Your idea with "HorseChase" is from COJ1.

To make your Damage working try to make a trigger that will count distance from AI to player (cnd_ObjectsDistance). If the distance value will be less than about 500 cm then the action act_Damage will run.

But then I would need to create a trigger for every single AI I want to use in the chase right? Every single AI needs to count distance, wouldn't that be too many computations?

The problem I found is that AI in facts gets within the radius of the waypoint. Problem is the act_Damage does not work (maybe I use it in a wrong way). I set a hint to be displayed when AI reaches waypoint and it worked, act_Damage didn't.

I hope my way of doing the chase is ok. I wanted to use spawners to spawn AI on horse, but I cannot spawn horses (can I?).

seir
01-28-2010, 07:54 AM
Show me your act_Damage http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

wookash_b
01-28-2010, 01:05 PM
Originally posted by seir:
Show me your act_Damage http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

Here you go:

http://www.lukaszbogaj.com/fields.jpg

Action in green area works, action in red does not.

seir
01-28-2010, 03:39 PM
Try to set "DamageType" to "CollisionFromGameScript" or some thing like that.

wookash_b
01-28-2010, 04:20 PM
Originally posted by seir:
Try to set "DamageType" to "CollisionFromGameScript" or some thing like that.

I will check that later, and let you know if it works.

I wanted to ask if it is possible that some things work differently in game launched via editor and game launched normally. See, when I launch my game in editor the AI teleports to the horse when doing mt_Mount, but when I play it via the game it looks OK. Does it make any sense?

seir
01-28-2010, 05:02 PM
WOW, that's weird. I'll ask programmers on monday. I have a free day tomorrow!!! http://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gif http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

wookash_b
01-28-2010, 05:07 PM
Please ignore my last post http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif The issue just happens randomly no matter how I play the level.

I wish I had a day off tomorrow as well. That would give me plenty of time to finish and polish http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif the level. Anyway enjoy it http://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gif

BurningGeneral
01-29-2010, 12:57 PM
I'm working on nearly the last part of my map. The player has to kill enemies in a village in coop with Ray and Thomas. I'm not using any coop actions - everything only with fight nodes because I don't know an other way.

1.) My question is: How can I force Ray to change between pistols/throwing dynamite/shooting rifle?

2.) How can I force Thomas to use his rifle sometimes instead of reloading his pistoles?

wookash_b
01-30-2010, 10:23 AM
Originally posted by seir:
Try to set "DamageType" to "CollisionFromGameScript" or some thing like that.

Still does not work http://forums.ubi.com/groupee_common/emoticons/icon_frown.gif

BTW How can I make friendly AI not being shot by enemies? Sometimes enemies shoot my wagon driver and his body stays behind while the wagon still moves.

baarssen
01-30-2010, 10:53 AM
wookash, you can change the driver's conflict side to neutral and he can't be shot but then he won't shoot at enemies either. also you should be able to create a barrier around driver and parent it to him so that it stays around him as wagon moves, but i can't figure out how to get barrier to block bullets. there is "block_trace" that says something about blocking bullets but doesn't seem to work for me.

wookash_b
01-30-2010, 11:02 AM
The driver is Neutral, that's why I ask. There are many weird things going on with this section. If driver can be shot, then you would think that some actions can be triggered when when he gets shot. But I cannot do it, no response in aOnShotFromEnemy/Friend/Player but then he can still die. Strange. Anyway I simply fail the mission now when driver gets shot http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif Works fine. Thanks.

baarssen
01-30-2010, 11:28 AM
check to see if bfriendlyfire is checked that is all i can think of. might prevent him from getting shot if it happens often.

wookash_b
01-30-2010, 11:34 AM
I'll leave that as it is. At least the player has to protect the driver.

But maybe you how to make AI more cause more damage to me when I am on the wagon. Right now they really cannot kill me. I have no idea why http://forums.ubi.com/groupee_common/emoticons/icon_frown.gif

baarssen
01-30-2010, 11:44 AM
You can try changing the value of the ai's fshotDeviation to a lower value. i think between 0 and 1 makes them more accurate and over 1 less accurate.

seir
01-30-2010, 11:59 AM
If you have player that is mounted to wagon, create act_PlayerControl with "EnableDamageIsPlayerCantMove" ENABLE or something like that.

BurningGeneral
01-30-2010, 12:02 PM
Originally posted by BurningGeneral:
I'm working on nearly the last part of my map. The player has to kill enemies in a village in coop with Ray and Thomas. I'm not using any coop actions - everything only with fight nodes because I don't know an other way.

1.) My question is: How can I force Ray to change between pistols/throwing dynamite/shooting rifle?

2.) How can I force Thomas to use his rifle sometimes instead of reloading his pistoles?

wookash_b
01-30-2010, 12:42 PM
Originally posted by seir:
If you have player that is mounted to wagon, create act_PlayerControl with "EnableDamageIsPlayerCantMove" ENABLE or something like that.

This works indeed. Thanks.

wookash_b
02-03-2010, 03:33 PM
Every time I put 2 same weapons in enemy AI properties I get a crash of the editor during validation. Map saves fine, but the crash is really annoying. Has that problem been reported?

seir
02-03-2010, 03:54 PM
No, nobody reported that. Are you using copy/paste to set the same weapon or maybe you are choosing weapons from the list?

wookash_b
02-03-2010, 04:06 PM
Yes, copy paste. Sorry I forgot to mention that.

seir
02-04-2010, 01:22 AM
And that's why it crashes. Weapon settings are very unique. Avoid copy/paste here but I'll report that to programmers.

wookash_b
02-20-2010, 04:22 PM
Hi, I am trying to create a path for spawning AI with the following pattern: AI spawns at the spawner->AI runs to the first waypoint->AI shoots at the object for X seconds from the waypoint->AI runs to the next checkpoint. Everything works fine, but only for the first spawned AI that will go through this path, the next AI that will be spawned and walk the same path will not stop and shoot in the waypoint. It looks like the bhv_Shoot at is ignored for the second AI. I tried setting bFailedConditionSkipsBahviour and m_CanBeSkipped to false but still AI skips the behaviour of shooting. Any idea how to force every AI to shoot every time?

Could it have something to do with cnd_TimePassed? Is this cnd_TimePassed calculated only once (first time it is used) or every time a new AI checks the condition?

After searching a bit more I found out that you can reset the time counter in cnd_TimePassed. This solved my problem http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

zwoib
02-23-2010, 09:17 AM
Hi, I want to create a wagon robbery where the player robs a wagon with a mounted gatling. The wagon stops when the driver gets shot and after that, the ai at the gatling should begin to shoot at the player, but I can't get this to work. The ai is doing nothing but looking at me with a sort of grin, saying "Ha-ha, did not work again, huh..." http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif
Do I have to create a fightnode for the ai at the gatling? The wagon has no defined stop position. It stops when the driver gets shot.
I would be glad if anyone could help me with that.

seir
03-01-2010, 06:04 AM
So the problem is the gatling gunner is not shooting? Make sure he's on "ALARMED" alarm level and check if he's on "COUNTER_PLAYER" conflict side. You don't have to use FightNodes to make it working.

How did you placed AI on gatling?

zwoib
03-01-2010, 11:06 AM
Thanks for the help, seir. But this does not work too. I createt it that way: first I took the selection "wagon" (from basic elements) and placed it. Then I placed a big gatling on the wagon and set its class to "GatlingBigOnWagon" and set the parent to the wagon. After this I added a "man" and placed a waypoint next to the wagon and the gatling. At the waypoint I set motiontype "mt_GetInGatling". I set the alarm level to calm (the gunner should not fire before player hits the driver) and set some settings to the driver: at the onDamage-actions i set the wagon speed to zero and added act_setAlarmLevel to "Alarmed" for the gunner. At this point - nothing happens in game. The gunner mans the gatling, but does not shoot after damaging the driver. I tried "act_changeParam" and set "ParamCanEngageFight". This works, but not with the gatling. The gunner leaves the gatling and starts firing his schofield. Changing his gun to "WeaponStationary" or "WeaponGatling" also doesn't work. The gunner gets either a "no mesh" sign while leaving the stationary gatling or a small gatling wich he carries but doesn't fire, but he still doesn't use the gatling mounted to the wagon... I hope this descripton helps finding my mistake.
Thanks for your help.

seir
03-02-2010, 01:05 AM
I would rather use "Conflict side" instead of "Alarm Level".

zwoib
03-02-2010, 10:16 AM
I tried that, too. But its not working. The way that got nearest to my intention was setting at the drivers "onDamage" actions an "act_changeParam" and "CanEngageFight" to true. But it only works with mobile weaponry and the gunner leaves the gatling when attacking the player. Its not working with the stationary gatling on the wagon. But I think the problem is not the gatling itself, because the player can use it in game.

wookash_b
05-12-2010, 03:42 PM
Is there a way determine if there is ANY active AI in a sensor? I am trying different ways but nothing seems to work. Just to make it clear I need the sensor to "know" if there are any enemies inside of it, not just one particular enemy.

Gazitron
05-12-2010, 06:53 PM
Hm I can't get your question - can you please explain for what do you need it? I mean is it should perform some actions if some AI will be in the sensor?

wookash_b
05-13-2010, 01:15 AM
Yes. The thing is I know how to do it for a single, specific AI. But what if you have 30+ enemies in the map and ANY of them could walk into the sensor? How do I check if ANY of these 30 enemies walked into that sensor? I tried by using AIGroup as a ControlObject in the sensor and it didn't work.

seir
05-13-2010, 03:13 AM
wookash, I already answered your mail about that problem. I hope that "cnd_ObjectDistance" will be good http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

KirGen1982
06-24-2010, 03:32 AM
fAIWeaponLODCoef - what is it? I have tried to cange it's value, but can't see any difference.

seir
06-26-2010, 05:53 PM
LOD is "Level of Detail" - this value is a factor of what distance will change the level of detail of AI's weapon. Values much lower that 1.0 will make weapons less detailed.

This option might been used in COJ1 - in COJ2 development we always used default value and it was perfect.

Luka1324
07-09-2011, 04:01 PM
Hi,

I set in properties for 3 AI conflict side pro player, but when the enemies come after some time they die, probably because they are between player and enemies and accidentally get shot by the enemy or maybe some other reason i don't know. Enemys has conflict side counter player so they don't should attack them.
I want that they never die.

(sry for my english)

cr1m3
07-10-2011, 03:02 AM
Hi,

if an AI have the counter player's side set, he will kill all player's friends too.

This game is like a western,
there's the bad = "counter player ,the good = pro player , the civilians = neutral touchable , the background actors = neutral and the uggly Clint as the really bad guy = counter all.

I mean that this is an easy way to set ai behaviours quickly and create some fighting areas.

I think there's two solutions for your problem,
you could set their fDefaultAIHealth to -1
to make them immortal so they never will die.

Or you could try this vodka-kyo selection to see how he had done this (in his selection, the AI's are attacking the player).

Ps, i have never tested it but i think that vodka-kyo have done a good job with this selection.

Luka1324
07-10-2011, 11:45 AM
Before I asked this question i set their fMaxHealth to -1, but now I see that it was wrong.
Now i've set their fDefaultAIHealth to -1 as you said and it's great.
Thx for help.

cr1m3
07-10-2011, 12:22 PM
My pleasure.

If fHealth is set to -1 , it will use the fDefaultAIHealth, i'm not sure but if you set the fHealth to "200" and fMaxHealth to "1000" it will overwrite the fDefaultAIHealth value.