Asset optimization, excess tilesheets exported

Discussion and feedback on Construct 2

Post » Thu Feb 14, 2013 4:47 pm

Hello. I'm currently optimizing a little game i'm working on, and i got a few questions regarding how C2 handles graphical assets upon exporting it for web use.

I resolved the original question, but have an updated issue:
If i have 20 objects that are the same, and using the same tilesheet - why does it have to create 80 tilesheets? That just adds to the size of the project, when it can simply use the same 4 tilesheets that are generated.

.capx - updated capx for reference. There are 4 trees present, they all use the same tilesheet. Upon export, they generate 16 tilesheets - even though 4 would be enough. Is there a way of using only those 4? Era2013-02-14 18:26:35
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Thu Feb 14, 2013 4:54 pm

You might want to check this article about spritesheets in Construct2 as well as image compression in C2.

This should help you optimize as much as possible.

Also be aware optimisation is a waste of time for anything not mentioned in the performance tips manual entry.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Feb 14, 2013 5:10 pm

Gah, i was one search away i guess. My apologies for that - and thank you!

*Edit: One thing though. If i have 20 objects that are the same, and using the same tilesheet - why does it have to create 80 tilesheets? That just adds to the size of the project, when it can simply use the same 4 tilesheets that are generated.

.capx - updated capx for reference. There are 4 trees present, they all use the same tilesheet. Upon export, they generate 16 tilesheets - even though 4 would be enough. Is there a way of using only those 4? @KyatricEra2013-02-14 18:00:30
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Thu Feb 14, 2013 6:39 pm

You shouldn't have 20 objects using the same images! Just use one object type with that one set of images.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Feb 14, 2013 7:06 pm

@era This is where you need to look at instances vs. objects... that should shed some light on this as well.BluePhaze2013-02-14 19:06:52
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Thu Feb 14, 2013 9:28 pm

@Ashley @BluePhaze Yes, sorry about that. Its not very clear in the capx provided, nor how i formulated my issue, but what if i have 20 different objects (with different behaviors, settings and events linked to each), but they all use the same tilesheet? Thats my issue.

Lets say i have 20 tree objects in this project. Each tree rotates around seperate circular shapes, some of these trees are moving constantly (up or down), some never move, and some are moving based on triggered events or periodically. All of the objects are behaving different in some way - but they could all use the same tilesheet (ie. they look the same).

If the tree was a static art asset i would of course just create 1 object and create instances of that object throughout the level.

I've for sure missed something very crucial during my time with this tool, because there has to be a better way of doing it. So my apologies for these rather basic questions. Era2013-02-14 21:30:59
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Thu Feb 14, 2013 9:35 pm

@era You can have events or functions that use the IID or UID of the object in order to have different actions for them possibly. That way you can use instances instead of objects and react differently to them. You could also create an instance variable that gets assigned some type of keyword or name, and have the events check that instance variable when the logic needs to behave differently based on which tree it is... just some thoughts. Hope this helps...BluePhaze2013-02-14 21:35:52
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Fri Feb 15, 2013 12:20 am

Well an easy thing to do is have invisible objects with no animations that are all acting differently, then just have one "cosmetic" sprite with lots of animations that you pin to each different kind of object.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Feb 15, 2013 3:14 am

Clever! I'll look into it, it'll probably work. Thanks for the feedback.
B
34
S
11
G
9
Posts: 189
Reputation: 8,595


Return to Construct 2 General

Who is online

Users browsing this forum: Google [Bot], shinichild, Unconnected and 0 guests