Wednesday, March 2, 2016

Mobs and Combat Code

Originally the MUD was designed to use static monsters that would have a chance of re-spawning every so often. This was to give the appearance of movement, but it has limitations in combat. I decided to rip out the static code and go with moving monsters, or MOBS (mobile objects). This really enhanced the world within the MUD, especially when other monsters enter a room where you are already in the middle of combat.  One of the downsides of this was I needed to handle when these new monsters entered, and at this point I also realized a design flaw. During each combat round, players would only battle one monster while the others (if they weren't battling another player) would patiently wait their turn for battle.  While it's a very polite way to fight, it doesn't make for challenging combat.

So, over the past few days I ripped out all of the combat code and rewrote it so that every player in the room and every monster in the room get a chance during a combat round.  Not only did it make combat more challenging, it also allowed me to streamline the combat code considerably.

No comments:

Post a Comment