Another change in direction...

by Joe Flood on 15 January 2015

So, I've taken a step to the side. A sidestep.

Work on the game engine itself (Equinox), and the games based on it, has effectively been paused, and put to one side.

Why? You thought I loved making games?

Well - I do! But I've realised I need to target my games to Mac AND Windows. And so, I'm now making the engine build and run with both the world's most commonly used OSes:

  • The Mac version will continue to use CMake, allowing me to build from Xcode, command line, or something like CLion.
  • The (shelved) Linux version should be workable very simply based from the Mac version.
  • The Windows version will build through Visual Studio only, using binary versions of the libraries. 

So, the next few weeks will be spent building a toolchain to use on Windows to build and run games! 

Just need to work around some of MSVC's shortcomings - lack of constexpr, no list initialiser syntax in member vars, and very, very strange variable rules - I can't implicitly convert ints to floats in some situations, because it's narrowing (?! - no it's not!) 

More Tech!

by Joe Flood on 22 November 2014

It's been 2 months and there's no word on the blog; what's going on?!

Fair point.

You'll recall last time I mentioned that I was adding in sound support to our game engine, Equinox right?

Well, we did it! And it all now works amazingly which is fantastic, but there was a much more important subsystem that needed writing - text support!

As a showcase for this, I decided to make a simple word game using Equinox - and of course to do that, I needed to support fonts and text. So, without further ado, behold! Text!

Text Test

Doesn't look too great though as you can see, each letter is rendered at the same width, and they overlap in places. The waveyness (not a word, but I'm using it!) is intentional though, this demonstrated a pretty nifty Mexican wave effect when running!

So fast forward a week or so, and I've cleaned it all up and got it all working perfectly. AND I've put together a quick prototype game to show it off, as shown below:

Final Product
So how does this work, you ask? Well, very simply actually! Thanks to a very nice piece of freeware, I'm able to give it any TrueType/OpenType font, and get it to create a bitmap of it, like this:

Font
It also creates with it a file which describes where each character lives inside the font. Pretty neat, actually! You'll also notice it's white that's because the colour is added artificially using a shader program, so we can use any colour at runtime.

Okay, okay, but why didn't we just use something like opentype to render the fonts on-the-fly? Well, pretty much the only reason not to is just that it's simpler not to require another additional dependency, as this means more effort to port to other platforms. This is especially true since we're targeting everything from Windows to Mac to Linux to iOS and Android!

Phew - that was a huuuge blog post! So what's next? Next we'll be taking a very old 3D dungeon prototype and adding 2D GUIs into it! 

Why? Because the game engine doesn't support GUIs yet and we're going to need them!

Equinox Update

by Joe Flood on 27 September 2014

So we've paused Platformer2D. Why?

Well, I wanted to focus more on the game engine that powers it, Equinox. As I worked on Platformer2D, I realised a lot of things were missing from the engine most noticeably, it had no way of playing sounds!

So I added a sound engine to complement Equinox, and we're calling it Solstice! It allows me to play sounds (obviously!), but because it hooks in with the existing entity system, I can vary the pitch, volume, and more using Equinox's built-in animation system. This means we get easing functions for free too!

Code example of a wacky sounding pitch-change event:
using namespace equinox::solstice;
 
SoundEffect *frog = SoundEffect::Get("/Sounds/Frog.wav");
frog->Animate(EQAnimate(1000, frog->Pitch, 1.0f, 2.0f));
frog->Play();

For those of you that are not developers, this'll change the pitch of the sound from 1 (normal) to 2 (very fast/high pitched) over the period of 1 second. Nice!

Okay, so that's pretty cool, and of course it can play .mp3 files as background music which is neat too but want to know something way more exciting?

We can now build for iOS! The engine now builds and runs under iOS! However... while the engine runs, it shows a blank screen as we're not asking the OS for the correct version of OpenGL. Damn. Should be usable soon though!

Platformer Update!

by Joe Flood on 16 August 2014

Been a while!

Nothing too exciting to report on here, except for one thing libEquinox (our internal Game Engine!) now uses SDL2 under the hood instead of GLFW.

Why's that you ask?!

Well, GLFW is amazing, and I'd recommend it to anyone, but there's quite a hitch with it you can't use it with iOS or Android! We thought of this and created a plugin-based system where you could use various "window creators" for different platforms; however this proved too ridiculous to support and got really messy really quick!

However, SDL2 allows you to target any platform ever with the same code result! It also gives you access to other things like TTF font support, sound support, and lots of other little "nice to haves" (also notable: proper PS3 controller support!).

So, without further ado, I present to you Platformer2D running within SDL2, with SDL_ttf doing its stuff and showing a nice label for us:

Screenshot

The eagle-eyed amongst you will see that there's also a crazy ropey thing coming out of our little dude this is his ninja rope! The graphics are not final (thank god!), but this feature allows the poor guy to navigate our terrain (which now generates using cellular automata yum!)

Screenshot

And there's another shot showing another bit of terrain this time showing off scaling too the graphics scale to match the window size which is rather nice!

Watch out for much more coming soon!

8 Months of C++

by Joe Flood on 30 June 2014

Looks like I've been working in C++ for 8 months now... how time flies!

While a lot of people are moving away from C++ and towards "managed" languages like Java and C#, I'm staying native and this is why:

  1. You can compile and run almost anywhere, because there's no need for anyone to write interpreters (JVM, CLR, ...) for the language. (Okay, so the JVM and CLR are more JITted these days, but I'm sticking with "interpreters"!)
  2. It's actually a really, really nice language!
And I don't think I need to go much further than reason #2.

For example, I can do things like:

vec3 myVector = { 20, 10 };
vec3 myOtherVector = myVector + 20;

Which is rather nice. And I can do colours like this:

Colour red = 0xFF0000;
std::cout << "Red has " << red.R << " amount of red and " << red.G << " amount of green" << std::endl;

And last but not least, compare this in Java and C++:

Vector3f javaVector = someOtherObject.getPosition();
vec3 cppVector = someOtherObject->position();

What happens when I change javaVector now? someOtherObject is changed too because the 2 variables point to the same object (gah!). But when I change cppVector? Well, it was copied so someOtherObject is left well alone... yay!

Long live C++!

Next Page

©2012-2015 Javawag. All rights reserved.