Save Vram Memory ,Cut your sprites up

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Test and challenge your memory in this amazing Christmas themed memory game!
  • This has probably been done before,But here is an example of how to optimise your Vram By cutting those big sprites into tiles.The 1st screen is the optimised sprite and the second is the full big ass sprite.

    And the best program for cutting big textures into smaller ones can be found here http://www.photoscape.org

    http://dl.dropbox.com/u/7658043/MemorySaverExample.cap

  • Its a good example, but for the "big picture" you should compare power of two textures, and frame rate.... there's always a trade off.

    For even more optimization check out the tiled background object with P^2, and non P^2 versus frame rate, and ram of your images.

  • I wonder if it's really important to reduce the vram usage on a 2d games... with the equivalent of 10 1024� textures, you're using like 30 mb of video memory. Is this so important to save several mb of vram ?

  • Yes, especially when you start adding animations, shaders etc. it can really add up.

    You have to take into account your target audience as well.

    Basically the less vram/ better frame rate you have the more systems there are that can run it.

  • Its a good example...

    No, it is not. I thought, I made the problem clear when I was posting in this thread, but I will explain it once again.

    The slicing that was done here is just replacing one memory-waste-sprite with 36 not-so-obvious-memory-waste-sprites. The original image was 700x700, which totals 1960000 bytes (1.87 MB). On most graphic cards the resulting sprite will consume the next power-of-two size, which is 1024x1024 and totals 4194394 bytes (4 MB).

    So, why is this example not a good one? Is does save memory, doesn't it? Yes, it does, but by chance.

    1) The arranging of the 36 sprites was done wrong. The slices are of 4 different sizes: 116x116, 116x117, 117x116, 117x117. This was not taken into account and the sprites arranged on a 116 grid, leading to an image of the size 696x696, thus losing image information.

    2) The slices created are of a non-power-of-two-size and also waste memory. All the 36 slices will consume the next power-of-two-size, which is 128x128 in this case. If the original image would have been splitted into 49 or even 64 pieces, the resulting memory use would have been the exact same. If it would have been splitted into 25 pieces, it would even use 256x256 per piece. Just because it wasn't splitted into power-of-two-sizes.

    I remade the example to show, that you can reduce the (texture) memory usage to exactly the size, that the original image consumes:

    I won't comment on the "do we need to save memory"-issue. But, if you decide to split up your images, then do it consequently. Always split them into pieces of power-of-two-sizes (the magic of power-of-two is that you can represent any number!)

    Here's the cap: http://www.mediafire.com/file/qec45byuwxb0q29/BetterExample2.cap

  • Thanks tulamide for showing us the Correct way of conserving memory.How did they conserve memory back in the days of the good old sega Genesis or Snes?.I mean look at earth worm jim for instance that game was only 3.00 Megabytes big.Yes they reduced the colors and sprite size to keep everything to a minimum but it was still amazing how they worked with so little and still created games which looked and played fantastically.

  • Imagine an image of a circle. There's a lot of wasted space in the corners, right? They would often stuff those wasted spaces with other stuff and reassemble it all every frame.

  • Thanks tulamide for showing us the Correct way of conserving memory.How did they conserve memory back in the days of the good old sega Genesis or Snes?.I mean look at earth worm jim for instance that game was only 3.00 Megabytes big.Yes they reduced the colors and sprite size to keep everything to a minimum but it was still amazing how they worked with so little and still created games which looked and played fantastically.

    Well 3 megabytes is A LOT.

    On nowadays PC we have become used to wasting memory space away (Standard PC nowadays have several gigabytes of ram!), but back in the time you could store several games in 3 megabytes. It just a matter of knowing how to work with restrictions.

    At the time of 8 bit computers, 64 kilobytes was reserved for big games. They could still cram very large levels in that space.

  • hmmm, hi guys. i have read the whole topic and the one corresponding with the issue (VRAM & Pow 2 Textures) and i know that cutting images IF properly is good. but i have a problem...

    you see - i can image cuting the tiles of a static image.

    but what about animation? especialy a huge one.

    i am asking because here i have a very nice looking animation. but i also have two problems.

    first: it has 1521 x 435 resolution

    secund: it has 106 frames

    now how i am supposed two cut that, left alone arranging on screen...?

    this animation alone eats 200MB+ of VRAM, and he whole aplication eats 500MB+... quite huge numbers for a Layout with just 3 pictures, where 2 of them are static.

    and yes, it has to be that big, and yes it must have 106 frames.

  • Sorry, but that's way, way, way, way.... way out of the realms of whats possible.

    What your describing is more like a cut scene, than an animation.

  • and yes, it has to be that big, and yes it must have 106 frames.

    No, it doesn't. What you are attempting to do is quite literally unreasonable.

    Game designers (both professionals and indies) often have to sacrifice quality in order to fit within technical limitations. What you need to do is redesign your animation so that it won't choke your average video card. If you continue to think that you must make your animation that big, and with that many frames, then you will get nowhere.

    Try to think of an alternate method, because what you're asking for simply can't be done the way you want to do it.

  • Sorry, but that's way, way, way, way.... way out of the realms of whats possible.

    What your describing is more like a cut scene, than an animation.

    actualy not lol its just the effect from Cockpit view when you open the space tunnel.

    and part of it is supposed to always play when you enter the cockpit while in tunnel.

    [quote:w4u0znev]No, it doesn't. What you are attempting to do is quite literally unreasonable.

    Game designers (both professionals and indies) often have to sacrifice quality in order to fit within technical limitations. What you need to do is redesign your animation so that it won't choke your average video card. If you continue to think that you must make your animation that big, and with that many frames, then you will get nowhere.

    Try to think of an alternate method, because what you're asking for simply can't be done the way you want to do it.

    excuse me but ive seen bazilions of games with bigger and smother animations then this and they used 1/10 of the ram i am using. so it is possible. my question is not "IF its possible" but "how".

    and its not me who make the rules of logic - if you are siting ina cockpit, and you open a semi-dimensional space tunnel its onlu obvious that you (being a pilot) should see the tunnel opening and filling your whole field of view. how i am suppose to redesign that? You can see some type of warping/hyperjumping in most FPP spacesims. damn, even grandpa of spacesims Elite had something similiar.

    its just a matter of technique used. I can imagine that this (the tunneling) can be setup much easier in 3d engine, but Construct is mostly 2d. so when i cant have 3d eviroment i can try to mimic it with images.

    ever heard of a game called Starscape?

    Subscribe to Construct videos now

    check from 0:50 (that particles flying from off screen to the center).

    damn how i am misssing a proper avi object plugin then i would just play the animation in the background instead of using Construct as slideshow.

    see the exe

    http://dl.dropbox.com/u/15566547/HS/tester.exe

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just fake it? There is no need to use big animations or even movie clip for the tunnel effect. Creative use of layer or object effects and particles can accomplish the same. Maybe even with sprite displacement.

  • Just fake it? There is no need to use big animations or even movie clip for the tunnel effect. Creative use of layer or object effects and particles can accomplish the same. Maybe even with sprite displacement.

    that is true but.. i use outside program to generate such animation effect... i wouldnt know where to even start in order to make Construct generate such animation by himself.

  • Hm, come to think of it, you could use 3D layout... randomly spawn some hundred stars at different Z-levels, then rapidly change view distance and blackout. Cheap trick. Try it in a new cap and see if you can work it in somehow... such as through layer inheritance.

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