Tuesday, April 17, 2012

Getting AI units to move at full speed

At the moment my AI is moving clumps of LABs around in formation as a platoon. This makes them move a lot slower than they should, and I'm trying to figure out a way to make them move at top speed.



Anyone have any ideas?|||if you were more specific about the problem maybee i could think of some workaround, in the current state i am not sure you have a problem with massive packs of the same troop or with massive packs of diffrent kind of troops.



those may work



split platoon at libitum and give same behaviour to the remnants which would result in so many smaller formations moving in the same direction instead of a big formation. using the platoon count option you call 1 platoons of 10 bots that can be used 10 times simultaneously instead of 1 platoon of 100 bots this would result in the AI building a platoon with 10 bots then building a second one immediatly after and so on until it has 10 of them altogether up and running. instead of trying to muster a big platoon of 100 bots altogether in an orderly fashion.



2 problems with this



the first platoon might go off as soon as it is built regardles of wether there is enough bots to create 10 platoons , this may end with you having just 10 or 20 bots going fiercly to their death instead of waiting to be 100 to go. you can workaround this asking the AI to use a unit count build condition say '90 bots built and idle' required to create the platoons so you ai will wait that it has a minimum of 90 bots standing still somewhere with nothing to do then it will create 9 platoons of 10 with them and throw them where you asked and if possible it will even create a tenth one.



the second problem is induced by the first one your bots move by groups of 10 so they as well arrive in orderly fashioned groups of 10 rather than

in a messy pack of 100. this might give a good result if the AI picks all the groups at the same spot they will arrive not very distant, but if the ai picks groups at very far apart spots on the map you may have a very unexpected result.



2nd idea



mess with formations variables, sorian might know more about that second alternate i have personally never messed too much with it. removing squadron formation reference everywhere you can find one (platoon creation in the archetype AND platoon template) might work. or might just crash the AI.





3rd idea



another idea would be to tweak the behaviour function in 'platoon.lua' and give one move order to every single platoon unit using a FOR... DO... END, instead of applying a move order to the entire platoon. and then make sure your platoon and platoon template both refer to that new function instead of the old one. be carefull dont mess with the old behaviour directly or you would modify the behaviour of all AI and not just that of yours, because 'platoon.lua' is a file used by all AI ( they just call diffrent functions inside it).



in that case the platoon will create a true group of say 100 bots then the behaviour function will give every single one of them their very own move order, which should result in the bots in your platoon behaving selfishly regardless of the position of other bots in the platoon.

No comments:

Post a Comment