[0.4.1/XP] Crash on startup "Couldn't create atlas bitmap"

Place for things which are bugs but we have no idea how to solve them. Things related to hardware, libraries, strange setups, etc.
Post Reply
KlockworkCanary
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat May 11, 2013 9:34 pm
Contact:

[0.4.1/XP] Crash on startup "Couldn't create atlas bitmap"

Post by KlockworkCanary »

Full error message is:
"Couldn't create atlas bitmap (2048x2028). Probably not enough of video memory."

The demo worked just fine so I was a bit confused as to why the full version didn't want to cooperate. After shuffling files between the demo and the full, it seems the problem is stemming from something in Factorio\data\base\prototypes. I was able to get the full version running eventually (full menu, map generator, etc.) but it's crash-prone and limited to demo items. Admittedly my computer is about 10 years out of date, but given how well the game performs otherwise I think it's too hasty to simply dismiss this as a hardware problem.

System Specs: (suppress your laughter please)
Windows XP Professional Service Pack 3 (build 2600)
2.60 gigahertz Intel Pentium 4
RADEON 9800 PRO
1.5g RAM

Any help is greatly appreciated. Thanks in advance.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by kovarex »

From what I found, the card has 128Mb video memory, this is probably not enough.

We might make some less graphically intensive installation option in the future, that would use lower resolution sprites and/or less rotation/animation frames.
If you want to run the game now, there is something you might try, as most of the video memory is used by the locmotive + cargo wagon, you can try to reduce the memory they take.

If you open data\base\prototypes\entity\entities.lua
and look for "diesel-locmotive", this is what you get:

Code: Select all

 {
    type = "locomotive",
    name = "diesel-locomotive",
    icon = "__base__/graphics/icons/diesel-locomotive.png",
    flags = {"placeable-neutral", "player-creation", "placeable-off-grid"},
    minable = {mining_time = 1, result = "diesel-locomotive"},
    max_health = 500,
    collision_box = {{-0.6, -2.4}, {0.9, 2.4}},
    selection_box = {{-0.7, -2.5}, {1, 2.5}},
    weight = 2000,
    max_speed = 1.2,
    max_power = 10,
    braking_force = 10,
    friction_force = 0.0015,
    -- this is a percentage of current speed that will be substracted
    air_resistance = 0.002,
    connection_distance = 3.3,
    joint_distance = 4,
    energy_source = {
      type = "burner",
      burning_speed = 0.1,
      effectivity = 1000,
      fuel_inventory_size = 3,
      heat_capacity = 100,
      heat_loss = 0.01,
      heat_transport_speed = 0.05,
      smoke = {
        {
          name = "smoke",
          deviation = {0.1, 0.1},
          frequency = 20,
          position = {0, -3},
          slow_down_factor = 0.9,
          starting_frame = 3,
          starting_frame_deviation = 5,
          starting_frame_speed = 0,
          starting_frame_speed_deviation = 5
        }
      }
    },
    pictures =
    {
      priority = "low",
      frame_width = 250,
      frame_height = 224,
      axially_symmetrical = false,
      direction_count = 256, <<<<<------- change this to 1
      filenames =
      {
        "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-matrix-256-1.png",
        "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-matrix-256-2.png",
        "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-matrix-256-3.png",
        "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-matrix-256-4.png"
      },
      line_length = 8,
      lines_per_file = 8
    },
    rail_category = "regular"
  },
  {
    type = "cargo-wagon",
    name = "cargo-wagon",
    icon = "__base__/graphics/icons/cargo-wagon.png",
    flags = {"placeable-neutral", "player-creation", "placeable-off-grid"},
    inventory_size = 10,
    minable = {mining_time = 1, result = "cargo-wagon"},
    max_health = 500,
    collision_box = {{-0.6, -2.4}, {0.9, 2.4}},
    selection_box = {{-0.7, -2.5}, {1, 2.5}},
    weight = 1000,
    max_speed = 1.5,
    braking_force = 3,
    friction_force = 0.0015,
    air_resistance = 0.002,
    connection_distance = 3.3,
    joint_distance = 4,
    pictures =
    {
      priority = "low",
      frame_width = 285,
      frame_height = 218,
      axially_symmetrical = false,
      back_equals_front = true,
      direction_count = 128, <<<<<------- change this to 1
      filenames =
      {
        "__base__/graphics/entity/cargo-wagon/cargo-wagon-spritesheet-1.png",
        "__base__/graphics/entity/cargo-wagon/cargo-wagon-spritesheet-2.png",
        "__base__/graphics/entity/cargo-wagon/cargo-wagon-spritesheet-3.png",
        "__base__/graphics/entity/cargo-wagon/cargo-wagon-spritesheet-4.png"
      },
      line_length = 4,
      lines_per_file = 8,
      shift={0.6, -0.45}
    },
    rail_category = "regular"
  },
Change those 2 valeus and try to run the game, everything will work, expect the locomotive+wagon will look ugly, but you can play the game without these.

I would love to know if it made any difference, thx.

KlockworkCanary
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat May 11, 2013 9:34 pm
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by KlockworkCanary »

Yep that fixed it. I was able to get locomotives up to a direction count of 64 and cargo wagons up to 32. Any higher and the program won't start. I haven't built any trains yet so I don't know how they look on these settings, but so far everything seems to be working. Thanks for the help, and I think your idea of making variable graphics is great. I'll at least know how to scale things back if it starts acting up again. Good luck with the development, your game is awesome!

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by SilverWarior »

@KlockworkCanary
The problems you have is that when you start Factorio it runs at current screen resolution in your case 2048 x 1536 I bleive. This cuases your graphics card to run out of graphical memory pretty quick.
Best solution so far would be for you to lower the screen resolution prior running the game to 1024 x 768. This would prevent you from running out of graphical memory so quick and would probably even increase the game performance quite a bit.

@Developers
I suggest implementing the ability to manually set ingame resolution wehn in full screen mode.
Also is it necessary for creating atlas bitmap this large? Isn't atlas bitmap used for storing sprite images in one comon bitmap (spritesheat) so that they can be accesed more quickly during the drawing phase.
Based on error message it seems that atlas bitmap width is the same as maximum screen resolution that his graphics card supports. Shouldn't be atlas bitmap dimensions proportional to the number of sprite images stored in it and of course their sizes?

@kovarex
Also when reading thread below that I found on internet you claim that you are creating multiple athlas bitmaps. Is this realy necessary?
https://www.allegro.cc/forums/thread/612025

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by kovarex »

HI, yes it is necessary, the amount of graphic content on my computer (my max size of atlas is 8192*8192) is something like 8192*6000, and it will increase. When the maximum size of atlas is 2048*2048, I just have to divide it in many atlases.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by SilverWarior »

kovarex wrote:HI, yes it is necessary, the amount of graphic content on my computer (my max size of atlas is 8192*8192) is something like 8192*6000, and it will increase. When the maximum size of atlas is 2048*2048, I just have to divide it in many atlases.
After checking the games graphics files I do realize that atlas bitmap realy needs to be so large, mostly due the animations.
Also do I understand corectly that you create multiple atlas bitmaps if the graphics card doesn't support creating single one whose size would be large enough to contain all ingame graphics.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by SilverWarior »

BTW on Alegro posts you wrote:
I found out, that even in 5.1.3 I have the same problem, when I stop using the window icon. Yes you heard me right, I stop using window Icon and resizing now starts to mess all my bitmaps.
I found out, that this has something to do with the fact, that I used subitmap of my atlas bitmap for the windows icon, and that the fact, that I used it changed the state of the bitmap.

Properties :lock_x, lock_y, lock_w, lock_h and lock_flags had all value -842150451 when I didn't use the bitmap from the atlas as window icon.
When I use it, it changes these values and the resize works correctly.
I belive that the reason why those properties have vale of -842150451 when you are not using subitmap becouse they probably don't even get initialized as they are probably not needed especially if those are the properties of subitmap.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by kovarex »

SilverWarior wrote: I belive that the reason why those properties have vale of -842150451 when you are not using subitmap becouse they probably don't even get initialized as they are probably not needed especially if those are the properties of subitmap.
Yes, I'm aware of that ..., the thing I'm wondering is, why do they need to be initialised when they are not used.
P.S. I'm using subbitmap.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by SilverWarior »

kovarex wrote:
SilverWarior wrote: I belive that the reason why those properties have vale of -842150451 when you are not using subitmap becouse they probably don't even get initialized as they are probably not needed especially if those are the properties of subitmap.
Yes, I'm aware of that ..., the thing I'm wondering is, why do they need to be initialised when they are not used.
P.S. I'm using subbitmap.
If they are not used, then there is no point for them to be initialized. But if noninitialized values are causing changes in your application than you are definitly using them somwhere where you probably shouldn't. I gues that these properties are part of some data object and somewhere in your code you are trying to acces nonexistand object. Where? I have no idea. I would have to see whole source code to figure that out, but I don't expect you to show it to me. So I suggest gtrying to figure that out by steping through your whole sorce code which won't be an easy ob since Factorio is becoming quite big.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.4.1/XP] Crash on startup "Couldn't create atlas bitma

Post by kovarex »

I'm pretty sure that the problem is connected with allegro insides.
It might be allegro bug (surprise, Allegro has lot of bugs, like almost every software ^^)
It might be me using allegro the wrong way somewhere, but it is related to allegro logic of preserving and dealing with bitmaps.

Post Reply

Return to “1 / 0 magic”