Slick Forums

Discuss the Slick 2D Library
It is currently Sat May 25, 2013 2:38 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: FourX
PostPosted: Mon Nov 28, 2011 12:43 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
Hi everyone, this time I'm here to ask some feedback from you guys for a new game (codename: FourX).

Image

for now what I have:
- random system generator,
- random planet generator,
- user can select system and see on bottom of the screen system details
- system name
- star's type
- race on this system
- planets list with maximum popolation, type of the planet and bonuses (food, industrial, science)

any ideas, feedback, thoughts are welcome!

In particular how to organize gui, how to generate a galaxy, etc...


images from freeorion :D

reference: master of orion 1&2, freeorion, sword of the star and so on...

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Mon Nov 28, 2011 12:45 pm 
Offline

Joined: Mon Nov 07, 2011 11:22 am
Posts: 10
lol i was thinking about such a game... create your own galaxie ; )

nice idea :>


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Mon Nov 28, 2011 12:56 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
I'm not alone (see here).

Problem for now is how to create a galaxy with stars and display to player :(

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Mon Nov 28, 2011 1:02 pm 
Offline

Joined: Mon Nov 07, 2011 11:22 am
Posts: 10
?

dont get it :D a mini map or what?


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Mon Nov 28, 2011 1:20 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
minimap could be a nice addition :D

For star placement problem.
I have decided to generate systems first and then place in game screen. First using random coordinate, then using a bsp tree to divide space screen, but for now result isn't good. So a feedback about that is appreciated

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Mon Nov 28, 2011 2:48 pm 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
There is this nice but old article over at Gamasutra:
http://www.gamasutra.com/view/feature/3377/algorithms_for_an_infinite_universe.php

Might give you one or the other idea?

Are you thinking 2D or 3D galaxy?

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Mon Nov 28, 2011 3:54 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
Thanks a lot!

A 2d universe, 3d is too much for me now

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Tue Nov 29, 2011 9:52 pm 
Offline
User avatar

Joined: Fri Oct 07, 2011 11:05 pm
Posts: 97
Location: France, Nantes
Great! I am working on a similar kind of game, yours looks really good!

_________________
"The Keeper is aware. The Keeper understands. The Keeper has seen the enemy."


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Wed Nov 30, 2011 8:08 am 
Offline

Joined: Wed Sep 07, 2011 5:02 pm
Posts: 36
Location: Netherlands
As to generating a galaxy, I found it very difficult to generate a galaxy of a specific shape. One approach that worked quite well was to use a "probability map" kind of approach.

To get an evenly distributed starmap I'd use the following approach:
1. Select a random position on the map
2. Check if any other star is too close
3. If not, place the star, otherwise go to 1
Repeat until you got enough stars.

Very simple, but usually works just fine. Now, the "probability map" makes this a bit more complicated. For this you need an image file of the shape of the galaxy you want. For example, a 128x128 image with a black background and the galaxy shape in shades of grey and white. Each pixel of the map then represents the probability that a star will be present in the area of the map covered by the pixel (i.e. black pixels = no stars, white pixels = many stars, grey pixels = some stars).

Generating a star map would then rougly go as follows:
1. Select a random position on the map
2. Get a normalized R,G or B value (i.e. 0f to 1f) of the pixel that corresponds to the selected position. We'll call this the "pixel value"
3. If (random.nextFloat() < pixelValue) check for close stars and place the star
Repeat until you got enough stars.

Ofcourse this is not an efficient algorithm at all, but map generators do not need to be. And you'll still need to add space lanes and stuff. But I don't really like wormholes or space lanes anyway (is it a coïncidence that the Master of Orion series went down the drain as soon as space lanes appeared?), so that's not a problem for me :)

Anyway, using this approach (and some toying with paint.net) it was quite easy to generate all kind of complex galaxy shapes, from clusters to spirals. And it didn't requite too fancy mathematics.

_________________
Researcher & game development hobbyist.
http://www.grunnt.nl


Top
 Profile  
 
 Post subject: Re: FourX
PostPosted: Sun Dec 11, 2011 4:50 am 
Offline

Joined: Thu Sep 01, 2011 10:15 pm
Posts: 31
Location: United States
Lol. I'm also working on a 4X based game. Is yours realtime or turn based?

For generating a circular galaxy in mine I used the following approach.

1. Set a max distance + 2000
2. Pick a direction.
3. pick a random distance along that direction up to the max distance.
4. Is this location too close to another star, if yes then goto 1. If no, place planet and goto 2.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group