The title says I did a new speed calculation system, so I better go into that also. The old system used to be:
- All monsters get updated
- The player return True, meaning it did something
- The game loops trough all the monsters
- The world object divides the monsters speed by the players speed to determine how many moves it gets
- The world calls AIturn that many times
- AIturn adds event to the monsters event quire depending on AI calculations (For the player object, this list is filled with keyboard input)
- The world calls AIturn that many times
The problem with that approach is that time is only counted for the amount of times its AI gets updated, but the player is being penalized for the amount of actions it takes. This mean monsters can take multiple actions per frame but the player can not. The AI should be based on a system where this doesn't happen, but never trust AI's. The AI coding was also more difficult because a lot of values where being checked that weren't important, like Event.Key when only Event.unicode was defined. You always had to check for everything
The new system works like this:
- All monsters get updated
- The player adds to its actions if it has a event
- The world object loops thew all objects
- if it has a action ready:
- add object.speed to object.action points
- if it has more then 0 action points:
- subtract the value of all the pending actions from its action points
- call process_actions()
Some other changes I made are: (I am using a lot of bullets today)
- Count armor in weight calculation (before, it would be lighter to wear some stuff)
- Make food more nutritious, so its actually possible to survive without starving
- A few improvements to AI
- reduce experience from eating food
- better text wrapping system, making printing using commas possible
- a few updated graphics (I didn't do this)
The next time I do something might be a few more month, so don't be surprised if you see nothing for some time. Be surprised if you see this in 2035 and it is still the last post.