Spellcaster Studios

Make it happen…

And boom!

Was working on the game when I got some funky rectangles on the screen… restarted the PC… and it was dead!

So, after a bit of mucking around, I’m about 80% sure the problem was the video card… I can boot in safe mode, and I uninstalled the video card driver, which in turn allowed me to go back into normal mode… Then I tried installing the driver again, and it wouldn’t start again…

I have an old Radeon 5850 that I can use on it, that’s about as good as the nVidia 465 GTX I normally use for development, so I should be good to go tomorrow… :\

Anyway, sucks… Was working on more multithreading stuff… Was using the water material with alpha for the windows on the Skydancer, and because of that, it now flows like water! Smile

Same goes for the engines, which use the lava material, but that one I want to play with a shader to get a better effect… Smile

Now listening to “The Computer Starting Over and Over While Typing This on the iPad”

More multithreading…

Think I finally squashed the last bugs caused by the multithreading system…

After a lot of logging, it was fairly easy to fix, the difficulty was finding out exactly where things were going wrong…

Also fixed a lot of small pending bugs (mostly waiting on things to go wrong with the multithreading), and added some new art:

screen527

Not happy with the new bushes, but I think it’s a right step… Personally, I think the color should be different, and have less detail… Also added the tents to the camps…

Now I need to add the preload to the planet navigation itself (so that the game starts creating a new planet as soon as we start moving towards it, with the possibility of aborting the generation halfway), and the OpenGL port of the multithreaded graphic resources manipulation…

Now listening to “Brothers In Arms” by “Dire Straits”

Ah, finally…

…I got some nasty bugs due to the multithreading…

Not totally unexpected, but I thought I was in the clear…

I added all the code to clear areas… To be well below the 1Gb RAM used, I store only a maximum of 5 areas in RAM, then I evict them… First I had some problems with deleting (it wasn’t multithread safe in regards to the renderer API, there’s meshes and textures to be deleted), and I had a lot of small bugs that was keeping me from figuring out exactly where the problems were…

Then I found some holes in the planet:

screen525

Finally I found that the problem was that some heights were negative, which led the holes you see…

screen526

The big issue I’m battling at the moment is a crash that I have in the game, that I have no idea where it comes from… It requires me to walk around the map a lot to happen, but I fear this one will be tricky to figure out, since the game runs terribly in debug mode with multithreading (debug without multithreading is a bit better). So, happy days… Disappointed smile

Still need to finish the scheduling of planet generation (related with the navigation console), and evict/abort the generated planets, the OpenGL version of this (just need to implement some functions).

Now listening to “Baldur” by “Skalmold”

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 the world generation connected to the hyperspace (which will force me to do the worse of it all: aborting some generation mid-way)…

Another day and I should have this up and running!

Now listening to “Halo OST”

Multithreading

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 making classes for threads and mutexes, and by changing the base generation code to use “requests” on graphical resources, instead of just creating them as needed…

I’ve actually implemented this at the vertex and index buffers, so that can be reused for other stuff in the future…

Next is to get the actual generation working in multi-threaded, but the system won’t work now, so no screenshot today! Smile

Now listening to “The Diary” by “The Gentle Storm”

AI state and more bugs

Today was mostly a bug-tracking day, with some polish to help me on this…

First thing I added was a display for the AI state… Now, when the player gets spotted by the enemies, it will get a visual queue… if the enemy loses the player, it will show the change again, etc… Considering the visual fidelity and the lack of other queues (animation, etc), this is a good compromise, and it helps me debug some issues, namely a pathfinding issue I was seeing…

It ended up not being anything, really, the enemies just lost line-of-sight and didn’t know where the player was, and the agro decay wasn’t working as fast as it should…

Also fixed the tracking system, so that it doesn’t show atmospherics on the map… Finally, fixed an old bug in which when the player took flight, the enemies would search for the player outside the game area, because they couldn’t detect the player’s position on the navigation mesh)…

All in all, a productive day!

screen524

Now listening to “Fallen” by “For My Pain”

Link of the Day: This is the sort of game I can see myself playing with VR:

Water splash and bug fixing

Today I added some more water effects, namely the “waves” when you walk in the water and the splash when you get in:

water_splash

It’s not very good, but I think it works…

Also added an effect for when lightning hits the water, instead of just leaving a scorch mark:

screen523

Then I had some bugs to fix, and laid some groundwork for the porting (replaced the explicit timer calls, which are OS dependent) for a function that can handle the pause.

And when I was almost done, I found yet another pathfinding bug, in which the drones stop hunting the player… Not sure why is that, but I decided the player need some feedback to know the state of the enemies (see if he’s been spotted, etc), so I’m adding that next!

Now listening to “End of an Empire” by “Celldweller”

Link of the Day: I love Harebrained Schemes since the excelent Shadowrun game… Besides a new Shadowrun game, and a tabletop game, they’re also working on Necropolis… Although I’m not a huge fan of roguelikes (I get tired after a bit), this one looks so cool:

Argh, more precision bugs!

The days started great… Added the “grass” shader to OpenGL, and added the option to hide the UI (great for screenshots), and was adding something pretty cool: water splashes when the player jumps or falls into water.

screen522

In the process, I found another silly precision bug (that of course, manifests if I switch renderers): when the player holds the jump key while in the water, on OpenGL it behaves as expected, but on D3D it would hover above the water!

After a lot of debugging (hard to do, because it’s an interactive thing, which means that I can’t use breakpoints, and debugger doesn’t work well with rivers), I finally found out the issue: a jump can only be triggered when the following conditions are met:

  • Height above the ground is smaller than 10cm
  • Vertical speed is zero

 

So, when we jump, there’s a point where the vertical velocity is zero: when we’re at the apex of the jump… That meant that if there’s terrain just below 10cm, it will be ready for another jump! On OpenGL, the vertical velocity would never be zero (it would be very small before going to negative, because of gravity), but on D3D (that sets the floating point unit to work with less precision), the velocity was zero, so a new jump could be triggered if we were just above the water, which happened…

So I had to add a very ugly piece of code, which checks if the velocity is more than zero and if the gravity effect would turn it into zero, it will set it to a very small negative value, to stop it from triggering a jump…

Alternatively, I could try to change the gravity strength so that it wouldn’t happen (risky), or use doubles (would cause the floating point unit to shift between normal and double precision, which could cause a real decrease in FPS).

This way is very hacky, but it works fine…

Now listening to “Undertow” by “Tool”

Link of the Day: This script looks awful… I know the movie it will be awful… But I need to watch it:

More grass

Worked a bit more on grass today… In the process I found a silly bug with the terrain generation:

screen519

The water over there should have a barrier making a basin… The reason for this was that the terrain around it was marked as “static” (because it’s rock), but it shouldn’t in this case… The result after the fix (which took me a bit, because I can’t use debug mode with rivers, it takes too long to generate):

screen520

Much better… Smile

Then I went back to the grass, wondering if the problem was the rendering or the texture… So I went online and found a random bush image and tried it out… The results were way better than I expected:

screen521

So I need to get the artist to make me some bushes (maybe a couple of different ones)… I’ve also added some vertex animation to get them swaying (it’s subtle, but I think it adds to the scene).

So now, it’s time for bugfixing and start work on the multi-threaded area generation (this one is going to be a big one, I think, since I don’t have multithreaded primitives in this framework).

Now listening to “Storm” by “Theatre of Tragedy”

Grass

Working on grass for the alien planet… Results are absolutely terrible!

First I tried putting in grass in a triangular pattern, so you could look at it from any angle (for cutscenes, mainly)…

screen515

The first problem shows up… The normal of one or two prongs will always be extra dark, which will cause the ugliness above…

So, moving on, I tried just using a quad aligned XY plane:

screen517

Bleargh! I can even animate the vertex, that won’t make a difference, that’s absolutely terrible!

Tried playing around with the texture, results were even worse:

screen516

And to add injury to insult, there’s a small issue that I can’t track down:

screen518

If you look at the marked places, it seems to be some UV issue, or interpolation issue, but I have no idea where that comes from… It’s always in the position in the texture, but I’ve looked and looked and looked at the texture and there’s nothing there that can explain that…

So currently, the grass is a bust… The problem might be primarily with the texture, so I’m going to look into that, but maybe the type of perspective the game uses doesn’t work with grass…

Now listening to “Powerhouse” by “Mustasch”