Local tsection.dat entries limitation?
#1
Posted 05 August 2024 - 10:02 AM
Building a route with dynamic track sections only (plus switches, of course).
Since some moment, new dynamic sections are looking right, during placement&extrusion, but yellow lines of TSRE look random, incorrect and odd.
Investigation of local tsection.dat file shows: entrie's number have exceeded 2x32768 (65536) and each further section takes small-numbered entries from nowhere*, as a reference, instead of real 5-sign entries.
Second observation is, the order of items jumps over 1-3 numbers (so there are free, unused numbers, plus some entries are not referenced by any real sections, being just mirrored instances of some referenced ones.
*Count starts from 40000, and I have doubts, any entry is being deleted, after deletion of sections, but instead, likely new one have being added, after modification of the same section... Overflow takes place.
So, I feel disappointed, as I can't finish the route, hitting limit, but still, I can renumber entries and delete unused ones to free some numbers for more sections.
I'd like to hear other's opinions about the question.
#2
Posted 05 August 2024 - 12:04 PM
Currently, sections 00001 thru 39999 are in the global TSection.
Sections 40000-65536 are in the local.
How hard would it be to break the limit entirely, and replace with logic that looks in the applicable TSection first, and the alternate TSection second if the lookup fails?
For example.... if section 65537 is encountered, look in Global, attempt Local if not found in Global, and fail entirely if not found in both?
#3
Posted 05 August 2024 - 12:35 PM
Doug
#4
Posted 05 August 2024 - 12:51 PM
#6
Posted 09 August 2024 - 03:30 PM
The second part of the file have consequent entries numbering.
The first one has gaps in numbering, and large gaps (about ten, or just a little less) is likely to be filled during further route editing.
However gaps as 2-3 numbers are being kept.
So, my first question is: does TSRE look for free/unused numbers to re-use them?
Second will be: why gaps are being left anyway, and why to write "mirrored" entries (containing the same values, but negative-signed)?
Third: am I right, thinking, that deletion of no longer used dynamic track sections doesn't free any entries (at least, in first file's part)?
Fourth: can file be re-built by some mean, to cull unused entries, what would free-up numbers for useful usage?
#7
Posted 09 August 2024 - 06:51 PM
#8
Posted 09 August 2024 - 07:38 PM
However gaps as 2-3 numbers are being kept.
Let me first say that this is a general comment about dynamic numbering and disk writing algorithms, they are very similar.
To write memory code to compact as you go is VERY time intensive.
To write to the next available slot is the shortest time and lets say it takes a time unit of one,
To go searching for a slot in all the available space, would take about 100 time slots,
On a disk drive ( mechanical disk ) it is about 5000 time slots.
The disk driver will only write forward of the current head position, and it will find the nearest slot that is large enough to write the current buffer.
#9
Posted 09 August 2024 - 09:05 PM
#10
Posted 09 August 2024 - 09:12 PM
FWIW, there are around 32,000 individual records (measured 1 record per id number). I use an edited version whose records look like this
_INFO( XTracks narrow gauge curves)
TrackShape ( 39991 FileName ( N1t54r1d.s ) Numpaths ( 1 ) SectionIdx ( 1 0 0 0 0 36206 ) )
TrackShape ( 39992 FileName ( N1t54r5d.s ) Numpaths ( 1 ) SectionIdx ( 1 0 0 0 0 36208 ) )
TrackShape ( 39993 FileName ( N1t54r10d.s ) Numpaths ( 1 ) SectionIdx ( 1 0 0 0 0 36210 ) )
TrackShape ( 39994 FileName ( N1t54r20d.s ) Numpaths ( 1 ) SectionIdx ( 1 0 0 0 0 36212 ) )
TrackShape ( 39995 FileName ( N1t72r1d.s ) Numpaths ( 1 ) SectionIdx ( 1 0 0 0 0 36214 ) )
TrackShape ( 39996 FileName ( N1t72r5d.s ) Numpaths ( 1 ) SectionIdx ( 1 0 0 0 0 36216 ) )
TrackShape ( 39997 FileName ( N1t72r10d.s ) Numpaths ( 1 ) SectionIdx ( 1 0 0 0 0 36218 ) )
TrackShape ( 39998 FileName ( N1t72r20d.s ) Numpaths ( 1 ) SectionIdx ( 1 0 0 0 0 36220 ) ) )
For me, that's much easier to read.
#11
Posted 09 August 2024 - 09:26 PM
What I have observed well-matches with situation, Derek have described. I have found analogy with data organization on disks too.
2. To Derek.
Thanks for explanation: it have answered and confirmed many of my guesses.
3. To Dave.
I didn't understand all, what I've read, but I doubt, they are hex: sequence looks like decimal, no a to f symbols for 10 to 15 numbers.
I think, I actually have used much less, than 65535 sections, but doubled number of every section's editings is being kept in file: again, when I just move already existing dynamic section, or, maybe, change it's elevation(grade), the list (count) still increases - that's why I guess, no deletion after actual sections were deleted; plus, I have to move a big part of already built route towards right coordinates (after topography distortions correction), plus, I have tried auto-placement of dynamic track (I suspect, 10m straight was placed), along existing track twice, however have removed "last placement" both times then.
#12
Posted 09 August 2024 - 09:37 PM
39991 to 39998 are entries umber in world files?
36206 to 36220 are section idx numbers from the first part of the tsection file?
#13
Posted 10 August 2024 - 12:48 AM
The misinterpretation of the tsection comes from me.
Weter is correct that the numbers in tsection are in decimal.
So Dave the new calculation for number of slots left has changed.
40,000 in total, 2/3 full so leaving 26,667 slots left.
Within the slots left, half is sections, half is shapes, therefore 13,000 tracks/roads can be had.
Given the rate of new routes, we still have many years left.
#14
Posted 10 August 2024 - 10:05 AM
#15
Posted 10 August 2024 - 10:54 AM
1. TrackSections The dimensions are listed here.
2. TrackShapes The different shape files are listed here.
I wonder which one the question refers to, because it really doesn't matter?