The International Simutrans Forum

Community => Simutrans Help Center => Topic started by: Spacethingy on October 11, 2012, 01:43:50 PM

Title: What is powerline "net ID"?
Post by: Spacethingy on October 11, 2012, 01:43:50 PM
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?

(http://i.imgur.com/XKZuE.jpg)

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?
Title: Re: What is powerline "net ID"?
Post by: prissi on October 11, 2012, 02:03:38 PM
Only power networks with the same ID are connected. You can use this to find out to which network a powerline belongs.
Title: Re: What is powerline "net ID"?
Post by: Spacethingy on October 11, 2012, 02:17:35 PM
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:
Title: Re: What is powerline "net ID"?
Post by: prissi on October 11, 2012, 02:52:16 PM
It is a memory location, I thing. Blame the 2 GB main memory then.
Title: Re: What is powerline "net ID"?
Post by: Ters on October 11, 2012, 03:24:44 PM
I did by the way indirectly complain about the fact that it was a memory location not too long ago.
Title: Re: What is powerline "net ID"?
Post by: IgorEliezer on October 11, 2012, 04:07:18 PM
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.
Title: Re: What is powerline "net ID"?
Post by: kierongreen on October 11, 2012, 05:41:01 PM
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.
Title: Re: What is powerline "net ID"?
Post by: Ters on October 11, 2012, 06:23:04 PM
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.
Title: Re: What is powerline "net ID"?
Post by: prissi on October 11, 2012, 09:59:59 PM
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.