Game Development Community

Largest possible object ID?

by Fyodor -bank- Osokin · in Torque Game Engine · 03/01/2007 (6:41 am) · 2 replies

Hi.

Does anyone know what is the largest possible object ID in torque? I mean if you run a server for a really long time, every single object created get's it's own ID on server, and more server is up, that ID is larger and larger. So, what the largest possible ID and does it somehow affect to performance? As I can see from the code it shouldn't. I mean it can be as large as possible (upto max of S32), and there shouldn't be any performance issued.. but, who knows? :)

On my servers I have seen the ID being a bit more than 500000, but I need to restart it on a regular basis, as I have some (still unresolved) memory leaks (ODBC issues with some of my custom code).

#1
03/02/2007 (8:07 pm)
How long were you running to get to 500,000? What would concern me is if the code does not loop around and recycle older numbers that are not used. I would guess the max is going to be near 2,147,483,648. That is 2^32/2 since this is a signed integer. 2147483648/500000 = 4,294 which is the number of 500,000 time periods. So if 500,000 is 1 month then you would have 4,293 months to go to reach the max of an S32 ID. Which is 515 years. That would be pretty good uptime, and I am guessing you probably do not need to run that long. How long does it take to get to 500,000 IDs?
#2
03/03/2007 (5:11 am)
Hey Frank, thanks for reply.
It's the stock "straight-forward" ID usage, so older numbers are not reused.

To get to 500k the server runs about 4-5 days with average 10 players online. It's MMO-prototype with lots of different things happening. The database calls (selects) "eats" ID's heavily :)

But, as I said before, I have some memory leaks, so I need to reboot it on regular basis (2-3 days of uptime is maximum for now).