The International Simutrans Forum

 

Author Topic: two season FrontImage, one season BackImage  (Read 2687 times)

0 Members and 1 Guest are viewing this topic.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
two season FrontImage, one season BackImage
« on: November 05, 2011, 04:41:44 PM »
If i set summer and winter for front and only summer for back, in winter only front is shown.

I would like that if there is only one back and one front for each season, the same back is shown also in winter. This way we could save memory putting only the snow in the front image

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9531
  • Languages: De,EN,JP
Re: two season FrontImage, one season BackImage
« Reply #1 on: November 05, 2011, 07:28:01 PM »
Identical images are not loaded during game time. Thus just include two.

A more sophoisticated approach could have been done; but in pak128 on ~100 images were double. For those such a complex system was decided too complex for little gain.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: two season FrontImage, one season BackImage
« Reply #2 on: November 05, 2011, 10:42:45 PM »
So if i put the dame backimage twice and i set front to - in summer and snow layet in winter for frontimage, the backimage will be loaded only once? could it be also stored only once in the  .pak file?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9531
  • Languages: De,EN,JP
Re: two season FrontImage, one season BackImage
« Reply #3 on: November 06, 2011, 07:47:49 PM »
The storing in pakfile is not implemented. Usually harddisk space is not too critical, but the number of images in memory is limited to 65534.

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: two season FrontImage, one season BackImage
« Reply #4 on: November 06, 2011, 07:55:17 PM »
@Prissi
It´s Possible the Limit from 65534 images to lift up on to 131068 images?
I Have many Pakfiles they want i use.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: two season FrontImage, one season BackImage
« Reply #5 on: November 06, 2011, 08:08:49 PM »
The storing in pakfile is not implemented. Usually harddisk space is not too critical, but the number of images in memory is limited to 65534.
Would it be possible to implement? ATM I have an issue with pak128 where i prepared a 300+ MB pak with a houses set which size would be halved by tjis implementation...

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: two season FrontImage, one season BackImage
« Reply #6 on: November 06, 2011, 08:11:17 PM »
We need a higher limit for Images that new modelles can be build in!

Offline Václav

  • Devotee
  • *
  • Posts: 3267
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: two season FrontImage, one season BackImage
« Reply #7 on: November 06, 2011, 09:02:28 PM »
It´s Possible the Limit from 65534 images to lift up on to 131068 images?
I Have many Pakfiles that I want use.
I don't see why to have in game all what is available ... like you. So, this is not most needed for your reason.

... Following number cannot be 131068 (or even 131071 that is 217-1) - because that max number of pictures is 65535 (216-1) ... and byte counting prevents such number as 217 (or not?, prissi)

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: two season FrontImage, one season BackImage
« Reply #8 on: November 06, 2011, 09:14:27 PM »
from my understanding, it's a memory address range issue.
65 534 (dec) = FFFF (hex) = 2^16 = 64KB

I guess the next step up would be
1 048 575 = FFFFF = 2^20 = 1024KB

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: two season FrontImage, one season BackImage
« Reply #9 on: November 06, 2011, 09:32:08 PM »
The Limit for 65 534 Images it´s too low for the many new modelles what fabio want make. ::( ::'(

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: two season FrontImage, one season BackImage
« Reply #10 on: November 06, 2011, 09:46:00 PM »
Don't worry greenling, i don't plan to paint SO MANY houses. But less disk space would help instead ;)

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: two season FrontImage, one season BackImage
« Reply #11 on: November 06, 2011, 10:11:20 PM »
fabio make your modelles and make the Simutransgame colorful.
I hat beginning to analyze Computer find many modelles they have many Images!
I be list up how many modelles be get exceed the Limit form 65 534 Images.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5535
  • Languages: EN, NO
Re: two season FrontImage, one season BackImage
« Reply #12 on: November 07, 2011, 05:54:25 AM »
from my understanding, it's a memory address range issue.
65 534 (dec) = FFFF (hex) = 2^16 = 64KB

I guess the next step up would be
1 048 575 = FFFFF = 2^20 = 1024KB

65534 is the maximum value for a 16 bit number (minus one, possibly because one value is used to signify "no image"). The next logical step would be 32 bit, which would put the limit at over 4 billion. (The fact that official simutrans builds are only 32 bit means that they can't access enough memory to reach that limit in practice.) Doubling the size of image identifiers will increase the game's memory consumption, which in turn makes the game run slower. (Not sure how much, though.) 24 bit and a limit of 16 million or so is also technically possible, as are all multiples of 8 bits (a byte), but will either result in memory consumption equal to 32 bit, or introduce alignment issues that decrease performance further.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: two season FrontImage, one season BackImage
« Reply #13 on: November 07, 2011, 08:35:26 AM »
I think it's simply index of an array, which was expected to never reach 64k entries (ought to be enough for everyone!) and to make object instances smaller, a smaller type was used. Bumping all the index variables to 32 bits is inevitable, new array size is arbitrary.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9531
  • Languages: De,EN,JP
Re: two season FrontImage, one season BackImage
« Reply #14 on: November 07, 2011, 09:08:08 AM »
However, you can only reach this limit, if you copy EVERYTHING ever made into a single folder. This will however not give a nice nor a playable game.

If some pak really goes close to this border  (last time I check with pak128 evn with tons of addons was at 40k images) then we will extend it. But as written correctly, every singe thing in the game stores at least an image. Thus doubling this will increase memory consumption.

Giving that everthing grows, it will happen sooner or later. But currently it is not on the top of my list.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: two season FrontImage, one season BackImage
« Reply #15 on: November 07, 2011, 09:52:31 AM »
...now that I read back, number of images was never the point of this thread :)