Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUDs
➜ MUD Design Concepts
➜ How to store running effects?
How to store running effects?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Serenity
(18 posts) Bio
|
Date
| Wed 09 Dec 2009 12:16 PM (UTC) |
Message
| Hi,
I'm trying to store running effects (spells, buffs...) to
persistant storage (disk, sql), so that when a player logs out after having drunk an expensive potion that should last an hour, he/she still gets the remaining time after relogging.
My system uses lua to implement effects and stores them under a runtime ID at runtime. Since some effects have scripts (with pauses in them), i'm at a loss on how to store this.
How does Aardwolf mud do this?
The same would hold for quests (kill x/x mobs, etc)
| Top |
|
Posted by
| Wjmurdick
(13 posts) Bio
|
Date
| Reply #1 on Wed 09 Dec 2009 06:11 PM (UTC) |
Message
| Well, the best way (taking a page from large-scale MMOs) would be to create the effects and quests as templates, each with their own ID. And then only store that ID and any relevant non-persistent data.
So, for example, a spell effect that buffs the character's strength by +10 and lasts for 600 seconds might be created as effect #105. When you store it on the player you would only need to store two bits of data (ID=105, TimeLeft=N). The rest wouldn't change from login to login.
Same goes for quests. The only data you need to store is data relevant to the particular character, such as what quest step they are on, how many mobs they killed on that step, etc. You don't need to store the full quest itself since it doesn't change.
As for the format, you might consider storing it in pseudo-xml.
<effect>
<id value=105/>
<timeLeft value=119/>
</effect>
| Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
10,782 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top