Star Wars Fleet – Free Online Game
This game is a turn-based tactical space battle simulator set in the Star Wars universe.
This game is a turn-based tactical space battle simulator set in the Star Wars universe.
This game is a turn-based tactical space battle simulator set in the Star Wars universe. It is possible to play against the computer with various levels of AI, and you can also play against another person at the same computer (two players taking turns).
The game was built with the Phaser 3 JavaScript and HTML5 game development framework, along with the Webpack asset bundler and Babel to enable developing with newer features of JavaScript. The game is served with a simple NodeJS server app and is available for free at starwars.codysandahl.com.
The Star Wars art was taken from various fan sites. The character avatars, sounds effects, and music loops were from various bundles accumulated from Humble Bundle over the years. The icons for the interface were from Kenney’s user interface pack.
Behind the scenes, each type of ship has a range of values. You can see what the original cards looked like in this image. The top row is attacking fighters. The second row is attacking capital ships. The third row is repairing the hull. And the fourth row is repairing shields. So you can see that most of the capital ships aren’t very good at attacking fighters. They will miss most of the time. There are also some little details from Star Wars lore. For example, the Mon Calamari MC80 Cruiser is known for having a comparatively weak hull but excellent shields. So you can see that it has a much lower hull value than the Imperial Star Destroyer, but also much higher shields. Also, the MC80 can repair more of its shields per turn than the Imperial Star Destroyer can.
Fighters have additional options. The ability of starfighters to do special and unexpected things to capital ships has been a staple of the Star Wars universe ever since Luke Skywalker destroyed the Death Star in his X-Wing. Or if you remember the giant fleet battle in Return of the Jedi, two tiny A-Wing starfighters destroy the shield generator of the mighty Super Star Destroyer Executor. Then another A-Wing crashes into the bridge, causing major damage. With events like those in mind, fighters have the ability to fly in under the shields to strafe a capital ship (skipping the shields and causing damage to the hull). They can also target the shield generators (causing 5 damage if successful) and turbolasers (reducing the capital ship’s ability to damage other capital ships).
But those special fighter missions come with a price. They have a chance to succeed, a chance to miss, and a chance that the capital ship gets to blast the starfighter instead! Watch out! Underneath the hood, the main missions are resolved with the equivalent of a 6-sided dice roll. The special fighter missions have ranges of success and failure using the equivalent of a 20-sided dice roll.
Each of the AI characters was built with a combination of a query language and fuzzy logic.
At the easy end, Sergeant Niles just queries a random available ship from his side and a random ship from the enemy side. And then he blasts it. That’s it. Totally random. He doesn’t know what he’s doing, so he’s pretty easy to beat.
At the hard end, Admiral Skeedl uses personality-weighted fuzzy logic. His AI searches for his preferred mission in each type. He gathers…
Each of these available choices are then weighted with Admiral Skeedl’s personality. For reference, he really likes to attack capital ships. He doesn’t mind repairing his ships. Everything else is only when the opportunity is too good to pass up. To choose between the available missions, a random number is generated and then the personality weights are added in. The highest total (random number + personality preference) is chosen as for this turn.
A lot can be learned by asking a five-year-old to play a game without any instructions! He understood it quickly, but whenever he asked a question or misunderstood something, the visuals and sound effects were updated to try to make it more clear what happened. The primary game balance was determined through thousands of simulations. Underneath the hood, the computer has the ability to simulate complete battles against itself. So the various artificial intelligences were pitted against each other in thousands of mock battles. Then the battles were tweaked to make them pretty balanced. The goal was to have each battle be about a 50% chance when two smart players were battling each other. To simulate this, most simulations featured the advanced AI (Admiral Skeedl) playing against himself. When Admiral Skeedl got close to 50/50 over a thousand mock battles, it was deemed decently-balanced.