Clouds and Video

Finally, after around 3 months of hacking away late at nights, throwing up my hands in frustration and throwing away the first 3 implementations, I've finally made the volumetric cloud + atmosphere shader that I've dreamt about ever since starting this project.

The shader uses raymarching to render a volumetric noise field, and a rayleigh and mie scattering simulation to provide the lighting.   Everything is unified - the atmosphere, clouds and planet lighting - so reddening sun at sunset will light the terrain as well as the clouds, clouds cast shadows on objects flying beneath them, the atmosphere and clouds also render into the ambient cube-maps, meaning they reflect on objects and on water too!

Every planet has unique procedurally-generated cloud and atmosphere properties such as particulate density which impacts scattering, climate maps to designate where clouds are and which type.   The clouds themselves have programmable features such as height ranges, water density etc…

2019 Progress Retrospective

Happy 2020!

Games take a lot of work, especially ones like Pegwars with the enormous scope of being a universal sandbox.  Although I haven't made any blog posts in quite a while, I have indeed been working hard throughout 2019 on fixing many bugs and implementing various new features.

Highlights for the year are :

- A beautiful procedural volumetric cloud system, fully integrated into the atmosphere shading - that unfortunately is still way too slow and so has been removed for now.  These clouds just have to go in one day, they add so much to the game and I really must work out (hopefully in 2020) how to make them fast enough to be included for good.

- The UI has been rounded out and polished, bringing much of the meta-game into play.   Markets, Shipyards, the player's galactic Empire are now fully represented and playable.   3D Views are incorporated into the UI.

- Combat is finally fun, mainly due to the introduction of gimballed lasers.  Prior to this it was just too hard t…

Rendering Nebulae

New Nebulae

Recently I began replacing the old particle-based nebula standin with proper volumetric nebula shaders.  The nebulae need to be many and varied, and so I want to procedurally generate them like the rest of the universe.    After being introduced to some awesome volumetric nebula examples on ShaderToy, I thought I'd too have a play around with ray-tracing a noise field to create procedural nebulae.   The end result looks something like this :

Ray Tracing a Noise Field

The general algorithm for rendering a volumetric noise field:

- for each pixel on the screen, cast a ray from far to near (or near to far based on your needs)
- at each step, accumulate density by looking up procedural noise functions - in this case, a fractal brownian motion function.
- return the accumulated density, to be manipulated for the final pixel colour.

This is a very basic implementation of volumetric ray-tracing, and runs very slow for the output quality.  Optimising the shader to get the best …

Planetary Installations and HQs

I hope you all had a great 2018!  I've been hard at work on Pegwars whenever I get the time, which is not as often as I would like, and have made some great improvements that I'll detail over the coming weeks.   One such feature I have working now and would like to present a teaser of is Planetary Installations.

Planetary Installations

Imagine purchasing and equipping your frigate with some heavy planetary bombs, and seeking out an enemy planet. Hypering in, you orbit the planet with eyes out cockpit window for any valuable targets - depots, airports, perhaps even the enemy HQ.  Evading the orbital defences you plunge into the atmosphere over your target, only to discover ground-based defences surrounding it are now opening up on you.  You dodge and weave fearlessly through the laser artillery fire until expertly maneuvering into place to drop your bombs on the perfect trajectory to ultimately destroy the enemy installation, causing immediate political and economic damage to yo…

Gameplay Concepts

Over the last 6 months I've been working almost exclusively on new adding gameplay elements to enrich the overall game environment.  Some are general concepts, applicable to the main universal sandbox.   Others are more specific and fill out the lore of the gameworld.   Others such as missions, factions etc. are still to come.

Here are the last 6 months worth of gameplay concepts, in alphabetical order.

Air Resistance

When ships enter/leave atmospheres they encounter air resistance.   This is imparted as a drag on the physics of the ships, with the primary effects being reduction of top speed, and dampening of flight controls.

Ships may or may not come with wings, be careful flying into a planetary atmosphere without wings!

The intention is to impart air resistance to the damage model, causing ships entering an atmosphere too fast to burn up and be destroyed.


All game objects, be they ships, debris, asteroids, all have a bounty associated.   Destroy something and you will be …

Ship Dashboards

Here's a quick look at a prototype dashboard for spaceships.   Like everything else in the game so far, the artwork is 100% prototype.  In Pegwars, spaceships are like future cars, so I've modeled the prototype from an 80's classic sports car.   The 80's really was the bomb, I love it how car designers tried to get so futuristic for a period of time.

The gauges, from left to right :

- Hull Integrity
- Shields
- Engine Revs
- (Top) Set Speed
- (Bottom) Actual Speed
- Current Gravity Forces
- Power Usage
- Power Available

Left and right of the dash will be a couple of MFD's (multi-function displays) that the pilot can customise to display whatever info they like.

Beneath the speed readouts are a couple of icons that I haven't used yet, but the idea is they will function as 'check engine' lights much like in cars today.  Expect that when you are under heavy fire and damage to see a whole row of bright red icons indicating your ship is about to be well-and-…

Space Truckin'

One of the central tenets of the Pegwars universe is that the future is not so dissimilar to what we are familiar with now.   Spaceships are not outlandish things, they are merely futuristic cars.  Most are low-cost, practical and plain people-movers, most people just need transportation and will pay the lowest amount they can get away with for a vehicle that ticks the right boxes.

Some spaceships are enthusiasts' vehicles - sportships, where the fun of flying them outweighs the practicalities or the cost.  Modded ships.   Ships with cusom paintjobs.   Ships that should never have had spaceturbos installed but do.  Ships that are loved and adored by their owners.

And similar to future cars, businesses must truck on as well. Space trucks are the evolution into space of ordinary trucks - long distance haulers, flown by truckers and contractors.  A big powerful cab owned by a trucker, behind which cargo and trailers can be towed.

There was an awesome game called I-War 2  that had the…