The International Simutrans Forum

Community => Simutrans Help Center => Topic started by: paulo francis da silva on May 12, 2013, 03:16:08 PM

Title: Out of images (more than 65534!), what's it?
Post by: paulo francis da silva 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! :)
Title: Re: Out of images (more than 65534!), what's it?
Post by: DirrrtyDirk 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: paulo francis da silva 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?
Title: Re: Out of images (more than 65534!), what's it?
Post by: Ters 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: greenling 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.


Title: Re: Out of images (more than 65534!), what's it?
Post by: paulo francis da silva on May 12, 2013, 06:04:51 PM
let me get this straight ...the simutrans has a maximum capacity of memory image?
Title: Re: Out of images (more than 65534!), what's it?
Post by: VS on May 12, 2013, 06:28:42 PM
Yes, maximum is 65534 images.

(Vehicles have most images: 1 vehicle = N*8 images)
Title: Re: Out of images (more than 65534!), what's it?
Post by: IgorEliezer on May 12, 2013, 08:11:51 PM
Quote from: VS on May 12, 2013, 06:28:42 PM
Yes, maximum is 65534 images.
65534 is almost 2^(2^(2^2)). Yeah, power-of-two for the win!

Title: Re: Out of images (more than 65534!), what's it?
Post by: paulo francis da silva on May 12, 2013, 09:38:23 PM
but there is no way to increase this capacity?
Title: Re: Out of images (more than 65534!), what's it?
Post by: Combuijs on May 12, 2013, 10:10:55 PM
No, apart from a rewrite of the whole program.
Title: Re: Out of images (more than 65534!), what's it?
Post by: DirrrtyDirk on May 12, 2013, 10:11:07 PM
Quote from: paulo francis PF20 on May 12, 2013, 09:38:23 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).
Title: Re: Out of images (more than 65534!), what's it?
Post by: An_dz on May 13, 2013, 12:03:16 AM
Quote from: IgorEliezer on May 12, 2013, 08:11:51 PM
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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: Ters on May 13, 2013, 05:00:34 AM
Quote from: An_dz on May 13, 2013, 12:03:16 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: IgorEliezer on May 13, 2013, 05:26:50 AM
Quote from: Ters on May 13, 2013, 05:00:34 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".
Title: Re: Out of images (more than 65534!), what's it?
Post by: Václav 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: Spacethingy 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: Ters 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: Markohs 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: paulo francis da silva on May 13, 2013, 06:26:33 PM
Quote from: Spacethingy 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.
That's right! over time, it will be a constant problem ... for more pak will be created, taking More stock images.
Title: Re: Out of images (more than 65534!), what's it?
Post by: Ters on May 13, 2013, 07:57:03 PM
Quote from: Markohs 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.

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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: IgorEliezer 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: prissi 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).
Title: Re: Out of images (more than 65534!), what's it?
Post by: Fabio 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: An_dz on May 14, 2013, 12:08:09 PM
Quote from: Fabio on May 14, 2013, 11:43:55 AM
addons should be loaded after base pakset.
They are.
Title: Re: Out of images (more than 65534!), what's it?
Post by: Ters 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: greenling 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.
Title: Re: Out of images (more than 65534!), what's it?
Post by: SaschaPascalS 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