One of the most important features of Shadow Wars is the galaxy layout. Rather than the traditional Dark Galaxy ‘anywhere-to-anywhere’ model, the Shadow Wars galaxy has a much more intuitive layout. The basic idea was to restict travel to specific wormholes between solar systems in the galaxy. This makes movement very linear and creates battlegrounds where the major travel route bottlenecks are located.

Writing a system like this seemed relatively easy, but once I started working on the project a few issues came up. The first was linking the systems together. The algorithm i wrote aimed at linking each system to its nearest 3 neighbours. This worked fine, but once i rendered the links on an image an issue was immediately obvious - some of the links crossed each other, messing up the visual experience. To solve it I checked ALL the existing links when adding a new one, not adding it if it crossed any existing link.

The second problem was not only a visual problem, but a show-stopper. If the galaxy was not densely enough packed with stars, isolated collections of stars would be generated, small islands of stars, not conneted to the rest of the galaxy. To solve this I added a special checking algorithm that identified all the islands of stars in the galaxy and connected them together by their nearest systems.

These initial algorithms and a demonstration applet were actually written last year. This code has been pulled out, cleaned, polished and improved, and now its ready to back the new Shadow Wars game. I added a little image-generator utility to the code so i could quickly generate galaxies and play around with the settings. Here are a few of the generated images to give you a little more of an idea of what can been done with the layout.

As there are two factions in this game, take note of the green/red - these colours are there to represent the starting positions of the players in the two factions.

The galaxy systems (including faction colours)

The galaxy systems (including faction colours)

The galaxy systems (including factions & wormholes linking them)

The galaxy systems (including factions & wormholes linking them)

There are quite a lot of options that will allow the galaxy to be made larger or smaller, increase/decrease density and number of lines (wormholes), and number of systems per faction. The above example has 2000 systems, 500 for each faction (red/green) and 1000 neutral in the middle. Here is another example with 600 systems, 200 for each faction and 200 neutral in the middle.

600 systems, 200 for each faction

600 systems, 200 for each faction

600 systems, 200 for each faction (only two wormholes per system)

600 systems, 200 for each faction (only two wormholes per system)

I’ll play around with the settings, perhaps make a really crazily large one and a tiny one for fun :)

Posted Sunday, August 17th, 2008 at 9:20 pm
Filed Under Category: General
You can leave a response, or trackback from your own site.

15

Responses to “Shadow Wars - Generating a Galaxy”

Supremo

I liked it =D

Navigation is the real “juice” of strategy in these kinds of games imo.

The layout looks nice, the faction thing is also a nice idea.

I’m loving it ;)

cox

wouldnt it be even cooler to disable alliances inside factions from time to time?

just one massive 2 party (maybe 3 factions would be nice aswell, maybe only 4) war, with no exceptions whatsoever, this might even be handy for newbies, who are also important for winning the round, and can see first hand how the “big ones” operate.

atnemip

Looking good! If you managed to make a great game like DG, then I’m betting this one will be great ;)

rozza89

just a thought:
if you’re gonna use larger galaxies like the top example (2000 systems), why not have four factions? two on each side of the gal?
waddaya think?

starborn101

so when can we look forward to playing this?

Cova Lue

I see two things that need some work :

1). The galaxies are square, and real galaxies are round. I can help you with this, it has to do with sectors and numbers for the placment of the stars.

2.) The Faction Colors, there are people out there who are color blind in the red/green areas, they will only see black. Light Blue and Yellow would be a better choice of colors for these people.

3.) Will there be worm holes connecting galaxies?

Otherwise everything is looking great.

Cova Lue

FrostyCoolSlug

Please remember all comments are moderated. Please do not leave more than one reading the same thing.

In answer to a few questions:

Cox: I can’t see why we wouldn’t do that from time to time, I’d personally be interested to see how everything functions without the organisational usefullness of Alliances, however, seeing as most people don’t communicate in-game, rather by other means, it wont be completely allianceless ;)

rozza89: The code is being developed in a way that is generic, Zedd commented to me at one point about making it possible to do just that!

starborn101: When it’s ready! *ducks*

Cova Lue:
1) The galaxies are designed to be square, to allow for clear and specific seperation between each opposing side, and in the middle a bulk of planets. With a round galaxy, it would become more difficult to see where one faction ends, and another begins, along with tentative ‘joining’ around the edges allowing for easier movement between faction terrtory. We’ve made the design decision to have the galaxy rectangular / sqare to prevent confusion. I’d be happy to spend 5 minutes writing up some “backstory” to fill in the gap ;)

2) Thanks for the feedback, I’ll probably have a chat with Zedd and do some research into other options in this area.

3) There will only ever be one galaxy.

Light_of_god

i dnt play long time ago ago i was going too play in jupiter and that but didnt got bored i think that new game seems cool and look mecury was the coolest ^^ i loved it .. Well good luck Zeed and frosty i will see this more often ;)

rilla

Looking good guys. If I ever decide to play another webbased MMORPG it probaply will be this. Keep it up :)

I C E

Looks cool.

Adios

Darzan

Cova Lue:
1) The galaxies are designed to be square, to allow for clear and specific seperation between each opposing side, and in the middle a bulk of planets. With a round galaxy, it would become more difficult to see where one faction ends, and another begins, along with tentative ‘joining’ around the edges allowing for easier movement between faction terrtory. We’ve made the design decision to have the galaxy rectangular / sqare to prevent confusion. I’d be happy to spend 5 minutes writing up some “backstory” to fill in the gap
_________________

so does that mean that you won’t be trying to render the galaxy in a sphere-shaped-object?

waster

that is really a great idea for a gal layout! fantastic!

but…one little thing. people will not sign up in equal numbers unless they are assigned to a specific faction. any plans on what to do when 1000 aliens go up against 500 humans? what if 750 of those aliens go inactive? if you assign players to the side with the fewest active players (maybe deleting inactives automaticly after x turns unless they entered some sort of ‘vacation mode’) it would keep the game balanced. but if they signed up to play with their friends they may be dissappointed to end up playing against them.

maybe an option to either be assigned or to choose? hoping that enough people will be willing to be assigned to keep it balanced? meh?

btw. you guys should get a medal. >hugz<

Rylan

I’m wondering how blind accessible these new navigation options will be? I’ve played dg since close to its beginning and had no problem with the way navigation took place. With the new linear approach coming up with strategies for fleet movements might be a bit more difficult for me if the maps are completely graphical. Perhaps there is an easy way to put text labels on the gateway planets of each system saying which adgacent systems they lead to it might solve the problem. If you need any help or further input, send me an email. :)

Leave a Reply