Help - Search - Members - Calendar
Full Version: Ai Problem i cant solve
Battlefield SinglePlayer Forum > Main > BF42 and BFV Discussion > AI Editing and Mod Support
Farmo
hey,
I've read trough some of the threads here to look for a solution of my problem.
but no one seems to have tried this or maybe it just can't be done,
but what I'm trying to accomplish sounds pretty simple.
so here it comes, I'm currently developing a Zombie mod for Bf:V
and one of my goals is to have the bots try to give a priority to shooting/killing other bots and the player and not try to capture flags and getting into vehicles, that's one
problem.
the other is the "zombie's" of course have no ranged weaponry so to test I have given the zombie side only a kit with a knife in it but they are not targeting an enemy unless you are in range of the max range which is 1.5 for the knife, and if put in an higher value they do target you but they try to knife you from that max range and that does not work (obviously ;p).
so would anyone have a solution for one or maybe both of these problems ?
Dnamro
First of all, you can't only change the Zombie AI unless you change it for both sides. Now if you restrict bots to only play zombies, then it will work to change the AIbehaviors in the game.rfa file by setting the moveTo setting to a very low value and increase the Fire setting such as in this example:



rem *** Construct standard weights ***
aiSettings.createBehaviourModifiers InfantryWeights
aiSettings.setBehaviourModifier Avoid 1.0
aiSettings.setBehaviourModifier MoveTo 0.01
aiSettings.setBehaviourModifier Idle 0.001
aiSettings.setBehaviourModifier Fire 7.5
aiSettings.setBehaviourModifier Special 2.0
aiSettings.setBehaviourModifier Scout 1.0
aiSettings.setBehaviourModifier TakeCover 1.0
aiSettings.setBehaviourModifier Change 2.0

You can restrict bots to specific teams on vehicles in the object spawner code:
If you want to restrict enemy bots from stealing a vehicle, use this code in the spawner with a 1 for Vietnam/Axis, 2 for US/Allies, 0 is neutral/default setting. If Zombies are team 1, then use this

ObjectTemplate.teamOnVehicle 2

Here are some ideas that will restrict all bots use of vehicles:
http://www.battlefieldsingleplayer.com/dna...20vehicles.html


the knife weapon actually fires a short ranged invisible projectile. You can increase the knife projectile range to match the AI range you can get better results. If you want the bots to fight with hands, give them a hand weapon that is set as invisible.


You can check out the AI that I did in the BF42 Zombie mod or the pirate sp mod in this thread:
http://www.battlefieldsingleplayer.com/for...showtopic=15143

Also, check out the online mod tut:
http://www.battlefieldsingleplayer.com/dna...Guide/index.htm
Farmo
yea changing only the Zombie Ai is no problem it was supposed to be a Coop mod anyhow,
and I did already figure out eh knife actually shoots invisible projectiles. but i just could not get them to attack me or bots they would just run to get in vehicles or capture Cp's witch was annoying because zombie's don't yell flagzzzzz they yell brainzzzz laugh.gif .

thanks for your help I already experimented with making fire a higher value but did not change the other value's,
but it did not seem to help much, but I'll surely try your idea's, as you've made a zombie mod before.
and the hand weapon idea what I was thinking to but I was just using the knife as a place holder to see if such a mod would be possible, seems i did not do my homework to well.

i'll let you know what happens, for now it's back to testing.
Farmo
laugh.gif Wohooo !!! the Ai is working like it should, they're attacking me like crazy, and dont really care about control points any more. they act really zombie like just stand there looking for prey and when they spot you they come after you and attack you. which is great fun.
but what I also did was change the AI/AIstrategies file in game.rfa , to be more aggressive and not to defend that works to I think because they don't really care about going prone or getting to cover when you hit them they turn around an target you instead of going prone first.

and now I've struck another problem (actually 2 sad.gif ) the stock maps in the game are a bit to big I already picked the city maps but still they're pretty big does someone know some custom Sp supported maps that are really small city maps ?

and I cant change what army is playing on a map without getting an error message in battlecraft, because when I load up a original Bfvietnam map i get a message saying it's missing some objects and when I ignore that and change the teams,
and try to play the map the game crashes which is pretty annoying,
I'm sure its just a stupid fault on my side but I cant seem to figure it out.
Dnamro
You have to edit the battlecraft cfg/lst files to add new teams, but it's easier to use winrfa to upack the map and edit the init.con file and change the teams by hand. You can also change or set a combat area here as well.

Bostogne would be a good city map, if you restrict the combat area to the city

Crimson_Raptor
What have you decided to do about the amount of damage or health the Zombies can take?
Farmo
@ Dnamro, ok I'll see how that works out,
guess I'll first try to finish the AI, texture's models, and coding.

@Crimson_Raptor
hmm, i don't really know yet but as very zombie fan/fanatic,
knows they only die by trough 1 shot in the head.
but i don't think that it is possible to to that,
so I'll give them the highest possible hit points that is possible
and still make them die in 1 shot trough the head with your primary weapon.

Dnamro
The problem with A Zombie mod in battlefield is the limited hand to hand combat. What about giving the bots a spitting attack?
Farmo
A spitting attack, would solve those problems but would ruin my view on how zombie's should behave.
maybe add some other fighting fore that tries to kill every survivor in the quarantined area,
because the government is trying to wipe the whole outbreak under the carpet.
but them they would behave lame because of the zombie AI, or wouldn't they?

for now I'm gonna focus on my zombie's happy.gif .
Crimson_Raptor
Well since you need 3 weapons at the least for the Zombies, may I offer some suggestions?

1st (Knife) Slot Punch Attack (or a Jab attack, using the knife animation to simulate the end effect)
2nd Slot - Rip Attack (Arms going back and forth like tearing the flesh off of the enemy)
3rd (Primary) Slot - Grab Attack (like arms out kind of thing, more or a choke attack I suppose)

The knife animation is strongly recommend for all, but you'd have to give the bots reason to what to do them. As all 3 would have a minimum distance to attack set to very, very low. Maybe make a punch attack able to hurt vehicles like the jeep, or any kind of light armor. A rip attack has a "burst" fire mode, like an automatic pistol. And the grab attack is like a one, two, 3 shot kill, like a sniper rifle.

Zombies are so much fun! laugh.gif
Dnamro
But, if all three attacks are hand to hand attacks, you would have to create classes and give each class a different attack in order to get the bots to use the different attacks.
Crimson_Raptor
Not if they're Zombies! Well then that makes weapon classes that much more difficult. Zombies aren't really good at using tools like chainsaws, and axes, and stabbing weapons. They prefer to eat away at their victims...

Ooo! A biting attack to replace the knife, a real close-quarters weapon!
Farmo
You know Crimson_Raptor, I really like your take on the idea of giving the zombie's some variety
.
and Dnamro's idea on making every attack form another class is handy to so your sure zombie's will take different classes and with it giving the horde more variety that way.
and you know I could actually totally see a zombie by mistake still have a shovel in it's hand or a machete because of what they were doing before they became zombie's.
and then kind or still trying to wield it (poorly laugh.gif ).
but you know the real problem is getting the horde to really chase you I mean in a game it's now 16 against 48 zombie's I think and some zombie's chase and actually kill, and others really stand and do nothing, it's kind of sad to see, i just cant get them hungry enough I guess uhm.gif, does someone have any idea's how I could change that even more ?
and combat area's are defined by a sqaure with the x and y positions on a map right ?

also does someone know if there's is a mod that uses a Double barrelled old shotgun?, I'd love to put that in the mod but unfortunately I am not so skilled with modelling to create new models I can only edit them to some extend.
come to think of it not that good a modder at all, oh well long as I'm having fun laugh.gif .
Crimson_Raptor
QUOTE (Farmo @ Aug 17 2010, 02:00 PM) *
You know Crimson_Raptor, I really like your take on the idea of giving the zombie's some variety


No problemo, I'm glad I can help stir up the brain pot of our community, lol. laugh.gif

QUOTE (Farmo @ Aug 17 2010, 02:00 PM) *
and you know I could actually totally see a zombie by mistake still have a shovel in it's hand or a machete because of what they were doing before they became zombie's. and then kind or still trying to wield it (poorly laugh.gif ).


Hmm, that is true, but a chainsaw shouldn't be used. The gas would've run out before they found a human to devour.

you know, if it was a farming town setup, pitchforks and a Grim Reaper's scythe could be weapons of choice. In the city, that would be a harder choice, like they still have their cell phone in hand or subway sandwhich, lol!

QUOTE (Farmo @ Aug 17 2010, 02:00 PM) *
but you know the real problem is getting the horde to really chase you I mean in a game it's now 16 against 48 zombie's I think and some zombie's chase and actually kill, and others really stand and do nothing


I've never seen bots go for the other team, or even just the human players, because Battlefield has a control point set up. Both sides go for the control points and get "stopped" by seeing or being fired at by the other team on their way "down the yellow brick road" of the pathmaps invovled. I wonder how a system like that might work with one side having nothing to do but kill and the other running around trying to defend control points. Of course, automatically the other team would "white out the flag of the control point once there for 10 seconds so when all the humans died they couldn't respawn. Man, that would be a frightenly real way to play against Zombies in a Battlefield-system. blink.gif I'm scared just thinking about it!

QUOTE (Farmo @ Aug 17 2010, 02:00 PM) *
and combat area's are defined by a sqaure with the x and y positions on a map right ?


On the minimap yes, but AI-wise everything is in circles and approx meters around it.

QUOTE (Farmo @ Aug 17 2010, 02:00 PM) *
I am not so skilled with modelling to create new models I can only edit them to some extend. come to think of it not that good a modder at all, oh well long as I'm having fun laugh.gif.


We are all learning all the time. None of us are experts, although we sometimes say we are and are called so by fans, rofl! I know othhers would recommend different programs, but GMax [ http://www.turbosquid.com/gmax ] is a free modeling program offered by Turbosquid [ http://turbosquid.com/ ], as well as their are dozens, upon dozens, upon dozens, of FREE models that you can resize and rescale for use in Battlefield 1942.

In fact, here's some links from a quick search of the site's contents:

Double-Barreled Shotgun in .3ds format
http://www.turbosquid.com/3d-models/double...3ds-free/336778

Shotgun Shells in .gmax format to go with it [actually made by my friend Semedar]
http://www.turbosquid.com/FullPreview/Index.cfm/ID/271578

Even a model of a Shotgun and shells included in .max format
http://www.turbosquid.com/3d-models/3ds-ma...-shotgun/411134


And here's something else, a full pack of modern weapons already unwrapped and textured.
Including a pump-action shotgun, one with an M4-stock for some reason, an FN P-90, an Uzi 9mm, and a Tec-9.
http://www.turbosquid.com/FullPreview/Index.cfm/ID/522500


The gmax and the 3ds formats would be easy to use in Gmax, but I've never seen a plugin for the .max format to work in Gmax. sad.gif
Farmo
hey, thanks for that info.
and sorry for getting silent all of a sudden,
but the truth is the models n' textures did not prove to be the big problem
that I had with my mod, in fact it was the zombie AI that messed up, and made me lose faith.
but the + is I have learned a lot from this attempt and I think I'm going to have to redefine the idea of my mod.
unfortunately I do not think the Zombie's will be in this new idea. it's like you said the AI is just to much fixed on control points and the Mellee AI is just not developed enough to really do anything, to bad sad.gif .

maybe the BF2 AI is better I would have to check that but I do know that there is a Zombie mod in progress for BF2, so I guess that AI is even better controllable than Vietnam's AI.

so sadly no Zombie mod for Vietnam from me, but maybe a different idea still something apocalypse aftermath like,because I just like that laugh.gif . I'll let it be known here for sure.
Dnamro
The AI in BF2 is very similar to BFV and BF42. There are settings in BF2 to control the stance (standing, prone, crouching) of the bots when attacking, which can keep the bots standing.

If you want, I am willing to take a look at what you have done and see if I can help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.