EDITOR’S NOTE: This is part of a series, start here.
I’ve nearly completed the code that deterministically generates random a spiral galaxy from a hash. What I ended up with was something that takes an arbitrary rectangle and a zoom level and gives you everything inside the rectangle. At the lowest zoom level, which I’ve cleverly named “1”, each dot represents something like 65,000 stars. At each zoom level, you are generally grabbing a smaller and smaller rectangle and a dot represents a smaller and smaller number of stars, until you get to (at the time of this writing) level 8, at which 1 dot = 1 star.
My old system used grid points to determine if there was a star at a given location. The new system works such that each point at a given zoom level is used to generate additional points at the next higher zoom level. This does mean that I need to loop through every zoom level from highest to the requested one every time I want to find the stars in a given cube, but that’s actually not terribly intense so long as the cube sizes are appropriate to the zoom level you’re asking for.
For graphics, I’ve got a reasonable SDL2 setup functioning. It’s an interesting contrast to my foray into writing DOS games, wherein there’s still a decent amount the developer has to do to get the thing drawing graphics, but a lot more than if you were using an engine like Unreal or Godot. I experimented with importing SVG files directly so I could scale them more easily, but after realizing that doing so was difficult, error prone, and didn’t really give me what I wanted anyway, it occurred to me that my logical screen height is always 768 pixels and the width is calculated dynamically. Scaling isn’t really all that much of an issue. Horizontal placement has to be done dynamically, but that’s not terribly difficult. I found a lightweight library called SDL2_gfx that has a nice set of drawing primitives and image zoom/rotation logic, so while I could probably figure those things out, this will save me a lot of time.
Now, on to the real reason for this entry, which is to capture some gameplay ideas, particularly the “RPG” aspects. Here’s what I’m thinking so far. You’ll start with a very basic ship that’s got some basic abilities and is self-contained in a single module. You can buy (and eventually build) additional modules to increase your stats and give you new capabilities. Some modules will also have submodule slots that can provide additional stats and perks. I’m still working through all these but here’s a rough outline of what I’m thinking about in terms of stats that can be increased/decreased with modules.
Determines how many modules can be controlled, how fast/automated calculations like navigation, research and power routing are. Primarily determined by the number and sophistication of “computer cores” which can be acquired or built.
Determines the power available to modules. Power routing is a fundamental game mechanic. Not all modules need to be powered at once, and some modules have certain features that are only active when the module has over a certain power threshold. At a given point you might route power to your shields, your weapons, a research or fabrication module, life support, etc.
Determines the number of humanoid crew members or passengers that can be on the ship and breathe by influencing how efficiently air/water/food is used.
Determines efficiency of operations that require crew members. Low morale may trigger negative effects like sabotage and violence. High morale may trigger research innovations or crew efficiency bonuses.
Determines how many hits from weapons/debris can be taken before the ship starts taking damage. Different shield modules can be used to protect different parts of the ship. Some can take more damage, but recharge slowly, others can take less damage but recharge quickly
Whateley Instantaeous Non-Kinetic (WINK) travel is the primary means of traversing long distances through space. (Technically it’s not “travel”, so much as it is hand-wavy opening of a portal and instantaneously relocating the ship from one place to another.) The characteristics of a ship’s WINK will determine its range.← Xoth Devlog Pt. 9 Xoth Devlog Pt. 11 →