Load Image from URL as Sprite Strip?

0 favourites
  • 12 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • Any chance we could get this added to the to do list? Then we could load an image from url and split it into individual frames. Would a lot on file size and loading/saving time by not having to store each frame in the capx. And could cut down on image loading overhead as well

  • I'm interested in this too!

    For my game here I'm using sprite sheets from an API, that delivers both the image and the coordinates of each sprite.

    See how it looks here:

    http://api.glitch.com/simple/players.getAnimations?player_tsid=PHVRMT3HOG72D33&pretty=1

    For now, I had to download the sheets and import them manually in C2, but if such thing was possible dynamically at runtime, it could support ANY character supported by the API, instead of ONE currently...

    And people would be able to play the game with their own avatar instead of mine.

    I've seen some discussion on the forums about an "image offset" parameter in CC for tiled backgrounds, but I don't quite understand why it's not in C2 too. Such thing would work eventually for animations.

    Or is there any other way to work this out with the current tools?

  • What's wrong with having your images in the project? Construct 2 does some very sophisticated work with image compression on export, such as automatic spritesheeting, color counting and PNG recompression. If you have external images you miss out on getting all that for free, so it seems it'd be better just to include them in your project.

    lemo - you might want to take a look at the plugin SDK for that type of thing, it seems a little niche to include in the core engine.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One of major obstacles in the path of major projects (MMO, lengthy VN etc.) is the amount of assets. How long would people wait for the 200 MB game to load? What about 400 MB? 1 GB?

    Preloading is not an optimal solution for these kind of projects.

  • Thanks for the reply Ashley

    I'm really new to game development, so I don't know a lot of things (nor am skilled enough to write my own plugins), but looks like Mipey may have a point here regarding general use

    And people still have pngnq & pngcrush at their disposal if they want to optimize their images themselves

    Also being able to apply basic transformations (crop, offset, mask?) afterwards sounds to me like a natural evolution to the "Load image from url" feature

    Btw Mipey, I almost replied on your thread the other day when I saw your Spritefont plugin, isn't that quite close to something that could process a sprite sheet from an url into an animation?

  • One of major obstacles in the path of major projects (MMO, lengthy VN etc.) is the amount of assets. How long would people wait for the 200 MB game to load? What about 400 MB? 1 GB?

    That's why you make it an application/executable...

  • That won't solve anything as far as asset management goes.

    Then again loading textures on the fly won't help either.

    Eventually we are going to need to be able to create objects without a set number of frames, and be able to dispose of those images as needed.

    Webgl helps a bit, but its not a solution for mobiles.

  • The best solution in this case is for Construct 2 to download images layout-by-layout, and not try to hack the same thing in using 'load image from URL'. (C2 already loads textures in to memory layout-by-layout, but it still downloads them all on startup.) This is on our todo list, but I can't give an ETA.

    For some users with good broadband connections, even a 400MB game won't take that long to load - if you're maxing out a good connection, it will only take a couple of minutes (which you can pass more easily using a custom loader layout). They'd have to wait equally as long, and without your own loading screen, if they downloaded a native app.

  • Ashley What about giving developers the option to tweak texture loading? I.e.: actions to load individual textures (per sprite/family) or for a full layout. If it's set as an action, and not automated when the layout loads, we could set up our own streaming mechanisms to load the next layout while the player is on the current one. Keeping the initial download time down and getting players into the game quicker.

  • GeometriX - that would be difficult to make events for, because the actual image files that are exported are not known until all the image processing on export finishes. It depends how they fit on to spritesheets and such.

  • Also being able to apply basic transformations (crop, offset, mask?) afterwards sounds to me like a natural evolution to the "Load image from url" feature

    Okay so here is a demo capx if anyone is interested in a temporary workaround for dynamic sprite animations!

    SpriteAnimDemo.capx

    I'm using the blend modes to create a mask around the sprite sheet, then animate it with a few events. Then anyone can use a regular "load image from url" to replace the sprite at runtime. In my case I have to work with random and unknown sizes of sheets, and you have that in the example too.

    Here's a recap of the layer structure from top to bottom:

    TOP LAYER

    • props sprites unaffected by the mask

    MASK LAYER (+ force own texture YES)

    • bg sprite (+ SOURCE OUT blend mode)
    • mask area

    BG LAYER

    • character sprite
    • bg sprite

    Ashley I'm still interested in a lighter method though

    Also all the masking seems to affect the overall performance a bit from what I understand.

    So again, instead of a one-click "Load Image from URL as Sprite Strip" big feature, we could use just a few simple options on the sprite element to crop or offset the image at runtime (and deal with the animation ourselves)

    There could be a lot of other uses to theses params :)

  • +1

    I could imagine to use the Load image from URL along with Animation Frames of a Sprite Object. Just need an additional C2 Action implemented - Create new Animation Frame, wherein I would load my next image for the set. The new frame could just appear as last in the active animation set of the Sprite Object.

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