Building a CLI Space Trading Background Running Game

Building a CLI Space Trading Background Running Game

Or trying to...

·

8 min read

The other day I was thinking about how I like games with a dynamic economy. In games like Albion or Eve Online, players determine which are the items of higher value. You go gather resources and sell them. Or you craft items or build ships and sell them at a higher value. The price of items is determined by their popularity and power in the current Meta, which affects the focus on certain resources. I am not an expert and have played each game for only two months. What keeps me away from this type of game is the time they consume, and particularly now I may not have lots of time.

Instead of collecting resources myself, what if I manage a corporation that sends teams to collect resources, which I can then trade with others? What if it is a game that I can have running in the background while I do other stuff on my computer? What if to connect to it instead of running a big game with graphics and stuff I just use my terminal? This last one isn’t because I don’t have any idea how to build game graphics, I swear. So what would this game look like?

My Ideal Game💡

Ok, let’s design this game. The game's primary rule is that it can't take too long to play. You should be able to enter, manage your squads, and then return to your normal life. It also would be nice that if I’m in a hurry, I just send a command to the game, something like this:

game-name mission <planet-name> <squad-name>

This command could send a mission to a certain planet for resource harvesting. Your squads will collect resources for you, so you can manage your busy life during this mission which will take several hours in real-time.

There are alternative ways to access the game apart from this. There would be times when you have more time to play so we can have a Text-based User Interface (TUI). It could look something like this:

Here, we would have access to all the information from our corporation. Active missions, trading hubs, squads, and any other thing that could be fun and make sense for this game.

When to enter the game?🔔

As I mentioned, the missions would last hours. So it should not require too much of your time but, when should I enter the game? How would I know what’s happening? For that, we would need to send the player notifications. How do I send notifications from a background running process that can work on every operating system? I don’t know, but for now, we can do this:

game-name notifications

# 18:24  your squad reached destination
# 20:20  your squad was attacked by pirates
# 21:22  Palladium is really valuable for planet X-435

It is not perfect but we would need to work with this for now.

Game Mechanics🕹️

So let's make this game fun, or at least try to.

Universe Generation🌎

Predefined planets every time you start a new game would get boring. I start the game, recollect this resource from this planet, and sell it to this planet and it would be always the same result. That is boring.

We need a randomly generated universe. Or a semi-randomly generated universe. We don’t want complete chaos. My first thought was to create the center of the galaxy with highly populated planets. These planets could be less populated as we move away from the center. We could also make the planets away from the center with richer and rarest resources, but also harder to harvest. Maybe we can have layer zones so it could be easier to identify.

Resource Management🌌

Resource management would be one of the core parts of this game. We should make it fun, but how? The best part is always going and recollecting yourself. So, let’s make it complex enough so the user would need to plan and have strategies to maximize the amount of resources gathered.

  • Real-Time: each squad mission would last for hours, so you need to plan before sending them. Players could ask themself: Do I have enough resources to complete my contracts? Should I send that distant mission or should I do a shorter one so I can gather the resources needed?

  • Distributed Resources: to make the game fun, we need to distribute the resources so that not every planet has everything the player needs. This way, players would need to send some kind of scout squad or probes first to study the planet, wait for the results, and then send the squad missions.

  • More Danger is equal to More Resources: the world generation algorithm should prioritize placing the best resources on the most dangerous planet. With this, the player would need to balance between the risk of the mission and the final reward.

  • Dynamic Demands: we should make the resource demand change dynamically. Inhabited planets should change their resource needs every now and then.

  • Conflict and Competitions: I thought that to make it a little more fun, we could create a system where many corporations race and fight for these resources and planet contracts. The player would need to get resources and sell them fast. They could try to be the best hydrogen distributor in the galaxy, at least until the economy changes again.

Trading and Economy🪙

One of the most important aspects for me is having a dynamic economy. I don’t want to always sell the box of hydrogen for a hundred credits. I want the actual price to change based on the demand of each planet and the supply from the corporations. Users should strategize what to focus on based on this. In this dynamic economy, players will find that the market conditions shift every now and then, so they should keep an eye out for strategy and timing. Should I sell all my load of resources? Should I wait until the price increase?

The economy should not be just a single big market. I want each planet to have its unique demands and supply. So, based on the planet’s location and local production, the demands would be different. Players would be obliged to explore the market and craft informed strategies.

To further immerse the player in the economic aspect of the game, there will be contracts and deals to be negotiated with planets. You could sign a contract where the planets pay higher prices to have an on-schedule supply of resources. There would also be taxes and tariffs to be considered. The idea is to have the player influence the game’s galactic economy.

Faction Behavior🤖

I want the universe to feel alive. So we would need other factions or corporations to have credible real autonomous behavior. They would form part of this ever-evolving economy and the player should feel it is racing against real threats to achieve the goal of being the best space trader in the galaxy.

AI corporations should send missions smartly, trade based on market conditions, and have their own agenda to achieve their goals. They should form alliances or even declare wars. Each faction should have a distinct personality, trading style, ethics, and approach to competitors. They could also change their behavior or strategy depending on world events or their failure or success on recent missions.

Missions🚀

Managing crew and spaceships is crucial in this game. The mission's outcome depends on every detail. Spaceships require upgradable or changeable systems. The player could upgrade various systems, including shields, travel speed, weapons, communication, and cargo. The success or failure of missions relies on the ship's aspects. The crew's experience and skills impact resource collection and defense against pirate attacks. To succeed, you must balance ship level and crew experience with planet danger during missions.

Formissions per se, I’m thinking of two kinds of missions. Squad missions are the ones you send for resource harvesting or to form a blockade on a planet so other corporations can’t access part of the resources. The other missions include main and side quests. I have a minimal idea of how I want that to be designed and I probably talk about it in a future blog post.

Simulation🖥️

As I mentioned before, I want this world to feel alive. I don’t want a static space of planets. For this, I’m thinking about the simulation of each planet. The planets would have population changes, random events, government changes and more to make them feel real.

Another aspect that could help is the lore of the universe, which I want to reserve for the future. But I want the lore to affect the behavior of everything in the game. The galaxy would have a council that decides on taxes, sanctions, and reaching the farthest planet to make the galaxy civilized. The player can join the senate (once they have enough reputation) and vote on new rules and laws that shape the growing universe.

Also, to keep players informed, there would be Galactic News. You enter the game and read that there was an event where two stars collided and formed a supernova destroying 3 planets. On one of those planets, you had a squad blocking access, oh no. It would also inform about new sanctions, the top 10 corporations of the week and so on.

Development Progress👨🏾‍💻

I have to be sincere, I never made a full game before, just small prototypes. I don't have any idea how to implement some of the aspects I mentioned. But I know that it would be fun to try.

I plan to keep updating my progress with the game on future blogs, you can also follow the progress on my GitHub repo:

Galactic Exchange Repo

Until the next time.

Did you find this article valuable?

Support Luis Matos by becoming a sponsor. Any amount is appreciated!