• Register
Post news Report RSS Galaxial: Recent Updates #4

Some of the features I have been working on for Galaxial over the past week, including asteroids, salvaging and rendering optimisation.

Posted by on

Asteroid Colour Variations

Added some slight colour variations to asteroids of the same rarity (common, precious etc.) so that they are now different shades of the original colour. I think this makes them look a bit more varied and realistic. It doesnt look that different from the screenshots below, but its a lot more noticeable actually in-game.


(With colour variation)


(What asteroids looked like before)

Also created an extra asteroid set to add some more variation, so that you dont notice asteroid graphics being repeated as often.


Sector and Galaxy Colours

Fine tuned the sector and galaxy background colours as some of them seemed either too bright or dull. I also re-written most of the code and the data file format so that its simpler to modify them or add extra colours through modding.

Railgun and Salvaging Modules

Started to create the visual effects for railguns and salvaging modules. I had to re-write most of the engine/missile trail code so that it could be used for other more general purpose effects. The railgun projectiles will leave a faint trail behind them. It's not quite finished yet so theres no screenshot of the railgun effects.

With salvaging modules fitted, a ship will be able to reclaim resources from the wreckage left over from battle. Once the salvaging module has finished working on a part of wreckage, the reclaimed resources get put into the ships cargo and they can then unload them at a colony. The player controlled ship also needs to be able to do this, so wreckage objects have to become targetable (with the mouse) for the salvaging modules to work.

This could become a problem as I dont want wreckage to become in the way when you are trying to select an enemy ship that is behind it. Smaller objects are always rendered in front of larger ones.
I will be working further on wreckage salvaging this week.

Rendering Optimisation

Spent a bit of time profiling and optimising the object rendering code (ships, asteroids, wreckage) now that I have finished making changes to them and made some small improvements to the overall framerate.

All the objects are rendered using the Painters Algorithm which is rather inefficient. This makes it incredibly difficult to batch objects and render them all in one go. There is a lot of texture swapping and individual draw calls for each object.

Earlier in the development of the game I experimented rendering objects using the z-buffer. It didnt work very well and introduced artifacts and sharp edges around the depth mask for each object. All objects require transparency sorting, so have to use the painters algorithm for rendering.
Although the rendering technique is rather inefficient it still runs very fast, even on the older graphics cards I tested on.

For example, I ran the stress test on an older laptop which has an Intel Celeron T3500 (2.1 ghz, 2 cores) with a Geforce 8200m (not great for gaming) and the framerate was stable between 40 and 70 FPS, depending on how zoomed out the camera is. Not so good when v-sync was turned on, as it then went down to 30.

The stress test scenario has 50 sectors with 100 ships fighting at the same time in each of them (5,000 total) Ship movement, AI and combat is simulated in full detail even when you are not in the same sector to see it.

Compared with my development computer which is 4 years old now (AMD Phenom X4 9950, Geforce GTX 260) it runs the same stress test between 110 and 220 FPS. Thats with v-sync disabled and max settings.

Older single core CPU's likely wont run Galaxial very well. Especially the games with larger galaxies that have many thousands of ships. The game is heavily multi-threaded and will benefit greatly from a (fast) 2 core or 4 core processor.


Development Blog: www.stuart-morgan.blogspot.com
Twitter: @stuart_morgan

Post comment Comments
Igncom1
Igncom1 - - 654 comments

Nice work.

Reply Good karma Bad karma+3 votes
abbalo
abbalo - - 60 comments

i'll be sure to give this game a try

Reply Good karma Bad karma+3 votes
Bombasticator
Bombasticator - - 9 comments

Very Nice, I love how everything is coming along!

Reply Good karma Bad karma+2 votes
evgenidb
evgenidb - - 372 comments

For the colors of the asteroids you could do the following - the further behind they are - the darker they are, i.e. the asteroids above would be brighter than those right behind them. So, you can make 3-4 layers of asteroids and each one below would be noticeably darker.

As for salvaging, I remember a game called Freelancer where you salvage by pressing a key and it automatically attracts the loot nearby. In your game you can do it the same way or just by pressing/holding a key and then the desired loot. If you need to attack/defend then you just release the loot key and you can shoot normally instead of looting.

Reply Good karma Bad karma+2 votes
StuartMorgan Author
StuartMorgan - - 81 comments

Some good ideas. I tried your asteroid layers suggestion but it didnt quite look right.

Larger objects are always at the back and smaller ones in front. So that meant asteroids of the same type where always the same colour, which didnt look as natural and random as in the first screenshot.

Holding a key to be able to target wreckage could solve accidently selecting it during a battle. So I will give that a try if it becomes too much of a problem, thanks!

Reply Good karma+1 vote
ranger10700
ranger10700 - - 59 comments

Also another method for the problem with salvaging. Perhaps when in a battle, the game is in a battle state so all wreckage are just objects and then once the battle is over, the wreckage becomes salvageable. I don't thinl anyone who would salvage during a fight.

Reply Good karma Bad karma+1 vote
evgenidb
evgenidb - - 372 comments

Why not? This way you can raid a fight right in the middle of it, steal as much loot as you can get/hold before someone spots you, and then run as fast as the engines can allow it to the nearest friendly base! :)

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: