Those heavy Polygon collision points

Discussion and feedback on Construct 2

Post » Wed Nov 25, 2015 7:19 pm

Hello guys ! You've probably heard of Dolly, a beautiful little indie game available recently (otherwise, you should). As an amateur working on a platform game, I wonder how can I have something like that on C2 with some physic in it, and I'm curious to hear your opinions about that, and your opinions about my opinion. Indeed, this one involves (eventually) some memory issues, and as we know, memory is sacred.

More precisions. Here's a pic from the game, we'll use it as our example for this whole topic.

Image

Now some statements :

- Everything on the Foreground is physic (let's pretend you have to dodge the leaves. I love being cruel)
- We can, of course, have as many layers as we want
- We can use whatever physic behavior we want (if your prefer Box2D or Chipmunk or Crayon...doesn't matter)
- We can use Tile Maps and Tiled Background (personally, I will not)
- Every platforms is a new different object, not the instance of another (just to treat that as an extreme case)

So now, here's how I'll try to make it runs :

number of layers : 3
- Background (contains the drawing of the sky and its clouds. This drawing is a sprite that I use as background).
- Intermediate (contains the drawing of the moutains and the sun. Once again, it's declarated as sprite).
- Foreground (contains the others sprites, which are physics platforms and character).

number of families : 1
- Phys, family which contains every single sprite supposed to be physical. This family has a physic behavior. As you may understand, she contains 8 objects (the player, the leaves and 6 platforms). They're all immovable, except the player.

Okay. The simpler platforms have "bounding box" as collision shape. But for the more developed structures like the one on the left, I'll use Polygon Shape and end up with a beautiful but heavypolygon of 20 points or more. I'll use Polygon Shape for the column too, even if I could use bounding box for them as well. Now, I have my physical objects. I just have to make some controls in the event sheet to move my dude and it will be ok I guess. It should looks great with some parallaxes.

But is it clever to proceed this way ? When I read something like this :

https://www.scirra.com/blog/112/remember-not-to-waste-your-memory

I suppose the answer is no, but then how to deal with complex objects when we're on a physic project ? And is it so problematic if we have one or two objects with more than 8 collision points somewhere ? I really question my approach. Even the background for example, you can't use a tiled background for such a detailed drawing, can you ? I really wonder :geek:

Well, here we are. I'm curious to know your own approach, and especially know if mine is correct or if it's a total mess of logic and/or memory. I always did my little games (when they use physic with a detailed background, I mean) with a similar method, so I wonder if it's finally worth or not. How to optimise it if I have a bunch of objects like the one on the left for example ?

I wait your comments, advices, and opinions folks, thanks ! ;)
Last edited by LeuNoeleeste on Wed Nov 25, 2015 8:29 pm, edited 4 times in total.
B
15
S
3
Posts: 86
Reputation: 1,430

Post » Wed Nov 25, 2015 8:21 pm

Hey,

Simply, for mobile it might be an issue, but for desktop no.

This is unclear to me thought:
- Every platforms it's a new different object, not the instance of another

You just make objects and you should reuse them as often as possible.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
78
S
21
G
19
Posts: 1,932
Reputation: 17,316

Post » Sat Nov 28, 2015 10:45 am

Thanks ! I'll take note. I'll wait for other's opinions too !

You just make objects and you should reuse them as often as possible.


Yeah don't worry I know ! This is just another difficulty to cover another extreme situation. Just a Test ! ;)
B
15
S
3
Posts: 86
Reputation: 1,430

Post » Sat Nov 28, 2015 12:45 pm

The collision point thing is mainly a recommendation, and mainly relates to C2's collision detection system. The physics behaviors use their own collision detection system if that's of any concern. Overall I'd just test it and see if it works fast enough for your liking. If not simplify your collision polygons.

The other aspect you're testing with big backgrounds and one instance per Sprite will just use more video memory. You can leave it as is and if it works, great, but the memory requirements for your game will be higher which limits what systems can run it.
B
89
S
30
G
95
Posts: 5,157
Reputation: 63,450


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests