Go to file
Simon Forman 8eab96431d A simple reticule for highlighting current star. 2024-04-16 11:57:39 -07:00
misc/terrain_automaton Move stuff I'm not using to attic. 2024-04-13 13:22:37 -07:00
tasks Stars and galaxies? 2024-04-13 13:20:48 -07:00
.gitignore ignore pycache dir 2024-04-11 21:48:30 -07:00
COPYING Some ah coo tray monts. 2024-04-11 21:54:52 -07:00
README.md Minor cleanup. 2024-04-15 19:56:43 -07:00
data.py Only reproduce on world in home stellar system. 2024-04-15 20:12:25 -07:00
game.sqlite Only reproduce on world in home stellar system. 2024-04-15 20:12:25 -07:00
poisson.py copyright notice 2024-04-11 21:58:21 -07:00
population.py Only reproduce on world in home stellar system. 2024-04-15 20:12:25 -07:00
reticule.py A simple reticule for highlighting current star. 2024-04-16 11:57:39 -07:00
server.py Only reproduce on world in home stellar system. 2024-04-15 20:12:25 -07:00
stars.py Blacken some code. 2024-04-15 15:32:16 -07:00
ui.py Precomputed easing values. 2024-04-16 09:35:55 -07:00
wordlist.py Generate names for the stars. 2024-04-14 16:53:47 -07:00

README.md

I've been kicking around the idea for a game for a long time. Recently I went to play Rome: Total War and it broke, so now I'm going to write a game.

It's roughly a space explore and colonize kind of a thing. Multiple species and civilizations (eventually multiplayer).

I want to separate the UI from the Server and maybe have multiple clients? At least a Tkinter client to begin with and then maybe a cool "gamey" UI written with Godot or something.

So far there is a canvas that is larger than the window and that you can scroll, and there are some stars that vary in size a little but they're all yellow. And that's it.

I use some old code I had laying around to generate stars that are not too close to each other, it winds up being just under 5000 stars with the current parameters.

The "server" isn't a server at all yet. It just generates the starfield so the UI script doesn't have to do it each time. I'm just using pickle for data format, eventually it could use JSON (ick) or SQLite (nice.)

Aesthetics: maybe have a sprinkling of background stars behind the "real" stars (that are part of the game.)

Toggle fullscreen.

Controls? Tabs? HUD/OSD (heads up display/on screen display)

Fri Apr 12 12:27:56 PDT 2024 I think I will use SQLite as teh interchange file format. It's language agnostic (i mean, SQL, sure, but you can use it from any lang) and I can keep historical data in it rather than just the current state, eh? No one will freak out?

That was easy.

I don't want to spend too much time fiddling with the widgets and UI, it's fun but it's a bit of a rabbit hole, eh?

The basic model is that you get a state db from the server, explore it with the client and queue up an order list to send back to the server for processing, which then returns the new state db.

What format for the order codes?

Thun code?

THe db tables and game data types should be compatible with Prolog?

I don't want to have a bunch of Python objects modelling the game entities if possible, what I mean is, it would be neat if the db rows (tuples of Python ints & strings) and the Tk widgets (canvas items, etc.) could be the bulk of the internal game, uh, stuff. Not everything needs to be a class?

Sat Apr 13 11:13:18 PDT 2024 I don't like the Poisson star layout. It's too regular. I'd like it if there was a really huge "space", like 2^10 x 2^10 with stars laid out in a spiral pattern like the Galaxy. Or even use real astro data (like, uh, is it Epic that does that?)

But it's not on the critical path. I've got stars.

VGA Planets is a big inspiration.

the 4X game (eXplore, eXpand, eXploit and eXterminate) model

4X game

Sat Apr 13 13:10:19 PDT 2024

I took a look at the real Milky Way and man is it ever big. Thouands of star clusters with thousands of stars each... I was looking at an image of the core and letting my mind expand to try to encompass it and I got really spacey/high, in a good way.

There's a tension between versimilitude (fidelity to the real data) and making something easy to write and fun to play. It would be simple enough to generate crude cartoon worlds, and a detailed realistic galaxy might be kinda boring (to play.) If you want to (virtually) explore the real galaxy there are resources for that.

In any event, I think the way forward is to generate something nice now and upgrade it later. I don't want to get side-tracked, I want to stay mostly on the critical path.

Sat Apr 13 13:31:02 PDT 2024

Context...

In this Universe there was a certain insectoid species (a hive species like ants or bees) that attained sentience very early on, before any other species on any other planet, and they effectively control the whole place. They are mostly uninterested in new species, other than to maintain stability and order.

As new species arise and attain sentience and explore the galaxy they are incorporated into the insects' system (or destroyed, but that's very rare.)

Rules:

1.) Species may only reproduce on their home planets. This limits exponential population growth. Each species must learn to live within planetary limits as proof of their sentience.

2.) War can only be fought by agreement. Before fighting two (or more) species must file agreements with the insects. These agreements detail the theater, forms of combat, parties, win criteria, and stakes for a given conflict. Importantly, the idea is that one cannot force another to fight. You can't use the threat of fighting to force other issues.

3.) Living beings are sacred. The insects generally speaking want there to be more life, not less.

(When species members want to travel between the stars they generally develop either suspended animation or longevity or both. D'oh! I forgot "Bob the Blob" takes care of both, also interspecies communication.)

Most interstellar economic activity is in the exchange of "spices" (biomolecules that are difficult or impossible to synthesize) and art.

To this end, you explore and find viable planets, seed them with life, harvest them until they eventually develop their own sentient species which then join the galactic society.

(Maybe? I'm spitballing here. I'd like to integrate this game universe into a inchoate Sci-Fi universe I'm toying around with, if possible.)

Don't over-think it. "A complex system that works will be found to have evolved from a simple system that worked." Something like that.

John Gall: Systemantics: How Systems Really Work and How They Fail

A complex system that works is invariably found to have evolved from a simple system that worked. The inverse proposition also appears to be true: A complex system designed from scratch never works and cannot be made to work. You have to start over, beginning with a working simple system.

So let's make a simple system that works, eh?

Sat Apr 13 14:09:14 PDT 2024

Battles are resolved by proxy. Any other game (that gives a definite result between the parties) can stand in for a battle or war in this game.

Sat Apr 13 21:46:16 PDT 2024

For selecting a star and showing some data about it one option is a static pane of widgets, like on the side. Another option is to have a tooltip kind of a thing, but not transient as in you should be able to select text on it? click controls? A third option is to populate a notebook tab and switch to it? That seems dramatic.

The first and second options are easy to implement, the tooltip needs positioning logic. Let's exercise the notebook...

Sat Apr 13 22:58:12 PDT 2024

We assume that each stellar system has all the energy and protons they need so they can transmute elements. The products of a stellar system are "spices", biomolecules, which require planets to have life, and art which requires sentient life.

So a planet has, let's say, a bio-capacity, the maximum life it can sustain (for whatever factors, temp etc.) and the basic mechanic is to seed lifeless planets with life (using fast cheap robot probes/drones) and then collect and trade spices.

Because acceleration is so expensive, we have "gates" that throw and catch ships for sentient beings to travel. That way the ships don't have to carry mass to eject for delta-vee or fuel to eject it, and I imagine that dust and such is swept out of the regular routes.

But it's expensive to build a gate and you have to bootstrap.

So you start with a home system, two seeder drones, and one ship-of-the-line for defense and you know, to have a ship.

You send out the drones to explore and bootstrap your local economy, fly your other ship around to do...? Fun side quests? Allocate build power to:

  • more build power
  • seed drones
  • ships
  • ?

Sun Apr 14 20:45:17 PDT 2024

Added some planets to stars and stats to planets. There are two kinds of capacity for each planet: "bio" and industrial. The bio capacity is the most bio production (of "spices" and population) possible and the industrial capacity is for production of seeders and ships and bases and gates etc.

Most planets start out w/o life and most planets that have life do not have sentient species.

A population on a homeworld grows at a certain rate, industrial production is limited by population (up to the max: planet capacity) but you can build "multipliers" that can make pop 10x - 1000x more effective.

biomass w/o pop growth, so you need at least two numbers: life and pop. life goes up automatically but pop cannot go up on non-homeworlds (by bug law) except by immigration.

bio is (well, shall be) in the planet table but pop should have it's own table.

Mon Apr 15 09:13:22 PDT 2024 Let's add some people.

I'm thinking that, say, 10% of planets (with non-zero bio capacity) should have naturally occurring life. (Any planet with life will have maximum life, because that's life.) If there are 10000 planets with bio capacity that means 1000 planets with life, if we want only about 10 sentient species that's 1% of those, eh?

Population can move around. Planets, space stations, ships, where else?

Just a note: I'm not happy with the Poisson layout of the star systems, too uniform, I know I've said that elsewhere. I'm also not happy with the radiuseses of the stars, the little ones are hard to click on. It's not so bad because you can click on the labels, but still. It would be neat to have a scattering of stars on the background, just tiny points of light, cosmetic only, no game function. Then the "real" stars could all be several pixels uh radius for clickability eh?

It would be fun to see if the Treeview widget could handle all the stars and planets... 12,300 planets, 1,948 stars, it should be able to handle it?

Mon Apr 15 15:48:51 PDT 2024

Pop growth on homeworlds only: we want the populations that are on a planet where that planet is in the home stellar system of the species of the population.

planets.star = populations.homestar

What if in the populations table instead of the species column there is a home system column? We can get the species name from the homestar name as needed?

Is there a good reason not to have the species name with the pops? Extra space used I guess, maybe? pop.homestar.name + 'ians'