Register forum user name Search FAQ

Gammon Forum

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 ➜ Questions about starting a new MUD codebase from scratch using Lua...

Questions about starting a new MUD codebase from scratch using Lua...

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3 

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #30 on Sat 06 Sep 2008 03:41 AM (UTC)
Message
You are of course correct -- I'm not sure why I said pointers earlier, since I store everything as IDs anyhow using your ID management table...

Nonetheless I still don't see why you would often need a persistent ID, i.e. one that lasts across reboots. Even in the case of the inventory plugin you mentioned, you only need it for one session.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #31 on Sat 06 Sep 2008 04:01 AM (UTC)
Message
The MUD might reboot, but the client still have inventory items cached in its memory. It would throw things out if they now referred to different things. This might especially happen on a hot boot, but I'm not sure.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #32 on Sat 06 Sep 2008 04:16 AM (UTC)
Message
Hmm, yes, a hot boot could cause trouble, I think, because the client doesn't really know it happened. But for a full reboot, shouldn't the client dump its cached data when it gets disconnected?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Quixadhal   (4 posts)  Bio
Date Reply #33 on Sat 06 Sep 2008 08:59 AM (UTC)
Message
I guess it depends on how you handle reboots. Since I intend to store everything (prototypes AND instances) in SQL, there's no reason not to restore everything on reboot except player objects (and even those if it's a hot boot).

You need some kind of unique identifier to store things in SQL anyways, and integers are the easiest to index and use for junction tables.

Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #34 on Sat 06 Sep 2008 03:53 PM (UTC)
Message
Yes, I suppose that if you've already got everything in an SQL table, everything is already indexed for you so you might as well take advantage of it. I'm still not convinced it's worthwhile if you need to build the indexing yourself, though.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Quixadhal   (4 posts)  Bio
Date Reply #35 on Sat 06 Sep 2008 11:48 PM (UTC)
Message
Yeah, if you're not using a database for storage, or you're just not saving instances, you probably don't need persistent ID's because just knowing that you have a "red cloth bag", and that it has 3 "sweet onions" and a "note from Farmer Ted" is enough to recreate them from prototypes.

I think ID's are useful for things which have internal state, because it provides a concise way to tie state information to usage within the game. If my sword gets damaged and I sell it to a vendor, you *could* have the vendor destroy it and only sell new swords... but you could also have him re-sell your used sword at a discount.

If, for example, that sword happened to have been a murder weapon, you'd only need to store the ID as pending case data. If your ID goes away at reboot time, you have to store the player/NPC who has it and all the stats about it too.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #36 on Sun 07 Sep 2008 12:32 AM (UTC)

Amended on Sun 07 Sep 2008 07:34 AM (UTC) by Nick Gammon

Message
Oh, just to be clear, I think there are indeed several cases where a persistent ID is useful. What I don't think is necessary is giving everything an ID if you don't have to.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
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.


100,913 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.