Game Design, Programming and running a one-man games business…

Debug Tools and defensive AI.

Life is so much simpler when you bunch up all your hotkeys and toggles for debugging the game into a single menu. I feel like I have a rough idea what’s going on now. I also feel more confident about coding decent defensive AI when you play as the attacker:

The code for defending basically needs to manage three things. The play style (Is it spamming units, hoarding points, or steadily placing), The choice of units (Does the enemy have units weak Vs lasers? Are there lots of infantry needing flamethrowerising?) And the choice of unit placement. I’ve been concentrating on the unit placement debug UI today, so I can see what the AI is thinking when it chooses to place a turret at X rather than Y. More work to do, but currently it evaluates proximity to enemies, their size, victory-point value, closeness to the exit and proximity to the placement, plus it also has bonuses for being able to cover multiple paths from a single location.

It all needs lots of tweaking and balancing obviously, but it’s getting there. Attacking AI is much simpler.

After getting this stuff done, I’m thinking of experimenting with a unit ‘cooldown timer’ beyond a certain level to prevent spamming the same unit everywhere. Essentially there are supply delays if you plonk down 4 heavy tanks all very quickly, as new ones need to be dispatched from your offscreen HQ. I think it might be a good mechanic that encourages variety.

6 thoughts on Debug Tools and defensive AI.

    1. It’s a good question. I’m coding it now, and I’ll see how it works with a flat timer first, but I like the idea of it varying. Then you could have heavy tanks as rare items, effectively.

  1. IMO you need it to allow you to spam units of the same type, otherwise if you need two heavy tanks to break through a flamethrower, say, and you can only ever have one due to the cooldown, you’re screwed.

    I’d do it like this, say: you queue up waves at a time, and each wave has an allotment of Metal, Tech, and Personnel. Waves have an Estimated Time to Arrival which can never be less than 0 secs, i.e. when you click ‘Send Wave’, it starts counting down and the units enter the board when it reaches zero. Since you can only receive resources at a fixed rate, if you want to order a lot of heavy tanks, that will mean a lot more time before your wave is ready…

    This ensures your troops attack as a unit. If you want, you can have a wave full of heavy tanks, but it will take a lot of time to have the wave ready. Having caps on the other resources motivates you to fill the waves in so you don’t waste resources, and having your opponent gain resources and build as you delay motivates you to push faster.

  2. I think you could do it like in the old mechwarrior games. When you outfit a mech you need to balance cost, space, and heat. So why not have limited space on the drops and make sure that some very powerful units also take up a lot of space?

  3. Having an AI enemy pushes this game more towards RTS than tower defense. Tower defense typically have predetermined lists of enemies to overcome, and judging by challenge modes in GSB any similar challenge mode in GTB will fall towards the predetermined side of things.

Comments are currently closed.