
Hex TBS Defense System?
I am making a hex-tiled turn-based strategy game (sci-fi) and I need a way to make planets (where you build your units) defendable. I am coding it in Java. Parts of the problem are: Changeable: Ships (units) can only attack or perform actions during their turn (except supply depots, which don't have an attack action but can shoot back at their attacker). Definite: Planets can't defend themselves, they can only be defended. This is a requirement as the game is set in an existing universe (FS2) and that game does not have planetary defenses. Definite: Ships can spend parts of each turn powering up for a subspace jump, which lets them either go from one star-system to another or to teleport to ANY open space in the current star-system. Inter-system jumps, however, may only be done when the ship is next to a jump node. Problem itself: Being able to teleport to any area in a system makes it so that the player whose turn it is can destroy the jump in and level the opponent's homeworld (win/lose condition) in one turn, without the player being able to defend themselves. In fact, the only way to defend against this is to establish a defensive force at the defender's side of the jump node, and to attack ships as they come in. This is no good. Misc: I don't remember if I ever implemented it, but when a ship jumps through on top of another ship, the weaker ship is/should be destroyed and the tougher ship takes the weaker ship's HP in damage (telefragging). Desired Solution: I need something that will let ships defend other ships or defend planets (only larger ships and planets may be defended by smaller ships, I think). Probably an action that the ships can do, but I will need rules for it, and I can't seem to think of anything that will make it possible to defend but not make every game turn into a war of attrition / stalemate (since resources are infinite in supply, even though their gather rate decreases with use). Effectively, I need rules for a defend action, or a way to set up automatic defense. Also, some of my audience has complained that the large ships can destroy the small ones without taking any damage, so maybe self-defense could be implemented. Screenshot:
Any ideas would be appreciated.

Signature go here.
As for the teleporting, are planets like one hit? Also make a range that the ships can teleport. This will allow for long range type sensors to pick up on them and attack them before they become a huge threat. You could also have it so that a planet can upgrade itself to give out an anti war field which stops any unit from teleporting within a range hexagons. Along with upgrading planets a world shield would be rather effective. Just make it a circle that passes through the 6 hexagons around it. This would keep units from quickly instagibing the enemy.
As for the small ships versus the large ships that's just poor rock paper scissors. If your game makes it so that small ships < medium ships < large ships then you need to allow a way to upgrade the small ships to combat the medium ships. I mean it might not do as much, like a micro nuke on a small ship. But that would allow the small ship to deal some damage, so a bunch of small ships could in fact destroy a large ship after some time. You could also allow the medium ships to teleport into the large ships from a range and "commandeer" the large ship. Basically add strategy to the game.
I'm not a fan of the telefragging idea... that just makes ships into instant damage death weapons.
Here is one of the best approaches... give small and medium ships fuel. Allow your large ships to act as carriers along with their offensive role then they can spawn small planes in the 6 spaces around themselves. This is called strategy, since the small ships will deal damage.
Okay and to allow ships to be benefit from one another allow small ships to repair if they are docked in a large ship and also allow large ships within a certain range of other ships or planets to divert shield energy. So if in one turn a large ship takes a lot of damage another large ship within range can transfer X amount of energy to the other ship to protect it. Same works for small ships but on a smaller scale. Since small ships have fuel they will travel around the large ship anyway and rely on it. Without a large ship the small ships will run out of fuel and die if another large ship doesn't show up and pick them up. Allow planets to have hangar bays and hold ships. Make the large ships so expensive that while you might have 25 fighter jets you might only have 2 large ships. Medium ships might hold 2 fighters or something.
Yah strategy...
Also you could allow a planet to build like 1 cannon around itself that orbits around the 6 squares. It could be used to lightly defend against say 1 small ship but it would never stand up to say 1 medium or large ship.
Onto weapons. For large heavy weapons that attack fixed points like planets you could make the WMD travel only a certain distance every turn. Much larger than the ship but if not destroyed during it's path it would deal a lot of damage and could be launched from far away.
As for the small ships versus the large ships that's just poor rock paper scissors. If your game makes it so that small ships < medium ships < large ships then you need to allow a way to upgrade the small ships to combat the medium ships. I mean it might not do as much, like a micro nuke on a small ship. But that would allow the small ship to deal some damage, so a bunch of small ships could in fact destroy a large ship after some time. You could also allow the medium ships to teleport into the large ships from a range and "commandeer" the large ship. Basically add strategy to the game.
I'm not a fan of the telefragging idea... that just makes ships into instant damage death weapons.
Here is one of the best approaches... give small and medium ships fuel. Allow your large ships to act as carriers along with their offensive role then they can spawn small planes in the 6 spaces around themselves. This is called strategy, since the small ships will deal damage.
Okay and to allow ships to be benefit from one another allow small ships to repair if they are docked in a large ship and also allow large ships within a certain range of other ships or planets to divert shield energy. So if in one turn a large ship takes a lot of damage another large ship within range can transfer X amount of energy to the other ship to protect it. Same works for small ships but on a smaller scale. Since small ships have fuel they will travel around the large ship anyway and rely on it. Without a large ship the small ships will run out of fuel and die if another large ship doesn't show up and pick them up. Allow planets to have hangar bays and hold ships. Make the large ships so expensive that while you might have 25 fighter jets you might only have 2 large ships. Medium ships might hold 2 fighters or something.
Yah strategy...
Also you could allow a planet to build like 1 cannon around itself that orbits around the 6 squares. It could be used to lightly defend against say 1 small ship but it would never stand up to say 1 medium or large ship.
Onto weapons. For large heavy weapons that attack fixed points like planets you could make the WMD travel only a certain distance every turn. Much larger than the ship but if not destroyed during it's path it would deal a lot of damage and could be launched from far away.
Have ships be able to go into 'orbit' of a planet. Limit the number of orbit slots/space, but allow upgrades. Any ship in orbit will return fire at any ship that attacks the planet.
Also, maybe require ships to 'enter orbit' of a planet before attacking. This would require all action points it has left. This means it will take at least 2 turns to destroy a planet, allowing a counter attack. Maybe give a negative effect to ship defense while in an attacking orbit, making blitzing harder, and forcing the player to take out most/any ships in attacking range of the planet before taking the planet out itself.
Also, maybe require ships to 'enter orbit' of a planet before attacking. This would require all action points it has left. This means it will take at least 2 turns to destroy a planet, allowing a counter attack. Maybe give a negative effect to ship defense while in an attacking orbit, making blitzing harder, and forcing the player to take out most/any ships in attacking range of the planet before taking the planet out itself.
Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
I agree with that; planets should be hell to capture or destroy. Consider my expansion on that idea:
1. To directly attack a planet, you have to be in orbit
2. Orbits are limited. If there are no open spaces, you must destroy a ship in orbit to make room.
3. You have to destroy all ships in orbit to attack the planet
4. The 6 spaces adjacent to the planet can also defend
This eliminates a lone gunman strategy, and requires a decent commitment of resources to capture such a big target. Once you have it, is there a special benefit that helps you keep it?
1. To directly attack a planet, you have to be in orbit
2. Orbits are limited. If there are no open spaces, you must destroy a ship in orbit to make room.
3. You have to destroy all ships in orbit to attack the planet
4. The 6 spaces adjacent to the planet can also defend
This eliminates a lone gunman strategy, and requires a decent commitment of resources to capture such a big target. Once you have it, is there a special benefit that helps you keep it?
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
Well, the orbits idea might work (of course it would require me to add a bunch more data to the save game files), but I'm not sure I get the whole thing. Is this 'orbit' a separate grid with positions, or is it just a list or array of objects (ships and planets, in this case)?
Second, if I did implement a system with orbits, then I would have two different battle environments, and that would seem kind of odd, I think.
I like the idea, I just don't know if it would work for this game, and it would need to be better defined.
I already have some of the features suggested by Sirisian, and the telefragging is only for intra-system jumps, where you don't get to pick the space you pop out on, it just moves you to a space next to the other side of the jump node corresponding to the one you jumped through, and if something is there, one of the two things will die.
Second, if I did implement a system with orbits, then I would have two different battle environments, and that would seem kind of odd, I think.
I like the idea, I just don't know if it would work for this game, and it would need to be better defined.
I already have some of the features suggested by Sirisian, and the telefragging is only for intra-system jumps, where you don't get to pick the space you pop out on, it just moves you to a space next to the other side of the jump node corresponding to the one you jumped through, and if something is there, one of the two things will die.
Signature go here.
Well, as for having two different battles, one for open space, one for orbit, that sounds reasonable. After all, in a close orbit of something battles WILL be different than deep open orbits.
Add an array to your planets, this array holds what is in orbit. Might need to use a special object that then holds the ship itself plus the state: Attacking/defending/blockade, or maybe this is something stored as part of the ship itself.
Now, I'm not sure, is this game based on fleets, a group of ships on a single grid that then move at the speed of the smallest/slowest ship, or is each ship always 100% independent of all others? (which I think is a bad idea, as it can then make large battles with large numbers of ships long and hard to deal with) One game that had nice battles is Galactic Civilizations II. You started off with very limited number of logistic points, these determined how large your fleets could be. Smaller ships counted for less, so you might get a fleet of 1 large ship, but 4 smaller ones. This keeps people from simply lumping all their ships in one massive fleet and run around taking out everything they can as quickly as possible.
Add an array to your planets, this array holds what is in orbit. Might need to use a special object that then holds the ship itself plus the state: Attacking/defending/blockade, or maybe this is something stored as part of the ship itself.
Now, I'm not sure, is this game based on fleets, a group of ships on a single grid that then move at the speed of the smallest/slowest ship, or is each ship always 100% independent of all others? (which I think is a bad idea, as it can then make large battles with large numbers of ships long and hard to deal with) One game that had nice battles is Galactic Civilizations II. You started off with very limited number of logistic points, these determined how large your fleets could be. Smaller ships counted for less, so you might get a fleet of 1 large ship, but 4 smaller ones. This keeps people from simply lumping all their ships in one massive fleet and run around taking out everything they can as quickly as possible.
Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
Well, the way I have it, capital ships and special units (like freighters, colonizers (transports), and support ships (rearming)) are their own units, while fighter squadrons, bomber squadrons, and supply depots are units with arrays of hitpoints that can't be split but take damage differently than 'single' units.
It still seems sort of odd that I would have a different combat system. The mechanism, in my opinion, should be the same, if possible, just with added factors and limitations.
Here's another screenie, from an earlier version:
It still seems sort of odd that I would have a different combat system. The mechanism, in my opinion, should be the same, if possible, just with added factors and limitations.
Here's another screenie, from an earlier version:

Signature go here.
I'm not clear just what the combat system actually IS. How is combat normally handled?
Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
The way I envisioned orbits was that it would be the one situation where multiple ships could occupy the same space: the planet hex. In order to move into a space, there can be no other ship there, I assume. In this situation, the planet's hex has a finite capacity, and you must individually destroy all ships in that hex in order to move in and take the planet. It would be attackable from all adjacent hexes, so you could have six ships converging on the planet. Perhaps six should be the maximum number of ships in orbit.
You may want to consider, in this case, that some attacks cause "area of effect" damage, causing equal or lesser damage to other ships in orbit other than the primary target.
Dwelling on it for a minute, I think I got this idea from Tradewars. If you wanted to capture a planet, you had to destroy all ships in that sector, all the manned ships in the citadel, and a reduce the fighters on the planet to an insignificant proportion of what you had onboard.
You may want to consider, in this case, that some attacks cause "area of effect" damage, causing equal or lesser damage to other ships in orbit other than the primary target.
Dwelling on it for a minute, I think I got this idea from Tradewars. If you wanted to capture a planet, you had to destroy all ships in that sector, all the manned ships in the citadel, and a reduce the fighters on the planet to an insignificant proportion of what you had onboard.
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
The current combat system is:
You use the attack action, select a target, and it takes damage.
Special cases:
If the target is a squadron or for some other reason has more than one hp value, the damage is randomly distributed, and in the case of squadrons, the less ships there are, the less likely you are to get a hit.
If the attacker is a squadron its offense is divided into multiple portions and it has a better chance of hitting a squadron with less than the maximum number of ships in it.
If the target is a supply depot the attacker takes damage from each sentry gun defending it (an array of hitpoint values defines the sentry guns). Supply depots cannot attack on their own.
Question/Idea: what if instead of having to enter a separate battle area, I just made it so that the planet is off-limits to attacking as long as their is a combat vessel (or maybe it would have to be a capital ship) in one of the six spaces around the planet? That would accomplish the same basic thing as an orbit with a maximum capacity of six, and it would fix entry and exit of from the orbit. I could even make it so anti-planet attacks have a range of 1, whereas the normal attack range is 2. It would, however, take a bit of coding.
Also, going way back to first reply (by Sirisian), a fuel limit on the smallest ships (fighter & bomber squadrons) might be good, but I don't think I will have them die if they run out of fuel, it would only make them unable to do some if not most or all actions. I have carriers (or at least ships capable of carrying squadrons) but they do not have the ability to produce ships, only to take them in, rearm/repair (but not rebuild), and deploy them.
I will put up a link to a version of this game sometime soon.
You use the attack action, select a target, and it takes damage.
Special cases:
If the target is a squadron or for some other reason has more than one hp value, the damage is randomly distributed, and in the case of squadrons, the less ships there are, the less likely you are to get a hit.
If the attacker is a squadron its offense is divided into multiple portions and it has a better chance of hitting a squadron with less than the maximum number of ships in it.
If the target is a supply depot the attacker takes damage from each sentry gun defending it (an array of hitpoint values defines the sentry guns). Supply depots cannot attack on their own.
Question/Idea: what if instead of having to enter a separate battle area, I just made it so that the planet is off-limits to attacking as long as their is a combat vessel (or maybe it would have to be a capital ship) in one of the six spaces around the planet? That would accomplish the same basic thing as an orbit with a maximum capacity of six, and it would fix entry and exit of from the orbit. I could even make it so anti-planet attacks have a range of 1, whereas the normal attack range is 2. It would, however, take a bit of coding.
Also, going way back to first reply (by Sirisian), a fuel limit on the smallest ships (fighter & bomber squadrons) might be good, but I don't think I will have them die if they run out of fuel, it would only make them unable to do some if not most or all actions. I have carriers (or at least ships capable of carrying squadrons) but they do not have the ability to produce ships, only to take them in, rearm/repair (but not rebuild), and deploy them.
I will put up a link to a version of this game sometime soon.
Signature go here.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement