Monday 27 July 2009

Message repeat bug fixed

This was one of the bugs that was around for a long time, because the lack of consistent thinking. But I have become better in that too, so I hope it's now fixed. The same bug is also present in Teemu, but it's not a crashing one. The routine just doesn't show repeating messages properly.

The thing with difficult bugs and features is that you have to fix them some day and it's really that hard to fix stuff that increases the time spent on a game project. If only everything was easy!

Wednesday 22 July 2009

LOS solved

Starting from Teemu's LOS routine I tried to transform it to Kaduria's block-sized output window. For some reason it didn't work. First I noticed artifacts in line drawing and there was a bug (<= should have been < in line length), but fixing that didn't solve the symmetry problem.

Then I discovered that in order to get symmetric result you have to draw lines in symmetric order from corners to center (previously tried to draw them with one sweep from one corner to another). So, you need eight line drawing sequences for each octet.

Using line drawing for LOS causes also the shallow slope problem which means the routine can't reveal everything, but always stops at wall. This can be solved with los fix -routine that scans for walls and other obstacles, checks if they are next to visible tile and pointing towards the player, then reveal them also if they are in darkness.

I believe the result is very fast LOS, because the tiles are visited roughly twice with line drawing and once with los fix. I'm also using an update map for tile drawing to prevent drawing black LOS tiles if there is already one in that place, so it reduces the amount of tiles output almost always when there is something in darkness.

Sunday 19 July 2009

Descriptions

New class Description loads and parses description texts which previously were in C++ files. It takes some files away from the project and speeds up the compile time, but now I can also edit descriptions at work as they are plain text files.

There certainly is some writing to be done. Lots of item descriptions are missing and while they don't really add anything significant to the gameplay I like the idea of verbose descriptions, because you can make the game world deeper with added details.