Return to “Everything & Anything”

Post

Procedural Galaxy Generator

#1
To test out some fractal algorithms, I have hacked together a simple "star map generator":

The galaxy map is similar to the structure used in EvE, where each starsystem is accessible by at least one connection / wormhole, while keeping the number of connections between stars low to allow chocke-points.
The Universe is generating clusters of stars in various sizes, eg "hubs" of civilizations.

Larger Star-systems are named by a random algorithm. (that can be certainly improved)

browser version: ( starmap generator )
-> click to toggle names, drag to tilt the map
Image The generation might take a while, as it looks for a specific "nice" setup, and might repeat itself if it cannot find it.
Hit "F5" to reload the page and thus regenerate the map. I have to implement some GUI here..
Post

Re: Procedural Galaxy Generator

#3
Technically it could generate itself infinitely.
Since I check that all paths are connected to the "main grid" (time grows exponentially), this would require the "universe" to consist out of a lot of clusters, that get a few connection points to the neighboring cluster at the outer edges.

This would also make it interesting to the player. As those connections to "new clusters" could be hidden in the gameworld, and require scanning it in one of the star-systems at the "outer rim".

I have kept the number of stars below 1000 here, as this demo is using a very ineffective rendering, and I tried to keep it smooth when scrolling the map.
Post

Re: Procedural Galaxy Generator

#4
Nice work, now you need to cull connections that are close to the same direction and very close or touching.
This way you can more easily see individual connections.

I might have to steal your code if I can find some time at work to abuse it today.
°˖◝(ಠ‸ಠ)◜˖°
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: Procedural Galaxy Generator

#6
Damocles wrote:You can tilt the map by dragging up and down to see the structure better.

I might have to implement a rotation transformation to make it more fun to zoom though the map.
But that probably requires the number of stars to go down a bit, as this is just very basic canvas rendering.
Yeah, Stellaris has this problem occasionally also.
Just remember, that most people view a starmap from the same direction and rotation.
Culling those connections is the best idea.
°˖◝(ಠ‸ಠ)◜˖°
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: Procedural Galaxy Generator

#10
The Systems could be structured like this: Image Where each "Location" is a "Level / Instance".
It uses the same nebula/background and different scales of the Sun (depending on distance),
and its corresponding planet, moon, asteroid-field, wreckage-field or other feature in its corresponding location.

Travelling -within- a system, gives the player a vaster representation of space, than just having one (in realistic terms tiny) location per system.

EvE basically used this instancing system to represent Space, travelling between locations using the warp-drive.
(they are not actually physically connected, but spawn a new location as needed)
Advantage: some locations within the system need to be first discovered (scanning), or can require a special gate to reach them.
It gives a pretty nice feeling of space without the technical difficulties (and huge empty areas) or free space travel within the system.
Last edited by Damocles on Sat Jun 03, 2017 4:06 pm, edited 2 times in total.
Post

Re: Procedural Galaxy Generator

#11
I have already written Stellar generation, and kepler motion into JS in the past for the Borealis project. (an attempt at a JS version of Aurora 4X)

I can provide the source for both if you wish.
Hell, we could open that project back up in Cloud9. :V
°˖◝(ಠ‸ಠ)◜˖°
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: Procedural Galaxy Generator

#13
http://www.goat.army/prototypes/ring_galaxy.htm
[Press space to reload the galaxy]
Spoiler:      SHOW
Image
So I got started on my own version. And have a basic ring galaxy generating with complex star color/temp/mass. :V
The stars are based on real star color distributions, and I have a bunch more work to do on those. (like variable, and twin stars)

But the idea I want to test, is if I can get these moving and keeping the structure, while providing dynamic wormholes.
Basically I am going to make each star move through the galaxy in a Kepler orbit (incorrect as all hell) and then have it create and destroy wormhole links based on distance to neighbours.

In theory this would provide a HIGHLY dynamic galactic battlefield. Which would make large empires hard to maintain, and lead to more fracturing of nations. Which would be cool for a space Grand Strategy. :V
But mostly I just wanna see what it would look like. :3


EDIT::
http://www.goat.army/prototypes/star_links.htm

Sorted out distance based Links between stars.
[1] [2] and [3] toggle rendering of things.

Working on the orbits next. :D
°˖◝(ಠ‸ಠ)◜˖°
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()}`);

Online Now

Users browsing this forum: No registered users and 29 guests

cron