Spellcaster Studios

Make it happen…

Cache issue fixed

So the bug I found yesterday was cache related… The planet (including the flow map) was being regenerated when I went back to the ship, but the associated areas weren’t, so they were still drawing the old data…

Took me a bit to figure out, because I couldn’t do any debugging in debug mode, because the water courses are not generated in debug mode (it takes too long, and I don’t want to optimize it just because of debug mode and STL).

screen687

Now, I found another smallish issue (not a bug, a feature). Because of the occlusion stuff I’ve added (so we can see the player through walls), it displays the player’s legs when he’s in water (which I don’t want to).

The easy way to fix it would be to not render the water in the normal/depth buffer, but that makes me loose the decals I have when raindrops and the player moves… So I need to find something smarter to get around this…

Now listening to “Vine” by “The Man-Eating Tree”

Not much time…

This is recurring nowadays…

With my current work situation, and other personal issues, my time is pretty much limited to one hour or so of development per day, and that’s terrible, since that’s mostly the time I take to get “in the zone”.

So I usually start development on a day, late at night, find a bug (because in the current stage of the game development, that’s most of the work, while doing testing), and it takes me about 45 minutes to sort it, and then it’s time to finish up development for the day…

screen686

Now I’m having a problem with the water flow shader and multi-threaded generation… When I get to a planet first time it works, when I go back to it, the flow texture isn’t there… No idea why yet, but I just found this one about halfway in the development for today and I haven’t got the time to track it down…

Now listening to “Far From the Sun” by “Amorphis”

Crash analysis

Well, the crash I thought was gone wasn’t that gone…

Took me a bit to track it down, but finally I got it down…

At first, it seemed to be a memory corruption somewhere, but it only manifested itself on the Mac build. Activating memory guard and other helper debugging tools didn’t show any memory corruption, but the problem persisted…

Tons of logging later, I finally tracked it down to a glBindVertexArray(0) call, which seemed very odd, so I thought that maybe the pointer to glBindVertexArray was getting corrupted, but the logging didn’t support that…

As usual, it ended up being something simple… I was just calling glBindVertexArray from the wrong thread, instead of the OpenGL thread… And it only happened on Mac because apparently the driver is a bit more picky (under Linux and Windows, I can apparently do that, even if it is incorrect)…

So now, no more crashes and I can start finishing the polish of the Mac version so that I can send it over to the UI artist…

On other news, I’ve been working on getting a new job, got some nice leads (including a couple of ones in game development), but nothing concrete so far… So, if someone has a job for me, just let me know! Smile

Now listening to “Swallow” by “Heavenwood”

Link of the Day: Fractals are soooo pretty: https://vimeo.com/136642732

More static analysis

Finished up the static analysis and fixed all of the issues, except a real no-issue with an external library…

The crash I was getting on Mac seems to be gone as well, but I need more testing to make sure…

screen685

As I’ve mentioned, my life has taken a bit of turn in the last couple of months, so don’t be surprised if updates are a bit erratic for the coming month or so… I’ll be working on the game as much as I can, just not sure how much time I can dedicate… I also have a logistics problem, since the machine I use for Mac and Linux porting belongs to the company I currently work for and is closing down… I’m going to try to buy it from them (they’re old machines), but if I can’t, I’ll have to figure out some other solution for this problem…

Now I’m just fixing the initial part of the game, improving the sounds and adding a “shader quality” option on the game so I can get a working Mac build to the artist…

Now listening to “Vocalo Zanmai” by “Wagakki Band”

Link of the Day: An amazing presentation from Guerrila Games regarding the cloud system of Horizon Zero… Really neat stuff there: http://www.guerrilla-games.com/publications.html

Static analysis

I just found a neat tool on XCode, a static analysis tool, which provides me a list of potential problems in the code (null pointers, unused code paths, etc), so I’m cleaning up the code to address these issues…

There’s a lot of “false positives” (well, they aren’t exactly false positives, the problems might exist from a code perspective, but other pieces of code either handle this, or if they reach that state I have more serious problems than a crash), but they’re easy enough to clear…

So, that’s my day…

Now listening to “New Blood” by “Peter Gabriel”

Bug fixing: Mac Edition

Still working on finishing the Mac port…

I found some performance issues, and after a lot of work I figured the problem is mainly the ambient occlusion.

The Mac I’m using for testing is an i3 with a Radeon 5670 with 512Mb of RAM, so it’s not totally a surprise it performs terribly when I push the graphics fidelity up.

The ambient occlusion will be an option, though, so Mac users can turn it off (if they don’t have a better iMac than me), and I’m still going to play around with the ambient occlusion shader, see if I can optimize it (less samples, etc).

screen684

I can also make the game run at 30 FPS (that’s the minimum frame rate I’m getting) on the Mac, instead of the 60 FPS.

Also have a nasty crash (which only seems to happen on Mac, although I haven’t run full tests on Windows or Linux to make sure) which I never to address…

Now listening to “Blackwater Park” by “Opeth”

Still on hold…

Well, as you might have surmised from my last post, there was a serious problem in my family, a death to be more exact, and as such I’m not in the state of mind nor I have the time to work on Gateway for a while now…

Hopefully next week I’ll be able to come back to the game, maybe reveal the teaser trailer or something, but for now I’m incapable of working on it…

Stay tuned!

Finally fixed!

screen683

This was a tough one to track… Ended up using GL Monitor to list all the calls and looking at them in detail, trying to figure out what was happening there…

The problem was the redundant texture switch system.

To minimize texture changes, before I set a texture I see if that texture is already set on a texture unit, and don’t set it if it is… Here, it resulted in the issue (for reasons I’m not 100% sure on) because the ambient occlusion texture was not being setup except at the shader level (glUniform1i). As soon as I got rid of the redundancy test, it worked perfectly… As I said, not sure on what happens because of that (the texture was set), or why it only happens under Mac…

Now to play the beginning of the game under Linux to check for bugs and to package this so the artist can play it and test it and get a feel for it so I can start overhauling the UI.

Now listening to “Veto” by “Heaven Shall Burn”

Weird bug…

Today I was trying to finalize the Mac version so I could send it to the UI artist, and I found a really weird bug…

So, sometimes the ship landing looks like this:

screen682

So, first guess: shader… But this only happens on the Mac build, it works fine on the Linux and Windows build… Still, might be the shader, so I played around it… This is where things got freaky: sometimes I’d add a comment to the shader and it would work, others it would stay the same. Some times I’d change some code (skip a rendering pass or something), and it would work, others it would stay the same…

After a couple of hours, I still wasn’t clear on exactly what was causing the problem, except for the fact that it only happens to that particular object. The only difference between this object and the remaining ones is that this one has an additional texture to be used as emissive (which is what actually is displayed).

After a bit more tests, I arrive to another weird conclusion: the problem is timing dependent. If I fly from the Skydancer to the planet as soon as the save game loads, the ship displays properly and will display properly until I fly up and down again… If I wait some seconds in the Skydancer before flying down, it will display wrong…

I’m not exactly sure on what that means (can’t figure out a relation between time and the shader), but it’s another piece of the puzzle… Hopefully tomorrow I’ll be able to figure it out!

Now listening to “Hydra” by “Within Temptation”

Link of the Day: Whooooooo, Deadpool!