Return to “General”

Post

Building LT - Generating a universe

#1
While more talented people are checking how to make the amazingly complex 3D-core of a spaceship game, I was thinking about how to generate a universe randomly that has a certain depth. In the core, this is how to generate the starting position and evolution for the historical LOD as explained here.

I was thinking a generating stars/planets/lifeforms/societies in a way inspired from roleplaying games (Star Wars, GURPS - see e.g. here), but in a flexible way that can be modded easily.
Because in my view, the atomic element is the planetary AI (and for simplification, I would target 1 planetary AI = 1 star system - see below for a possible relaxation of this constraint), we would have basically a planetary AI object with expandable properties and expandable influence on each property on other properties.

What I mean is: one property of the planet is temperature. Another property is "biome" (as we probably go with the standard sci-fi 1 biome per planet). Now the biome property is dran at random; but it is possible to tweak the randomisation according to previous properties - in our case we add a threshold for temperature: if too hot, it cannot be an ice planet.

So in XML, the planet would have properties:

Code: Select all

<Planet_Property>
 <ID>PL_TEMP</ID>
 <Name>Temperature</Name>
 <Mode>NormalRandom</Mode>
 <Mean>20</Mean>
 <Sigma>100</Sigma>
 <Unit>C</Unit>
 < ... further properties ...>
</Planet_Property>
<Planet_Property>
 <ID>PL_BIOME</ID>
 <Name>Biome</Name>
 <Mode>List</Mode>
 <List>
  <Item>
   <ID>1</ID>
   <Name>Desert</Name>
   < ... further properties ...>
  </Item>
  <Item>
    <ID>2</ID>
    <Name>Ice Planet</Name>
    <Condition>
     <Type>Incompatible</Type>
     <Property>PL_TEMP</Property>
     <Threshold>gt</Threshold>
     <Value>0</Value>
    </Condition>
   < ... further properties ...>
 </List>
</Planet_Property>
So you see, if a new property is added by a model/developer, it can just be added and it can override other properties by adding conditions. For instance if I add the distance to the sun, I can make it a condition for the temperature - and of course it will cascade as being a condition for the biome.
This is simply done by making a new file:

Code: Select all

<Planet_Property>
 <ID>PL_DIST</ID>
 <Name>Distance to Star</Name>
 <Mode>LogNorRandom</Mode>
 <Mean>1</Mean>
 <Sigma>4</Sigma>
 <Unit>A.U.</Unit>
 < ... further properties ...>
</Planet_Property>
<Planet_Property>
 <ID>PL_TEMP</ID>
    <Condition>
     <Type>Minimum</Type>
     <Property> PL_DIST</Property>
     <Factor>0.01</Factor >
     <Origin>0</Origin >
    </Condition>
   ...
Do you think it makes sense to try starting investing work in developing such a concept?
Image
Post

Re: Building LT - Generating a universe

#2
There are some logical reasons for wanting a single biome; ice balls, water worlds, molten hellscapes, barren (luna/mars/venus/asteroids), and gas giants. If you have to use a 'single biome' for an Earth-like planet, just call it terrestrial or even habitable. But it's not like we can't afford the memory, you could even use a shorthand like Traveller's UPP (universal planetary profile.) On that note, it might be nice to use a planet's data (hydro percentage, temp, atmosphere, etc) as parameters for randomly generating the surface. So, the planet would actually be a visual representation of the numbers.

It's just my opinion, but single biomes for a diverse world is... [deletes multi-paragraph rant]... doing a disservice to the audience. We can do better.
Post

Re: Building LT - Generating a universe

#3
I think the main point here -- an appropriate, consistent data model for in-world objects (including planets) -- is good.

I would suggest not spending much time at this point considering the particular kinds of data values to include per object type, as probably 90% of that will change by the time a game becomes really playable.

And in particular, I'd note that there are a number of meta-data questions that need to be asked and answered, such as:

  • What game data values should be stored and retrieved in binary form using a database for performance, versus data that can be stored (for single-player mode) as human-readable structured text?
  • If there's a lot of data that needs a database, should all game data be stored/retrieved that way for consistency?
  • How must game data be structured and stored in order to make it serializable for reliable saving?
  • Should full data for all objects in the game world be generated at game start, or (as zircher implies) should only Traveller-like basic data be generated and large-scale results simulated until details are needed?
  • I personally don't need multiplayer, but for those who want it: should all game save data be encrypted to resist cheating?

These are just a few questions that occurred to me -- there are probably more. I suggest they need a good discussion, and decisions made about them, before we start debating particular data values for object types like Planet and Asteroid and SpaceStation and Ship. This meta stuff isn't much fun, but it becomes much, much less fun if left unaddressed until after the more enjoyable details are implemented... and then have to be re-implemented.
Post

Re: Building LT - Generating a universe

#4
A good question to bring in too, is what scale is the universe?
Are we going to play around with 10 planets? 100? 1000? 1000000?

The higher the planet count, the less data we want to store for any individual planet.
Oh top, why even worry about planets?

This is a game about spaceships right? Lets abstract planets down to two types, Inhabited, and Uninhabited.
They can then provide a simple Resource Tap/Sink for Credits/Goods respectively.

And any station above the planet makes use of this.



Say stations normally only use 1 good per inhabitant per month.
With a planet there, they are also providing that value down to the people on the planet.
If there are two stations, the amount can be provided for at either station.

This gives us a SUPER simple way of producing credits, without them coming out of thin air, and a reason to have a manufacturing process. (Making goods to give to planets for Credits)

IT also then makes planets entirely about making credits, and have limited impact on the game play.
Which saves us doing planetary landings
Which saves us having to do planetary assets, or an atmospheric flight model.
°˖◝(ಠ‸ಠ)◜˖°
WebGL Spaceships and Trails
<Cuisinart8> apparently without the demon driving him around Silver has the intelligence of a botched lobotomy patient ~ Mar 04 2020
console.log(`What's all ${this} ${Date.now()}`);
Post

Re: Building LT - Generating a universe

#5
A handful of variables that describe the basic parameters plus a random seed (to generate the surface on the fly when you get close) are enough for a planet that is only looked at from space. Something like CSE's hierarchy would be needed at some point. Galactic Map -> Solar System -> Star, planets, and other objects. I imagine that the 'real' interface to the planet would be the various retail and communication screens at the space station(s).
Post

Re: Building LT - Generating a universe

#6
i'm working on some large structure generation stuff for the galaxy (with the smallest unit being a system) which should go fine ish for hundreds of thousands of systems.
i have it written up in some OneNote workbook, which i sadly cant share with a general accessibility link, if someone wants access throw me an email i can share it to

Silverware wrote:
Sun Apr 26, 2020 11:41 pm
Say stations normally only use 1 good per inhabitant per month.
With a planet there, they are also providing that value down to the people on the planet.
If there are two stations, the amount can be provided for at either station.

This gives us a SUPER simple way of producing credits, without them coming out of thin air, and a reason to have a manufacturing process. (Making goods to give to planets for Credits)
i'd personally also introduce an explicit credit sink into (different types?) of planets to at least try to mitigate infinite inflation

like hiring crew from groundside


Silverware wrote:
Sun Apr 26, 2020 11:41 pm
A good question to bring in too, is what scale is the universe?
Are we going to play around with 10 planets? 100? 1000? 1000000?

The higher the planet count, the less data we want to store for any individual planet.
tbh i'd not even generate most data until we need it for any specific purpose that needs it and at best cache it in RAM and not permanently save it.
and make the purposes that actually need it (planetary production blah) be relatively rare or just have them determine their own values from the planetary data once and ignore it for the most part.
so a planet only produces permanent data when its actually "in use" for something.
and when its not used, unload all the data it has to be re-PCG'd when needed
Post

Re: Building LT - Generating a universe

#7
Cornflakes_91 wrote:
Mon Apr 27, 2020 3:21 am
tbh i'd not even generate most data until we need it for any specific purpose that needs it and at best cache it in RAM and not permanently save it.
and make the purposes that actually need it (planetary production blah) be relatively rare or just have them determine their own values from the planetary data once and ignore it for the most part.
so a planet only produces permanent data when its actually "in use" for something.
and when its not used, unload all the data it has to be re-PCG'd when needed
Aye, that's why I mentioned storing a random seed for each planet so things like the surface and a cloud layer can be created with a noise function influenced by the planet's type and parameters for surface water and temperature. It's something that can be generated in the background when you enter a new system and cached rather than permanently stored. At low resolutions, this is a trivial, at higher resolution this might take some time which is why you would want to off-load it to a background thread.
Post

Re: Building LT - Generating a universe

#8
Cornflakes_91 wrote:
Mon Apr 27, 2020 3:21 am
so a planet only produces permanent data when its actually "in use" for something.
and when its not used, unload all the data it has to be re-PCG'd when needed
And here's the rub.

More PCG on world state = Less living universe.

Infinite PCG for map gen has zero impact on the 'living' of the universe.
But suddenly offload the population, or the goods requested, or the crew available, or whatever data we are using on colonies.
And suddenly we no longer have a living universe.

I don't think any of us want an explorer to go off for a few months, then return to their "home" section of galaxy and have it completely unrelated to how they left it.
But of course this then requires SOME limit to the number of NPC factors involved.

This is how ED could do it if properly singleplayer. Because there are only SO many populated worlds.
These can then be simulated at the various levels of detail. from course to fine to properly, depending on distances and the like.

This means that you can explore the unoccupied black for decades, and return to a universe that's expanded, but one that you still recognize.

But if we want to drop the 'living' part of the universe, then this whole proposal becomes a TON simpler to manage.
Only the current system is simulated, and everything else is procgen'd and cached.
Get too far away and the cache gets cleared.
°˖◝(ಠ‸ಠ)◜˖°
WebGL Spaceships and Trails
<Cuisinart8> apparently without the demon driving him around Silver has the intelligence of a botched lobotomy patient ~ Mar 04 2020
console.log(`What's all ${this} ${Date.now()}`);
Post

Re: Building LT - Generating a universe

#9
Mixing the idea of having a near infinite universe in terms of stars and solar system, with the idea of having a near infinite number of populated worlds is one of the main fallacies I see with the original LT.

There is no need to have thousands of populated worlds, nor would it add to the gameplay, or be technically realizable if they really interact, and are not just imposters pretending to interact. (spawning in markets, just so players have a chance to buy and sell stuff)

A near infinite universe is quite possible, as its just a question of having a well working procedural generation based upon RNG and a seed.

But the civilized areas I would keep to a range between 100 to 300. With the occasional simulated deep space explorer wandering around, and some points of interest dotted around otherwise uninhabited areas.
This is then still technically feasible, and also in a magnitude that the player can have a noticable impact on.

Those inhabited areas should not be in one blob in the center, but have several clusters, with more uninhabited areas between them (the main travel and trading routes)

Also: only the inhabited and visited areas need to be serialized (saved), with the rest just coming into existence when entering them the first time. This keeps the save state database in a manageable size.

BTW: why did the inventors of XML required to repeat the tag name in the closing tag, this such an unnesessary waste of space.
eg:
<myTag> .... </myTag>
and not
<myTag> .... </>
Post

Re: Building LT - Generating a universe

#10
For the XML question, I'm sure it is related to nested elements. Also, if some elements are large texts or binary elements, you may not see the beginning when you get to the end of the data. And, just cause XML stores it that way, does not mean that the database does. The bloated text is for our benefit and not the machine's. :-)
Post

Re: Building LT - Generating a universe

#11
zircher wrote:
Mon Apr 27, 2020 5:24 pm
For the XML question, I'm sure it is related to nested elements. Also, if some elements are large texts or binary elements, you may not see the beginning when you get to the end of the data. And, just cause XML stores it that way, does not mean that the database does. The bloated text is for our benefit and not the machine's. :-)
It is related yes.

But this is why JSON is replacing XML in every single case it can, it's the smallest (that I know of) data packing format that's easily human readable.
YML is actually larger than even expanded JSON.
And JSON doesnt take any special understanding, a glance typically tells you enough to use it from then on.

Code: Select all

{
	"name": "Bob's Pizza",
	"price": 12.50,
	"cookingTime": {
		"minutes": 25,
		"seconds": 15
	},
	"ingredients": [
		"pizzaBase",
		"tomato",
		"tomato",
		"sausage",
		"cheese",
		"cheese",
		"cheese",
	]
}

Although this entire post is now offtopic, so lets do something about that....

Damocles I agree entirely, a fully procedural universe that slowly expands (and starts out as a small-medium area of 50-200 systems) is the way to go.
It gives us discrete points for simulation, and means that we get a living universe that actually does stuff.

Later expansions and start options can include other bubbles, or civilizations.
And it allows us to ENTIRELY separate the concept of system generation from civilization generation.
Which allows these functions to be developed independantly.

If we do go this route, there is one other datapoint we may have to track;
Asteroid resource pools.

If we have asteroid clusters where we do mining, it may pay to track how much is consumed there, that way miners cant reuse the same spot forever.
Instead it'll drive a gold rush in a system once one is found, for a few months, then once the area is mined out, people will move on, and the stations will remain and be left to slowly degrade and potentially move from a mining/refining economy to something that is more stable long term, like research and development, or manufacturing.

This is what I ultimately want from any LT style game.
A world where the demands of industry are ever growing, and the miners ever expanding outwards from the start system (call it Sol).
Thus the transport lines extend infinitely, and the ability for pirates to prey upon transport grows slowly and steadily.

In the early days with only a few systems, you only need a few police forces. But as the logistics chain stretches and transports are in old empty systems for longer and longer, the risk of pirates increases accordingly.

Giving rise to bounty hunters, and all sorts of emergent fun.
°˖◝(ಠ‸ಠ)◜˖°
WebGL Spaceships and Trails
<Cuisinart8> apparently without the demon driving him around Silver has the intelligence of a botched lobotomy patient ~ Mar 04 2020
console.log(`What's all ${this} ${Date.now()}`);
Post

Re: Building LT - Generating a universe

#12
The gold rush thing in interesting, I can see station memos like, "New asteroid cluster found in Tarrantis system." That would be one way to add pools to old systems. Or, if we don't have FTL ships, "The warp gate to Secundus Mundi is now operational. Station Head is seeking scouts and miners for this new system."
Last edited by zircher on Tue Apr 28, 2020 1:02 am, edited 1 time in total.
Post

Re: Building LT - Generating a universe

#13
zircher wrote:
Mon Apr 27, 2020 11:05 pm
The gold rush thing in interesting, I can see station memos like, "New asteroid cluster found in Tarrantis system." That would be on way to add pools to old systems. Or, if we don't have FTL ships, "The warp gate to Secundus Mundi is now operational. Station Head is seeking scouts and miners for this new system."
And now we have a REASON for selling map data too.
Because finding a resource patch is going to drive economy.

This makes you part of the world's evolution even when exploring, as you return with this data, and set off a new gold rush for the minerals.
°˖◝(ಠ‸ಠ)◜˖°
WebGL Spaceships and Trails
<Cuisinart8> apparently without the demon driving him around Silver has the intelligence of a botched lobotomy patient ~ Mar 04 2020
console.log(`What's all ${this} ${Date.now()}`);
Post

Re: Building LT - Generating a universe

#14
Silverware wrote:
Mon Apr 27, 2020 2:27 pm
Cornflakes_91 wrote:
Mon Apr 27, 2020 3:21 am
so a planet only produces permanent data when its actually "in use" for something.
and when its not used, unload all the data it has to be re-PCG'd when needed
And here's the rub.

More PCG on world state = Less living universe.
we seemingly had different interpretations of "in use"

a settled planet with an actively interacting economy is "in use" by the simulation.

an unsettled moon in a system with noone present isnt "in use"
(unless an actor who explored that system before does a database search for a new mining station)

for temporally varying phenomena (like regenerating resources) put a "last accessed/modified" timestamp on the largest viable abstraction unit (system, cluster) and run the time dependency onwards from then when regenerating stuff
Post

Re: Building LT - Generating a universe

#15
I think it is a matter of settling on what is universe data and what is faction/economic/sim data.

For example, as part of universe creation, we'd want to know the location of nebula, stars, their type, and any connecting points (if we're using warp points or gates for bottle necks.) Once a star is visited, we need to record planets, ring debris fields, asteroid clusters, and maybe plot event stuff (like artifacts, doomsday machines, comets, invaders, plagues, etc.) Those are physical and persistent properties that do not take up a lot of space. This might happen even if a player does not visit the system in the case of the economic sim when there is an NPC presence such as a colony or pre-existing outpost.

The economic sim, would need a little more information, but it is still a manageable amount of data. This is still all top level stuff.

The things that should be PG like stations, asteroid/planet surfaces, etc, those that only matter when there are eyes on can hopefully be created and recreated on the fly and do not need to be stored in the database except as a set of parameters and a random seed for the PG functions.

Even AI actors (factions and individual ships) only exist in the database as an entity.

Now, there will be persistent resources like basic parts, some textures, maybe NPC portraits*, and the like. But, those will be tweaked on the fly and cached locally when they are in possible close contact range of the PC.

Thoughts?
--
TAZ


* Didn't think about that until now, but you can even build NPC pics with a random seed from list of images and then tweak those images for item, skin, and hair color. Throw a 'sloppy video feed' filter over the top of that when communicating with them. Of course, I have nearly zero artistic capability myself. If tasked, I would pick up something like DAZ and make a bunch of renders. Your typical programmer art solution. :-)

[edit]

The sloppy video feed thing might be a future feature unto itself. Less distortion when you are close to the sender, more distortion and (crosses fingers) communication lag for distance contacts.

[add to the wish list] Rescue missions as an event, salvage ships and rescue crew (either in emergency stasis or stranded.) Note, lifeboats are not a realistic thing for most space disasters. Why would you leave your only source of water, heat, food, and power? Spaceships done 'sink' unless they are caught in a gravity well or on a collision course with something (usually astronomically rare in deep space.)

Online Now

Users browsing this forum: No registered users and 14 guests

cron