Spellcaster Studios

Make it happen…

Tag Archives: optimization

Raycasting optimization

Yesterday, while playing around with the beam cannon, I found some bugs on the collision detection, so today I dived right into that… The current method for raycasting on the voxel map is to do sampling: start at the beginning of the ray and walk through it, checking if it is a solid cell. Of […]

60 FPS!

Tadam! Found the issue with the frame rate… The game is running at a good framerate, but due to some old code, the frame rate got locked to 50 FPS, which in a normal monitor that refreshes at 60 Hz causes some jumps in the image… “So, Covenant, you just had to change a variable […]


I wasn’t happy with the performance of the game in certain points, with drops to 30 or 40 FPS, as measured by Fraps… So, I decided to dust off my profiling tools and try to figure out where were the bottlenecks, but when I was running the initial benchmarks I got a very strange issue: […]

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 […]

More multithreading

And another day without a screenshot… Mostly work behind the scenes, but it’s going along nicely… Already can generate areas in the background and they work fine… It’s a lot of work, but most of it has been smooth sailing (which is a bit unexpected)… Need to deal with some crashes (to be expected) and […]


Today I started tackling one of the big optimizations: multithreaded area generation and management… Multithreaded code is always hard, since it demands a lot of care on how to build stuff, and since graphic APIs don’t like working multithreaded (at least D3D9 doesn’t), I need to work around that limitation as well… So started with […]

More bugs down!

Today was mostly a bug-hunting day, but I had time to do other stuff… First things first, I removed one of the big bugs in the game: a raycast issue that would sometimes cause the game to freeze… This was very hard to detect, but after I found a way to replicate it consistently, it […]

Optimization: failed!

Today I spent my evening trying to optimize the map generation (when the player lands on a planet) and the area generation (when the player changes areas). The map generation takes about 15 seconds on a normal map (this can be a bit more or less, but this is a good average), which is very […]


Today I worked on some bug fixing and optimization, namely on the voxel raycasting… I already suspected that my raycasting function was a bit iffy and missed some intersections, but today I got to confirm that and to fix it, while optimizing it a lot… So yesterday, while in debug mode, the game would drop […]