Using a really big background image

This forum is currently in read-only mode.
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Hi, new guy here . I'm trying Construct, loving it so far and loathing myself for purchasing a Game Maker license a few months ago.

    Anyway, I decided to try creating a game with a bird's eye perspective (not isometric, more like GTA 1 and 2) and it was coming over really smoothly: I created a 2024x2024 layout, added some tiled backgrounds, a few 3D boxes with shadow caster behaviour and a simple sprite with 8-direction movement. I exported an exe file to get the feel of it, it was around 1.5 mb.

    Then I created in Photoshop a 2024x2024 png file with terrain and grass and added it. This time I created a 12 mb exe! I went back to the image and (silly me) it had no optimization, so it weighted around 8 mb. I optimized it (took it down to less than 2 mb), imported it again, created a new exe and it still weoghted 12 mb.

    By the way, I added the png file as a tiled background (found no other way to do it).

    I don't know, maybe (probably) I'm doing something wrong. I looked around the forum and the wiki but found nothing I could relate to my issue. The thing is, by using a large terrain rather than tiles I can make it much more realistic, and I thought it would also be good performance-wise, since many things would be pre-rendered.

    Anybody can help me shed some light on how to do this?

    Thanks in advance.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Welcome to the forums.

    Construct stores all images as uncompressed PNGs, so no matter what you do to an image outside of Construct, it will always be the same size.

    Also, I'd suggest not using large images like that. An image that size will take up 16MB of VRAM. It would be a better idea to split everything up into tiles. It will greatly cut down on EXE size and VRAM usage.

  • I thought it would also be good performance-wise

    Bad assumption! A 2048x2048 texture will take up a huge amount of VRAM. Construct is 100% hardware accelerated, which uses the graphics card to render the game, and VRAM (the memory on the actual graphics card) is an important consideration when creating a game. A 2048x2048 texture uses (2048 x 2048 x 4 bytes/pixel) 16mb of VRAM. Some people still have crusty old 32mb video cards hanging around, and these tend to be half full of system stuff already, so you might have already eliminated those users from being able to play your game already - with one background texture.

    When designing a hardware accelerated game, it's always better to make levels using many small textures rather than single big ones. It's even better if you can do as much as possible with a Tiled Background object with a power-of-two size texture (eg. 128x128, 256x256...). You may think it would slow down rendering a bit having lots of small images on top of each other, but in many cases, surprisingly, you may actually measure zero change in the framerate! (This is because of the way the CPU and GPU work in parallel together) Even if you can find a difference, it's such a tiny change it's not worth bothering with at all: graphics cards can render simple images shockingly fast, generally only things with effects will impact the framerate.

    As for your filesize issue, Construct doesn't care what the source image is when you import it. It copies it to an internal image, so the format or optimisation of the source file makes no difference.

    Edit: linkman, images are compressed PNGs when they are stored in Construct, but they're lossless but not optimized.

  • Hey, thanks!

    I was sort of hoping to avoid having to load many different tiles one by one, but what'cha gonna do

    I'll try splitting the background on powers of 2 and see what happens. And as soon as I have something worth showing I'll make sure to show it here.

    Again: many thanks, guys!

  • Trying to wrap my head around this a little more. I am still cloudy on the initial image creation and setup. Let's say I am creating a background or another level or game object. If I was using Photoshop or another graphics program what would be the ideal setup out of the gate in terms of DPI, resolution, etc.

    I have read various tutorials, forum posts, etc. on layout size as well within Construct and it seems like that discussion is all over the board. Is there an ideal dimension for the layout of a game that is at least a great starting place across the board. Say a 16:9 ratio with the my exports out of photoshop relating to that scale using a 1200x675 file at 72-96 DPI. Should I be creating my files higher res than that. Or is aspect ration truly king here and I can create at any size. Maybe I should be in vector?

    Also talking about a tiled background above. Are you saying create your full background image and then basically cut it into a grid and tile it verse one large image. I am not sure I am quite tracking. Going to go dig in the manual and tutorials again to see if I can grasp it a little better. Thanks for the topic and time.

  • Ok, did a little more reading and ran across this forum post which I thought had some good information in it...

    scirra.com/forum/multiple-screen-size-image-size-optimisation_topic52276.html

    However I am not sure if the issue was solved. So lets say I design at 1200x675 as mentioned in my first reply and then I am view the game within a viewport that is much much larger... say 2500px wide. It will pixelate and not look great however the file size is manageable for mobile devices.

    Should I then be creating these images at higher DPI and dimension say 16:9 at with a 400px width. Then Construct will crush down and the it will be nice sharp at almost any resolution without impacting the mobile load times. Seems like that is not possible.

    In regards to the tiled background I clearly misunderstood. Obviously you would need a repeating element for that work. So I guess what I am asking or or wondering is if you have a nice 16:9 piece of scenery that your game is happening on top of it is better to break that up into as many layers as possible instead of have just a single large image? That also brings other advantages if you want to integrate parallax or BG movement I suppose. Seems like that would be a space hog verse one file but what I feel like I am hearing is that it is better to break up your background into multiple layers instead of that single image.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)