Memory Usage regarding redundant events?

Discussion and feedback on Construct 2

Post » Mon Dec 22, 2014 4:52 am

So I was reading an article here on scirra about too much memory usage, and how to avoid it.
Firstly, I want to thank you for how specifically and throughly you worded it, without using tons of terms that can go over people's heads. I can offer the same praise to the C2 manual, if I haven't yet done so.
So, I decided that my game's memory usage was slightly too big, but not too terribly (141 MB, and you said to keep in less than 100). However, although I managed to reduce the "estimated memory" by about 11MB, I couldn't find too many more images that were extremely big, or too many junk ones that I was willing to remove.
So this prompted me to write a message there. After I posted it, I suddenly decided it was better off posted here to allow the possibility of more in depth discussion. So here is my message, take it as if I am saying it here and now as opposed to past tense.
-----------------------

May I ask how big of a difference it is to avoid redundant events, conditions, actions, etc and stuff?


For example, having a variable with 20 possibities, and then putting 20 "if" type events instead of simplifying it into one event that checked it.

Like for example, 30+ playable characters, the events for changing their animations, and a variable that corresponds to the index of the character being played as (each character has both a numerical value and an "internal name" string). It now sets animation by name to things like currentplayername&"stand" currentplayername&"walk" etc instead of having a large list of events for every possible character. But as some characters are also animated differently, there are actually about 5 or 6 of these "large lists" as different possibilities. There is one variable that gets checked to determine which one is used, rather than having a bunch of "or" conditions for all the characters. However, said "or" events still happen at the start of layout just to set this value. It's just not checking all these conditions every tick anymore.

I also have some uneccessary things, like, weapons that use no energy, still have energy variables, and also check to make sure they never go above the maximum energy or below zero. And also these weapons to still have energy bars that are animated accordingly. This type of thing is used for consistency, and just in case to allow for future possibilities. But, is the difference in memory usage worth being inconsistent if leaving this type of stuff out makes it lag less?

Also, every possible enemy (currently 8 boss objects and 6 normal enemy objects) has a collision event with every possible bullet object (currently about 30+), due to the weakness/resistence stuff. I want it to be flexible, and allow infinite possibilities, so there is no rulebound "elements" that these weapons are tied to. Almost every single one of these events also has two sub events, to check whether or not the enemy was killed or not from the hit it just received. I am uncertain whether or not coming up with some kind of system for using families to lessen the number of events would be essential or not. I don't mind making all these events, especially with the inclusion of "replace object" after duplicating and highlighting lots of stuff. Only if it has a large effect on memory usage or lag, do I wish to try to change this.

I would like to know if this kinda thing is even worth doing, and if so, by how much?
And given that I have already simplified lots of this type of stuff, am I making it sound like my changes were good enough? Perhaps I didn't even need to do them to begin with? Sorry if this is too vague. I don't expect you to see into my mind completely, just get a feel for the type of thing I have described, if you possibly can. :)

---------------
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Mon Dec 22, 2014 5:07 am

I am curious... are you testing for mobile?
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Mon Dec 22, 2014 5:41 am

ruskul wrote:I am curious... are you testing for mobile?


No. Game is windows only, and I intend to never go mobile. I have barely even owned a cell phone. Although I have had a couple low end ones, and inheritied mom's dinosaur aged ipad but never use it, I definitely have no desire to play games on such devices. I prefer bigger screen, and more possible keys that are also not add-ons that must be plugged in to a device smaller than them, or are tiny. And touch screens don't contribute much to my enjoyability, and I absolutely hate the idea of being forced to use it over a moveable cursor, especially when such a thing could probably have easily been programmed in anyway. Thank god DS/3DS Pokemon games don't do this to me. Honestly, I am more open to and actually appreciate using a touch screen for convienience as an alternate control method, as long as it actually is alternate. And I guess my thing is, I prefer to prioritize targeting those I empathize with as my audience. This memory thing is just one more reason for me not to go mobile. My game exports as node webkit, and I only distribute the contents of the "win32" (Windows) folder, due to not owning Linux or Mac or the ability to test on them.

Although the complexity of my game might seem as if I know more, honestly, my brain functions different and I am actually not as tech savvy as I anticipate I could come across. I barely know what the word "Linux" even is, despite having heard of it as an operating system, and figuring out that two exported folders are named after it with different numbers attached to them.

Oh, and my apologies. I intended to specify what system my game was for. I forgot to write it in.
Is 141 MB even too big for a computer? I mean like a semi new one, not something so rediculously old and uncommonly used that accomodating it would just be too much extra effort.
I mean the lag really isn't even that bad, assuming it's actually there and not just perceived by my paranoid brain.
I just kinda fear the idea of my project getting too big, especially if it happens in a way that is hard to reverse.
Last edited by DialgaBrite on Mon Dec 22, 2014 6:00 am, edited 1 time in total.
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Mon Dec 22, 2014 5:54 am

Don't make your app do any work it doesn't have to.
Minimize or eliminate every-tick events.
Definitely use Families. A lot.
Reduce repeated/redundant code regardless of memory/lag.
Are you using SpriteFonts? Check that you don't have many 'types' that use the same font image (e.g. if you have 'cloned' any SpriteFonts). Go and take a peek in the 'textures' folder of your project.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 22, 2014 6:07 am

codah wrote:Don't make your app do any work it doesn't have to.
Minimize or eliminate every-tick events.
Definitely use Families. A lot.
Reduce repeated/redundant code regardless of memory/lag.
Are you using SpriteFonts? Check that you don't have many 'types' that use the same font image (e.g. if you have 'cloned' any SpriteFonts). Go and take a peek in the 'textures' folder of your project.


I already do all of this to the best of my ability.
I described a lot of it in detail that was less vague than your post.
I thought I had conveyed my desire just to check how hugely it would effect lag/memory issues. I already simplify things as much as I feel it neccessary, but do not wish to feel judged on an effiency level that works fine for me, and affects no one else. I only wanted to know if it would cause too much lag/memory/slowness issues etc... since then it would affect others afterall.
Your response really didn't help me any, sorry.
oh, and my game is not an "app". At least not by my perceived definition of the word.
My apologies if I come off as frustrated. That's because I believe in honest expression of one's feelings, while attempting to remain calm to the best of one's ability.

As an example of how I feel, due to the vibe you gave me:
Have you looked at my source code? How do you know I don't use families? How do you know I don't use them a lot? I actually know quite a bit about them, and really appreciate their value and how they work. The bullets actually do have them. So do enemies and bosses. Some of my objects are in more than one family. What I described above, was a specific case where I was intentionally not using them, for reasons which I did describe. It is one of the few specific cases where I think things are perhaps much less simplified than perhaps they should be, which I have not found a way around yet.

As I said, I only wish to change this if it affects the exported game's performance, and affects it ENOUGH. My current system works for me otherwise, regardless of what you think of it or what works for you.
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Mon Dec 22, 2014 6:21 am

Chill
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 22, 2014 6:29 am

codah wrote:Chill


I am merely trying to speak to you like a human being who has feelings, and not "just an online person", despite your behavior.
The fact is, even though I was the one asking a question, your answer was less informative than the question.
This is not the first topic I have made like this and had it get invaded by useless responses in the same exact way.
Rather than me chill, I think your feelings need to become more warm.

And, I had just got done posting this: just-showing-scirra-some-love_t121350
Despite your behavior not being Scirra's fault, at all, it is the threat of this type of invasion that makes me afraid to come here. And yet, I keep coming anyway. And hey, are you the same person who invaded my last topic, and also said mean things to me regarding mental problems? As someone who actually has mental problems, and attempts to cope with them to the best of my ability, despite being constantly harassed online, what you said then was very hurtful. Do not act as if you are trying to be helpful when you are clearly not.
Oh, and so admin/others know, here's the topic: this-should-be-simple-math-here-what-the-heck_t118872?start=10
Second post down on page 2, after I had been constantly trying to talk to him respectfully like a human being, despite feeling emotionally abused already. Bear in mind, my post immidiately before that was legit frustration which I could understand if it seemed rude.... but like I said, what is one expected to do if they are constantly feeling emotionally abused online? It should not have ever had to come to that.
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Mon Dec 22, 2014 9:42 am

DialgaBrite wrote:
codah wrote:Chill


I am merely trying to speak to you like a human being who has feelings, and not "just an online person", despite your behavior.
The fact is, even though I was the one asking a question, your answer was less informative than the question.
This is not the first topic I have made like this and had it get invaded by useless responses in the same exact way.
Rather than me chill, I think your feelings need to become more warm.

And, I had just got done posting this: just-showing-scirra-some-love_t121350
Despite your behavior not being Scirra's fault, at all, it is the threat of this type of invasion that makes me afraid to come here. And yet, I keep coming anyway. And hey, are you the same person who invaded my last topic, and also said mean things to me regarding mental problems? As someone who actually has mental problems, and attempts to cope with them to the best of my ability, despite being constantly harassed online, what you said then was very hurtful. Do not act as if you are trying to be helpful when you are clearly not.
Oh, and so admin/others know, here's the topic: this-should-be-simple-math-here-what-the-heck_t118872?start=10
Second post down on page 2, after I had been constantly trying to talk to him respectfully like a human being, despite feeling emotionally abused already. Bear in mind, my post immidiately before that was legit frustration which I could understand if it seemed rude.... but like I said, what is one expected to do if they are constantly feeling emotionally abused online? It should not have ever had to come to that.


Sorry, but this frustrates me. You post a link stating that codah has made you feel emotionally abused and whatnot, but in the same link on page 1, codah was spending his own time to try to help you. And reading through that thread, he's not giving useless or random info, he was trying to help you understand something and you were in panic and confusion and thus couldn't comprehend what he was explaining.
It frustrates me that he attempted to help you several times in a polite manner in another thread and now you're making him sound malicious for his vague comments. His comment on Page 2 is very vague but you can't assume he was attacking mental issues, and even if he was or anyone was, come on, it's just a random guy on the internet! The mods will probably clock on to him and he will be gone. It'd be a lot worse if a group or the whole community, including the mods, was abusing 1 person. Don't get me wrong, you seem cool and it's cool you are emotionally-fueled and making detailed posts and that other thread showing your appreciation to Scirra is awesome and heartwarming to read! But come on, the guy wasn't a troll or anything, he was trying to help. (Plus this thread, he listed a few things including and you respond with "How do you know I don't use families?"...well, how is he supposed to know? We don't have your capx or anything :P)

Relevant to the thread:
You'll come to learn what sorts of events really take a toll on performance. Luckily your only target is Windows so it's not as big of a deal. I'd say one of the worst things is collisions with more than 4 collision points, it could severely impact performance if there's too many going on at once. Try and make as much stuff only have 4 points in their collision polygon.
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Mon Dec 22, 2014 10:22 am

@Jase00 thanks for the word in defense, I purposely refrained from replying in case I said something I'd regret. My last post in this topic.

Edit: oh jeez, it's him from the other thread. I hadn't noticed.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 22, 2014 11:40 am

Jase00 wrote:
DialgaBrite wrote:
codah wrote:Chill


I am merely trying to speak to you like a human being who has feelings, and not "just an online person", despite your behavior.
The fact is, even though I was the one asking a question, your answer was less informative than the question.
This is not the first topic I have made like this and had it get invaded by useless responses in the same exact way.
Rather than me chill, I think your feelings need to become more warm.

And, I had just got done posting this: just-showing-scirra-some-love_t121350
Despite your behavior not being Scirra's fault, at all, it is the threat of this type of invasion that makes me afraid to come here. And yet, I keep coming anyway. And hey, are you the same person who invaded my last topic, and also said mean things to me regarding mental problems? As someone who actually has mental problems, and attempts to cope with them to the best of my ability, despite being constantly harassed online, what you said then was very hurtful. Do not act as if you are trying to be helpful when you are clearly not.
Oh, and so admin/others know, here's the topic: this-should-be-simple-math-here-what-the-heck_t118872?start=10
Second post down on page 2, after I had been constantly trying to talk to him respectfully like a human being, despite feeling emotionally abused already. Bear in mind, my post immidiately before that was legit frustration which I could understand if it seemed rude.... but like I said, what is one expected to do if they are constantly feeling emotionally abused online? It should not have ever had to come to that.


Sorry, but this frustrates me. You post a link stating that codah has made you feel emotionally abused and whatnot, but in the same link on page 1, codah was spending his own time to try to help you. And reading through that thread, he's not giving useless or random info, he was trying to help you understand something and you were in panic and confusion and thus couldn't comprehend what he was explaining.
It frustrates me that he attempted to help you several times in a polite manner in another thread and now you're making him sound malicious for his vague comments. His comment on Page 2 is very vague but you can't assume he was attacking mental issues, and even if he was or anyone was, come on, it's just a random guy on the internet! The mods will probably clock on to him and he will be gone. It'd be a lot worse if a group or the whole community, including the mods, was abusing 1 person. Don't get me wrong, you seem cool and it's cool you are emotionally-fueled and making detailed posts and that other thread showing your appreciation to Scirra is awesome and heartwarming to read! But come on, the guy wasn't a troll or anything, he was trying to help. (Plus this thread, he listed a few things including and you respond with "How do you know I don't use families?"...well, how is he supposed to know? We don't have your capx or anything :P)

Relevant to the thread:
You'll come to learn what sorts of events really take a toll on performance. Luckily your only target is Windows so it's not as big of a deal. I'd say one of the worst things is collisions with more than 4 collision points, it could severely impact performance if there's too many going on at once. Try and make as much stuff only have 4 points in their collision polygon.


I feel like I am talking to a brick wall here.
Thanks for the info about the memory thing, but it felt greatly overshadowed.
I just want to ask one thing though. Can I trust you to actually give a reasonable response? I want to know about this:
you can't assume he was attacking mental issues

May I ask what can be assumed then?
What he had said to me was "C2 is not the only thing you need help with".
If it is not C2 or mental health, what is it then?
It's not like he actually told me.
When someone acts secretive in such a way, this is not something I can trust.
If someone has a legitmate problem with me, then they must tell me what it actually is. Otherwise, I can not even attempt to fix it.
B
15
S
2
Posts: 103
Reputation: 1,178

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 25 guests