After a few days of coding, I have managed to implement the framework for actual battles. RTS games are no fun if you can't have epic battles, right? In BoS, there were 2 problems:
- Inability of AI/Units to select targets, and player units would sit there being shot at without orders.
- No field control, aka interdiction. Targets could run around you and you never hit them.
So, I worked on solving these issues. First I added the ability for idling units to select targets within range and engage without AI/Player intervention. This means that idle units that are being ignored can actually defend themselves.
Next, I implemented the two interdiction modules in BoS: velocity nullifiers and warp jammers. As you suspect, nullifiers slow a target down and jammers prevent it from warping. This means that you can effectively control range on your target.
Two new effects were added for these abilities so you can see what ships are being interdicted:
These interdiction methods come very directly from EVE Online, where they are vital to controlling a target in any fight from a 1v1 to a fleet battle.
The ability for your unit to know that an enemy approaching and engage it is vital to any RTS, imagine having to watch your sentry units constantly! So, I have implemented a system that checks for an enemy in range using rectangles.
This function was eating up a lot of CPU cycles, but I mitigated that by merging it with another function that was doing nothing but caching bullets. The game speed effect of the code is minor.
This function is not called if the unit finding a target is:
- Not constructed fully.
- Been given a destination to fly to.
- Already has a target assigned by the controlling player.
Enough Game Theory Crap, Show me the Fighting
No problem. Here's your show. Please remember that the effects and behaviors in this video are by no means final. Also remember that there are range limits on interdiction, so just because the fleet is attacking something does not mean it can interdict it.
Remember, the music was not in the game, it was provided by audioswap.
Like what you see? Hate what you see? Have a suggestion? Contact me, or I will never know. I am glad to create a free, open source, space RTS for everyone.