Sunday, April 21, 2013

Turn based battles in space

Making code for turn based battles in space.


  1. The part that engages has opportunity (1 vs 0);
  2. Battle commands are queued (if the player has opportunity points to en-queue a command)
  3. At Every battle command issued the value of opportunity lowers by 1;
  4. At every battle tick (1 sec) the players opportunity value gets incremented (1).
  5. At every tick battle commands are evaluated in pairs (side 1 vs side 2)
  6. if a command didn't got a response command by the other side in 10 seg it will be evaluated alone.
  7. Every side gets notified by the commands issued by the other side. (so they can respond)
Space battles can be PvP ou PvE. PvP will issue a bounty on the player that started the battle... Rules for bounty issues are yet to be determined. 

Basic commands

F - Fire main weapons
M - Fire missile (if available)
E - Perform Evade maneuver
J - Missile Jammer 
S - Energy Shield

The commands will always be the same but the type of equipment installed in the ship - and the ship it self - will vary. 

1 comment:

  1. Maybe i will review the opportunity growth at every tick... i think that 1 seg is very fast for a more tactical type of battle... or just make it pure turn based...