The International Simutrans Forum

 

Author Topic: Out of images (more than 65534!), what's it?  (Read 9030 times)

0 Members and 1 Guest are viewing this topic.

Offline paulo francis PF20

  • *
  • Posts: 49
  • a vida só gosta, de quem gosta dela...!
  • Languages: pt
Out of images (more than 65534!), what's it?
« on: May 12, 2013, 03:16:08 PM »
I'm currently downloading addons pak128, and when I put on, and open the game, this error appears ´´ ERRO... register_image ***Out of images (more than 65534!)*** ``
what should it be? please help me! :)

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: Out of images (more than 65534!), what's it?
« Reply #1 on: May 12, 2013, 03:22:30 PM »
Simple: you installed too many addons. Simtrans can only handle a limited number of images and you are over this limit now. Reduce the number of addons you use and the game will run again.

Offline paulo francis PF20

  • *
  • Posts: 49
  • a vida só gosta, de quem gosta dela...!
  • Languages: pt
Re: Out of images (more than 65534!), what's it?
« Reply #2 on: May 12, 2013, 03:45:41 PM »
but if I reduce the numbers of add ons, saved game, I have to delete. have another option?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5695
  • Languages: EN, NO
Re: Out of images (more than 65534!), what's it?
« Reply #3 on: May 12, 2013, 04:08:12 PM »
The number of add-ons you used for your saved game was apparently OK, or you wouldn't have been able to play it, let alone save it. Just go back to the add-ons you had then, and you can continue to play your saved game.

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Out of images (more than 65534!), what's it?
« Reply #4 on: May 12, 2013, 05:29:24 PM »
Hello Ters and paulo francis PF20
A brand new pak128 have alone already a 55% of memory use.
We need for pak128 slowly an new idea, how we can get more space in the memory from simutrans.
I think, that Simutrans need a new memory administration, that's support more than 65534 images can use.



Offline paulo francis PF20

  • *
  • Posts: 49
  • a vida só gosta, de quem gosta dela...!
  • Languages: pt
Re: Out of images (more than 65534!), what's it?
« Reply #5 on: May 12, 2013, 06:04:51 PM »
let me get this straight ...the simutrans has a maximum capacity of memory image?

Offline VS

  • Senior Plumber (Devotee)
  • Devotees (Inactive)
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Out of images (more than 65534!), what's it?
« Reply #6 on: May 12, 2013, 06:28:42 PM »
Yes, maximum is 65534 images.

(Vehicles have most images: 1 vehicle = N*8 images)

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4112
  • I have nothing to do with it!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Out of images (more than 65534!), what's it?
« Reply #7 on: May 12, 2013, 08:11:51 PM »
Yes, maximum is 65534 images.
65534 is almost 2^(2^(2^2)). Yeah, power-of-two for the win!


Offline paulo francis PF20

  • *
  • Posts: 49
  • a vida só gosta, de quem gosta dela...!
  • Languages: pt
Re: Out of images (more than 65534!), what's it?
« Reply #8 on: May 12, 2013, 09:38:23 PM »
but there is no way to increase this capacity?

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1408
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Out of images (more than 65534!), what's it?
« Reply #9 on: May 12, 2013, 10:10:55 PM »
No, apart from a rewrite of the whole program.

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: Out of images (more than 65534!), what's it?
« Reply #10 on: May 12, 2013, 10:11:07 PM »
but there is no way to increase this capacity?

Not for us normal users, no. The developers could increase this capacity of course, but it would probably cause performance to decrease, or increase the memory consumption of the game - or both. Therefore I don't think it's going to happen - especially since it only benefits a few people (those who use so many addons).

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Out of images (more than 65534!), what's it?
« Reply #11 on: May 13, 2013, 12:03:16 AM »
65534 is almost 2^(2^(2^2)). Yeah, power-of-two for the win!
That's the reason!
2^2^2^2^2 = 65536, but programming start from 0 so you reduce one, the number is 65535.
But 65535 is the limit, you have only 65534 working slots.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5695
  • Languages: EN, NO
Re: Out of images (more than 65534!), what's it?
« Reply #12 on: May 13, 2013, 05:00:34 AM »
That's the reason!
2^2^2^2^2 = 65536, but programming start from 0 so you reduce one, the number is 65535.
But 65535 is the limit, you have only 65534 working slots.

Or 2^16 as it is usually written. (That is, with ^ notation. 216 would be the correct way. Just in case someone is puzzled by the odd notation.)

I think the error message is slightly misleading. There are 65536 possible image "slots" numbered 0 through 65535. Slot 65535 is for "no image", reducing the number of possible actual images to 65535 (0 through 65534). The error prints 65534 apparently because there were attempts to load more images after slot 65534 had been filled, but that means there are actually 65535 loaded images. Either that, or Simutrans' calculations are one off, meaning that there is actually room for one more image, unless there is another special slot I'm not aware of.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4112
  • I have nothing to do with it!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Out of images (more than 65534!), what's it?
« Reply #13 on: May 13, 2013, 05:26:50 AM »
Or 2^16 as it is usually written.
Yes, I had found 216 too, but as 16 is a binary number, I broke it up for pedantic purposes. XD

Why not:

    2
   2
  2
 2

2    = 65536


.... oh math spree! ;o)

Anyway, I propose a more descriptive error message, such as: "ERROR: Simutrans tried to load a number of images/graphics more than the limit (65534 images). Check your pakset folder and remove the exceeding pak files".

Offline Václav

  • Devotee
  • *
  • Posts: 3325
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Out of images (more than 65534!), what's it?
« Reply #14 on: May 13, 2013, 03:48:38 PM »
I think that Pak128 may be one of first pakset where may be problem with capacity of images - when too many add-ons have been installed. But there is question: What number is too many?

As development of some paksets will go on, I am afraid of that number may be lowered too much. And then, pure paksets may achieve this capacity. And this would not be. No pakset should achieve capacity.

But on other side, I don't understand usage of too many add-ons.

Offline Spacethingy

  • *
  • Posts: 183
Re: Out of images (more than 65534!), what's it?
« Reply #15 on: May 13, 2013, 05:07:41 PM »
I was wondering how on earth this would be possible, but actually...
Wild math guesses:

500 vehicles = 500*8 = 4,000 images
So, actually, relatively negligible.

Enough buildings to make a 100x100 city have no repeats (ignoring roads) = 100^2 *2 (for winter) = 20,000 images

multiply by three for various eras = 60,000

I've hit the limit already, and I've ignored roads, terrain, attractions...

So, actually, we must be nearly at the limit already, as already mentioned, in pak128 etc.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5695
  • Languages: EN, NO
Re: Out of images (more than 65534!), what's it?
« Reply #16 on: May 13, 2013, 05:22:28 PM »
A pak set with 30000 different buildings? I imagined the most developed pak sets would have no more than a few thousand or so.

As for raising the limit, this would make an OpenGL renderer much more difficult. With all image slots filled, the images in pak128 would require 4 GB of video memory. Even more memory would be required for the frame buffer(s) and the geometry.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Out of images (more than 65534!), what's it?
« Reply #17 on: May 13, 2013, 05:36:37 PM »
For sure if images are to be stored in VRAM, a mechanism to load/unload them on demand will be needed.

Offline paulo francis PF20

  • *
  • Posts: 49
  • a vida só gosta, de quem gosta dela...!
  • Languages: pt
Re: Out of images (more than 65534!), what's it?
« Reply #18 on: May 13, 2013, 06:26:33 PM »
I was wondering how on earth this would be possible, but actually...
Wild math guesses:

500 vehicles = 500*8 = 4,000 images
So, actually, relatively negligible.

Enough buildings to make a 100x100 city have no repeats (ignoring roads) = 100^2 *2 (for winter) = 20,000 images

multiply by three for various eras = 60,000

I've hit the limit already, and I've ignored roads, terrain, attractions...

So, actually, we must be nearly at the limit already, as already mentioned, in pak128 etc.
That's right! over time, it will be a constant problem ... for more pak will be created, taking More stock images.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5695
  • Languages: EN, NO
Re: Out of images (more than 65534!), what's it?
« Reply #19 on: May 13, 2013, 07:57:03 PM »
For sure if images are to be stored in VRAM, a mechanism to load/unload them on demand will be needed.

Although having all images at the same size means it's easier to replace one without having to regenerate everything, having to swap images complicates things.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4112
  • I have nothing to do with it!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Out of images (more than 65534!), what's it?
« Reply #20 on: May 13, 2013, 08:40:17 PM »
Hey, not mentioning that double heights, new landscape and new world board patches will add a ton of new images into Simutrans... so, free room is going to be no longer *so* free.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10821
  • Languages: De,EN,JP
Re: Out of images (more than 65534!), what's it?
« Reply #21 on: May 13, 2013, 09:14:12 PM »
Only if they actually have different content. Otherwise simutrans merges the images in demand. And the last time I checked, the amount of images of pak128 was samethign around 35000 (or rather exact 35044). Double height will add about 4000 images (dependign on ways and so on).

In order to reach this limit, you will have to throw to paks together, like pak128.britain and pak in one folder. Since those use totally different styles alignment and industries, this is a very bad idea. Using all know vehicles for pak128 (and not pak128.japan or britain) you will not reach this limit (yet).

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Out of images (more than 65534!), what's it?
« Reply #22 on: May 14, 2013, 11:43:55 AM »
but instead of crashing couldn't it simply stop loading with a warning  and crash only if resulting pakset. is invalid?
addons should be loaded after base pakset.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Out of images (more than 65534!), what's it?
« Reply #23 on: May 14, 2013, 12:08:09 PM »
addons should be loaded after base pakset.
They are.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5695
  • Languages: EN, NO
Re: Out of images (more than 65534!), what's it?
« Reply #24 on: May 14, 2013, 03:17:32 PM »
Just continuing to load without loading it all might cause all kinds of odd things. And people, having just ignored the warning, will complain that things are strange. I think it's better that they get a fatal error right away, so that they can come here complaining about that. Then we can easily tell them what's wrong from a simple error message, rather than having to deduce what caused the mysterious strangeness.

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Out of images (more than 65534!), what's it?
« Reply #25 on: May 14, 2013, 03:45:03 PM »
Hello Ters,An_dz,Fabio,prissi
The limit from 65530 images reach for a full develop pak128 not really out.
Pak128 it before 1930 at the Vehicle and factory,and after 2000 not full development.

Offline SaschaPascalS

  • *
  • Posts: 24
Re: Out of images (more than 65534!), what's it?
« Reply #26 on: May 16, 2013, 10:20:30 AM »
Well, as the first guy reaching the border already one year ago, I can say, the most images produced are NOT by trains (only 8 normally), but by WAYS and Catenaries. Because there you have much images so that for etc a elevated track looks good in much different alignments, also as the corresponding catenary. And especially the pak128.japan has a much amount of different ways, elevated in 80-360 in different speeds and colours (with our without earth on the beton-body), Catenaries in much styles (even for more parallel tracks, a realistic establishment, or tell me any train station with 10 tracks, where you have one-arm catenaries for every track) etc. For simple gaming perhabs too much, but for example I am a map artist ;) I like to build up interesting looking maps :D