FGSL #002 : How I’m building the project

2014-10-15 3:30 PM

I thought to start out the series it might be worthwhile explaining how I’m going to build the fighting game.The game is being built using C++. No particular engine is being used, just a handful of libraries to help development. In the game’s current iteration I’m using the following api’s and libraries

  • OpenGL for rendering - GLFW for handling window management as well as keyboard and mouse input. - RapidJson for handling data mangement such as character frame data - ImGUI for handling debug gui elements

I’m using GLFW because I’m fairly familiar with the library. It’s a great way to get a window up so you can start focusing on your game and rendering code. I’m using OpenGL to render because it’s most familiar graphics API to me and I’d like to be able to target all the desktop OS’es at the very least. Right now I’m not being too careful about which spec I’mtargetingbut I’ll probably end up going for OpenGLES2 compliance since that’s the feature set I need and it tends to run on a lot of devices.

You can find out more about GLFW here :http://www.glfw.org/

RapidJson is the solution I chose when looking for Json soulutions via Google and various Json library comparison articles. I’m very happy with the library, it’s very easy to use. The reason I chose to use Json for data representation is really just so I can learn a new data definition format. I could have just as easily used XML but seeing as I’m very familiar with XML I figured I’d try something new. So far it’s working out great. I like the way you can declare arrays of data. Great for frame data definitions.

You can find out more about RapidJson here :https://github.com/miloyip/rapidjson

Here’s an example of some of the current frame data code definitions.

{

"looping": false,

"frame_data":
[
{
"lifespan": 72,
"hitbox_body":
{
"x": 10,
"y": 10,
"width": 150,
"height": 350
},
"hitbox_attack" :
[
{
"x": 100,
"y": 100,
"width": 45,
"height": 100,
"damage": 5,
"knockback" : 0.4
}
]
}, 

{
"lifespan": 114,
"hitbox_body":
{
"x": 10,
"y": 10,
"width": 150,
"height": 350
},
"hitbox_attack" :
[
 {
"x": 50,
"y": 100,
"width": 245,
"height": 50,
"damage": 5,
"knockback" : 0.4
}
]
}
]
}

```ImGUI is a simple immidiate mode GUI system that is renderer agnostic and took essentially no effort to get hooked up in my rendering pipeline. I need a lot of diagnostic information when developing this game and didn’t want to spend a bunch of time making GUI elements. This library fit my needs perfectly. Small and un-intrusive. Exactly what I want in a GUI library.

Here’s a screenshot of the game with debug consoles enabled.

You can find out more about imgui here :[https://github.com/ocornut/imgui](https://github.com/ocornut/imgui)

Tags: fgsl