[MUD-Dev] Ticks?

Derek Licciardi kressilac at insightBB.com
Sun Jun 9 22:09:20 New Zealand Standard Time 2002

From: Anderson, David

> What have other people done for regenning?  I'm just doing my best
> to have it make a bit more sense.

What you do during each heartbeat is something that is very specific
to the gameplay you are trying to achieve.  I would think that you
would be hard pressed to find any one idea from this list that is a
total "solution" as there are really no solutions to your question.

That said, you're correct in your assumption that processing would
go up if you did your healing in combat rounds, though I am not sure
it is necessary.  When I was coding Dikus, combat was processed at a
certain tick and healing was processed at another tick.  The entire
mud itself did not run on combat rounds as you would suggest here.
Only combat ran on combat rounds where a round was a specific tick
in the main loop processing.  So with the Dikus I worked on there
was really no way we could get to a more granular level of healing
without modifying the tick count or adding additional healing

If you choose to use a combat round as your tick interval, I would
highly suggest using some sort of list system for healing.  When you
need to heal all those PCs and NPCs having them placed on a list
allows you to remove a check to see if the NPC or PC actually needs
healing.  Manage the adding and removing of the pointers in the list
at the time that you know they need healing or are done healing.  We
found that this could speed performance considerably as the list
gets longer from increase players...  I would only assume that the
more frequently you process the NPC/PCs for healing, the more
beneficial a list would be.

I hope this helps.


ps I am not a Java programmer by any stretch so your mileage may
vary.  The theory behind this should be solid enough for you to
start with.

MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list