Onslaught The Game

A game that I will be working on (Onslaught). Here is the GDD Link.

Azura Engine

I finally coded Azura to a level that it can be put up on Github. There are still many pending fixes, but the current code sets a skeleton for the future code commits.

It uses:

  • Boost Lib
  • Effects11 (or FX11)
  • Direct3D 11

So far it is pretty generic and takes a lot of inspiration from Unity. Learning Unity side by side was really helpful as it showcased the way Unity implements Component behavior which is similar to Azura's Property behavior.

Here are some initial outlines:

Read more

Game Feel - Terrain

While building terrain, I realized that it looked a lot basic and mundane, here is a tiny example of how I improved my terrain's "game feel":

Original Terrain:

Game Feel - Basic

Added Decorations:
Decorations make the game a little beautiful, with the added props like rocks or foliage.

Game Feel - Props

Added Grass Variations:
Added some grass variations so the terrain doesn't always look flat.
Game Feel - Grass

More Variations?
Some variations include:

  • Wind effects to grass
  • More flat grass tile textures
  • More background elements like background walls etc. fitting to the theme

Direct3D and Effects11

Those trying out DirectX via Frank D. Luna's Book (3D Game Programming) would be a little confused because the book occasionally mentions the use of Effects 11 (from the start itself you link the Effects11.lib).

When this book was written DirectX had already a pre-built version of Effects11 Library. But after going through a few blog posts at MSDN, I came across this porting guide. It basically says that the Effects 11 Lib was removed and moved to a new Library FX11.

By default, If you're on a Windows 8+ you will have issues building this book's code. One way I thought was best to pull and build the FX11 from Source and Link it. However the repo is far ahead and different from the original code that Frank was referring to.

One of the biggest change was that the "fx_5_0" shader profile is no longer compatible with Windows 10 and the book often recommends using that very same shader:
// This will not work
HRESULT hr = D3DX11CompileEffectFromFile(L"Effects/color.fx", 0, 0, 0, "fx_5_0", shaderFlags, 0, 0, &compiledShader, &compilationMsgs, 0);

// to fix this, pass nullptr in the shader profile as fx_5_0 is deprecated, and use it as:
HRESULT hr = D3DX11CompileEffectFromFile(L"Effects/color.fx", nullptr, 0, shaderFlags, 0, m_d3dDevice.Get(), &mFX, nullptr)

// and in your effects file:
use Vertex Shader vs_4_0_level_9_1
use Pixel Shader ps_4_0_level_9_1

Effects11 is a very nice way to provide re-usable shaders. It generates the them from the effects file automatically and saves redundancy of shader files. For example, we can use the uniform function variables to specify stuff like Lighting Levels, Shadow Levels etc. and generate multiple "techniques" with different levels of each property.

Some art too ...

Moving forward in the capstone project. Some pixel art I made in a few hours through Asperite.

Marine Sprite Idle

Some basic idle animation frames. Looks a little funny (well that's what you expect from a programmer)

Handling Overload in Erlang/OTP

Great article (pretty long) on handling and also probing for overload in Erlang/OTP applications.

Course Update: Advanced Movements for 2D Platfomer

I was working on a small Mario style 2D platformer. For the project capstone, I was to modify the game significantly. Being a programmer and not a good artist, I took a sprite sheet online and worked in making a couple of things like Player Movements. The course already taught Jump and Double Jump. I added two more movements: Crouch and Climbing.

Here is a modified animation showcasing the flow and the FSM.

Crouching (C Keyboard or X on Xbox):

Crouch Movement

Climbing (Up/W Keyboard or LS-Up on Xbox):

Climb Movement

Here is the FSM ...
Read more

Generic Game Timer / Stopwatch

Sharing some early code about the game timer in my DX11 Engine. The reason why I built a new Timer is because here are the implementations available:

1. Microsoft ships a generic StepTimer.h with each DX11 Project
But it has some issues like you can't pause the timer and resume it at will. Furthermore, it's just a Stopwatch not a Timer.

2. Frank D. Luna's GameTimer
This is a slightly better implementation than Microsoft's Timer. But it lacks the Timer and Callback functionality, however it provides Pause and Resume for Stopwatch mode.

Here is my Version:

  • Timer or Stopwatch as per the Configuration
  • Start, Pause, Resume, Stop
  • Callbacks for Each Tick
  • Callback when Timer has Elapsed (only for Timer Mode)

It's so generic that I can use it for many things like animations, timed stuff like bombs, item timers, level timers etc. I have shared the initial code on gist (embedded below). It may change later on, but not that much.

Read more

Elixir - Managing WebSockets while hot upgrading

Found this gem:

Really interesting when he explains how he creates a connection proxy and service migration (Like Table Service). So Old Clients always go to old code and New Clients to new code. No need to manage backwards compatibility when the server itself are different instances!

ScaledC - Perlin2D

Finally a free Sunday, with no hackathons, no company work & no university related work.

I started coding a rough implementation of Perlin in 2D.
Since I am porting ScaledJS to C++, need two things:
1) Port the Algorithms
2) Port the Edge Detector & Terrain Selector

Here is an initial generation algorithm for Perlin on ScaledC (C++). It's really easy once you get to know the algorithm.

Here is a brief idea of what each function does (main ones):
Generator::GenerateMap - Generates a Noisy Map for a given set of Dimensions. (We can switch Algorithms here, like introduce DiamondSquare etc.)

Generator::Perlin - This is the Main Function for Perlin, It rotates through each octave, adds it to the total (for a x,y point). Each octave's participation in the overall value is determined by Amplitude (Persistence from the user's side)

Generator::generatePerlin - Main Business Logic of Perlin Noise - for a particular sample point x,y

Generator::perlinGradientFunc - Holds the Dot Product values and determines which dot product to use based on the permutation array

Generator::perlinFade - Smooths the value to near integral values

The Code Usage is given below.

Read more