Load Image from URL as Sprite Strip?

Discussion and feedback on Construct 2

Post » Wed Jun 27, 2012 6:05 pm

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
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Thu Dec 20, 2012 6:12 am

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?lemo2012-12-26 05:25:57
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Thu Dec 20, 2012 11:52 am

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.Ashley2012-12-20 11:53:09
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Dec 20, 2012 12:04 pm

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.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Fri Dec 21, 2012 12:13 am

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?
lemo2012-12-21 00:16:47
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Fri Dec 21, 2012 12:59 am

[QUOTE=Mipey] 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?[/QUOTE]

That's why you make it an application/executable...
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Fri Dec 21, 2012 2:40 am

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.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Dec 21, 2012 1:49 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Dec 22, 2012 7:15 am

@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.
B
56
S
15
G
10
Posts: 910
Reputation: 11,972

Post » Sat Dec 22, 2012 3:35 pm

@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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Silverforce, Zebbi and 13 guests