Solarus: A child’s attempt to design an RTS

This isn’t good

A long time ago when I was a wee lad, I had a sudden desire to create an RTS, so I wrote a design doc. I had not and still haven’t played much by way of RTS games, so the end result is very primitive and probably unbalanced. But I think it’s a fun look back, so here it is, largely unedited and as it was many many years ago.

Initial version

Braindump

This initial version of the doc was mostly a brain dump of what I thought would be cool. As such, there is not much logic behind any of the choices.

A randomly-generated third-person tactical turn-based/real-time command-and-conquer space-battle action strategy game.

General

  • Human and Bot players.
  • Player alliances: Bribes optional.
  • Planet properties: Atmosphere, Buildables, Populations, Resources, and Morale.

    • Populations: Civilian, Worker, and Military, along with their own Growth Rates.
    • Resources: Minerals, Organics, Fuel, and Food, all measured in kilograms.

    All Resources, excluding Food, need to be mined before they can be used, and as such have Unmined values.

  • Player properties: Money, Actions, Ships, and Alliances.

  • Ship types: Fighter, Speeder, Destroyer, Carrier, Barge.

Ship properties

  • Hull Integrity: A number used to describe the integrity of a ship's hull (outer shell). In essence, a ship's "health points".
  • Attack: The power of a ship's attacks.
  • Accuracy: The percent at which a ship's attacks land.
  • Speed: The speed of a ship. This affects the ship's flying speed and the accuracy of the other ship.
  • Capacity, Fuel: Max fuel capacity.
  • Fuel per Turn: The fuel taken by a ship every turn.
  • Capacity, Resources: How many Resources a ship can carry, in kg.
  • Capacity, Crew: The number of Military Populators required to operate a ship.
  • Capacity, Passenger: How many Populators a ship can hold.

Ship stat table

Type HI AT AC SP CF FT CR CC CP
Fighter 100 26 0.85 175 1500 125 1000 2 1
Speeder 50 12 0.95 400 900 100 0 1 0
Destroyer 250 48 0.73 110 2500 150 5000 5 8
Carrier 1250 0 N/A 110 7000 250 8500 50 750
Barge 2000 0 N/A 90 9500 275 25000 15 25

Planet Food values

The amount of food eaten in one month as recommended by the American government is about 14kg, so per-turn, random(13, 18) Food should be taken for each person.

Planet Populations

Civilian growth is not taken from any source and instead is self-reliant, while Worker growth is taken from Civilian Populations, and Military growth is taken from Worker Populations.
Equation = Population * ceil(Rate * Morale)

Combat Types

  • Warzone: The game runs in real-time for all players. A turn occurs every in-game month (every five seconds). However, Actions can be used instantly. Actions regenerate by one every turn.
  • Original: All players are given a turn, lasting 30 seconds. If time runs out or all player Actions are used, the turn ends and the next person uses their turn.
  • Flurry: Original with a twist; All players share a turn.

Game Types

  • Last Man Standing: Simple player-versus-player match. Two to five players. No time limit. Last alliance alive wins.
  • Time Attack: After a preset time limit, whatever alliance has the most planets under their control (meaning has the most population living on them) wins. Fighting doesn't have to be an important tactic.
  • Stronghold: Two-player game. One player defends a number of solar systems while the other player attacks. If the attacking player can take all of the defender's systems, the attacking player wins. If a preset amount of time passes or if the attacking player is defeated, the defending player wins.
  • Destruction: Players compete to see who can accumulate the most in damages to other players after a preset time limit, i.e. Populations, Buildables, etc.

Per-turn details

  • If ships cross paths and there is no alliance between the ship owners, they will fight.

Ship damage is dealt based on the ship's attack damage, multiplied by the accuracy of the attack (varies from ship to ship, max is affected by Morale).

  • Per-planet, take Food and other Resources and mine Minerals. Raise Populations. Then apply any special Buildable bonuses.
  • Recheck planet statistics (populations, etc.).

GUI

  • Buttons at top right: Stats, Settings, Menu
  • Stats: Alliances, Round (time spent playing and turns taken, number of formed and broken alliances, Game Mode, Combat Mode), Player (paged for each player; pop. total, pop. separated, dead pop. total, dead pop. separated, ships total, ships lost, team name and color).
  • Settings: todo
  • Menu: Quit to main menu.

Buildables

  • Terraformer
    • Uses 20000 Minerals.
    • Uses 30000 Organics.
    • Uses 20000 Food.
    • Must have 500 Workers minimum.
    • Raises all unmined values on a planet and Morale by a lot.
  • Solar Bomb
    • Uses 40000 Minerals.
    • Uses 5000 Organics.
    • Must have 1000 Workers minimum.
    • Destroys planets, raises all planets' Morale for you and any allies, lowers for others. If you or any allies have ships or populate the planet, all your planets' Morale goes down.
  • Propaganda
    • Uses 1500 Minerals.
    • Uses 500 Organics.
    • Must have 20 Workers minimum.
    • Raises Morale by 1 and 0.01 a turn.
  • Residential Buildings
    • Uses 5000 Minerals.
    • Uses 4000 Organics.
    • Must have 20 Workers minimum.
    • Raises Morale by 3, raises Civilian Growth Rate by 0.05. If Civilian Populations are 0, set to random(50, 200).
  • Commercial Buildings
    • Uses 10000 Minerals.
    • Uses 2000 Organics.
    • Must have 50 Workers minimum.
    • Raises Morale by 2, raises Worker Growth Rate by 0.03. If Worker Populations are 0, set to random(20, 50), with at least 2 Civilians left.
  • Military Buildings
    • Uses 15000 Minerals.
    • Uses 500 Organics.
    • Must have 150 Workers minimum.
    • Raises Morale by 2.5, raises Military Growth Rate by 0.01. If Military Populations are 0, set to random(30, 40).
  • Arc Destructor
    • Uses 100000 Minerals.
    • Uses 20000 Organics.
    • Uses 5000 Food.
    • Must have 5000 Workers minimum.
    • A top-secret and expensive buildable that makes suns go supernova and destroys the entire solar system. If the explosion hits another sun, there is a possibility that one will go supernova, too. Morale functions like when using a Solar Bomb, except much more effective.
  • Slip Bridge
    • Uses 17000 Minerals.
    • Uses 300 Organics.
    • Must have 80 Workers minimum.
    • Uses stable black holes to send ships to other planets in one turn.
  • Radar Station
    • Uses 5000 Minerals.
    • Uses 200 Organics.
    • Must have 5 workers minimum.
    • Blips when enemy ships are nearby.

If there are multiple players on a planet, they will fight unless there's a truce. The military population of all inhabitants will fall random(0, 1000 * (1 - Morale)). If you have the most soldiers your Morale will go up. else, it goes down. after all threats are gone, you will get some of the enemies' pop. minus random(100, 5000) with a minimum of 1000. Also, during this time residential pop. may go down random(0, 50).
If Morale hits 0% then you will be kicked from the game and all your citizens will go to the one with the biggest military pop.
When a ship is destroyed set gravity to 0, blow it apart and add to deaths count.

Revised version

Here be psuedocode

I attempted to implement the game in ROBLOX, back when that game was still about building things and not selling cosmetics to children. As a result, there may be some ROBLOX nomenclature and psuedocode.

This also isn’t good

See the top of the document.

Solarus: A procedurally-generated third-person tactical turn-based/real-time command-and-conquer space-battle action strategy game (whew).

Comparison to original Solarus

  • Minerals were Metal.
  • Organics were Wood.
  • The Speeder, Destroyer, Supercarrier, Superbarge, and Mechanics didn't exist.
  • The Carrier was the Shuttle.
  • The Barge was the Cargo.
  • All Planets had unique mine and population growth rates (rates are now calculated automatically based on the Planet's Morale and the Government's Tech levels, and can be boosted with certain Buildables).

Governments

  • Government properties: Name, Name Abbreviation, Color, Kal, Actions, Ships, Alliances, and Tech.
    • Name, Name Abbreviation, Color: Each user forms a Government with a name, abbreviation (ex. the full name of a Government is "The Glorious Big-Shoes Empire", while the short name is "Shoes Empire", "GBSE", or something of the sort), and color (possibly icon?) of their choosing when starting the game. Their name will be shown to other Governments (or the abbreviated variant if there isn't enough space) and their Ships, Buildables, and other related objects will be colored with their chosen Government color. (Possibly allow users to save governments for later quick usage? Save stats to them?)
    • Kal: Kal is the universally accepted currency shared by all Governments, symbol ¤ (ex. 12¤; 2,920¤; 3,238,239¤). No matter how much the Governments may clash (and that happens a lot), it is understood and accepted that a shared, equal currency is essential to ever regaining positive relations with other Governments. Kal can be obtained through trade with allied Governments, through attachments on Alliance requests, and through Currency-based Buildables that convert Minerals/Organics/Fuel/etc. to Kal at a steady rate.
    • Actions: Actions are used for building/destroying/activating Buildables, sending a Ship to another planet, changing Ship destinations mid-flight, and researching new technology (raising Tech). The max Actions every Government gets is dependant on game settings and applicable Buildable and other bonuses.
    • Tech: A Government's general intelligence level. Higher Tech levels are required to build certain Buildables, raise the universal speed Workers are able to mine Unmined Resources, etc. Tech is raised by building certain Buildables, or spending Actions on research. (As Tech is raised, the amount of Tech gained from using an Action to research technology is significantly lowered (reciprocal?).)
    • Alliances: Name required, bribe optional.
    • At any point in time a Government can request, decline, and leave an Alliance. New Alliances must have a name and color to represent themselves ("Dr. McEvil" and "Baddest Bad Guy" can make "The Coalition of Really Bad Evil Dudes"). Alliance requests can also have any amount - positive, negative, none at all - of Kal attached, acting as a bribe, gift, method of payment, even a prerequisite to surrender; it's all up to the user, equally so to negotiate further to keep the Alliance going.
    • If the attached Kal value of an Alliance request is equal to or above 0, the sender of the request will be the Alliance Owner; however, if the Kal value is less than 0 (meaning the sender of the request is offering a payment to the recipient), the recipient will be the Owner. The Owner is the one that sets the name, color, and other information related to the Alliance. Only the Owner may recieve/accept/deny requests from other Governments and remove other Governments from the Alliance (though a Government can remove itself from the Alliance at any time).
    • Governments can only be in one Alliance at a time. Governments can still send and recieve Alliance requests; however, joining another Alliance will leave the Government's current Alliance.
    • If the Owner of an Alliance leaves the Alliance (or, by association, the game), ownership will be transferred over to the Government with the highest Tech. Owners can manually transfer Alliance ownership, as well.
    • Normally,

Translation

  • Externalization: Each piece of text in the game will be stored in external translation files for easy localization.
  • Array system: Translation phrase ID declarations ending with "[n]" will be placed in a random-choice array.
  • Custom translation files: Users have the ability to create their own partial translation files that, among other data, will be sent to the server and then replicated to all other clients when they initially connect. When a client decides to use translation data, it will check first for relevant translation files it has recieved from other clients, and if none are found or contain no matches, will use the one selected by the local user. This allows certain whitelisted translation phrases, such as will be the Crew responses, to be customized by the user that activated the action. This can allow users to modify how their Government is linguistically presented to the other users on the server and really only serves a metagaming purpose: Are a Government's followers fiercely loyal? Do they sound like surfer-dudes? Do they spam Japanese weeaboo lingo? Do they speak Nazi-era German, Herr Führer? This will be up to the user.

Example of a gusto, powerful Government translation file:

   ships.buy.SuccessCrew[1]="Ship is ready for combat, sir!"
   ships.buy.SuccessCrew[2]="Ready to deploy! They will not survive!"
   ships.buy.SuccessCrew[3]="We will crush them with our might, sir!"
  • File structure: The fallback translation files will be the standard English translation files. There will be two translation files, one for non-whitelisted and another for whitelisted lines. If a translation line is found in a downloaded user translation file, but not in the whitelisted translation file, the default line from the non-whitelisted file will be shown
  • Formatting: As opposed to standard C-style %s string formatting, each translation phrase will allow the use of variables. This way, variables such as [[ShipName]] can be used to display the class/name of the Ship that the translation phrase is referring to. This allows far greater translation customization, including creating both simplistic and verbose translation files to adapt to different personal preferences.
  • Scape: UI elements that are shown to all players, or have the capability to be shown to multiple players, will be stored serverside as translation indicies with arguments and replicated to the receiving clients when required. Certain persistant variables like ship/crew names (if implimented) are to be stored in the serverside ship entities. The server will send information to the client and the client will interpret it, including fetching translations, as it sees fit. (Perhaps a Source-inspired system, so that normal text and translation lines can be shown using the same system, i.e. a text label with a value of #buildables.buy.Success(BuildableName=Barge) will parse the translation line and replace [[BuidableName]] with "Barge"?)
  • Example of file structure:
   translation.Name=English (U.S.)
   ...
   buildables.Name=Buildable
   buildables.NamePlural=Buildables
   ...
   buildables.buy.Fail=You can't buy this Buildable right now.
   buildables.buy.Success=You've successfully bought a [[BuildableName]].
   ...
   ships.buy.SuccessCrew[1]="Ready for takeoff, on your mark."
   ships.buy.SuccessCrew[2]="All systems green, preps OK."
   ships.buy.SuccessCrew[3]="She's all fueled up and ready to go!"
   ...
   ships.Death=A [[ShipType]] has been lost.

...Etc.

  • File names: File names that match the given language setting of the system (TODO: ISO 639-1/2/3? IETF? How do OSes categorize languages?) will be automatically loaded on first start. (Possibly scrap that and just show a language menu on first start.)

Turns

  • In-game equivalent: Each turn lasts for two in-game months.
  • Actions: All Government's Actions are refreshed at the beginning of their every Turn.
  • Combat: If Ships cross paths and the Ship owners are not allies, they will fight automatically. Ships attack 5-10 times per Turn, with each attack subject to bonuses and detrimental effects, as opposed to all of the attacks together as a whole.
  • Per-turn scheme: Per planet, apply any special pre-Turn Buildable bonuses; take Food and other applicable Resources; mine applicable Resources; raise Populators by their specified growth values; apply any special post-Turn Buildable bonuses.

Planets

  • Planet properties: Atmosphere, Buildables, docked Ships, Populations, Resources, and Morale.
    • Atmosphere modifies certain Planet-based inputs, outputs, and values, such as but not limited to: Yield of crops from simulated Worker farms, specific Buildables (ex. Extended Farms), Population growth, initial Resource counts, regeneration rate of Organics and Food (or deterioration rate), and Morale.
    • Populations: Civilian, Worker, and Military. Induviduals are called Populators.
    • Resources: Minerals, Organics, Fuel, and Food, all measured in kilograms. All Resources, excluding Food, need to be mined before they can be used, and as such have Unmined values. Only Workers are able to mine Resources, with every 1-2 working in a mining-related industry, outputting Minerals, Organics, and Fuel (TODO: TBD exact count), multiplied by their Planet's Morale, rounded up.
  • The amount of food eaten in one month on average according to a study by an American company is about 14kg, so per Turn cycle, 25-30 Food should be taken for each Populator from their Planet. To simulate farming, every Worker has a 1-5 chance to work in a food related industry, and will output 13-17 Food multiplied by their Planet's Morale, rounded up. Planets with an Atmosphere of or above 0.8 will recieve better crop yield, while those with 0.4 or less will recieve less.
  • Every Turn, all Populations will grow at their specified growth rate (TBD) multiplied by their Planet's Morale, with an additive dependant on the Government's Tech value (TBD), and with any applicable Buildable bonuses. Civilian growth is self-reliant, while Worker growth is taken from the Civilian Population, and Military growth is taken from the Worker Population.
  • Planets have morale-based status effects:
    • Famine, lower Food at start, lower Food regeneration, lower Morale per turn.
    • Crime, lower Morale and all Resource values and kill a small number of Populators per turn.
    • Corruption, lower any Kal output values for that Planet.
    • Drought, heavily lower the Food produced by farmers each turn.
    • Wildfires, lower unmined Organics per turn.
    • Pollution, lower Atmosphere per turn.
  • Random occurances:
    • Meteor strike: Lower population and resources based on the random size of the meteor. Random chance to mine meteor for Minerals if it's big enough.

Ships

  • Ship types: Fighter, Speeder, Destroyer, Carrier, Barge, Supercarrier, Superbarge, and Mechanics:
    • Fighter: With a good balance to its stats, a Fighter-class Ship is the first choice for general space combat. It is highly cost-effective to manufacture, as well as reliable. It's simple to fly, and only requires a two-man Crew, with optional Passenger.
    • Speeder: Sometimes speed is a required asset; every corner of this sleek craft was shaved down to the milimeter to ensure a light weight. Speeder-class Ships race past the competition like no other, designed for a skilled single-man Crew with no Passengers.
    • Destroyer: When you want something in pieces, a Destroyer will accomplish that wish quickly. Destroyer-class Ships are feared by even the most prestiged space warriors. 5 elite pilots and gunners make up its Crew, with an optional 8 Passengers.
  • Ship properties:

    • Owner: The index of the Government that owns a Ship.
    • Type: The UI translation label for a Ship.
    • Crew: The Crew of a Ship is created when the Ship is produced and cannot be added to, changed, or removed.
    • Passengers: An array for each Government index holds a number of Populators for all three Populator types.
    • Power: Fuel loses Government ownership once put in a Ship and converted to Power, and cannot be converted back to Fuel.
    • Status Effects
    • Resources: An array for each Government index holds a number for all four Resource types.
    • Waypoints: An array of planets to visit before docking at a planet.
    • Stats:
    • HUL, Hull integrity: The integrity of a Ship's hull (outer shell). (Display as fraction: current int/max int)
    • SHL, Shield integrity: The integrity of a Ship's rechargable shields. (Display as fraction: current int/max int)
    • ATK, Attack: The power of a Ship's attacks.
    • CHC, Critical hit chance: The chance of a Ship's attacks applying negative Status Effects to its target.
    • ACC, Accuracy: The percent at which a Ship's attacks hit.
    • SPD, Speed: The speed of a Ship. This is equivalent to the game units flown per turn and affects the ACC and CRC of enemy Ships in combat negitavely the higher the value goes.
    • POW, Power: Current Power capacity of a Ship. (Display as fraction: current power/max power)
    • PPT, Power per Turn: The Power taken by a Ship every Turn.
    • CRE, Capacity, Resources: How many Resources a Ship can carry, in kg.

      Note: Fuel stored in a Ship will be used as Power should its main Power capacity be depleted.

    • CCR, Capacity, Crew: The number of Military Populators required to operate a Ship.

    • CPA, Capacity, Passengers: How many Populators a Ship can hold, total.
    • Stat table:

      Type HUL ATK CHC ACC SPD FUL FPT CRE CCR CPA
      Fighter 100 25 0.3 0.85 200 1500 125 1000 2 1
      Speeder 75 12 0.1 0.95 350 900 100 0 1 0
      Destroyer 250 48 0.8 0.73 140 2500 150 5000 5 8
      Carrier 1250 0 0 0 110 7000 250 8500 50 750
      Barge 2000 0 0 0 90 9500 275 25000 15 25
      S. Carrier 2000 5 0.05 0.7 100 9000 350 10000 100 5000
      S. Barge 2500 5 0.05 0.6 85 12000 400 50000 50 0
  • In the event of an Alliance being broken, now-enemy Populators will fight for control of the Ship. Whichever Government(s) have more total allied Military Populators (Ship Crew included) will gain control of the ship. Some Populators will have been lost in the firefight, naturally, but the losers will have taken the worst. Adjust values accordingly. TODO: Flesh out.

Gameplay

  • Fixed Alliances: Some gametypes or goaltypes may enforce fixed Alliances, i.e. Alliances cannot be created, joined, or left. Before the game starts, all Governments are required to form Alliances. After one minute, Governments that are not part of an Alliance will automatically be moved to the Alliance with the lowest number of players. If there are no Alliances formed, two will be provided ("Red" versus "Blue"). If there is only one Alliance formed, another will be provided ("Blue"), and half of the players from the Alliance will be moved to the Blue Alliance.
  • Gametypes:
    • Original: All Governments are given a Turn, lasting 30 seconds by default. If time runs out or all of the Government's Actions are used, the Turn ends and the next Government begins their Turn.
    • Flurry: Original with a twist; All Governments share a Turn at once. Time limit is increased to 45 seconds by default.
    • Alliance Flurry: Fixed Alliances. Each Alliance member shares a Turn at once.
    • Chaos: The game runs in real-time for all Governments. A Turn occurs every ten seconds. Actions can be used instantly. Actions regenerate by one every Turn.
  • Goaltypes:
    • Planetary Domination: After a preset time limit, whatever Alliance has the most Planets under their control (meaning has the most Military Population stationed on them) wins.
    • Total Domination: No time limit. No Alliances. Last Government with Military Populators on any Planet wins.
    • Political Agenda: After a preset time limit, whatever Alliance has the most Populators, total, wins; fighting doesn't have to be an important tactic here.
    • Stronghold: Two fixed Alliances. One Alliance defends a number of Planets while the other attacks. The defender are not allowed to send ships outside of their designated defence area. If the attacker can take all of the defender's Planets, either by force or by destruction, the attacker wins. If a preset amount of time passes or if the attacker is defeated somehow, the defending player wins.
    • Destruction: No Alliances. Governments compete to see who can accumulate the most in damages to other Governments after a preset time limit, i.e. Populations, Buildables, etc.

GUI

TODO

  • Buttons at top right: Alliances, Stats, Menu

Alliances: Shows all current alliances.
Stats: Round: time spent playing and Turns taken, number of formed and broken alliances, Game Mode, Combat Mode; Government: pop. total, pop. separated, dead pop. total, dead pop. separated, Ships total, Ships lost, team name and color, one page per user.
Menu: Show in-game pause menu. Includes at least settings, leave game/server/whatever, and quit.

Buildables

TODO: Add more buildings, Extended Farm, Asteroid Shield, Currency Buildables, etc.

  • Terraformer
    • Uses 20000 Minerals.
    • Uses 30000 Organics.
    • Uses 20000 Food.
    • Must have 500 Workers minimum.
    • Raises all unmined values and Morale on the target by a lot.
  • Solar Bomb
    • Uses 40000 Minerals.
    • Uses 5000 Organics.
    • Uses 50000 Fuel.
    • Must have 1000 Workers minimum.
    • Destroys planets. Raises all planets' Morale for you and any allies, for every enemy casualty, lowers for others. Killing your own lowers Morale.
  • Propaganda
    • Uses 1500 Minerals.
    • Uses 500 Organics.
    • Must have 20 Workers minimum.
    • Raises Morale by 1 upon building and 0.01 a Turn up to a max of 7.
  • Residential Buildings
    • Uses 5000 Minerals.
    • Uses 4000 Organics.
    • Must have 20 Workers minimum.
    • Raises Morale by 3, raises Civilian Growth Rate by 0.05. If Civilian Populations are 0, set to random(50, 200).
  • Commercial Buildings
    • Uses 10000 Minerals.
    • Uses 3000 Organics.
    • Must have 50 Workers minimum.
    • Raises Morale by 2, raises Worker Growth Rate by 0.03. If Worker Populations are 0, set to random(20, 50), with at least 2 Civilians left.
  • Military Buildings
    • Uses 15000 Minerals.
    • Uses 500 Organics.
    • Must have 150 Workers minimum.
    • Raises Morale by 2.5, raises Military Growth Rate by 0.01. If Military Populations are 0, set to random(30, 40).
  • Arc Destructor
    • Uses 100000 Minerals.
    • Uses 20000 Organics.
    • Uses 50000 Fuel.
    • Must have 5000 Workers minimum.
    • A top-secret and expensive buildable that makes suns go supernova and destroys an entire solar system. If the explosion hits another sun, there is a possibility that one will go supernova, too. Morale functions like when using a Solar Bomb, except much more effective.
  • Slip Bridge
    • Uses 20000 Minerals.
    • Uses 5000 Organics.
    • Must have 80 Workers minimum.
    • Uses stable black holes to send Ships to other Slip Bridges on other Planets in one Turn.
  • Radar Station
    • Uses 5000 Minerals.
    • Uses 200 Organics.
    • Must have 5 workers minimum.
    • Blips when enemy Ships are nearby.
  • Hospital

Reword and fit this in somewhere

TODO
If there are multiple users on a planet, they will fight unless there's a truce. The military population of all inhabitants will fall random(0, 1000 * (1 - Morale)). If you have the most soldiers your Morale will go up. else, it goes down. after all threats are gone, you will get some of the enemies' pop. minus random(100, 5000) with a minimum of 1000. Also, during this time residential pop. may go down random(0, 50).
If Morale hits 0% then you will be kicked from the game and all your citizens will go to the one with the biggest military pop.
When a Ship is destroyed set gravity to 0, blow it apart and add to deaths count.

Left-click: follow link, Right-click: select node, Scroll: zoom
x