Graphics Hiccup

For questions about using Classic.

Post » Sun Jun 07, 2009 2:25 am

I've gone ahead and attached a copy of my exe. My problem is that in my level, there are two places where the game will hiccup loading them the first time.The two areas in question are directly to the left of where you start off. Does anyone know what causes it? I"m using a couple large objects, but have tried using low resolution images for the textures to no avail, as well as splitting the two large terrain pieces into many small pieces.

Link
B
2
G
3
Posts: 15
Reputation: 880

Post » Sun Jun 07, 2009 9:22 am

It's impossible to say without looking at the .cap to see what you're doing.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Jun 07, 2009 1:49 pm

Which actions cause the hiccups? If they're actions like loading textures from disk, they have to be decompressed and transferred to the graphics card, so there's no way around the delay in doing that.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Jun 07, 2009 6:47 pm

[quote:35d80yd5]as well as splitting the two large terrain pieces into many small pieces.[/quote:35d80yd5]

I don't know if it's the images that are causing your hiccup. But if it is your images, then it's not just a matter of chopping up large images into small images.

You have to make modular tiles. Create a handful of selected pieces that can snap together to make larger, complex shapes. For instance, you have a lot of large areas that are filled with basically the same empty, black space. You don't need all that blank space, it's just taking up VRAM. You can use a simple 32x32 black Tiled Background and stretch it. Or if you plan on texturing that area, you can use a few simple types of tiles that that layer over each other and repeat them.

And just so I'm clear... no you can't just take the large platform sprite and erase the middle part, because blank space in a sprite takes up just as much memory as colored space.

As for the outer surface of your platforms... it appears that you want to have something that doesn't look like it's repeating. That's fine, too. Just make a small set of raggedy looking tiles (maybe twenty tiles or so) that you can fit together in different configurations so it doesn't look like it's the same tile over and over again. You might get a few similar looking areas, but you can disguise them with decorative stuff.

It's just not a good idea to draw a large area of terrain, ever. It's wasteful. Yes, making tiles and fitting them together like puzzle pieces is more work... but it works. Games use tiles and repeating textures for a reason. One kind of tile with 20 instances is much more efficient than a single sprite of equal area.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Jun 08, 2009 2:51 am

2d games = instanced terrain chunks or tiles <ALWAYS USE EITHER OR BOTH.
1. don't make a big terrain sprite
2. don't do 1
3. 1 and 2
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Mon Jun 08, 2009 5:28 am

Heh... saw this posted in the SA Game Dev Challenge thread :P. Hammer Bro's game, too.

I had another thought about the hiccup... it might be the physics. I've noticed when I have many small physics objects colliding, I sometimes get a pause. It could be your lava, or your rocks, or all of it. Hard to say.

Try taking the physics lava out and see if that cures your hiccup. And if you're not doing anything special with the lava (i.e., if it's just going to be for show) then you can create a similar bubbling effect with non-physics sprites. Just create some oblong egg-shaped gradient sprites and set them close to each other. At the start of layout, set their angles to random(360), and then rotate them all from that point. It looks nice and bubbly. I can upload an example later if you like.

Also, if you're making large collision masks for your landmasses then you can still use the tiles method. I have a prototype minigolf game that uses regular sprites to show the boundaries of the level (like tiles) but then there is a single box object with a single custom collision mask that encompasses the whole level. I can PM you the .cap if you want to take a look. It would likely help to increase the performance of your game.

Oh, and good luck with the compo :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests