Large layout issues

  • Yann - that's a great screenshot, and shows the truly ingenious levels of sprite re-use that professional games use, and you hardly notice unless you look carefully. Construct 2 makes this convenient too since you can take a sprite and scale it, rotate it and copy to different layers. I think even the original Mario got away with using the cloud image for bushes, but with a different palette to change the color to green. So there's a long history of this kind of trickery!

    Arima - the memory manager only works layout-by-layout - it currently makes no effort to release textures mid-game. It will only release anything when changing layout. It tries to pre-load everything on a layout when the layout starts, but it does this by looking at which objects are placed in the layout view initially. If you create an object not initially in the layout view, it still has to load the texture at the moment you create it, which can create a pause.

    Modern 3D games use a technique called texture streaming, which is where they load and unload textures dynamically as you move around. However they have two advantages in doing this:

    • they support threaded texture loading, so they can load textures to the GPU in the background without pausing the game. WebGL doesn't support this yet, although I think the group working on it want to add support using Web Workers or similar.
    • they are 3D, which means they exploit distance. If a texture has not been loaded, the object will appear a solid colour. However it will generally load textures as you approach objects from a distance. So at first they are usually so small in the distance you can't see any texture detail. The texture usually gets loaded before you can approach and see any detail, meaning it's a pretty seamless experience. In 2D, there is no distance, so objects will simply appear as holes in the level until they get streamed in. This makes it more difficult to ensure textures are always loaded by the time you scroll to them - especially difficult if you can scroll very quickly in unpredictable directions.

    So we could improve texture streaming capabilities in C2, but the tech isn't quite there yet, and it would still be hard to use. I'd still recommend taking the composition approach (Rayman style). Not only does it make the game use a lot less memory, it also makes the download size considerably smaller, which is especially important for web games.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've had the same desire. I want to eventually create a 2D game world similar to that done in Grand Theft Auto China Town Wars. Ok that game used 3D. But the game was played in 2d. Also GTA1 and 2 both were in 2D.

    I have no solution, but I've been thinking about Sprite.URLLoad the image. The sprites instances are re-used else where. but this also required a level designer to track all sprite re-use, shifting and object loading :| and I have no idea if the image will still stay in ram from URL loading. It's just a plant to try out someday.

  • Tobye - it's sounding like probably not with the current state of the tech, as Ashley explained. For future game design, it's probably best to use the method Yann described.

    Ashley - thanks for the detailed reply, I had been wondering how they did it in 3d.

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