Tanks-of-Freedom icon indicating copy to clipboard operation
Tanks-of-Freedom copied to clipboard

AI turns take too long

Open jficz opened this issue 8 years ago • 9 comments

Hi, it would be nice if the CPU turns were not as long as they are now. Sometimes it takes around half a minute even if all enemy units are hidden in fog of war and sometimes even longer when the battefield is visible. This is for Android. It's slightly better on a Linux box but it could still be faster.

Perhaps a settings gauge to set AI turn time speed?

-cM.

jficz avatar Apr 27 '16 12:04 jficz

I believe that significant reason for slowing down is the "smooth" following camera - it takes a lot of time until it fixes over a location. It's unfeasible to play without a following camera on Android due to smaller screen but if turned off on a computer with big screen, the AI turn time is almost twice as fast.

jficz avatar Apr 27 '16 14:04 jficz

Hi cptMikky, thank you for the feedback! I would have to check, but I think, that AI takes it's turns as fast as it can. Idea we have to somewhat help with this issue is to add a configurable camera speed, so it takes less time to show the action. I will add this to the planning board, and consider adding it to some future release.

czlowiekimadlo avatar Apr 28 '16 07:04 czlowiekimadlo

It would me much better if AI would not keep switching units as it does now. Since the game is deterministic anyway, AI should be able to compute all actions for given unit and perform them at once.

caryoscelus avatar Aug 25 '16 14:08 caryoscelus

The game is already computing all moves for a unit, it switches, because it sees other moves, that are 'better'. I think we could add some weight to moves done by the unit, that moved last, so it would switch less, but I'm not sure if we want to go this way.

Right now AI should balance the movement between many units, so it does not send single guys for raids against big enemy force just for them to die - it should try keeping it's forces closer together. To fix that we would have to add much more movement prediction, and that is not really an option due to performance issues with AI scripts. Maybe when Godot 2.2 adds C# support and we can make pathfinding faster we will be able to make AI smarter.

czlowiekimadlo avatar Aug 28 '16 06:08 czlowiekimadlo

Well, i guess it's hard to completely fix this, but i've seen some situations which "should be" obvious to AI, like tank & heli moving against infantry & tank respectively - and they did it in single moves, switching between each other (and there was enough ap to do both in the end, which they did).

Not knowing architecture i don't know how hard is it to fix such issue though.

caryoscelus avatar Aug 28 '16 07:08 caryoscelus

I'm on android , playing at the campaign 8/14, AI turn take around a complete minute even with disabled camera follow, any advise ?

Wait a minute between each round is really frustrating :p

Aside from this, thanks for your game it rocks :+1:

Shuunen avatar Sep 08 '16 18:09 Shuunen

I'm afraid, that if turning camera follow to off does not help, then there are no more workarounds at this time. It is possible, that I never suffered long AI turns, as I try to not let it gather too much AP - it will cause it to have more to do and take more time.

Increasing AI speed is quite low on our priority list right now, but we are keeping this issue open to get back to it in the future. Also, I'm afraid, that turn-based strategies just tend to be slow :)

czlowiekimadlo avatar Sep 08 '16 20:09 czlowiekimadlo

Yes it was because I let AI to much AP and I had to stop the mission that was un-finnishable :)

Shuunen avatar Sep 09 '16 13:09 Shuunen

That actually gave me an idea. We could add an AP cap for the AI, so it's turns time would be somewhat capped as well. I will discuss this idea with the rest of the team.

czlowiekimadlo avatar Sep 09 '16 13:09 czlowiekimadlo