Mechanics
SpaceGame's state management is dependent on a variety of factors.
Panes
The game interface is built using panes.
Each pane is the representation of various different states in the game.
The values in any given pane may affect the values of other panes, especially as different events take place.
Terminal Pane
Variables
- terminal_history = [];
Contains the history of every message printed to the terminal - free_scroll_mode = false;
Whether or not the terminal can be scrolled or if it always bumps to the most recent message. - terminal_input_active = true;
This is whether or not the user can type into the terminal, or if the keys are used for navigating the rest of the controls. The player can type '`' (tilde ~ key) to switch between the modes. - terminal_queue = [];
This is the queue of conversations messages that need to be printed to the terminal. This allows multiple lines of messages to be printed one at a time instead of simultaneously. - is_printing = false;
Used for the printing
Description
The terminal pane is the game's "console", which shows text updates in real-time. It can also be used to issue text commands directly into the game.
The ultimate goal is to get the game to function so that any action you could take using the GUI, with the exception of the dialogue actions, could be accomplished using the command console.
This would help to increase the immersion, but more importantly, allow shortcut commands to be created which initiate sequences of commands. These "Batch Programs", if you will, would allow the player to improve their efficiency in the game.
In the long run, it would be good to be able to make complete programs, with the ability to create variables, access stored variables from the systems, use logical operators, and control structures such as WHILE, FOR, IF / ELSE, etc.
The programming language for this would be a very simple BASIC-like syntax.
Dialogue Pane
Variables
- character_data;
This is a placeholder for the character data, which is fetched from characters.json based on who shows up in the dialogue. - dialogue_active = false;
This is the state tracker to know whether or not a dialogue is currently active. Best not to mess with this directly, or it will break the game's understanding of its own state. - dialogue_queue = [];
This is the queue of conversations which are to happen. Having this variable allows for a new dialogue to be triggered even if a current dialogue is already active. - var current_dialogue_position = "1";
This is the state tracker for the current position in the active dialogue. This index is a string because it allows for Dialogues to have a string based index. For example: "attack_success" might be a position in the dialogue. - var next_dialogue_position = "2";
I can't really remember what I was thinking here, but I think there just needs to be a default for the next dialogue position. Honestly not sure if this variable even does anything.
Description
The dialogue pane, along with the radar pane, are the two panes which collectively keep the game moving. The dialogue pane is the primary area where the player makes decisions, and game dialogue is what triggers events which lead to positive or negative consequences for the player.
For example, if the player is attacked by an enemy ship, a dialogue will appear. The player can choose how to react. Choosing to "Fire weapons", may trigger a function within the game which "rolls virtual dice" to determine the outcome. The random result will be affected by various factors such as the condition of the ship, presence of supplies and crew, and the relative strength of the enemy ship.
When a dialogue is triggered, the player MUST continue through the dialogue in order to move their ship again. The ship will not be movable while a dialogue is active. Thus, dialogues are effectively mandatory.
The key to succeeding in SpaceGame is to ensure that you make wise decisions so that when situations arise you have the proper resources and intelligence to handle the situation.
Crew Pane
Variables
- var soldiers_numbers = 5.0;
- var soldiers_skill = 5.0;
- var soldiers_energy = 5.0;
- var soldiers_health = 5.0;
- var engineers_numbers = 5.0;
- var engineers_skill = 5.0;
- var engineers_energy = 5.0;
- var engineers_health = 5.0;
- var scientists_numbers = 5.0;
- var scientists_skill = 5.0;
- var scientists_energy = 5.0;
- var scientists_health = 5.0;
- var medics_numbers = 5.0;
- var medics_skill = 5.0;
- var medics_energy = 5.0;
- var medics_health = 5.0;
These values are floats to facilitate precise calculations, but represented in the game interface as ints, which is determined by rounding.
However, it should be noted that the value used for RNG calculations will be the ROUNDED value.
For example, if some calculation about the likelihood of a vaccine development effort for a plague is based on the medic skill level, and the medic skill level is value 5.42, it will be used as 5.0 in the calculation. The same can be said for 5.51 being used as 6. The value displayed to the player is what the game will use.
Description
The "Crew" pane displays the stats on an abstraction of the ship's crew.
There are four types of crew, and for each type of crew there are four statistics.
Types of Crew:
- Soldiers
- Engineers
- Scientists
- Medics
Statistics on Crew:
- Numbers
- Skill
- Fatigue
- Health
Types of Crew, Detail:
Soldiers
Soldiers are the military might of the ship. Soldiers are important to the defense of the ship in an attack, whether it be a ship to ship battle or a boarding situation. Soldiers are also important for offensive matters as well.
Engineers
Engineers are the technical people who make things happen. They are relevant to pulling off difficult feats, repairing the ship, and other matters of technology.
Scientists
Scientists are the advanced crew for super high-tech operations, and scientific operations. They are relevant to the success of any mission, in many different dynamic ways.
Medics
Medics are medics. Everyone knows what a medic is, and when they need one. Don't be an idiot and not have medics.
Statistics on Crew, Detail:
Each of the four statistics on crew types is measured on a scale of 0-10, with 0 being absolutely nothing and 10 being the best possible value.
This numerical value serves as an abstraction to keep the game relatively simple, so we aren't dealing with super high numbers of crew for no reason, or using a different scale for crew numbers vs health.
Numbers
The number of crew is directly relevant to the RNG for many actions. In some cases, the action is simply not possible without a certain number of crew members. In other cases, the number of crew impacts the likelihood of success.
Skill
The skill of crew is relevant to the likelihood of success, and in some cases there is a minimum value to make a certain activity possible to begin with.
Skill is interesting in its relation to numbers. If new crew are acquired, skill may actually rise or drop as an average is calculated from the new crew members. This affect does not take place as old crew die, as the average skill was transferred to the new recruits, and each existing crewman's skill level is not tracked on an individual basis.
This effect will make one consider their options when looking to hire a large amount of new crew members when they have a small amount of highly skilled crew, as it may drastically reduce skill level.
This effect is intended to punish crew losses, and prevent rapid growth of the crew.
Energy
Energy is one of the vital statistics of the crew members. Energy regenerates slowly with each move based on the energy regen rate, which itself can be modified by various factors.
Energy is depleted by repeated activities, and can be regenerated quicker from certain actions, such as shore leave.
Energy, like skill, can affect outcomes.
Health
Health is similar to energy, except it is modified by different factors.
Command Pane
Variables
- var tactical_officer_faith = 7.0;
- var engineering_officer_faith = 7.0;
- var science_officer_faith = 7.0;
- var medical_officer_faith = 7.0;
These faith values work very similarly to how the crew stats work.
Description
The command pane represents your command advisors. You have four officers, each one has a faith meter, which measures the amount of faith the officer has in you.
Officers:
- Tactical Officer
- Engineering Officer
- Science Officer
- Medical Officer
Each officer corresponds directly to a type of crew. The type of crew's performance will be impacted by the amount of faith their officer has in you.
Officer faith is a long-term crew performance RNG factor that punishes you for treating your crew poorly, and rewards you for treating them well.
Not only does officer faith impact the performance of your crew, it also impacts what certain officers will recommend in certain dialogues.
For example, if you have low faith from your Engineering officer, the engineering officer is less likely to recommend riskier courses of action. This is accomplished during the dialogue events.
Also, a possible future feature (which is not planned for the initial release), is for the ability to get new command crew. That is, a different medical officer than the original Dr. Layzeri.
Cargo Pane
Variables
- var water_amount = 5.0;
- var food_amount = 5.0;
- var medical_supplies_amount = 5.0;
- var organics_amount = 5.0;
- var chemicals_amount = 5.0;
- var electronics_amount = 5.0;
- var metals_amount = 5.0;
- var weaponry_amount = 5.0;
- var luxury_goods_amount = 5.0;
- var exotics_amount = 5.0;
Description
The cargo pane functions similarly to the crew pane, except the only attribute is number.
- Metals
- Organics
- Munitions
- Electronics
- Exotics
- Food
- Water
- Luxury Goods
- Medical Supplies
- Chemicals
Each of these cargo items has its required usage for different activities.
Subnet Pane
Variables
Variables not set yet. Likely this will operate with a message queue array just like the terminal or dialogue.
However, what remains to be seen is how the creation of new subnet messages will come about.
Surely, this will be the last feature to be developed.
Description
The subnet pane tracks intelligence and long-range communications.
Subnet communications are very long range and out of necessity must be very simple.
Thus, only standardized information is transmitted across subnet.
It follows a strict format:
(to be determined, exact format, but this is the important information it contains)
- Source Faction ID:
Every communication device is an authenticated device which guarantees what faction is sending the message - Message Code:
There are a limited set of allowed message codes to be sent, which detail exactly what type of message this is - Coordinates
The source coordinates of the message. - Short Message
A limited, all-caps 14 character message to accompany the original message.
[-FACTION_ID-] { MSG_CODE } {{ "SHORT MESSAGE" }}
Faction IDs:
- CREAET - "Creaetians"
- CYBERIA - "Cyberian Remnant"
- etc
Message Codes (MSG_CODE):
- MAYDAY!
- ASSIST
- SELLING
- BUYING
- MEDICAL
- BOUNTY
Example Subnet Message:
[-CREAET-] { MAYDAY } {{ "ENGINES DOWN" }}
The idea behind the subnet pane is to allow for quests to "summon" the player from afar.
Typically in the game, events are triggered by RNG as the player moves across the map tiles. However, subnet pane allows for the player to become aware of certain events at specific locations.
Subnet messages may be triggered by a variety of different things.
Radar Pane
Variables
- var map_data;
this contains the entirety of the map data, which is every single tile, what type of tile it is, its image, and its "inspect" text. - var map_width;
This is a calculated value, calculated from map_data. Mainly used for calculating to make sure player moves are not out of bounds. - var map_height;
This is a calculated value, calculated from map_data. Mainly used for calculating to make sure player moves are not out of bounds. - var radar_position = [0,0];
This is the position of the focus. The radar can be moved around the player, and the player can be moved within the map. The radar_position represents the position of the radar's "scope", so to speak. i.e. "Where is the minimap?". This value represents the tile at the TOP-LEFT of the minimap. - var player_position = [9,6];
This is the position of the player within the map.
Description
The radar pane is the representation of where the player is in the galaxy.
The player can move one tile at a time in any of 8 directions.
Every time the player moves, the tile type is checked against possible events.
Some tiles are "space" tiles. These tiles typically have very low chances of triggering events. Other tiles may be "space stations" or "planets", which are more likely to trigger events.
Once an event is triggered, it will typically open a new dialogue if it is a complex event. If it's a simple event, such as taking damage from a solar flare, it will not trigger a dialogue.
The radar coordinates are very simple, with X and Y axes. Top-left is 0,0.
In the game, the player will start somewhere near the center of the galaxy. The edge areas of the map will have progressively less content until there is an entire radar width of empty space.
As the player hits the edge of the map, the game will trigger a dialogue with your science officer where he says "It wouldn't be wise to continue traveling into deep space".
Ship Pane
Variables
- var port_nacelle_health = 100;
- var starboard_nacelle_health = 100;
- var engine_room_health = 100;
- var armaments_room_health = 100;
- var forward_hull_health = 100;
- var astern_hull_health = 100;
- var shield_display_mode = false;
Toggles whether shields are displayed
Description
The ship pane contains basic status and controls for the ship itself, with the exception of the engines and weapons, which are their own panes.
The ship pane contains a simple graphical representation of the ship, which breaks the ship into the following areas:
- Port Nacelle
- Starboard Nacelle
- Engine Room
- Armaments Room
- Forward Hull
- Astern Hull
Each area has its own health value, which is measured as colors.
- Green: Full Health
- Yellow: 75% Health
- Orange: 50% Health
- Red: 25% Health
- Black: 0% Health
There is a "Shield Display Toggle" button, which toggles whether the colors represent the health of the ship or the shield status of the ship.
- Blue: Shielded
- Grey: Unshielded
The health and shield status of each area of the ship may have different effects on various RNG.
For example, when the armaments room is low on health, weapon attacks will be less accurate and/or powerful. When the Engine room is low on health, the ship will suffer decreased performance on moving, and is more likely to trigger solar events. The same can be said about the Port and Starboard nacelles.
If the port nacelle is at 0% health, the ship cannot move right.
If the starboard nacelle is at 0% health, the ship cannot move left.
If both port and starboard nacelles are down, the ship cannot move.
If the engine room is down, the ship cannot move.
If the armaments room is down, the weapons will not be usable.
The ship pane is also where certain shipwide modes can be toggled. It remains to be determined what those modes will be.
In the current development, these are:
- Hull Temperature
- Hull Pressure
- Air Pressure
- Shield Efficiency
- Energy Stability
Engines Pane
Variables
- var fuel_level = 100;
- var fuel_purity = 100;
- var engine_efficiency = 100;
- var engine_running = true;
- var engine_stability = 100;
- fuel_regulator_on = true;
- overdrive_on = true;
- inertial_dampeners_on = true;
Description
The engines pane contains lower-level engine controls, which can help improve engine performance. It also shows the low level condition of the engine.
This is *different* than the engine health from the ship pane, which is more intended to represent the structural integrity of the engine room.
Fuel Regulator Toggle
Makes it cost less fuel to travel one tile.
Overdrive Toggle (turns off Fuel Moderator)
Increases fuel usage per move.
Improves odds of escaping successfully.
Move two tiles at a time.
Inertial Dampeners
Must be on to move in overdrive without injuring crew.
Cost a little bit of extra fuel per move.
Weapons Pane
Variables
- var neutrino_bombs_count = 0;
- var neutrino_bomb_bay_functional = true;
- var torpedo_count = 10;
- var torpedo_bay_functional = true;
- var lasers_online = true;
- var cannons_ammo = 100;
- var cannons_functional = true;
Description
The weapons pane stores information about the ship's weapons.
The ship is armed with three types of weapons:
Neutrino Bombs
Requires lots of atmosphere to be effective, only effective against planetary targets.
Very expensive, hard to find.
Torpedos
Relatively Expensive.
Highly Effective.
Limited Capacity (10).
Lasers
Relatively weak.
Increase power consumption when used.
Unlimited ammo (except for power availability).
Cannons
Medium strength, between lasers and torpedos.
Fired in "barrages" of 5 shots.
Limited ammunition (100, which is 500 shots).
Tech Pane
Variables
- var computer_online = true;
- var life_support_online = true;
- var transporters_online = true;
- var sensor_array_online = true;
- var replicators_online = true;
Description
The Tech Pane is the control center for the core technologies of the ship.
Computer
The Computer is the main information system. If the computer is down, then a lot of stuff might not work properly, such as subnet or whatever.
Life Support
Life support uses energy, but without life support crew health will begin to deteriorate.
Transporters
Transporters are required for surface missions and boarding.
Sensor Array
The sensor array helps to detect threats and also for missions. Uses power.
Replicators
Replicators help to keep fatigue and health up for crew, and converts energy into water and food. If turned off, food stores begin to be used instead of energy.
All of these features are beginning to imply the existence of some sort of "Base Energy Consumption" rate, which would be a value that is used in RNG. There could be a direct relation with the energy consumption and the different things that demand it.
With all the luxuries turned on it may diminish weapons and shield effectiveness, and turning off the luxuries of technology may help to ensure weapons and shields are more effective in battle.
View Pane
The view pane is just a visual representation of what's going on outside the ship. It serves a purely aesthetic purpose.