Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Universe Generator

Author
Message
Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 29th Jul 2007 17:13 Edited at: 1st Aug 2007 20:55
Universe Generator


This was spawned as part of the Star Trek Trader Project.

Basically this program generates a 100,000 cubic sector universe, each sector with it's own data. The first version is quite crude, it generates a random number as to weather or not a solar system exists within a sector. I'm giving it a 1 in 8 chance, so the average number of star systems should be about 12,500. Which is loads for people to explore. It then lists the number of planets in that system, the type of star, and presents a 1 in 4 chance of that system being populated. So that will provide roughly 3125 populated systems to explore. The next is the systems Tech level. A full Byte is given to this so between 0 and 196 the systems will be Pre-Warp civilisations at various ages (bronze, stone, undeveloped, industrialised etc), and anything above 197 is Post-Warp. Post Warp will have starbases to dock at and technology to sell. Federation standard technology is listed as 240, with borg level technology being at 255. Later on I will add code that draws a sphere around different empires. Any post warp in federation space (which is the largest) will have a 65% chance of being a federation member. These systems will automatically get a federation standard rating of 240. The rest of the post warp systems will have random levels of technology, but never exceeding 243 while within the empire sphere. Systems outside these empire spheres will go up to 250 max, and a few special systems will be higher, but I want to make those extremely rare, and more danergous the travel in. So in the end this should populate the universe with about 781 post warp civilisaions to visit, and lots of pre-warp systems, and unexplored space to explore. Other empire spheres will include Klingon space which has an average tech level of 335 but a higher chance of their planets being part of the empire, as kligonds invade rather than negoshiate. Romulans will have an average of 337, but their space will be more dangerous to travel in, as their's no firm treaty between the two. Cardassians will have an average of 230, but will need large bribes to travel trough their space. Frengi space will have a more random numbering system and no average, as it's made up of inderviual buisness men rather than a consistant goverment controlling technologies. I indend to add a special value, that has a range of 255 as well, which will be designed to further populate, unpopulated and empty sectors with other sella objects such as nebula, black holes, unstable worm holes, time related objects, quantum strings, pirate stations, etc.

I will also be working on an Elite style discriping and naming system. Unpopulated systems will have a binary name, while populated sectors will have words generated for them.

Once all this has been generated, I can also manually edit the array with known star trek systems such as earth, vulcan, etc.

So as you can see, alot can be done with a simple multi-dementional array, combined with a number of datatypes. Once the data's created the options are plentiful.

I've attached the first version of this generator so you can view it for youself. To exit at anytime just press X

This program won't be exclusive to Star Trek Trader, I'm treating it as a seperate developement tool with a wider range of applications. Eventually I'll add a GUI, and star system viewing code.

Multi-Dimentional Array
10,000 cubic sectors
3125 Populated Systems
718 Post Warp Drive Systems
Datatypes for organization
Sector locations in X, Y and Z
Is there is solar system check
What type of start is at the center?
How many planets are there?
What is the tech level?
Array to dat file exporting
dat file to Array importing
Original Array and Loaded Array comparison check


Enjoy!

Attachments

Login to view attachments
Deathead
18
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 29th Jul 2007 17:36
screenshots?

Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 29th Jul 2007 17:38 Edited at: 29th Jul 2007 17:40
lol, run the program. It's glorious text and an outputted dat file.
Deathead
18
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 29th Jul 2007 19:27
Won't be my cup of tea. Just saying stuff like it has blah blah moons. Don't like it. To be honest I hate text things.

Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 29th Jul 2007 19:49 Edited at: 29th Jul 2007 19:50
You need to work out the logic before you make the pretty graphics. What's the point in making a set of wonderfully textured planets, with shaders, and a halo, if you don't know where the hell to put it? Or what type of planet should be positioned? Sure you can model hundreds of star systems if you have enough time. I on the other hand will only have to make several base models, add randomized size variations, and adjust the texture colour with another randomize varaible. Low and behold, I'll have thosands of decent looking star systems with a fraction of the effort!

Variables are simply numbers and text at the end of the day, and without them, you've got no game.
Deathead
18
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 29th Jul 2007 21:19
I know i'll try it is it a darkbasicpro file if so i can't run it haven't got it.

tha_rami
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 29th Jul 2007 22:09
Perfect reasoning there, Kenjar. Like the variety and seemingly complex while simple variables you're using. This means every game will be totally different, won't it?

I thought you said procedural, though, not random.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 29th Jul 2007 23:46
Aw, I was hoping you would be able to fly through the universe.


Cheers,

-naota

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 30th Jul 2007 00:09 Edited at: 30th Jul 2007 00:10
Hey Kenjar, I happen to have an old planet generator lying around. So if you want any help with making all those planets, you can use it as a foundation. Here's a sample.




Open MMORPG: It's your game!

Attachments

Login to view attachments
Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 30th Jul 2007 18:05
Cool, thanks RiiDii.

Quote: "Perfect reasoning there, Kenjar. Like the variety and seemingly complex while simple variables you're using. This means every game will be totally different, won't it?

I thought you said procedural, though, not random."


It's based on the same system Elite uses. A seed is inputed, and a whole new universe is generated. However if you wish to generate the same universe over and over, you merely need to use the same seed.

Quote: "Aw, I was hoping you would be able to fly through the universe.


Cheers,

-naota"


You will be able too. This is a side project from Star Trek Trader, I've got a very basic solar system already generated. I'll also be deploying it in Ezekiel 3416 when I reactivate that project.

http://forum.thegamecreators.com/?m=forum_view&t=91992&b=32

Here's some of the graphics I deployed in the 2005 version of this project, I've come up with some nice improvements since then. Including halo's. Also, unlike the first project, the planet sizes and positions in Sol, are going to be as accurate as I can make them in both scale, and distancing from the sun. Much, much later on I also intend to add a time system, and orbit simulation. Though that's much, much later, I'll have to study the mathematics behind the problem. For now, the new engine basically randomises the orbit of each planet around the sun, and randomises orbit of moons around planets. Not ideal, but form a game play stand point it's not too bad.



tha_rami
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 30th Jul 2007 18:11
Kenjar, your system is not procedurally. It's random. Procedural means generating new planets on the go. Just being nitpicky .

The game sounds very good.

Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 30th Jul 2007 18:50
You're quite right. I tend to look at the generator and think it is producing systems on the fly. On the other hand, I'm also using this program to produce the data I need, which will then be saved to a file and imported into the main game engine. So yes, the game itself isn't proceedual. The generator itself however does generate systems on the fly, reguardless of what it does with the data afterwards.
PowerSoft
20
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 30th Jul 2007 21:14
Good projects here, by this compliment I also include Trader. Great stuff.

The Innuendo's, 4 Piece Indie Rock Band
http://theinnuendos.tk:::http://myspace.com/theinnuendosrock
Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 2nd Aug 2007 00:47 Edited at: 2nd Aug 2007 00:50
Build 0.0.2 update


Solar System Existance

A new subroutine created, checking to see if a solar system actually exists or not. Removes a couple of bugs from the first try.

Planet Generation

Randomly selects planet type based on position within the solar system. So planets close to the sun, have a higher probibility of being hot, moultan worlds, or gas giants. There is also a slim chance of a Deamon class world (X - Z). Planets in the middle of the system have a higher probibility of being life sustaining worlds. Including M, L and O classication. Then towards the end of the system you get a reduced chance of habitable worlds, a higher chance for ice worlds, and a slim chance for deamon class worlds.

Post warp system check

Confirms if the system is post warp, which activates a series of additional commands and checks. This prevents additional usless processing from being done. After all, what's the point deciding if a system has a base if it's not even a warp capable culture?

Is Base True?

For Warp capable systems, all class M planets definately have a base of some kind. All the other planets in the system have a 50/50 chance of having a base or trading post of some kind, even perhaps a military testing station. The type of base will depend on what already exists. So every system needs a central starbase docking station, once that's created, any additional based can be anything from simple trade posts, to scientific research stations, storage stations, or a military defense outpost. What is availible depends largely on the tech level of the system, the higher the level, the more options will be assigned to the generator.

System data save to .dat file

Rather then saving to a txt file, I've renamed it to dat. I've also added a compression routine for some of the larger numbers, such as any double floats and integers I might need to save.

Universe data loader

This allows the software to load the .dat file back into memory.

Universe Data Integerity check

After the universe data has been loaded into a seconary array, this part of the program will run a full data check compairing every peice of data from the old, just generated array, to the saved file. This will ensure there's no missing data, or file damage.

50% complete, planetary orbit generator

Not finished yet, it generates orbit distances from the sun, based pm on the sol solar system model. This will vary distances between planets. I am deciding if I should produce mass ratings for each planet, and base the distance from sun calculations based on those. Or merely randomize the orbits, but preventing certain extremes.

10% complete, Special System Generator

This will generate special systems. This will include rouge planets without a sun, stellar strings, black holes, unstable wormholes, astroid's, pirate bases, deep space outposts, etc.

Proposed sector Editor

A GUI tool that will allow you to view the sector generated and change any value you wish. There are well known trek worlds including earth, vulcan, romulus, etc. Plus you can design your own uniqe systems, and add special sectors for missions. I'm also planning to add an event sector, so storyline events can be added. For instance, universe().TriggerEvent = "loadmissionscript1.dat" and universe().EventFinished = 0 or 1.

5% complete, System viewer

This will allow you to read and view any sector in the galaxy, as either a 2D representation, or a 3D system chart.
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 4th Aug 2007 10:58
So is this going to be somewhat like freelancer? or like Universal combat?

Your signature has been erased by a mod because it's larger than 600x120....
Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 5th Aug 2007 00:26 Edited at: 5th Aug 2007 00:27
More like universal combat (rubbish game btw) I certainly won't be using a gate system. Starships have warp drive. But this is just a system and universe building application for the moment. The data compiled will be imported into the game. Howver I'm basically using a square sector design method, so there is absolutely no reason the data can't be used to produce gate based games as well.
Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 7th Aug 2007 03:41 Edited at: 7th Aug 2007 03:47
A quick screenshot of the first 2D system viewer, converting the array data into visual 2D display data. 1 will display empty space, any higher numbers are represented with a uniqe 2D image. Planets represented between the numbers 11 and 17 will sustain life. Anything between 2 and 10 is rocky, or moltan. 18 to 23 are daemon class worlds or gas giants.

Attachments

Login to view attachments
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 7th Aug 2007 04:59
How about a binary id system that can mix & match bits to create unique world types? Something like:

0=No planet
1=Rock
2=Liquid
4=Gas
8=Ice
16=Tiny
32=Medium
64=Huge

So that 35 is a medium rock planet with an aptomosphere (32+2+1).

Earth might be something like:
Small = 16+32 (Tiny+Medium=Small) = 48
Rock = 1
Liquid = 2 (oceans)
Gas = 4 (aptmosphere)
Ice = 8 (polar regions)

For a total of 32+16+8+4+2+1 = 63

You could even add in factors like "Unstable" (molten/volcanic) and "Stable", or No Life, Basic Life, Animals, Intelligent Life, and Advanced Life (warp capable). Basically, for any single DWord, you can have 32 flags for up to roughly 4.2 billion possible world types.


Open MMORPG: It's your game!
Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 7th Aug 2007 13:30 Edited at: 7th Aug 2007 13:32
At this point I'm using the Star Trek A - Z classification system. So there's 23 planets. The system deployed at the moment is a far more simplistic version that's not very accurate. However over time it will evolve properly into the full trek classification system. Furthermore I intend to setup a scripting system that will allow users to create their own planet types, with a minimum of 10, to a maximum of 99. The designed script will be something along the lines of:

[Master Script]

[Number of Planet types]

[indervidual scripts]

[Planet ID]
[Planet Type Name] `Class B or Type X or whatever
[Planet Type Quick Discription] `Rocky Barron
[Planet Type Full Discription] `Rocky Barron world with open gas fissures. Unable to support humanoid life.
[Icon Filename] `MyPlanet.png
[Planet Base Texture Surface] `MyTexture.dds
[Planet sky bsae texture] `MySkyTexture.dds
[Ring Ture] `1 or 0
[Ring Thickness] ` 1 - 50 (saturn approx 35]
[Planet Ring base Texture] `MyRingTexture.dds


Star Trek Classification System:

Login to post a reply

Server time is: 2024-11-24 01:42:21
Your offset time is: 2024-11-24 01:42:21