[Poll] How many room numbers do you need?

Post Reply

What is the upper limit on room numbers that you would like in Mudlet?

9,223,372,036,854,775,807 - (Theoretically nice but needs more memory/time to work with)
0
No votes
2,147,483,647 - (OP's preferred choice, more than enough and should work on any platform)
3
100%
Other - (I will explain in a post below)
0
No votes
Don't care!
0
No votes
 
Total votes: 3

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

[Poll] How many room numbers do you need?

Post by SlySven »

The data type used inside Mudlet to store room ids is currently coded to be an "int" although we do not allow negative ones. I was looking to clean up some aspects of the Application and - as this data type need not necessarily be the same size on all platforms am looking to define it to something more explicit.

I was looking to use a 64-bit data type which would allow valid room numbers to be in the range 1 to 9,223,372,036,854,775,807 - however that might be a bit more than is necessary; if I instead choose a 32-bit data type (which will be more compact and possibly faster on some systems) this would restrict the range to be: 1 to 2,147,483,647. Given that my experiences with a map with only around 2.2 Million rooms (i.e. around one thousandths of the second value) suggests that over 4GByte of system memory is needed to hold a map of THAT size currently I am beginning to think that mayhaps the second smaller limit will be more than adequate. :D

Any thoughts - either way - anyone? :ugeek:

EDIT {2016-06-023} Humm, 64-bits won't work in Lua 5.1 as that larger value needs too many bits to store discrete integral values within the "double" floating point number UNLESS the additional LNUM patch is also compiled into the lua subsystem (see this Stack Exchange answer)...

The prototype code I came up with before I discovered this allowed me to create and use a room with an id of 9,012,345,678,901,234,567 but it was indistinguishable from a room number of 9,012,345,678,901,234,560 or 9,012,345,678,901,234,580...!

Post Reply