Saturday, January 3, 2009

Plague 3.04

Today is a productive day!
  1. made zombie_massive turn faster
  2. draw_overlay for game_state and sims (bars, paths, indicators, etc)
  3. added health bars for zombie_hives
  4. reinstated sim indicators (as people dont like hunting zombies for ages), will make an option in the future so purists can turn indicators off
  5. stopped corpses going through blocks (turned on collision detection)
  6. made pickups square_project with blocks in collision
  7. added in trees to tech demo
  8. add fire to the tech demo


7 comments:

Anonymous said...

I just downloaded the .exe and tried this. I played a game for a few minutes, and almost completed the first level when the game crashed. Here's the logfile report:

Traceback (most recent call last):
File "main.py", line 839, in "module"
File "main.py", line 833, in load_menu
File "main.py", line 815, in load_instructions
File "main.py", line 831, in load_menu
File "main.py", line 820, in load_battle
File "main.py", line 833, in load_menu
File "main.py", line 815, in load_instructions
File "main.py", line 831, in load_menu
File "main.py", line 820, in load_battle
File "main.py", line 833, in load_menu
File "main.py", line 815, in load_instructions
File "main.py", line 831, in load_menu
File "main.py", line 820, in load_battle
File "main.py", line 831, in load_menu
File "main.py", line 819, in load_battle
File "engine.pyo", line 106, in start
File "engine.pyo", line 146, in __mainLoop
File "pygame\sprite.pyo", line 303, in update
File "simobject.pyo", line 1178, in update
pygame.error: SDL_ttf render failed

The error happened when I killed one of the super zombies, so I'm guessing that's related.

Benedict Carter said...

Odd. Looking at that it seems like you've played 4 games (or so) and then the game has failed to load a font. I'm guessing it ran out of memory. I've been trying to track down the memory leak but so far have been unsucessful. I recommend quitting (entirely) every game or two, until I find and fix the issue.

Anonymous said...

Well, speaking of memory leaks, I'd say the traceback is pretty clear about one of them. If you can tell the number of games I've played based on the traceback, then unnecessary data is being preserved in a way it shouldn't be.

If you want to record the order in which I opened the menu, started battles, and read the instructions, it's better to record that in an array, and include that array in the logfile report. That saves a lot of memory.

If you use one instance of load_menu to create load_instructions, you should either get rid of the old load_menu instance, or reuse it.

In this case, you can see that there were seven instances of load_menu, three instances of load_instructions, and four instances of load_battle. At most, there should only be one instance of each.

Anonymous said...

I just noticed another memory leak, but I'm not sure what's causing it. Try loading up Plague and starting a map. Press ctrl+alt+delete and watch the memory usage. On my computer, after the map was created, Plague took up about 140,000 kilobytes. In the time it took me to write this post, Plague has increased to 170,000 kilobytes.

Anonymous said...

I just noticed that when I start up Plague, without clicking on anything, it takes up about 40% of my CPU power; I'm using a 2.81 Ghz dual-core CPU.

When I put Plague in the background, it starts taking up 50% of my CPU power.

It seems to me that with all of this wasted CPU power, you could probably increase the FPS five times if you could find some way to make Plague stop wasting so much CPU power. I say this because if Plague normally uses 40% of my CPU power needlessly, then it's doing four times as much work as it does when it's processing the frames. I normally get a framerate of around 20 fps, so I think you could easily increase that to 100 fps.

I should also note that at the start screen, Plague consumes a maximum of 7,316 Kb. There's no memory leak at this part of the game. When I started the help screen, the memory consumption increased to a a maximum of 16,800 Kb, so there's no memory leak here either. When I returned to the start screen, memory consumption was at 20,996 Kb. After putting Plague in the background to type this, memory consumption went back down to 7,904 Kb.

Benedict Carter said...

wow, thats really great feedback. I have been working on rewriting the game_states to reuse them (so you can go to the menu without losing your game), but I thought that they would be garbage collected immediately.

It's also good to know that mem usage increases while the game is idling. It narrows down the potential leaks.

Benedict Carter said...

The "memory leak" continues even if windows doesnt report it under "mem usage"

http://mail.python.org/pipermail/python-bugs-list/2004-August/024741.html