Lost Flagship - daily bugfix report, huh

"Everything is broken - it's just about more or less".

My game looks like "more". First players have found lots of problems, starting from softlocks (enemy won't move, buy units or shoot for some reason) and ending unexpected behaviour.

Bugs are multiplying like Lernaean Hydra, and I'm just continuing to cut through them :)

work.PNG

At the beggining of this development I met a funny bug.

My AI is based on method from old-good Red Alert 2 - a task forces. If AI decided to do something, it would search for some pre-defined group of units nearby (for example, two tanks and some troops for small ground attack, or 1-3 flak units fo intercept your annoying plane). If there are no such units, AI will produce them or switch to another strategy. So, I've formed first task force from 4 destroyers (let's name them A, B, C and D). Big and nasty ships that looks like a prey bird:

dest.png

Their task was simple - "look around, and if one of you has enemy within fire range - go and shoot him". And they've done their task very well. When enemy approached to destroyer A... three of his brother-in-arms looked at poor A, warmed their lasers, and shot him down in a second! I was shocked. Of course, problem was on definition of "him" - it wasn't about "enemy", but was "one of you". So, lots of problem are caused by very stupid overlooks.

Today's "bug of a day" is his small brother. Look at that simple attack algorithm: - Task force decides to attack. - Then they're finding the nearest enemy. - Then they're coming after the nearest enemy. - They're getting within fire range and shooting enemy.

Looks normal, right? But what happens at step 3? When you move to the target, target may retreat or simply move at point where none of your guns won't ever reach it. Other enemy may stand in your way. What'll happen next? Task force will try to destroy target, no matter what happens around it. One small error - and your AI will look like berserker maniac :)

Softlocks are more difficult. I still have not done with fixes, but "Softlock Watchdog" is not so bad as a temporal solution.

The worst problem is a loading. I'm still fighting with hanging that happens on some of the machines after tutorial level.

https://ldjam.com/events/ludum-dare/45/lost-flagship