Page 1 of 1
Bot behavior: can bots always follow the player?
Posted: Wed Apr 26, 2006 5:31 pm
by rassgatalius
Hi guys,
As a school project I want to modify bot behavior in MOH:AA multiplayer or single player.
I want to create a playable level where all bots (enemies and friends) face and follow the player at all times. The bots do not shoot back, they simply run towards you (no matter where you are in the level) and stop and look at you. If you walk towards them they get out of your way, but keep facing you at all times.
My questions are:
1. Can I edit the bots' behavior in the above way?
2. Can I have them say a greeting of my choice (if I record the sound myself)?
I am not changing the models, only their behavior.
Any help greatly appreciated!
Thanks,
Halli
p.s. any map/level will do. All I want and need is to be able to play the game with the bots behaving as mentioned above.
Posted: Wed Apr 26, 2006 5:37 pm
by jv_map
Yes, the above is very well possible
Are you looking into creating a map specifically for this purpose?
P.S. Welcome to .Map

Posted: Wed Apr 26, 2006 5:49 pm
by rassgatalius
Thanks for your reply.
Actually I do not need a particular map for this project, so any map (big or small) will do fine.
The thing is that I don't have much experience with these things. Is there a "kind of simple" way to do this, as opposed to the "crazy complicated"
way?
Thanks again,
Halli
Posted: Wed Apr 26, 2006 6:22 pm
by rassgatalius
I read through this:
http://www.planetmedalofhonor.com/freeb ... apt-8.html
...where it talkes about Route Nodes and Routelists, paths etc.
I see that I could change the way the bots run to a particular point (a bomb or a house), but I don't know how to make every bot run to me and follow me around, the way my squadron would do while playing single player.
Is the following code an example of what I should be adding?
01 level.routelist[routes_to_bomb][1] = "north"
Thanks,
Halli
Posted: Tue May 02, 2006 11:11 pm
by rassgatalius
Although I am quite comfortable with code (and can have help with the code if needed) I don't know what parts of the code I should and could be messing around with.
I am wondering if the difficult part is the code itself (in which case I can get help), or if it is how to be able to modify the bot behavior?
For the bots speaking: if that can only be done in multiplayer (a hosted game) that's fine. The main thing for me is having the bots follow the player, so them speaking is an extra.
I know that in some levels your teammates group up around you and follow you through that level. Also, bot behavior can be modified where you can add or remove nodes on their path to a particular point (a shelter, a meeting point etc). The nodes (as I understand it) are just there to make the bots move more smarter, i.e. that they don't just run across the field like chickens, but instead follow a bit more complex route.
I thought that I could somehow combine these two, so that there are no extra nodes for the bots to follow, and the meeting point is always me (the player), just as where they group around me.
If anyone of you guys could point out which parts of the code I should modify, that'd be great! Also, if you know of a level that might suit my needs for the project.
Thanks again,
Halli
Posted: Tue May 02, 2006 11:16 pm
by rassgatalius
Hello guys,
I was thinking:
Do you think that I could perhaps define path nodes for the bots, so instead of them "following" the player, I just create a small level -- inside a house for example -- and program all the bots to just walk around the house?
Will that be easier to do?
Thank you so much,
Halli
Posted: Wed May 03, 2006 5:35 am
by jv_map
Hmm you're probably better off not using jv_bots, but stock (single player) AI. The 'added value' of jv_bots is that they automatically perform typical multiplayer tasks like planting bombs and manning machineguns. That comes at the cost of reduced flexibility, which is the last thing you need.
Pathnodes are the navigation beacons of all AI. They are not for path optimizing, but merely for pathfinding. A bot can only move somewhere if it can draw a continuous path to it, via pathnodes.
(route nodes apply only to jv_bots, not stock AI. But for stock AI, you usually don't need em

)
Posted: Wed May 03, 2006 9:23 am
by bdbodger
But stock ai don't work in mp unless you mod the new_generic_human.tik and clients will also have to have a modded file . Useing the bots from JV_bots in place of the ai but not useing the bot scripts will work with less effort and can be used for bot maps as well . Couldn't you just make a bot map and set the tasks to have them follow the players or just use camp and sniper nodes and not have them plant bombs or use mg's.
Posted: Wed May 03, 2006 4:09 pm
by jv_map
bdbodger wrote:But stock ai don't work in mp unless you mod the new_generic_human.tik and clients will also have to have a modded file . Useing the bots from JV_bots in place of the ai but not useing the bot scripts will work with less effort and can be used for bot maps as well . Couldn't you just make a bot map and set the tasks to have them follow the players or just use camp and sniper nodes and not have them plant bombs or use mg's.
Hmm no jv_bots are scripted so that not more than 1 bot follows each player

Posted: Wed May 03, 2006 5:14 pm
by rassgatalius
Thanks for your help guys,
Stock AI might be exactly what I need, because while the project is meant to
playable, I am happy with it only being playable for one person (at least to start with). So I might not even need the new_generic_human.tik for now.
In a way, I want them to behave like zombies, without the blood, white empty faces, and the growls.
What would be the easiest way to achieve what I mentioned, using Stock AI?
The most important parts are:
1. bots approach the player, and do not back away easily
2. they follow me around
3. they face me most of the time, or all the time if possible

4. their aggression does not cause them to shoot or attack, but simply be persistent in the approach, and how they follow me.
Posted: Wed May 03, 2006 6:08 pm
by jv_map
Hmmmm ok i c
Well.. you're gonna need a map with pathnodes.. either make one or use an existing map.. making a new map would probably be easier but you'd have to learn the basics of mapping... you could also post a request in the help wanted forum and a mapper may be able to help you out. I don't know if that's allowed in your project though.
Once you have map with pathnodes, the scripting isn't that hard. You might need some code to prevent bunching up, though. The basics:
1) spawn a german or friendly AI.
2) if the AI is german, set .enableEnemy = 0 (he won't attack now)
3) make AI walkto player (this'll automatically follow) (put this in a thread)
Code: Select all
// self is AI
while(isAlive self)
{
self walkto $player
self waittill movedone
wait 1.0
}
This way they'll look really relaxed. You can make them look more aggressive by having them aim at the player
self aimat $player
They'll keep aiming at the player until you set self aimat NULL.
Hope this helps to some extent.