Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Casteele

Random Starmap/Jump Generation

This topic is 5763 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings, I''ve searched high and low for algorithms or sources to generate a specific type of random starmap. (Maybe I just don''t know the right term to look for? ;-) Anyhow, I can generate several starmaps now, but still not the kind I want.. I want to generate a universe similar to the way the old BBS door game TradeWars did, using sectors and warp jumps to connect them, which may possibly exist withing the boundries of one or more empires. Travel between sectors is limited to the warp jumps generated, and there are no "one way" jumps. While I can generate a basic universe using the TW methods just fine, I''m not so sure how to generate a graphical view of such a universe. However, I came across an old win3.1 game which did almost exactly what I''m looking for, Stellar Empires 1.0 (do a web search for stlemp10.zip to find a copy). If anyone has any ideas how to impliment the algorithm (psuedocode is fine, don''t much care to tie it to any particular prog lang) used in stlemp, I''d be glad to hear them. Failing that, ideas and pointers how to create a graphical view of a universe based on the TW algorithm? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
I''d love to help you but I''m not going to download an ancient Win 3.1 program, struggle to get it running on Win2k, play it to get an idea of what you''re talking about, and them come back and post my thoughts. Maybe you should post an image of what you want or explain in a bit more detail?

Share this post


Link to post
Share on other sites
I''m going to give an example of how to do it from the standpoint of Trade Wars 2002. You''ll probably have to modify it somewhat for whatever you are doing, but it should get you started.

Create an array of 1000 sectors.

Randomly pick a 5 to 25 sector group.
For each of the sectors in the group:
Connect it(A) to a random one(B) of the others
Connect (B) to (A)

Randomly pick 5 to 25 more sectors, but make sure they haven''t been picked before.
Do the same loop to connect those sectors.

After the final group is settled, you''ll have a selection of grouped sectors. The grouped sectors each should have their own name, like "The Marmalade Nebulae" or "Halaf Zone" or whatever. You should have 40-200 of these groups. You can, of course, adjust the amount by changing the amount of sectors per group.

To connect these groups to each other, do something similar.

Loop through each group and connect one to five or so of the sectors randomly to one of the other groups.

This method still leaves the chance that there are sectors that cannot ever reach other sectors. You''d have to run through a pathfinding algorithm for each sector from the same starting point to be sure of that.

There may be other problems with this, but it should get you thinking on your own.

I don''t know if anyone ever wrote up how Trade Wars 2002 created their universe, but from what I could tell, it couldn''t have been that far off from the method I described.


£§

Share this post


Link to post
Share on other sites
quote:
Original post by Dobbs
I'd love to help you but I'm not going to download an ancient Win 3.1 program, struggle to get it running on Win2k, play it to get an idea of what you're talking about, and them come back and post my thoughts. Maybe you should post an image of what you want or explain in a bit more detail?


I'll try.. was trying not to post any large image files ;-)

Here are two maps generated at 600x480 (and somewhat cropped), plus two "zooms" of major clusters in the second map, at 1152x862 (and cropped)..

(If you cannot load the images, and are firewalled, allow port 5080, since all image links are redirects to my local server on port 5080 via DynDNS redirects)







As you can see, they are a bit grainy, but I hope you get the idea.. I basically want to create a more or less random graph, where there is some clustering. (Not sure I'm using the right terms, I'm new to this )

(PS: I run Win2K, and the program runs fine right outta the .zip)

[edited by - Casteele on February 9, 2003 3:58:59 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by LoneStranger
I''m going to give an example of how to do it from the standpoint of Trade Wars 2002. You''ll probably have to modify it somewhat for whatever you are doing, but it should get you started.

<snippage>

I don''t know if anyone ever wrote up how Trade Wars 2002 created their universe, but from what I could tell, it couldn''t have been that far off from the method I described.
£§


The general algorithm isn''t bad, I do have some *old* turbo pascal sources for early versions of TradeWars on WWIV BBSes, but have not gone in-depth over them yet (If you want them, ask). I also have looked at other "warp-link" style games, such as PHP based Solar Empire. But the real problem I have is in generating a universe that maps easily onto a graphic 2D display monitor.

Solar Empire does generate a graphics image of the universe, and I''m looking at how it does, but I''ve noticed the universe it creates are typically grid-like. Another game I''ve just found is Space Empires IV, which does a pretty good job, plus it has different universe structure options (including the grid-type ones, spirals, etc.)

I''ll see what I can do with the algorithm you gave.. I''m thinking of using polar coords when drawing the map, using small values of ''r'' for local clusters, and larger for links to distant clusters. If you can think of a better way, or another way to generate maps, I''d be glad to hear.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!