[MUD-Dev] Ticks?
Draymoor a Vin il'Rogina
draymoor at cloud9.net
Wed Jun 12 15:11:45 CEST 2002
Sasha Hart Wrote
> Odd idea I tried a long time ago to deal with the CPU use issues
> you're dealing with: each time the player's health needs to be
> determined concretely, record the time. The next time it needs to
> be done, take the difference between the current time and the
> saved time to see how many updates "should have" been done;
> multiply it by some small number and add those just before
> returning the new value.
I like this idea in theory. Very clean. But have you concidered what
to do if the rate of healing changes between calls to the health
update?
Imagine a person is resting, not doing anything, for 5 minutes, and
is healing. At 4 minutes, they get hungry, slowing the healing
rate. How does the function know that only 1 out of those 5 minutes
was at a slowed healing rate? In a text mud, this might be fixed by
the hunger report to the player forcing a prompt update. In a
graphical mud, however, it might pose some problems.
That said, I'll answer my own question. Whenever the healing rate
changes, a dummy call to the HP retrieval method could be used to
force an update of the HP.
Speaking of graphical muds, it seems like interpolated HP updates
might cause a problem there anyway. Currently in my own mud, I was
planning on sending updates to the client whenever a player's vital
stats (HP, Fatigue, etc) changed. If interpolation was used, it
seems a catch 22 would be created. HP doesn't heal until accessed,
and it's not accessed until it's changed. You'd never heal. Would
there be any way to make this work?
| Philip Loguinov
| Draymoor a Vin il'Rogina
| Head Coder/Admin: Nirvana Project
| http://drayworks.dhs.org
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list