Maximum KUID Question

jcardana

Trainz Enthusiast
I working outside Content Manager, making my own KUIDs in the format of MddHHmm, which is Month day Hours(24) and minutes. So right now, it would be 3120931.

Is there a limit to KUIDs?

Come December, I'd could be looking at <kuid:151329:12312359> And if I add the year... (YYMddHHDDmm) = <kuid:151329:2013312359>

Thanks for your time,
Joe
 
Yes, mapfile formats use 32 bit unsigned int for the content number part of the kuid. 25 bit user ID and 7 bit version number are packed into another 32 bit unsigned int.

Bob Pearson
 
Last edited:
What is the driving reason for this scheme? Isn't the creation date of the file enough? Unless you're working and creating 24/7, there will be a load of numbers that you'll never use. I still use a variation of the original TRS2004 pattern wherein different classes of objects had their own kuid ranges (Buildings / Structures, Track, Rolling Stock, etc. Thus I used the range 1 - 99,999 and 100,000 to 999,999,999 was Trainz Assigned.
 
I've used this here to set my KUID range from the command prompt.

Code:
echo off
cls
ECHO.
ECHO ...............................................
ECHO PRESS 1, 2,3, OR 4 to select your task, or 5 to EXIT.
ECHO ...............................................
ECHO.
ECHO   Set for Loco 10000                 1
ECHO   Set for Rolling Stock 20000        2
ECHO   Set for Interiors 30000            3
ECHO   Set to Default 800000              4
ECHO   EXIT                               5
ECHO.
SET /P M=Type 1, 2, 3, 4, or 5 then press ENTER:
IF %M%==1 GOTO LOCO
IF %M%==2 GOTO STOCK
IF %M%==3 GOTO INTERIORS
IF %M%==4 GOTO DEFAULT
IF %M%==5 GOTO EOF


:LOCO
trainzutil setnextcontentid 10000
GOTO EOF
:STOCK
trainzutil setnextcontentid 20000
GOTO EOF
:INTERIORS
trainzutil setnextcontentid 30000
GOTO EOF
:DEFAULT
trainzutil setnextcontentid 800000
GOTO EOF
:EOF




Mod 2:
GOTO EOF
:DEFAULT
REM %TRSpath%\trainzutil setnextcontentid 800000
GOTO EOF
:EOF
Set TRSpath=
set M=
%TRSpath%\trainzutil setnextcontentid 2000000


Mod 3:


>NUL %TRSpath%\trainzutil setnextcontentid 100000
FOR /F "delims=: tokens=1-4" %%i in ('%TRSpath%\trainzutil generateKUID') do (
if "%%i"=="<KUID2" set LZKUID="%%i:%%j:%%k:%%l"
)

We can thank Justin Cornell (Norfolksouthern37) for this. He posted it ages ago.
 
What is the driving reason for this scheme?
I wanted something that would definitely prevent overlaps.
Isn't the creation date of the file enough?
Yes, it is.
Unless you're working and creating 24/7, there will be a load of numbers that you'll never use.
Does that mean I'm wasting resources?
I still use a variation of the original TRS2004 pattern wherein different classes of objects had their own kuid ranges
Sounds reasonable.
 
In file "assets.tdx": section "kuid-generator", entry "base-kuid". Use "Trainz Settings Viewer" by vvmm.
 
In file "assets.tdx": section "kuid-generator", entry "base-kuid". Use "Trainz Settings Viewer" by vvmm.
it's all compiled
assets.tdx... found
kuid-generator... found
base-kuid... found. I'm guessing this is my kuid 151329?

Having to use another program defeats the purpose of using my software to generate a kuid sequence.

This isn't worth it. Thanks anyway!
 
Where do I find the "source" of my next kuid#? Is it on my computer or on an online database?

I simply sort by Author #self and then by Kuid.

Sorting Ascending puts the highest number at the bottom of the list. This should be mostly sequential. Keep in mind that there are temporary route files used now in TRS19 that will use your ID but "return them" when done after the route and session are closed.
 
Back
Top