Time To You Em El. (UML)

To plan for the scene I’ll need to come up with a list of objects that will be needed and then put them into a class diagram.

  • Scene
  • Terrain (including volcano)
  • Lava mesh
  • Smoke particle
  • Lava bubble
  • Soot particle
  • Sky clouds
  • Tree
  • Light
  • Camera
  • Action (not really)

That’s basically it. Now let’s figure out how these relate to each other:


So basically the whole scene will be held in “Scene” and then the scene will be made up of a bunch of scene nodes parented to the root scene node. The UML shows how they all derive from each other

I think from here I can start coding. Which I’ll talk about in the next post.

Alpha, particles and GPU profiling

This week we learnt how much of a bitch transparency is because of how OpenGL decides which order to draw something.

You will see in games, even these days, sprites that have transparency in them, like leaves or water, get drawn in the wrong order.


I like particles.

We learnt how particle systems work and that the best way is to have single verts flying around and make the geometry shader convert them to billboards.

Usually particles are in the form of “billboards” which basically comes down to “thing will face camera”. There are particles that face the camera from both vertically and horizontally, and also billboards that face only on one axes. Like a barrell or a tree.

The other thing that was covered this week was “GPU PROFILING” which is basically looking at what the GPU is doing udsing nVidia programs and what not. nVidia tools look pretty neat.

This week I basically worked on my node class getting my planets to be attatched to the sun node and also rotate at their own local axis.


Silly Jupiter. WAT U DO. Y R U ON UR SIED?

This is what happens when you try and mess with the matrix’s 4th row and not change the rotation bits:



I also did a bit on vertex shaders. I had already done this but accidentally over-wrote it with another exercise and working on my lava because I’m a dumbass.

Playing around with the Y of the verts accidentally came up with this:


20130325023957It looks so smooth! Almost like looking at something under an electron microscope.

I eventually came up with this thing, which is what the exercise asks:



It looks more impressive when it’s animated.

Anyway… time for another week.


I done some photos

For my assignment, I’m doing a cloudy scene.

It turns out today is a cloudy day.

I took photos for reference.

photo 3 photo 1 photo 2The tree and the cars are good examples.

Basically the shadows are like “projector shadows” (just under the thing) and get darker the closer they are to contact (see in the car example).

This is probably similar to “skylight” effects. Basically what the blue colour of the sky does to shadows of things. Then there’s the light from the sun that casts the main solid shadow.

The thing is, though, you don’t really see the skylight make these sorts of shadows. I think it’s because the sun light almost over-writes this because it’s so bright. But maybe more realistic lighting might take this into consideration. Secondary lighting also (like sunlight bouncing off objects) probably add to this.

Silly sun. You so bright.

So yeah, this means that despite me wanting to actually do shadow maps, I might not be able to because they’d look out of place. Maybe I could get extra marks for a sexy inclusion shadow shader or something. HMMMMMM?



This week in class we learnt about animation. Something I’m keen on.

But in 3D it seems a lot more mathsy.

That’s a word now.

It’s basically all to do with:

  • “Hello, I’m a 3D model”
  • “Hello 3D mod L, I’m an abstract pile of maths that can be represented as a “bone” in a 3D model.”
  • “That sounds great abstract boner, what is your purpose?”
  • “I basically tell you how much of each vertice in your model is effected by me when I move!”
  • “Oh, shit, that sounds useful!”
  • “It sure, is 3D Mode L. I am also useful because you can create a bone structure and  put me into animations, then re-use my animations in an infinite number of models that are similar to my bone structure!”
  • “Oh wow that sounds a lot more useful than animating each model separately!”
  • “Yes, and it also means the programmer can change individual libs if he wants, like raise an arm or position a leg where he wants without having to create a whole new animation!”
  • “Great!”
  • “It is also useful for physics like rag dolls!”

Because this week I wanted to catch up on my shadow work, that’s what I did instead. Animation can be done later. Although this week we missed Wednesday because of the public holiday, and on Thursday I got sick, and took Friday off. I spent the weekend being sick and did some assignment work.

All and all a very non-productive week.

Probably should start my assignment

Ignore this intro

Hello blog. Hi Jimmy, said the blog. Wait…

Because I really hate reading boring articles and get distracted easily, I’m going to try and make all my posts as interesting as possible, and coenside this with the comments in my code.

I know a guy called Coen actually.

Organising the assignment

The first thing that needs to happen is getting a Visual Studio solution set up to run this game. This is probably the most fun part because it;s easy and you can’t cause bugs that take hours to complete.

Wrong. I have to do planning first.

  1. Come up with game idea
  2. Do planning and UMLs
  3. Prepare solution
  4. Write main code and get engine running without errors
  5. Create classes for objects and nodes etc.
  6. Create terrain using classes and generation
  7. Add lava and lava effects
  8. Add textures
  9. Add particles
  10. Add fine details like fog, extra shadows
  11. Tweaking things so they look special (the good kind)

My understanding of this ass iron mint

Basically make a demo scene with a camera that I can control to show it the F off.

It has to have:

  • A light
  • A camera
  • An FBX model
  • A shadow
  • Generated terrain
  • Particles
  • Basic scene graph
  • Everything textured and lit with lights properly

What I do

I’m planning on making a volcano scene. I was and still am inspired by the volcano level (Eridium Blight) in Borderlands 2. Here’s some pictures:



I sat there in Borderlands 2 for probably 30 minutes looking at the detail that went into this lava and I noticed the following:

  • The lava has a layer underneith that has a water/blur effect on it
  • There’s soot floating through the air that lands on your face (like snowflakes)
  • There’s smoke coming out of the lava
  • There’s heat waves
  • The lava texture flows in one direction rather than just sits there
  • The lava has a glow effect on it
  • There’s hot looking particles bubbling out of the lava
  • The lava mesh is slightly wavey and not just static

This is a lot better than the deadful lava in Starcraft II:

shit lava

OH GOD IT BURNS MY EYES. Not in a lava burn way, but a “I can’t stand to even look at it” way. It’s low resolution, doesn’t animate, and looks flat. It doesn’t even appear like it’s bright. It looks more like a Persian rug is coming up to destroy all my units and buildings.

My scene won’t actually have an erupting volcano, but I do want some particles coming out of it like black smoke, soot and bubbles of lava. Also snow-like soot like on Borderlands.

I now have the lava down pat. The next thing is the scene generation.

I plan on having a hight map generation using perlin noise, over the top of another map that contains the volcano’s “norm” shape. Something similar to the following:

rings of deth

Combined would look something like this:


Then, I’d add a plane of lava just around the lowest Y area and make sure the 2 hight maps together don’t go too low. You will notice that the centre of the volcano ring overlay is darker than the outside. This is the key to having the lava only in the volcano. It might even have a few rocks pointing out of the lava, which would be okay.


I don’t plan on generating the volcano ring (at this state, although it’d be possible because I just made it with an oval gradiant in Fireworks) but If I just use the image I could play around with the shape of the volcano, maybe give it some natural looking veins or something.

Lights and stuff

The light source will be a skylight coming from the sky, and an orange one coming from the volcano. This will ensure the inside of the volcano’s walls are lit up by the lava. There will also be a general diffuse colour around the rocks.

Because I want to do shadow maps, I’ll be adding in blurred shadows. This is because The scene is going to be cloudy.

FBX models

I’ve combed TurboSquid.com for trees. I thought that I could randomly place a set number of dead trees around the map (avoiding the volcano) using circle maths for distance. These should be textured, lit and cast shadows. Naturally.

Advanced features

For my advanced bit, I’m adding in advanced shadows because shadows are kick-ass like unicorns. So the light source is going to be a sun. Again, the scene is dark and cloudy, so I want to try and blur the shadows a bit to appear like ones in a cloudy-ish sky.

Other notes

The camera will just be a normal one much like the AIE Framework camera. WASD will move it, and the mouse will aim it. Nothing too fancy.

The scene will be set up using a scene graph. This will be represented by simply having all the trees as children to the landscape. It won’t be dramatically noticable but it will be made like that.

I’ll add a transparent, cloudy plane as the sky. If I have time (and can figure it out), I’ll add a skybox.

There will be a sort of fog in the game. This will make the landscape nicer and hopefully cut off the edges of the map so you can’t see the box where the hills are. The only issue with the fog would be the lighter parts of the map should shine through more than the darker ones. This will be a challenge. For example, looking at the sun through fog.

Gameboys are awesome

So I’ll start my blog thing by talking about Gameboys.

I was playing Kirby’s Dreamland 2 on Gameboy and decided that the game is amazing and almost like a perfect game. Great tileset, story, sounds, music and really nice world. Because the main characters and art style were created in Kirby’s Dreamland (the first one) the art style suits the gameboy really well compared to other games like Donkey Kong which used bad looking 3D models converted into sprites. Kirby is basically just a circle with eyes and round legs: easy to draw.

So, I looked at the graphics and tried to figure out how the tile-set worked and what they probably did to draw everything. I then recorded the sound directly from the emulator and ha da look at it in Sound Forge. The sound and music is really interesting. The sounds in the gameboy seem to have the volume of the waveforms locked on to about 7 levels and whne there’s no volume at all, the soundwave is right at the bottom of the negative part of the waveform. So I assume this is because they preogrammed the waveforms so they would have an offset of -7 db or something and then from that, use a single 3 bit number to push the wave higher. This also means the DC offset is wrong and when the sound starts and ends, because the wave is pushed down to the negative when there’s 0 volume, there is that pop noise. I assume this is what caused the tiny pop sound when you turned a gameboy on when having headphones plugged in.

With the graphics, I magined that most of the tiles were flipped and rotated with algorithms. This would save memory and it got me excited because I do enjoy compression and low-level programming with pixels. It’s just so simple compared to these day’s graphics.

Then it got me thinking, would it be as hard to make a Gameboy game as it was to make a Sega Megadrive game? Could I make it work on an emulator or even a real Gameboy?

Apparently not hard.

I looked up a bunch of sites, most of which were made around the year 2000, so a lot of the links didn’t work.. but I managed to download a C compiler for the Gameboy that outputs a .gb file that you could put in an emulator and run! Awesome!

So I played around with this, trying to get Notepad++ to compile it and managed to do this with a .bat file that ran the compiler and some variables that get get parsed into it. I assigned a button in Notepad++ that would compile the code with the compiler and run the game in an emulator.

This was awesome, but how do I do this in Vidsual Studio 2010?

No idea.

I managed to learn from teachers that I could set up Visual Studio to use Makefile settings and do it that way. Challenge accepted.