Saturday, March 22, 2008
Crash fix & Game Speed Limit.
I’ve fixed the crash that could occur when the player where standing in the upper lef corner of the map.
I’ve also made an attempt to limit the game speed so that it will run at the same speed no matter how fast the CPU is. Though as I’m limited to just one computer at the moment I’ve been unable to test if the solution really works on other CPU’s, but as the game now reads the CPU speed from the registry it should work.
Here’s the latest version of the game:
Dragonia Demo - version 1.02
Tuesday, March 18, 2008
Bug Detected!
I’ve detected a bug that appears sometimes when the player is standing in the top left corner of the map, it causes the game to crash while an AI agent is searching for a path, but this bug can appear even when they doesn’t target the player so I haven’t been able to locate the source of this bug yet.
Thursday, March 13, 2008
Flee State Discarded & Small AI Optimizing/Bug Fix!
Well, after trying out the result of the flee state I noticed that once the AI agents attempts to flee they are always killed almost instantly as the maps really are far too small to have any “safe” locations. Now that I’ve removed the flee state however they seem to survive slightly longer.
I’ve also optimized the AI a little to make the game more fun and I’ve finally found and fixed two AI bugs where, one where they ran into a wall an wasted all energy by attacking it and one where they kept walking back and forth on the same spot for about 1 - 3 sec every once in a while. There is however one additional bug witch I still haven’t solved, this bug is very rare (witch makes it harder to locate) but it may crash the game on occasions, it seems that this bug only appear sometimes when the player is standing in the top left corner of the map and one or more of the AI agents are targeting him.
Now I’ve just got the last 3 weapon effects, the AI version of the curse effect and the remaining basic sprites left to do in order to reach the minimum requirements.
Monday, March 10, 2008
Frame Rate & Crashes Fixed!
Well, the huge drop of the frame rate seems to be caused by using more than one thread since the frame rate went back to 60 fps once I moved all calculations to the main thread and removed the AI thread. So now the game runs at rather nice again. By removing the AI thread I also removed the remaining bugs as they only occur when the threads where writing and reading certain variables at the same time. There is however another bug I’ve noticed witch causes random projectiles to spawn and move at random locations, this new bug only occur when there is more than one AI agent activated and one or more of them have died, so I guess that they aren’t stopped correctly, but at least this bug doesn’t crash the game. :)
Due to the result of this fix I can now activate all available AI opponents without risking to reach a frame rate below 10. But I’ll need to adjust their behavior so that they’ll actually do what they are supposed to do and to allow them to target each other instead of locking their choice of target to the player (to avoid unfair 3 vs 1 fights).
Here’s a picture of a 3 wizards vs 1 wizard screenshot:
![]()
(Green, Purple & Orange vs Blue(Player))
Once I’ve finished the last two ranger sprites & the 4 knight sprites I’ll be able to take screenshots of more variating battles where the other’s ain’t represented by white squares.
I’ve also changed some timers to avoid unnecessary updates of AI / Player to ensure that the frame rate stays at 60 fps (witch is the highest fps allowed as I’ve caped it there).
As the bugs and frame rate issues are fixed, I can now continue with the game.
I’m closing in on the minimum requirements specified in the design document but as I’ve already added a little more than what I first chose as minimum requirements (more than one class etc) I’ve now set a slightly higher minimum requirement for the game.
Thing’s left for the new minimum requirement:
- AI:
- AI Flee State
- AI version of the Curse effect
- Include Traps, Snares & Players for the AI map (I might skip traps & snares for the AI map though)
Game Play: - Weapon effects for the three last weapons (Force, Throw Object & Trap Object)
Graphics: - Last two basic Ranger character sprites
- The four basic Knight character sprites
- The four basic Knight weapon sprites
I won’t be able to add sound, more advanced AI and other wanted extra features before the MS 3 delivery due to lack of time, but I’ll try to add as much of them as possible after MS 3.
Tuesday, March 4, 2008
Frame Rate Issue!
Well, I’ve solved most bugs on the AI by moving the updating of their avatar’s to the main thread, but unfortunately this have lowered the fps to around 45 frames per second (was 63 fps before). So I’m considering to move the rendering to a thread of it’s own to reduce the load on the main thread, though by doing this I’ll need to change the way that the renderer currently reads the data to render or I’ll have random crashes there as well. Currently the renderer reads the data directly from the map class witch means that if the data changes on the main thread then the renderer may attempt to read the data while it’s being written witch is the same as the AI thread does when it causes the game to crash.
Moving the rendering to another thread might also fix the terrible huge fps drop when I add more than one AI opponent (currently drops to about 10 - 15 fps when I’ve added all 3 opponents). Each AI agent runs on a thread of its own but they do increase the work load of the renderer. And currently I’ve not really fine tuned the AI load balance (i.e ensure that all the AI agent function updates one at a time at a nice rate to avoid sudden drops of frame rate).
As for the remaining bugs that still crashes the game at random I’ll need to fix a way to ensure that the data they read ain’t being written at the same time within the main thread. Maybe by making a variable that only updates at a certain rate that ensures all users get enough time to use it before it updates.