Instances vs. Objects

Discussion and feedback on Construct 2

Post » Sun Jun 14, 2015 3:27 am

What is best for speed and size of game?
1. Many instances of as little objects as possible.
2. Many objects to as little instances as possible.

And why you think so?

I normaly try to do 1.
Because I have seen that every tileMap for example saves its picture to output, even they have the same...
I think thats for most other objects, too.
Since I had seen this, I only create needest objects.

Can for example look like this:
Image
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Sun Jun 14, 2015 11:10 am

No one with an opinion?
I do not need 100% statements!
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Sun Jun 14, 2015 11:41 am

As far as my understanding of how the c2 engine works, you will get less gpu demand if you use one sprite with the same image rather than lots of different objects with the same image (draw calls are per object).

However, this will probably only achieve measurable gains on a low end mobile. And as soon as your project takes on a few thousand events, I imagine that you will not enjoy easily using one of c2's strengths - the layout editor. It would be difficult to edit and manage a game with only a couple of objects, and optimization techniques like render cells work on objects not animation names, so there could be balancing performance losses by doing this...

I would advise you do a performance test on the platform you are targeting - because any gpu gains might be offset by a collision checking load or other extra events you have to put together to manage your technique.

Also, don't waste your time.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,211
Reputation: 43,844

Post » Sun Jun 14, 2015 2:56 pm

To Organisation, for me I can say, its much better. I faster find anything I search. But that has much to du with order all!
Im also more a programmer as a designer, may be thats why I habe no problems to organize that. I order them in some sheets and groups, I separate function and creation. The sheet you see has only creations. By copy paste l create a new menu part in a minute.
In objects I search hole day to find anything... :D and mostly i take the wrong.

The last parts of your post are interesting, I will think about this things. Thanks for your opinion.


My english is bad, but with smartphone its a real horror! Sorry!
Last edited by deathangel1479 on Sun Jun 14, 2015 7:49 pm, edited 2 times in total.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Sun Jun 14, 2015 4:56 pm

The answer is 1 since Construct2 reuse the sprites created in memory thus cloning will consume as little memory as possible, whereas when you create many sprites, then C2 has to memorize all these sprites thus consuming more memory!
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,431

Post » Mon Jun 15, 2015 11:29 am

I think you also better use spritefonts if you want best performance, works pretty much thesame and is faster, more important if you have moving and updating text..
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Mon Jun 15, 2015 11:33 am

vtrix wrote:I think you also better use spritefonts if you want best performance, works pretty much thesame and is faster, more important if you have moving and updating text..


Instead of Text("ButtonText")?
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Mon Jun 15, 2015 11:39 am

instead of regular text plugin yes, buttons could be graphics and are faster and more ways too change look, depends strongly on what you need it for, it might be better too make the app first , then to get caught in optimizing like its mentioned, just letting you know
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Mon Jun 15, 2015 11:49 am

vtrix wrote:instead of regular text plugin yes, buttons could be graphics and are faster and more ways too change look, depends strongly on what you need it for, it might be better too make the app first , then to get caught in optimizing like its mentioned, just letting you know


Buttons are grafics... And the text on is Text.
I do not think that graphics are faster than text, but I dont know it...

If you write the app sloppy and optimizing it at end you are a bad coder... Sorry, my opinion, no offense.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Mon Jun 15, 2015 12:04 pm

you dont have too believe me but they are faster, these are choiches you have depending on what you need from the app, its not sloppy, making optimizing that have little impact is counterproductive, ofcourse there are general programming rules that make for better code and should be used
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Next

Return to Construct 2 General

Who is online

Users browsing this forum: BackendFreak, htmlgames and 26 guests