Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Building a 4X game (WIP with pictures)  (Read 16045 times)
0 Members and 1 Guest are viewing this topic.
Offline lastaid

Junior Devvie

Projects: 1

« Posted 2011-09-19 14:35:50 »

I am currently working on a 4x-ish game, and find this forum extremly helpful.
i just wanted to post a few pictures and maybe get some feedback.

i am currently working on a base data structure together with a friend of mine, so the pictures might not reflect the actual game state, mostly because large parts of the code are just research and different planet types.
the pictures show a galaxy, which is generated randomly. the galaxy consists of sunsystems, those consist of planets.

let me know what you think, and maybe even visit my wip blog
Offline h3ckboy

JGO Coder

Medals: 5

« Reply #1 - Posted 2011-09-19 15:31:10 »

maybe showcase is better place? since u don't have a specific newby question.
Offline lastaid

Junior Devvie

Projects: 1

« Reply #2 - Posted 2011-09-19 15:35:35 »

maybe your right, didn't know if it is in the right state for showcase
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lastaid

Junior Devvie

Projects: 1

« Reply #3 - Posted 2011-09-28 10:01:10 »

Ok, i got some time to do some updating, i am putting everything on my blog.
I will also upload a current "playable" [ its not really playable, but you can explore the galaxy ]
currently a lot of stuff is borrowed or influenced by other peoples work, mostly the procedural ressources.

take a look at my blog and please post what you think of the current state and if oyu have any ideas Smiley

also pic Smiley

also the game
Offline philfrei
« Reply #4 - Posted 2011-09-28 23:20:07 »

Neat! Fun project.

I ran the program on my WinXP, Pentium 4, 3.2GHz, 3Gigs RAM.

It seems to take about 5 to 10 seconds for a screen to appear when I click in the "big view" window to go to a new location. Each new location adds a fair bit of RAM to the total being used, according to the Task Manager. If I just go to one screen of galazies and drill straight down to a planet, I can get there with only using about 50MB of RAM, but after a half dozen galaxy clicks I've more than doubled the RAM.

So, probably every Galaxy that is viewed is then preserved? And each has a significant overhead? Given the size of what you want to encode, I'm thinking you will want to look for efficiencies, for example, maybe that allow details to be reconstructed anew rather than preserving each and every detail between visits. Perhaps you are already doing this.

So, what is the latest news from the "Unlimited Detail" people?  Wink

Graphics are pretty neat, but I have a quibble with the orbits. You might check out "Bode's Law" and consider making the distances between planets less regular.

Is there a way yet to climb out of the planet view and back to the galaxies view? I couldn't find one.

music and music apps:
Offline lastaid

Junior Devvie

Projects: 1

« Reply #5 - Posted 2011-11-05 14:19:53 »

So i finally managed to care for my pet project again.
I first had to take a good look at the data structure and decided that it needed some modifications.
Currently the data structure consists of a single galaxy that contains a hashmap with solarsystems and its identifiers(keys). Every solarsystem consists of Astronomical Objects with completely incorrect distances to each other. After a post from "philfrei" who pointed me at "Bode's Law" i will probably do some research on this but for kow i want to extend the data structure.
What I did first was to instroduce the Universe, a data structure that contains galaxies. For this i had to rewrite the cascading data structure and i found that i could manage the data much better if i would have every planet, solarsystem and so on in the universe and just use the identifiers(keys) for reference in solarsystems and galaxies.

After this, i will start introducing some actual gameplay, currently placing structures on planets.

Will further update, but no nice screenshots for now.
Offline lastaid

Junior Devvie

Projects: 1

« Reply #6 - Posted 2011-11-08 20:00:22 »

As promised, some pictures. Finally something that looks like a game is emerging.
Building something finally works, although it completely ignores levels Cheesy

The ugly lines  in the second picture are the vias that will at some point enhance transportation between solarsystems.

I am off for now, updates will follow ^^

Offline lastaid

Junior Devvie

Projects: 1

« Reply #7 - Posted 2011-11-27 21:10:52 »


still working on that game ^^.

I could really need some help or a hint how to create a user interface i can render on the screen as an overlay. i imagine i would need something layered, so that i have my view in the background, but the ui as an overlay on top, and then check if a user interaction like a click was meant for the overlay, or the the underlying game part [ although this is still part of the user interface ].

i also used a technique which is probably VERY VERY bad, maybe you guys can help me out with this.

the minimap on the top right of the galaxyview is a Image that gets generated every time i move in the galaxyview. so everytime this happens i take the positions of all the stars, paint them in an imageBuffer, turn the imagebuffer into an image, then render the image onscreen. some help on this would be greatly appreciated.

now for some screenshots again Smiley, the game looks a little nicer now, i generate a background with stars that looks better then just black void. this background would still need some improvement, like nebulas etc, but i didn't figure out a way to create one, but it will probably involve noise and fractals Cheesy

please comment, i need some feedback on what to do and how to do it Smiley

Offline Gornova
« Reply #8 - Posted 2011-11-28 11:21:20 »

I'm also trying to build a 4x game with Slick 2d !
For now I have only systems and planets generation and my biggest problem is find a decent way to place systems in a galaxy form and create connections between them.

I've found your blog very good at this, do you plan to opensource your game code? Or maybe just galaxy generation code?

thanks in advance!

here link to my demo (WIP on Slick forum)

Blog | Last game Drone Swarm
Offline lastaid

Junior Devvie

Projects: 1

« Reply #9 - Posted 2011-11-28 23:09:32 »

Hi  Gornova,

as of now the generation code is quite messy, but i can break the steps down for you some time this week.
i have problems generating the vias [ this is what i call the lines between solarsystems or in your case planets ]
as of now, i dont use any sort of algorith, i just calculate a distance and if the distance is small énought roll a dice to generate a via. i want to use an algorith that creates small subsystems without to many unnecessary vias

as for the galaxy generation code:
i took an image from wikipedia containing galaxytypes
then i used the images like a heightmap to calculate a chance that a solarsystem is created at that point in the galaxy. i am pretty sure using an algorithm would work too, and i would prefer such a solution, but as of know this is all the "magic"

the solarsystems are generated random as well, as an array with stars that have an image that is generated with an algorithm and an angle to the sun as well as a distance.

i am not sure where i want to go with this game, so no source code yet.

you seem to go in the same direction, i really want to know how you did the user interface because i have no experience in doing this.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Gornova
« Reply #10 - Posted 2011-11-29 10:46:22 »

wtf, here the magic Cheesy thanks for explanation! I didn't get this first time on your blog!

There is around some tutorial about creating a galaxy (here and here and example, but I'm not able to do nothing good!
Any idea are welcome!

About interface:
I think I will use TWL ( for my project and trying to follow freeorion approach to interface (
This screenshot explain beauty of this approach:
- up part of the screen for fast summary of your empire (see starcraft and rts genre about this),
- you can navigate throught galaxy and game show you where you are (center of the screen), with navigation routes
- right widget for system summary and planets control

If you want to contact me for a more indeep (email maybe) compare about this topic, please send me a pm!

Blog | Last game Drone Swarm
Offline lastaid

Junior Devvie

Projects: 1

« Reply #11 - Posted 2011-11-29 15:09:30 »

Hey, while on a train ride i invested some time tweaking the generation of path between solarsystems.
Generating the 4000 Solarsystems with on avg. 9 planets only takes 1000ms at maximum. but the algorithm to produce nice ways between the solarsystems clocked in at 80seconds, after some tweaking at 5seconds.

it still looks like crap, so i will check some algorithms and ideas before i try again. another method might be generating all vias, then checking for intersecting lines and delete those, then check if all planets are connected [ if this is what you want ] generate new vias, try again. this would be quite unressourceful, so i need a better aproach. you can email me at: callmesascha [ ät ] gmail [ dot ] com and you are always welcome to place comments in my blog, its hard to get a blog rolling, especially with such a generic topic.

Offline Gornova
« Reply #12 - Posted 2011-11-29 19:23:34 »

I'm sending you and email Cheesy

Blog | Last game Drone Swarm
Offline uaequals_42

Junior Newbie

« Reply #13 - Posted 2012-02-21 05:35:47 »

Cool project.   Grin   Have you any new news about your progress?
Offline tberthel
« Reply #14 - Posted 2012-02-21 16:49:46 »

Very nice.  I especially like the medium zoom star systems pic.

Pages: [1]
  ignore  |  Print  

hadezbladez (730 views)
2018-11-16 13:46:03

hadezbladez (366 views)
2018-11-16 13:41:33

hadezbladez (717 views)
2018-11-16 13:35:35

hadezbladez (183 views)
2018-11-16 13:32:03

EgonOlsen (2378 views)
2018-06-10 19:43:48

EgonOlsen (2532 views)
2018-06-10 19:43:44

EgonOlsen (1469 views)
2018-06-10 19:43:20

DesertCoockie (2134 views)
2018-05-13 18:23:11

nelsongames (1930 views)
2018-04-24 18:15:36

nelsongames (2612 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!