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 ➜ SMAUG ➜ Running the server ➜ VNUM Stuff

VNUM Stuff

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


Pages: 1  2 

Posted by Samson   USA  (683 posts)  Bio
Date Reply #15 on Thu 07 Aug 2003 07:04 PM (UTC)
Message
In the event anyone is interested, the Smaug 1.4a FUSS code has been updated to correct this. All of the mismatches were resolved by making them all ints. Seemed the logical choice since it looks like that's what RoD intended from the start.
Top

Posted by Akumafire   (8 posts)  Bio
Date Reply #16 on Fri 24 Oct 2003 03:59 PM (UTC)
Message
Hey, just recently downloaded smaug, and was checking out the code/server. I dunno if people are still having the vnum problem, but uh I changed the typedef of sh_int from short int to int in mud.h, I think (only a guess) that the developers did this to save memory, but I think int should run faster than short since current processors takes in 32bits at a time. So hopefully I'm correct, anyone foresee any problems with my change?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #17 on Fri 24 Oct 2003 04:19 PM (UTC)
Message
Uh, I don't think this will have any speed changes, but I could be wrong on that.

However, you'll probably increase your memory size by a considerable amount, if short int and int actually do have different sizes. Sometimes (often) shorts are 2 bytes and ints are 4 bytes. So you'll be using up twice the memory every time you store a short. And since there are a LOT of shorts stored... well... that's a lot of memory. :)

Other than that, I don't think I can see any problems you might have from changing that. If the compiler gave you no warnings, that means that all the functions you call should still be happy.


I've been wondering if this sort of problem could have been made moot by having a "vnum" typedef from the start. That way, to change your vnums, you only change one typedef. Definitely would have solved the problem. Maybe it's a bit excessive to break things down into so many typedefs, but for some things like vnums, it probably would have been a better idea. Oh well...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Akumafire   (8 posts)  Bio
Date Reply #18 on Fri 24 Oct 2003 07:51 PM (UTC)
Message
oh yea few more thing, just what exactly is vnums? how is it used? is it an identifier for everything in the world? that's the impression I'm getting, and is it ever negative? if not wouldn't it be even better to make it an unsigned int and up the cap to 4bil, haha sorry for all the questions, but uh, are there any detailed documents and such on these things?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #19 on Sat 25 Oct 2003 06:23 AM (UTC)
Message
I don't know exactly what "vnum" stands for (virtual number? ...), but the vnum is like a unique identifier for prototype mobs, objects and the rooms (which are sort of their own prototype, but we don't need to get into that.) It's kind of like a serial number e.g. load up mob #75.

The vnum is never negative in practice, but the negative values are used to return error conditions in some version of the code. For example, in the codebase I'm using (derivative of SMAUG 1.0 ... old :P) many functions that look up vnums will return -1 in the event of failure. This is a useful feature, but I suppose you could return 0 just as well.

You're right though, that technically, this WOULD increase the maximum range by two. I'm not sure how necessary that is, though. :)

I've never seen any good SMAUG documentation. It comes with some "documentation" I think, but it's not exactly what I'd call useful. Best way to learn is to look at the code and just figure it out... or ask people who already have figured it out. :) However, if you ever want to be a decent coder, you'll need to figure it out anyways, so the advice I would give to all prospective coders is to really try to understand what's going on, and not just follow the advice of old-timers without understanding what's going on.

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.


72,140 views.

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

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.