Spellcaster Studios

Make it happen…

Just a quick update…

As updates to the blog are being a bit sporadic, a little explanation is in order…

I’ve started work on a new company, in game development… The problem with most new companies is that things are always really busy, getting contracts, financing, the instability of it all, etc, etc, etc, and as such, I’ve been working really hard, with no time beyond that to work on Gateway or any of my other projects and hobbies…

So, while this doesn’t mark the end of my projects, it will take me a while to be able to dedicate some time to them again, especially in this first month!

Things will go back to normal one way or the other! :)

Until then, just keep looking into the blog or on the Facebook page for some more info!

Caves

Today I squashed an old bug…

I had a cave planet whose generation ended up being this:

screen727

So the player couldn’t get out of the initial drop zone!

I have a lot of code to try to prevent this sort of thing, but sometimes some stuff falls through the cracks… That’s actually one of the big problems of procedural generation: you either have very boring and similar areas, or you risk having bad gameplay situations.

 

Continue reading →

Documents

As most (all?) coders in the world, I hate writing documentation…

That’s what I did today, to finish off my work for OldJob™… So, I’m theoretically done with it (although I probably have some bugs to fix still, but let’s see)!

Next couple of days I’m going to finish getting ready for my NewJob™, go on a short vacation, then I’m getting some friends over for a week while starting the NewJob™…

So, I’ll have a busy couple of weeks, and I don’t expect much to get done on Gateway, so expect the blog posts to be a bit more sporadic!

Now listening to “Legend of the Shadowking” by “Freedom Call”

Finishing the old work…

Today I finished getting my lab ready (well, it’s never really ready, but close enough):

IMG_0003

I’ve installed Linux Mint, but it has some issues with my friend Synergy… Hopefully I’ll be able to fix them and still use it, since it’s quite nice (at least until now)…

Anyway, I’m finishing my work for my old employer… Just need to write some documentation to pass over the code, which will be quite boring… Disappointed smile Hopefully tomorrow I’ll be able to finish this and say goodbye once and for all! My heart really isn’t in this anymore!

Now listening to “Colony” by “In Flames”

Doing some multitasking…

So working on two things at the same time: getting a Linux Mint install to work properly, and finding a good way to debug/profile compute shaders…

Decided to try Linux Mint because I ran into a problem with some updates on Ubuntu 14.04… It’s not the first time this happens. I install something on Ubuntu and something breaks down and I spend several hours trying to figure out how to recover from it… This time, it was once too much, so I decided to try something different.

Unfortunately, when I try to install the NVidia drivers from their site something goes wrong and I get stuck on the login screen… I think it has something to do with how I’m uninstalling the nouveau drivers. For now, I’m leaving the drivers as is, since I need to do some work for my OldJob™ and I require a working Linux machine for it.

At the same time, I’m also trying to figure a good way to profile compute shaders. I got AMD’s GPU PerfStudio working, and it provides me some good info (apparently my reduce shader is taking 2ms to reduce 33 million elements), but this doesn’t account for retrieving the actual data, because everytime I add the code to lock the output buffer (through a Map method), it crashes the PerfStudio server…

So, not sure on how to proceed on that… Don’t see anybody else on the Internet with this issue, but I’ll keep on looking… Disappointed smile

Now listening to “Dreams and Imaginations” by “Two Steps From Hell”

More Compute Shaders

After getting compute shaders working properly yesterday, decided to check some profiling…

After some moving code around, got some rudimentary profiling working. In terms of CPU flow, running the compute shader to sum 33 million elements took about 0.2 ms (against 37ms of CPU time)… This looks great, in theory…

But the reality is way more complicated…

Untitled

This sort of commands are asynchronous, which means that when I run a compute shader, it’s not running immediately… It just gets placed in a queue for consumption later, so the time it takes me to actually setup the operations is what I’m measuring… So, if I want to do a bit more accurate measuring, I have to actually fetch the results. Here we hit a huge bottleneck in PCs: reading from the GPU to the CPU…

My initial work was pointing to 7 ms to fetch the result, which is way too much!

After some mucking around, I figured out this the time waiting on a result to be ready; but here is where things get tricky… For example, if I run a Present() command, that time goes down a bit (but that could be just because the present itself takes some time)… But if I do 2 Presents, the time goes to zero, and there’s no way 2 presents take those 7 ms! Even weirder, it seems that if I do a sleep of one second, the data is not ready as well..

My working theory is that the compute shader is not taking that long to run, but it only is marked as “done” (so the results can be fetched) when I do the Present call… So after the first present, the data is not ready yet… But when I do the second present, the data is there, and that’s why the time goes down to zero…

Although this is a theory that could explain some of the practical results, I’m not happy with it… There’s still some stuff that doesn’t jog with it… For example, if I do only one present, preceded by a sleep, it should have the data ready for me, but it doesn’t…

Anyway, I’ll investigate this in greater depth, and I’m going to see if I can find any tool that can give me some performance measurement on the GPU calls…

Now listening to “Roots” by “Sepultura”

Compute Shaders

Started today with compute shaders… The concepts behind them are a bit weird at first, especially the relation between threads and groups, read/write orders, barriers, etc…

Anyway, I made some headway and I have a naïve compute shader that sums all elements of an array… Impressive, I know, but it’s a start… Now I can expand that, optimize it and make a better framework for tests…

Work on Gateway has been stalled because I’m preparing my new job and finishing off the old one… Time is a commodity! Disappointed smile

DirectX 11

Continuing to learn stuff I’ll need for my new job… Today it was a day for learning DirectX 11… This wasn’t that hard, since I’m very experienced with DirectX 9.0, and 11 is not that different… It’s just a bit more organized in places, and there’s some new concepts (which I usually implemented at a different level anyway).

So I created a small framework to learn DirectX 11, especially compute shaders (although I haven’t started that yet).

image

Wonderful, I know! I’m focused on the compute shader part, not the rendering, so that’s good enough for now… Smile

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

Physics in UE4

Started working with physics on UE4, combined with making a small physics-based game…

Untitled

The game will consiste of a platform and some cubes falling on it, and the player has to use it’s own weight to balance it… pretty simple stuff, but it should provide me with enough stuff to keep me busy learning UE4.

Physics are relatively simple to make work, although I had some issues with using a scaled sphere as a platform, since it didn’t register the collisions properly… Think the problem was the scaling, but that seems odds in an established engine like UE4…

The shadows on UE4 are also annoying me… they seem to work worse than the ones on SurgeEditor, which is odd:

UE4_Shadows

There’s probably some hidden parameters that makes this work well, but I’ll be damned if I can find them!

Now listening to “Oceanborn” by “Nightwish”

More UE4

Still learning UE4… Ran through most of the tutorials and the development/programmer guides, so I have a good grasp on how things work (although I couldn’t actually do anything by myself yet)…

Untitled

Now I have three things I can do:

  • Try to build a small game using UE4
  • Learn PhysX (that will be important in my future work)
  • Learn ComputeShaders (that will also be important in my future work)

I’m thinking a good idea might be to combine the first and the second: build a small game that uses physics, but I’m afraid that will be a bit complicated to start off…

I’ll sleep on it and see what I feel like doing tomorrow! Smile

Now listening to “Massive Addictive” by “Amaranthe”