News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

What is powerline "net ID"?

Started by Spacethingy, October 11, 2012, 01:43:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spacethingy

Hi guys, I've searched for quite some time now and I can't seem to find an answer anywhere:

I can't even begin to guess what "Net ID" is, when I click on/inspect a powerline. Is it some debug thing that's irrelevant to my gameplay, or does it actually do something?



Thanks for your help! :)

(I'm using 111.3.1 and it appears in all paks I think)


Edit: I've just noticed that it's a similar number to the capacity - are they related somehow?
Life is like a Simutrans transformer:

You only get one of them, and you can't have it on a slope.

prissi

Only power networks with the same ID are connected. You can use this to find out to which network a powerline belongs.

Spacethingy

Ah neat, that is useful! Much easier than having to scan through miles of wires to see if it's connected properly!


But why the huge number? Wouldn't 1, 2, 3... be simpler, or is that not how this is calculated?


Thanks for getting me clear on that! :thumbsup:
Life is like a Simutrans transformer:

You only get one of them, and you can't have it on a slope.

prissi

It is a memory location, I thing. Blame the 2 GB main memory then.

Ters

I did by the way indirectly complain about the fact that it was a memory location not too long ago.

IgorEliezer

erm... other entities in Simutrans like buses, stations and lines can numbered by cardinal numbers (1,2,3...), why not powerlines too?
Simutrans could still generate these long ID numbers as internal identifiers. They could be listed and ordered "internally" and then receive display numbers that would be user-friendly.

kierongreen

Possible with a bit of work - at present I don't think powernets are saved, they are recalculated on map load:
When joining or separating networks the effect on labels would be a bit odd:
When joining two networks together you'd randomly lose one of the labels (could be a bit annoying when connecting a new factory to a network).
When separating networks one random half would be given a new label.

Ters

That randomness should be there today, so that in itself is nothing new. Coincidentally, I've been working on similar concepts at work. Not power nets, but merging and splitting, and how identities should be preserved in a meaningful way. The general rule there was that the lowest id (label) is preserved when merging, and the biggest half should retain the original id while the smaller gets a new id when splitting. I think that should be doable in Simutrans, too.

prissi

Using handles instead of addresses is easy and might even help to find odd errors. Although a long time no big problem there was reported. The simutrans way of handles is usually that when a handle is freed that number is not given until simutrans ran out of handles. And of course at reload most handles are resetted, so the numbers a counting up again.