The problem is not in gcc, because VC++ release compile also has the same bug: monsters just go somewhere and get stuck in walls. It could be uninitialized variable, because debug and release versions might have different values for them. I think I have to double check the routines that take direction as parameter, because some functions assume that it's a valid direction and nothing else.
Then there was a bug with endianess of wst file (my tile editor's native format). For some weird reason it's reversed in release version vs. debug version of VC++. I have no idea why. Anyway, I don't want to do anything more today. I wanted to release the game today, but this difference with release version was an unpleasant surprise.
Sunday, 7 December 2008
Test stories
I have tweaked items and monsters in Teemu and haven't yet won the game. I have included messages warning about hunger, but still I died two times in starvation. Maybe the food meter is too fast. I could slow down it a bit and make food items less powerful. What I like in this game is the way you can get in trouble fast if you make a mistake and I do mistakes a lot. This game is practically ready, but I still have to win it to release it.
Then there is one little thing to do.. I have to compile the project with DevC++ to get rid of Visual C++ dependency of .NET. GCC also has good optimization options. There are some VC-specific stuff I have to give an option for GCC, but I think it's going to be just couple of small things.
Actually it was just two warnings with -Wall. One was returning -1 from unsigned char return value and other was unused variable. That's all. I can't believe there were no other problems. It took about five minutes to set up the DevC++ project and compile it.
Then there is one little thing to do.. I have to compile the project with DevC++ to get rid of Visual C++ dependency of .NET. GCC also has good optimization options. There are some VC-specific stuff I have to give an option for GCC, but I think it's going to be just couple of small things.
Actually it was just two warnings with -Wall. One was returning -1 from unsigned char return value and other was unused variable. That's all. I can't believe there were no other problems. It took about five minutes to set up the DevC++ project and compile it.
Friday, 5 December 2008
Teemu ready for testing
Teemu is ready, only some minor details missing like level descriptions and maybe some game world interactions with new terrain tiles. I have an odd feeling now, because this will be my first game released in a long time and for a moment I was worrying how people will react to it when they may have certain expectations. Well, I can only blame myself for being such an ass with all that stuff about Kaduria and how it will become the next gen roguelike surpassing every major roguelike.
Thursday, 4 December 2008
Serialization part 4
There were two bugs in load game. First one was easy, I copy-pasted npc restoring code and there was old value from item restore loop so it tried to restore too many monsters. The second bug was a bit harder, but found when inspecting the load buffer size. I forgot to clear the std::string where data was stored before loading next piece of data, so the new data was added to the old string.
Load game seems to work now and I can concentrate on pathfinding routine.
Load game seems to work now and I can concentrate on pathfinding routine.
Wednesday, 3 December 2008
Serialization part 3
I'm testing the save and load game routines. Loading doesn't work, which wasn't that much of a surprise. It's giving me out of bounds error with std::string. It seems that I have to use a debugger for this one, which I rarely have to do, because usually I'm writing bug free code. I'd like to know more about Visual C++'s debugger, because I'm not that familiar with it. It seems to stop when player's data is loaded, but the traceback information shows that it's breaking in Level's load routine. Go figure, but stepping through the code should clear the confusion when it's actually crashing.
I already programmed today more than two hours so I think I'm going to do something else like home page for the game, so it's already there when the game is ready.
I already programmed today more than two hours so I think I'm going to do something else like home page for the game, so it's already there when the game is ready.
Tuesday, 2 December 2008
Serialization part 2
Save game routines are now ready. I'm taking this carefully, because I want to have bug free save and load routines. I'm constantly checking with hex editor that the save file contains proper data. I also wrote new packer routine for maps that are saved to reduce the amount of space they take in the save file. Loading is going to be more difficult, but I'm sure it will work fine without big problems.
The pathfinding problem is annoying, because I know from experience that I'm going to spend a lot of time to create it. There are also some bugs in throw routine, which has been difficult in Kaduria as well.
The pathfinding problem is annoying, because I know from experience that I'm going to spend a lot of time to create it. There are also some bugs in throw routine, which has been difficult in Kaduria as well.
Sunday, 30 November 2008
Serialization of Teemu
One of the reasons why Teemu is taking so long to finish is that I'm doing some of the routines first time. One of them is serialization. The first and easiest place to check how the load and save works was the scoreboard. I don't actually know how other people do serialization, because I usually become confused when I read source code programmed by some random dude.
I was thinking that it would be easier to save the number values as text, because then you don't have to worry about types. Arrays are saved as raw arrays, because they would take more space if saved in text mode (numbers separated by comma). The file mode is binary and it's always containing the next block size loaded in one piece.
I'm using a helper class named Tar_Ball to save and load data for objects. It's a low level class which makes load and save routines in object's class clean:
Now I just have to save the world. Game world, to be more specific.
I was thinking that it would be easier to save the number values as text, because then you don't have to worry about types. Arrays are saved as raw arrays, because they would take more space if saved in text mode (numbers separated by comma). The file mode is binary and it's always containing the next block size loaded in one piece.
I'm using a helper class named Tar_Ball to save and load data for objects. It's a low level class which makes load and save routines in object's class clean:
void Score::Save(K_File *f)
{
Tar_Ball tb;
for (int t=0; t<Max_Player_Name_Len; t++) tb.Put_Char(name[t]);
tb.Put(death_reason);
tb.Put(killed_by);
tb.Put(score);
tb.Save(f);
}
void Score::Load(K_File *f)
{
Tar_Ball tb;
tb.Load(f);
tb.Get_Next_String(name, Max_Player_Name_Len);
death_reason=tb.Get_Next_Value();
killed_by=tb.Get_Next_Value();
score=tb.Get_Next_Value();
}
Now I just have to save the world. Game world, to be more specific.
Subscribe to:
Posts (Atom)