Spellcaster Studios

Make it happen…

The action mapper

Two things I was still missing from the core tech was the ability to redefine keys (not everyone likes my layout, of course, and people with keyboards different from QWERTY might have some difficulty using WASD), and controller support.

For both of these, I need to build an action mapper.

This is an abstraction layer that allows to say that the key associated with the action UP is ‘W’, and that moving the left analogue stick forward also has the same effect.

So today I spent it building the basis of this…

There’s still some problems to solve, especially regarding aiming… In the current game state, the mouse aims the shots… With a controller, I’d need to use the right analogue stick to aim, but then the player looses the verticality, which might be complicated in certain environments… Need to think this one through…

screen667

Also finished making my portfolio, if you want to take a look: http://www.shadowcovenant.com/portfolio. If you are interested in a game developer or software engineer, just give me a shout! Smile

Now listening to “Skills in Pills” by “Lindemann”

Link of the Day: This demo is pretty sweet, considering it’s done in a ZX Spectrum Enhanced:

Particle bugs…

Not much time for game development today… Since my professional life is a bit undecided at the moment, I’m taking some time to work on a portfolio and my CV, and see what’s out there…

Anyway, I did some work on a weird bug that I noticed on the Mac build (although it’s present on all builds):

screen665

The most attentive amongst you will notice that the particles are running behind the player, instead of the right position (in front of him)…

My first thought was a problem on the new inverse-Z pass, but the particles don’t use it, and the player won’t fail the Z test there (the particles don’t write to the Z-buffer)…

Then I thought it may be a problem with sorting (since the particles don’t get drawn on the Z-buffer, the player was being drawn afterwards and messing up the render)… Disabling the alpha pass from the player, solved the issue, but that’s no solution… So it looks like sorting, even if it didn’t make sense looking at the code, so time to fire up the debugger and confirm if my theory about the ordering…

And… I was wrong… The object is sent to the scene graph earlier, as I saw, but it gets queued on the blitter, which means that it actually gets drawn at the end!

Simple solution, force a flush that forces the pipeline to flush after a change of “type” of rendering (mesh to blit, or vice-versa), but only for the alpha-pass. It was on my list to alpha-sort things anyway, so that flags can be used for that as well…

screen666

And there, problem solved! Smile

Now listening to “The Battle” by “Allen/Lande”

Link of the Day: I love the visuals on this demo:

A lot of bug-fixing…

Today was the time for a lot of bug-fixing (you remember the list from yesterday?!):

– Bounding boxes now correct (they were screwing up on some tall objects, which led them to disappear before they should, instead of only off-screen).

– Sound issues were solved (including the combat music rolling in and out properly… Also added the menu music).

– Some tweaks on the cutscenes (ugly popping on some of them, taking too long to start).

– Invisible enemies no longer show up as occluded.

– Particles on the portal no longer disappear when overlapping the portal in screen space.

– Tweaked the first boss fight to make it a bit more interesting

– Fixed bug with animation selection based on camera orientation.

Still have plenty to fix, including a Mac-only issue, probably going through them tomorrow…

screen664

Now listening to “Star Rover” by “The Loveless”

Link of the Day: This looks like a nice Kickstarter… Cyberpunk adventure with a lot of minigames going around, that’s certainly my cup of tea: https://www.kickstarter.com/projects/syncbuildrun/vnext

Mac playthrough

Started the Mac playthrough, and it was glorious…

…in the sense that it lasted one cutscene, until I found a bug in the system and had to track it down!

It ended up being a multithreading bug (which didn’t show up on Windows due to the fact that Windows allows for locking a mutex twice from the same thread, but not referencing counting the mutex (so you can lock twice, but release only once, which can lead to weird behavior)).

After that was fixed, I started playing…

screen662

And this is the list of issues I’ve found (the handwritten stuff):

screen663

Most of it is quite simple, though, it’s real polish stuff…

The only one that kind of worries me is that SSAO looks terrible at a quarter resolution, but the Mac video card can’t take more resolution than that without becoming very slow… And removing the the SSAO is not an option, it looks terrible!

Anyway, in general it worked fine, so I’m relatively happy about the game…

Can’t say the same about other stuff, though… The company for which I work in my DayJob is shutting down it’s operations in Portugal, which came as a bit of a surprise, so I’m not 100% sure on what I’m going to do in the future… I have a lot of options, so not worried that much (including continuing to work on the same company, but in the HQ), but this will probably impact the development of Gateway, and it’s a massive disruption of my life… We’ll see…

Now listening to “Shatter Me” by “Lindsey Stirling”

More bug fixing

Today was mostly about fixing bugs in the different ports, adjusting small issues that arise from there, and fixing the broken audio system…

So, the result is:

screen661

Right side is the game running Windows (Direct3D), middle is Ubuntu 14.04 and left is iMac!

Everything is fully functional, from my tests…

Next step is seeing if I can play the initial areas on the Mac, so I can then send a build to the UI artist so he can start working on that, and I can move onto the rest of the small issues I still have…

Only three “big” tasks remaining (all optional really): glow shader, realtime reflections and controller support… Well, controller support is not optional, I really want to have that in the game…

Now listening to “Abyss Masterpiece” by “Heavenwood”

Link of the Day: Such a cool idea!

Mac port working!

Yeah, I got the Mac version working!

screen660

No sound for some reason (need to investigate), but working fine as far as I can see…

The weird part was that I was expecting to have to upgrade the shaders (I’m using version 1.40, which correspond to OpenGL 3.1, and this context is not backwards compatible), but apparently he can take it (like Linux)…

So now I have the game running in the three target platforms, even if it isn’t perfect or tested! Don’t think I ever done such a thing before! Smile

Now I need to do some tests and I can give this version to my UI artist so he can start playing around with it!

Now listening to “Shades of God” by “Paradise Lost”

OpenGL 3.2, Part “I don’t even know anymore”

So continuing on the work to port the game to OpenGL 3.2…

I fixed the issue with my Ubuntu (the upgrade screwed up the owner of a .XAuthority file, and reset my nVidia drivers, so a chown and a download later, I was back in business)…

Then the game decided to crash on “glGenSamplers”… But asking for the extension said the extension was there…

After some hunting around, it seems I have to activate a flag called “glewExperimental”, since the system on Linux sometimes queries the wrong driver, and returns the wrong value…

So, the game is working more or less fine on Linux again:

screen659

That stuff in the corner seems to be trash in one of the render targets, which I’m fairly sure I clear, so I’m not sure what happens there, but I’ll get to it soon…

Also have a problem with multi-threading… Sometimes a thread will crash because it tries to call a NULL virtual function… I think the problem is that the thread is starting too fast, so the rest of the setup of the object hasn’t happened yet (since it goes from lower in the class hierarchy to higher)… I’ll look at it later as well… It’s on the to-do… Smile

Now, back to the Mac, let’s see how it goes…

…and it doesn’t… Initialization went nicely, but I then had a crash because I forgot to change one thing on Recast (the navigation library)… I have to set the library to use virtual functions… So I set that (just change a #define macro), but then I can’t compile the game anymore:

Undefined symbols for architecture x86_64:
  "typeinfo for dtQueryFilter", referenced from:
      typeinfo for Recast_ScanPoint in ScanPoint.o
      typeinfo for Recast_EnemyQueryFilter in HostileSprite.o
      typeinfo for Recast_QueryFilter in PlanetArea.o
      typeinfo for Recast_RobotQueryFilter in Robot.o
      typeinfo for SandwormNavmeshQueryFilter in Sandworm.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Last time I had this error, the problem was a mismatch between the library and the code… In this case, I have no idea what this actually means… If I remove the virtual function, it works, if I keep it, it doesn’t… So I’m linking with the right library/includes (things change when I change those), but it seems the library is missing something…

Oh well, once more into the breach!

Now listening to “The Heroine Diaries Soundtrack” by “Sixx AM”

More OpenGL 3.2

So I figured out the issue… I didn’t have a “Vertex Array Object” associated to the rendering… It’s apparently the equivalent to Vertex Declarations on Direct3D…

It’s easy to fix when you figure out the problem, but OpenGL is remarkably hard to search for in the net, since there’s a lot of versions available, and most people apparently learned OpenGL by following some tutorials that don’t actually explain how things work internally, so a lot of people just add noise to discussions… There’s also a lot of noise with Direct3D, but it’s easier to sift through because of the ease of understanding which version is being discussed!

screen658

So, apparently I got OpenGL 3.2 working, no errors being reported (although I find it strange that it is compiling my 3.1 shaders…), so now to test this on Linux (just because my Ubuntu machine is closer at hand)…

…and it’s not working… The whole Ubuntu machine, I type in my login, and it gets back to the login screen… Apparently, according to the internet, that happens when drivers conflict (the nVidia and the Nouveau baseline), so now I have to work this out before I actually test it…

On the Mac, the game crashes on “glGenSamplers”… Bah!

Now listening to “Keeper of the Seven Keys” by “Helloween”

OpenGL 3.2

So I started working on porting the game from OpenGL 3.2 with backwards compatibility to OpenGL 3.2 without any backwards compatibility…

screen657

So, a lot of debug code and error checking…

This was the first result:

screen656

Not impressive… :\

So now I’m looking at what I’m missing there… The 2d part seems to work fine, the 3d gets all screwed up…

Now listening to “Whispering Jack” by “John Farnham”

Link of the Day: Hum… Raytraced shadows in realtime… *drool* We’re getting closer and closer to a GI solution for realtime 3d…

Mac port, Part 3

…and a big problem!

So, I got the game to compile, and link… Was a bit of work, but most of the hardest part was done before on the Linux port, since they’re very similar…

And then I find out that Yosemite (the current version of OSX) only supports OpenGL 3.2 (and upwards) and below OpenGL 3.0… So the version I’m using (OpenGL 3.2, backwards compatible for 3.1 shaders) doesn’t work!

And I don’t think it will be a small change to adapt the shaders for 3.2 (because I’m using GLSL Optimizer, which only goes until shaders 3.1), besides the fact that I also have other weird problems (which I think come from the version of OpenGL supported)… For example, glGenSamplers is crashing the game, so I’m guessing there’s also other changes (or it’s a problem with GLEW, need to figure out which one is it)…

So now I have to try and figure out exactly what will be the effort in supporting OpenGL 3.2 with no backward compatibility…

Now listening to “Tinnitus Sanctus” by “Edguy”