Large layout issues

Discussion and feedback on Construct 2

Post » Thu Apr 11, 2013 4:13 am

@ramones - Oh I should have been more clear, I knew you could import them but also heard that they get converted on export so it had no real effect (as Ashley just confirmed)

@TELLES0808 - no, I haven't heard of it. Do you have any link?

@Arima - Yeah after trying it a few ways I still ran into the occasional pauses. It was slightly different on different computers though, on one you couldn't notice any pauses at all, but the others had different ranges of pausing.

@Ashley - Okay, thanks for that. Would you have a recommendation as to how large is okay before you run into issues on the average computer? (as in memory usage, and also not concerned about mobile)Tobye2013-04-11 04:16:32
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Post » Thu Apr 11, 2013 4:16 am

http://www.mapeditor.org/

http://www.scirra.com/FORUM/plugin-tiled-sprite_topic53015.html?KW=tiled+plugin
ImageImageImageImageImageImage
B
93
S
20
G
13
Posts: 1,215
Reputation: 18,990

Post » Thu Apr 11, 2013 5:05 am

Thanks, I tried it out but it didn't help unfortunately. The memory usage was unchanged.
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Post » Thu Apr 11, 2013 5:12 am

Hmm, I wonder if something like this could be implemented as a plug-in at some point. It seems like something people frequently want to do, and if a plug-in could stream in and discard segments of a texture dynamically based on distance, I think it would really help.Arima2013-04-11 05:14:19
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Apr 11, 2013 9:37 am

@Arima - Do you think this would be a possibility at all? I wouldn't mind paying someone a little cash if you know someone who can do a good job of it.
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Post » Thu Apr 11, 2013 10:54 am

When you're developping a game, you enter the world of tricks and faking.
It's just not a straightforward process.

The only time I worked on a game with full, non modular assets, was on a friends point&click game.
But we still used a trick: we made video sequences that looped and we layered a HUD on top. Changing a view was merely just reaching another point on the video and looping through a range (like from the 30th second to the 45th).
The year before I learnt the lesson. Another friend was making the same kind of point&click but with Sprite animations. The project (it was multimedia fusion 2 but it's not relevant here) went up to 1.5Go and took like 10 minutes to open.
And at least 1 minute or 2 to preview it. The Ram used, I think, went up to 800Mo.
All that because there were a lot of 1024x768 sprite animation.

If you're curious about the calculation it's rather simple. A pixel has 4 channels R,G,B,A and each Chanel takes 1byte (8bit, 256 levels).
So a 1024 x 768 image will take 1024*768*4 bytes which is exactly 3Mo.
This friend of mine had like 4 camera view with looping animation(to create some kind of mood...) and when I say animations, it was 3D animated render and composited on after effect. So making tonnes of frames was pretty cheap. And there were between 50 and 150 frames. On top of that, there were some state changes, which means, an entirely new animation loop each time.
So the project probably had up to 250/300 images.... Here are your 800Mo of Ram. (And of project size since, I think multimedia fusion 2 store images as raw bitmaps).

Now, for a better example that kind of speak for itself, you have Rayman Origins.

And I'm probably missing tonnes of things.
I wouldn't be surprised if some part of the land in the background were used for the foreground (or the other way arround)
But anyway, you can see that this image is build by duplicating the same assets. They are resized/mirrored but also the hue,saturation and lightness are tweaked as well as some blurring effect to fake out of focus objects.

What I suspect as well, since it's made with the ubiart framework. is that the curly plants might be distorted sprites to create a bit more variety. And also, you can see those plant on other levels but with a more purple hue.

And that's only what I discovered. They are definitely more tricks that allowed them to lower the memory footprint and so increase the amount of graphics in the image.

A good 2D game artist has to think of modularity. It's not easy, it's even, often, painfull for the artist. But that's the price of real time rendering (:
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Apr 11, 2013 5:09 pm

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

Post » Thu Apr 11, 2013 5:33 pm

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.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Thu Apr 11, 2013 6:20 pm

@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.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: 99Instances2Go, Artpunk and 12 guests