War Boats: A Naval Combat Simulator


Wedge Formation

War boats is a basic naval combat simulator I did for my research project for my Game AI class. Boats can be selected by left clicking them and then give them a move command by right clicking. Boats move realistically having to slowly arch towards their goal, rotating so the face the goal and then accelerating forward. Boats are able to detect other nearby boats and are able to successfully avoid them while still being able to reach their goal.

Line Formation
Multiple boats can be selected and formed into fleets by holding shift and left clicking other boats. Fleets can take on two types of formation; Wedge and  Line formations. In wedge formation boats get into increasing sizes of rows with one flag ship at the beginning and then two ships in the next row, then three, four, etc. In line formation each ship gets behind one other ship forming a long line. Each formation size can handle any number of ships.

Fleet bending in dynamic mode
I implemented two separate techniques for getting the boats into formation; what I call dynamic and static. In static mode the each position of the boats in the fleet is based off of the leader or flag ship of the fleet. This mode is good if the boats are on average really far from where they are supposed to be but gets awkward when the flag ship starts turning as the whole formation has to turn with it and ships in the back have trouble keeping up. In dynamic mode each ship tries to get into position with respect of the ship that's supposed to be in front of them in the fleet. This mode gives the a more natural movement when turning as the formation can bend similar to how an actual ship formation might.

The Boat's cannon's attack range
A fleet attacking enemy boats
Selected boats can also attack enemy boats. When having a number of ships selected right clicking an enemy boat will have the selected fleet move towards the target and attack it. Ships are only able to attack boats within a certain range and within an arc of their sides. The boats will position them selves to have their cannons facing their target and then will circle around them until their target is sunk.

The graphics is done using my graphics engine and I wrote all of the ship logic from the ground up.