Wednesday, September 28, 2011

some updating

This game should get some game mechanics. But in order to test these i need a view to support the functionality i want to implement.
What i want first is the ability to build structures on planets and in space. I am currently trying to figure out the most efficient and maintainable way to do this, have to read up on my OOD which is a little rusty ^^.
I also was not completly happy with the procedural textures i provided for plantes and solarsystems, while i still have to figure out a way to render the solarsystems, i was able to improve the way planets are rendered.
I found a pretty nice note on this at http://angryoctopus.co.nz/, i especially liked that he takes the gradients from a file rather then defining them in code. this makes it easier and more visually comprehensive to create and read new planettypes, as i needed lots of them.

i still haven't figured out what the memory leak is all about. It appears as if the programm saves every rendered frame, the memory leakage greatly depends on the resolution my program has and increases whenever i alter the part of the galaxy i view, even when no planets are present which means no textures are even generated.

but now some nice screens :)




when a solarsystem is selected we switch so a solarsystem view, when a planet is selected, we go into planet view.
i want to implement a menu in planetview that allows the user to manage the planet, build stuff etc.
in the solarsystemview the ressources should be shown.
i want the user to be able to manage single planets from start, and as the game gets more complex, he can do 80% of the managing in solarsystemview.

regarding ressources i am not quite sure how i want to handle these. ressources in most games are units of something you can accumulate, like metal and crystal until you need them. i also want to add streaming ressources, like sciencepoints and energy. those ressources will be able to steam in solarsystems, so if you have energy + 10 on planet 1, you can share it with planet 2. there will also be research options to increase the usage of this network, making it possible to stream ressources to neighboring system.

this is it for ideas right now.

have fun

Sunday, September 25, 2011

I don't think this is normal ...

Ok, programm works great, solarsystems look much better now, but only in a wip sense, have to work on that.
But when i checked how much ram my program ate i was confused



i then checked for memory leaks but found nothing when i anaylzed the heap [ except that storing 4k solarsystems with ~9 stars inside of each with corresponding images eats quite a lot of ram ]

i went into an irc channel and checked it out further just to be relieved.
a user called djdduty [ thanks to you! ] tested my programm to reveal  it uses ~ 100 - 150MB of ram on his machine.


aparently i have a 32bit jre and jdk installed on my 64bit machine as well as the 64bit counterpart.
i have to use 64bit native interface for lwjgl because i have a 64bit machine and this appears to be the point where the magic happends that extends my ram usage by 13x times.

i might uninstall the 32bit jre&jdk to fix that, but as of now i can continue programm without worrying about the memory usage because 100+ mb seems totally ok for me. when i checked the heap i found out that all those little images eat not as much space as i thought, so i am on the safe site here as well.

Friday, September 23, 2011

StateBasedGame rocks :)

After some code mangling and re-factoring i finally managed to get it working the way it was BEFORE i started updating it.
Using states to program a game works great. you put every possible view into an own class and eventually create a very simplistic state machine for your game.
this way adding a menu screen, credits, options, main game view, research view and any other view is no problem and it probably saves on performance because you can control exactly what calculations you want in your update method and which not.
i started implementing the planet view, which will be the actual game view when you are managing your solar systems. I've added a screenshot that just shows a proof of concept. now i just have to figure out this.

Thursday, September 22, 2011

More coding

So, finally a few things are working now.
We have a fully procedural generated galaxies with randonly generated solarsystems that contain randomly generated planets. This is nice, especially because its quite scalable, i could just stack galaxies or make them bigger and it just works.

Grafix are working ok too, still looks very rudementary, but i could never finish anything if i would to the gfx myself, so randomly generated is good enough, maybe needs some tweaking.

The Screenshots i currently provide are actually only for debugging. Now i have to start writing more code to turn this debugging view into a State based game. Slick2D works great this way, at least as far as the examples and tutorials suggest.

What i need now is a sepereate view for research, solarsystems and planets which might take a few hours to complete :)

Monday, September 19, 2011

This looks much better :-D

this looks much better, but there might be some scaling factors that need some fixing, the big "planet" in the middle is supposed to be the sun. so some adjustment might be justified

Making progress

which is hard to visualize


now we generate solarsystems instead of planets, and while the generation of planets works fine, the sunsystems might need some tuning. The code for the planet generation was from Bonbon-Chan @ java-gaming.org, a forum that is a great help.

On another note, all the sunsystems are actual sunsystems with a randomly generated number of planets and different types of planets. i use a gaussian random from 0 to 1 and then multiply it with a maximum number of planets we want in a solarsystem.

on a technical note, smooth scrolling and zooming now works

Tuesday, September 13, 2011

so where am i

scrolling, zooming (barely) and the minimap works :) and seems to run quite snappy as well :D
i still have to figure out how to associate every mouseclick with the right planet to finally give this some meaning and the ability to start experimenting with buildings, ships and so on

Monday, September 12, 2011

Some progress...

Generation works good, Galaxy looks a bit blocky because it's currently rendered depending on its position in an array. Planets should have other options for placement then to check in an array, maybe something depending on the distance between planets.

The Planets should also replaced by Sunsystems that will render if zoomlevel is too high to show all planets. On high enough zoomlevel sunsystems are rendered as individual planets.



also resolution of the planets should be reduced.
funny enought, planets have different sizes, which is currently almost invisible.
the size of the planets is between 40 - 310, i calculate a scaling factor with  1 - 1 / sqrt(size) which should be improved

How to generate a galaxy

When i make a game about space, i need a space, preferably filled with solarsystems, astroids and all that stuff. Because i want it to be generated and not placed piece by piece i need some kind of reference what galaxies actually look like. Wikipedia helped me a lot, and there even was a nice image containing a top-down view on 6 types of galaxies.

At first the random generated galaxies looked quite "random", but in a noise kinda way. galaxies dont look like this. But there would be no point in generating a random map, then applying a large physics simulation just to create a credible looking galaxy.

When I first though about game developement i came across procedural generated landscapes, most of them using heightmaps. i didn't like those heightmaps because they dont give much variation in the landscape. But those heightmaps could be used to influence the generation of a galaxy. using the images above i could influence the random generation of my galaxy by giving the white value of a pixel a large part in the decision if a planet could be generated there or not.

Getting things started

I have been programming in java for about 3 - 4 years now and notices that i have never actually written a game. Sure, i've written a tetris clone, but most of the code was somebody elses so i'd better refer to it as a port.
I want to write my own game, brainstorm idea's, think about gameplay and visual style and disregard most of them just to make up new ones.

The basic layout currently is 4X - ish space game, based on lwjgl and slick2d.
As i am no artist and quite lazy, i want the game to generate as much ressources as possible for me. This might be possible with large structures as galaxies and sunsystems, but might need a little work when it comes to textures. It might not be a good idea to implement the audio system with this dogma, unless i want my game to sound like Schönberg utilizing a 56k modem to create music.

That's it for now.