Spellcaster Studios

Make it happen…

Behind the scenes: bug-fixing

Not much to talk about today (at least nothing interesting)… It was mainly a bug-tracking/killing day…

Some issues with the management of missions (which would sometimes cause for duplicate missions to show up), plus the sneaky ninja that wouldn’t cross the area boundary (which sucks!) and some other small stuff…

I expect tomorrow I’ll be doing more of the same, unfortunately… Making new stuff is much more fun than fixing existing features!

Now listening to “Irrational Anthems” by “Skyclad”

Link of the Day: This looks interesting, a more “story-driven” FTL… Hopefully it plays as well as it looks!

Silly bugs…

Found another bug with the game related to the new multithreading system: sometimes, at a certain point in the game, ninjas spawn to chase the player. Before, when the player changed area, the ninja would spawn again, but now they don’t, because they haven’t been destroyed (the previous area is still in RAM).

I’ve adjusted the code to account for this, but it’s not working and I can’t figure out why… So time for some more debugging…

Also fixed some minor issues, including fixing the smoke bomb effect when the ninjas appear:

screen546

Not 100% happy with it, but I’ll probably tweak it some more in the future…

Now listening to “Origins” by “Eluveitie”

Task underestimation

Scheduling and task management is something I could never do just right, I always tend to underestimate the effort, even if I multiply the times by two or even three… I probably think I’m smarter than I actually am! Smile

Anyway, today was one of those tasks… I thought that reviewing the scanner effect would take me 20 minutes tops, ended up taking the whole evening, all because in a place I had the parameters in the order “normal, right, up”, and on another I had “right, up, normal”, but this took me forever to notice!

screen544

The new effect looks way better, though… Smile

In the process I found a lot of small bugs (unrelated), so that’s my next step, fixing those bugs before moving to something that might be fun or hell: creating random names for the planets! Smile

Now listening to “Blackstar One” by “Celldweller”

Optimization: Shader Cache

The shader system on “Cantrip” has some sophistication to it, and part of it is the fact that it generates the specific necessary shaders from a uber-shader (a big shader full of conditions) and a render environment that trims that uber-shader to smaller ones, depending on need…

The problem with this approach is that everytime there’s a new shader requested (for example, a 3d model with a point light and a spot light on it, with two texture maps and no normals), the system has to generate a shader, which sometimes leads to a small stall (a shader takes some milliseconds to generate)…

So I’ve added a shader cache. I can’t store the generated shaders (well, on Direct3D I could store the byte code, but even that would cause issues, and in OpenGL I don’t even have that possibility), so I store the second-best thing: the generation parameters, so when the game starts, the system will generate all the shaders that might be needed for the game, preventing the gameplay stalls…

This works rather well, and allows for a more fluid gaming experience, and the expense of a slightly larger startup time (some seconds only). Just my initial setup (not all shaders accounted, this list will grow automatically, so I don’t have to see every permutation I’m using) has 110 shaders and takes about 15 seconds…

No screenshot though, this is all done on code! Smile

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

Polishing the caves…

Working on the caves, I found a lot of small bugs…

First, something I should have noticed before, but it really becomes apparent when you have no light: explosions have a light and that light was not being computed properly:

screen541

It ended up just being a bad setup of the structures for lighting, took me a while to figure it out, though…

Then, I found out that the terrain below the bridges in the chasms supported the character in thin air:

screen542

That’s not game breaking, but it was annoying… Since I wanted to remake the whole chasm/bridge part, I started that way and fixed that in the process…

Then I added the possibility of having caves with lava instead of chasms… It’s just cosmetic, but it looks nice to have some variety:

screen543

I’m still a bit undecided on what to do next (my task list isn’t shrinking as fast as I’d like, for everything I do, there’s another one that shows up!)… I want to see a glow effect and shadows on the spotlights, but that’s not really needed, so I think I’m moving that to the wishlist (like the realtime ice reflection, and the pixelated transitions).

So, moving onwards!

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

Polished the asteroid…

Not much to do here, to be honest… It’s an asteroid… Smile

First I remade the starfield… That had some issues, because I wanted to replace the points with something more pixelated:

screen538

Because of the way I had a flag defined, it conflicted with another one, so I had some weird effects while trying to make the billboards point towards the camera:

screen537

And the best one:

screen536

I like this one, it gave me the idea for a skybox for a futuristic, cyberspace game… Smile

Also ran into a small issue with the landing cutscene… when we’re on a dark planet, there’s no light so you can’t see the ship… First I tried using an emissive texture to make the window of the ship have some light, but even that way you couldn’t see it properly…

So I ended up adding a light to the hull of the ship…

screen539

It’s not brilliant, but it works… Cutscenes in procedural environments are hard!

Also fixed some bugs with the loader… Apparently, the SwapBuffers command on OpenGL returns immediately, even if it’s still rendering, which means that I didn’t have a fade out – it was too fast in rendering, and would miss the monitor refresh and would stutter along the way…

Next up: the cave area!

Now listening to “A Deeper Kind of Slumber” by “Tiamat”

Polishing the desert…

Not much to do here, the desert was rather good looking already and there’s not much you can add to a desert without making it look less desert-like… Smile

Anyway, had to fix a lot of bugs related to the oasis generation (it was linked to the lake generation, which was removed when I built a decent system for that)…

screen534

Next one on the list is the asteroid… I figure there’s not much to do there as well…

Now listening to “Rocket Ride” by “Edguy”

Done with the ice planet!

Today was a good day, finished the ice planet polish!

screen533

It also means I managed to make the cube maps work on OpenGL (had a nasty seam on the skybox until I found that I had to do glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS) to get seamless cube maps on OpenGL)…

So, we got snow, grass, and reflective ice, and I also fixed a lot of small bugs as well!

Next on my polish list is the desert planet, which I don’t think has much to do, just need to look around and see if there’s something that needs fixing/polishing…

Now listening to “Eternal Endless Infinity” by “Visions of Atlantis”

Link of the Day: So over the top, so awesome:

I have such meager skills for art…

Today I mostly worked on the skybox, trying to get a good result, that works nicely with the ground planet (for the reflection) and for the skybox…

This is the best I could do, glueing together several textures, etc:

screen532

It’s not bad, but too sparse, because I have to guarantee a fade out so we don’t see texture at the horizon (because there’s some buildings from one of the textures I used to build this one)…

Think I’ll have to bug the artist to build me the skybox, but at least the tech part is done on the Direct3D front… Now I need to make these shaders work on OpenGL, along with (shiver) cubemap support… Surprised smile

Now listening to “Mass Effect OST”

Ice planet work

Today I’m working on the ice planet polish…

First I wanted to make an ice shader, which means a reflection… Best way to get a cheap reflection is to use a prebaked cube map, but for that I have to add support for cube maps on Cantrip… For Direct3D, that’s already done, for OpenGL maybe tomorrow…

The shader just mixes the base texture of the ice with the lookup of the cubemap, and modulate both of them based on the alpha of the base texture (so we have more reflective areas than others)… I may add some sort of perturbation to the normal map, but I think that might be overkill for the purpose…

Adding snow was pretty easy as well, as well as grass:

screen531

Now I need to finish the skybox (the reflection is an overcast sky, so it should match), add scorch marks to the ice (it currently behaves like water, with a spray), and port all of this to OpenGL… A lot of work, but it’s going nicely…

Now listening to “Ki” by “Devin Townsend”