Streamlining

                I made a fair bit of progress on the boxing game today and implemented a major change that should make for a better built program. In short: I switched opponent behavior from a threaded timer-based system over too one which uses the WX Timer object. In long:

                When I first started designing the game, I built a system which queued up all of a round’s behaviors at one time. Each of the punches, taunts, and unblocks basically received their own alarm, and when that alarm went off, the event attached to it was triggered. While the program ran smoothly  enough, it always gave me a huge number of trace backs—or errors—every time I prematurely shut it down. Each of the separate alarms was known as a thread, and when the program was closed, any threads that hadn’t yet been executed were cut, resulting in an error message for each one. I’m not certain if this really did anything bad, but it sure looked disconcerting when it happened.

                Partially because of this, I switched the program over to a new system today. Using a module called WX, I built in support for a single recurring timer that will handle all of my event management rather than placing the responsibility on dozens—sometimes hundreds—of separate timers. This single timer runs every tenth of a second, and when it runs it makes various checks to determine whether it should throw a punch, taunt the player, adjust fatigue and health, end the round, and a whole host of other functions.

                The second benefit to this new system is that it allows for on-the-fly changes to be made, including the aforementioned behavior system that people asked for. Because all behaviors aren’t laid out at the beginning of the round, they can be changed as needed.

                In order to really test things, though, I need to go back to the opponent creator and start building in support for the new system. In fact, I think I’ll start that now.

5 responses to “Streamlining

  1. I am certainly liking the sound of this, and it’s good to here the game is stil progressing.

    Opponent creation and conditions should be awsome, sinse it allows for lots of diversity in behaviour and in player management (especially the stat training thing), I look forward to creating some boxers for the game.

  2. Man can’t wait. Glad that things are going great.

  3. Finally i quit my day job, now i earn decent
    money on-line you should try too, just type in google
    – bluehand roulette system

  4. I see a lot of interesting posts on your page. You have to spend a lot of time
    writing, i know how to save you a lot of time, there is a tool that
    creates readable, google friendly posts in couple of minutes, just search in google – k2 unlimited content

  5. I read a lot of interesting content here. Probably you
    spend a lot of time writing, i know how to save
    you a lot of work, there is an online tool that
    creates readable, google friendly posts in minutes, just type in google – laranitas free
    content source

Leave a Reply

Your email address will not be published. Required fields are marked *