Need some suggestions on what algorithm to use -


its simple game in c++ .

there 5 random towers generated in coordinate range (0.0f,0.0f) (10.0f,10.0f). have random hp,range , damage capped within limit. can't move.

now , 10 units added on map fixed movement speed, hp , damage.

no of units , towers fixed through simulations . initial position randomized. 1000 simulations run.

goal achieve win rate of 90% approx units.

a game won when units destroy of towers . units can move @ predefined speed towards tower. each simulation takes multiple rounds complete. in each round unit move towards best selected target , attack if within range. towers pick 1 unit within attack range , keeps attacking until dies or moves out of range.

i need pointers on algorithms shall invest time in achieve same.

currently , able achieve 84.2% win rate using weighted average of distance unit, hp ,range , damage of towers , selecting tower scores least on these criteria. moving towards tower least distance unit without considering other attributes achieves win rate of approx 72 % .


from comment of deleted answer:

there 1 more restriction . can select target each time. units make sure move towards target . not supposed modify part units move towards target . , there has target tower each round of simulation towards unit targeting move. , there no way can move units away tower safe area , assemble them @ point , plan attack.

i've had better idea formula select tower attack.

for each of warriors use "score" each tower. select tower highest score

a1*todaldmgfromotherwarriorsaimedatthattower - a2*towerrange - a3*towerdamage - a4*towerhp - a5*distance/speed 

a1-a5 should modified again , again until optimal result making parameters more important others


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -