Je Fawk's Forum Posts

  • I agree about the bug report.

    It seems like 1 out of 20 chance when the game navigates to a random layout. Sometimes they happen one after the other when I start the preview (since I must close the tab when this happens), other times I can navigate 100+ and it won't happen.

    I'm still looking for others that experience the same in hopes that they have more info on this.

  • Seems it's unrelated to load from URL. I disabled in bulk and I'm still getting the same error.

    After changing tabs back and forth a few times the console became responsive and I could see it was spammed with

    Uncaught (in promise) TypeError: Cannot read properties of null (reading '_StopRunning') at C3.Runtime._DoChangeLayout (runtime.js:1:43338) at C3.Runtime._MaybeChangeLayout (runtime.js:1:41925) at C3.Runtime.Tick (runtime.js:1:38375) at instance.js:36:39 _DoChangeLayout @ runtime.js:1 _MaybeChangeLayout @ runtime.js:1 Tick @ runtime.js:1 (anonymous) @ instance.js:36

  • I'm working on huge projects (5-10k events) and had not much of a problem with the saves.

    If you have problems it might be your browser or your addons.

    I had issues with Edge, but Chrome has been working great.

    After you save successfully just push to git.

    Another idea is to make your save files smaller by offloading data into files in the C3 projects, rather than having them in the events (works great for visual novels for example).

    Good luck!

  • Randomly our game Nightwalkers.io is freezing with this error:

    imageInfo.js:1 Uncaught (in promise) Error: already loaded texture at C3.ImageInfo.LoadStaticTexture (imageInfo.js:1:2448) at animationInfo.js:1:730 at Array.map (<anonymous>) at C3.AnimationInfo.LoadAllTextures (animationInfo.js:1:706) at runtime.js:1:498 at Array.map (<anonymous>) at t.Plugins.Sprite.Type.LoadTextures (runtime.js:1:489) at C3.ObjectClass.LoadTextures (objectClass.js:1:6451) at C3.Layout.MaybeLoadTexturesFor (layout.js:1:12984) at C3.Runtime.CreateInstanceFromData (runtime.js:1:26444)

    We started developing more on this 7 year old projects recently and we've been having this error.

    I've read some forum posts and supposedly it was fixed 3 years ago. I guess the was resurrected somehow, our never fully fixed.

    construct.net/en/forum/construct-3/general-discussion-7/error-already-loaded-texture-143707

    construct.net/en/forum/construct-3/general-discussion-7/heck-uncaught-in-promise-174957

    construct.net/en/forum/construct-3/general-discussion-7/error-texture-released-times-175126

    We don't really have the time to try and isolate this from a 7200 event project projects, so posting it as a bug is out of the question.

    We are pulling images from URL (which we saw in other posts talking about this error).

    This is the first thing we'll attempt to remove though it will take some time...

    Meanwhile does anybody have any more ideas/suggestions we can try?

    Tagged:

  • The problem is the following, as with a lot of C3 features: the feature is good but there is no documentation for what it shouldn't be used = devs need to test a lot of stuff to find out that from 10 ways of doing 1 thing, only 1 is really what they need for their scenario.

  • Cannot debug a project without an internet connection.

    Can run it normally, just not in debug mode with the debug panel appearing.

    Is this intended or is an internet connection required for debugging for some reason?

    I don't lose internet connectivity often but when I do it can be for days.

  • The community wants to see more features added, not the removal of features! 🙏

    After the hierarchy which is amazing I stopped using any other features due to bugs, low performance, or it was stuff that I already do with my own systems.

    So more features, hmmm I don't know about that, depends who you ask.

  • The CPU profiler is great to see usage side by side, even though it might be wrong.

    When my game stutters on my M1 Mac that's when it needs optimizing, because if it has problems there, it will be worse on weaker computers.

    Hard to avoid looking at this thinking I'm testing wrong though:

    However Ashley you made some good points and provided interesting insight, thanks!

    > Ashley: So for maximum performance, avoid "for each" unless you really need it.

    Tips like this are super valuable. I think people really need something like a Construct Cookbook or CheatSheet that shows the best practices for doing things the right way.

    It's a good tip, for code that can go without it indeed. I first test without and then if it doesn't work after some changes around I sadly have to resort to For Each.

    I bet I could avoid it more often if I had more time to change things around more, but I need to balance finishing the project vs making it better and not having it published for some time.

    > ...in the case of "has tags", in one case you just compare a string which is a very simple and quick operation for a CPU. On the other hand "has tags" has to split the given string by spaces to extract individual tags, and then verify that all the provided individual tags are in the set of tags for the given instance. It's probably at least 10x as much work as just comparing a string. It's not that it's slow...It's just that you've used a feature which necessarily includes more complex steps. So if you make a benchmark that absolutely hammers that specific feature, you will probably see something like a 10x difference.

    I don't understand why it splits when it has 1 tag and no spaces. Feels like if there's a check "does it have any white spaces" it would not be so bad in performance for this scenario, but to be fair, I'd still use the instance var check.

    — just like Jase00 said, “This is a good example of understanding ‘under the hood’ a bit more so that we can make decisions on what to use and how to structure things.”

    It's what I've been saying all this time, every dev wants to understand more of what's happening under the hood so that we can avoid wasting time guess-testing.

  • Ashley thank you for the reply.

    TLDR

    It's acceptable to have different ways of doing 1 thing, and some being worse than others, but a lot of devs were surprised about very basic things, that if done differently result in high CPU gains, for example the Sprite.instancevar vs compare two values, or using an instance var rather than Tags if you have only 1 tag per sprite and not multiple: construct.net/en/forum/construct-3/general-discussion-7/stop-using-tags-tag-187031

    I would like to see more info in the official docs about these quirks. Also there are some useful blog posts from you that are very hard to find, if they are still relevant today.

    Real world projects

    We've been struggling with performance issues for a long time now, started with our multiplayer game Nightwalkers.io which could not have more than ~ 100 zombies on the screen. You could argue the architecture was wrong to begin with, which might be true, but also optimizations were always needed and took a lot of dev time to achieve, which did improve the game until a point.

    We're not making simple games, we're making very complex ones.

    This forum post started from the following issue

    This is CPU intensive

    This is not

    And these are my measurements, both the CPU profiler as well as my laptop's CPU usage. Can't get any more real than this I believe.

    CPU intensive: C3 CPU profile 19.3%, system CPU usage user 14%, Chrome 48.9%

    Not so CPU intensive: C3 CPU profile 5.8%, system CPU usage user 10%, Chrome 44%

    Bear in mind that I was not doing anything on the screen apart from having the panels opened, so most mechanics were on pause.

    Regarding the CPU power

    I don't think it's related to this in this case because people have tested with the same groups active at all times, and it shows differences.

    If the CPU would be throttled because it's not used at max, then all the groups would suffer and show reliable differences.

    BeatsByZann I'm sure he could provide the c3p without any addons if it would be helpful.

    He posted these screenshots:

    Also here alastair did the same: construct.net/en/forum/construct-3/general-discussion-7/stop-using-tags-tag-187031

    Construct 3 is very fast

    Also regarding how fast C3 is, I have to agree with you, this would have to be tested using real life projects because at the end of the day, that's what we make and that's what people play.

    Why make forum posts about small tests that might not appear in real projects?

    It would be ideal to publicly show what's wrong in our project but it's not realistic. So we make small projects in an attempt to replicate an already existing theory. And we're very happy that other devs pitched in on this, it was a very useful community-driven test. As far as I understood, a lot of devs gained some valuable knowledge from these.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • thanks for testing it out!

    Also can do without disabling groups as you can compare each Group's performance in the CPU tab while debugger is open:

    True, but I don't trust cross comparison on the same run of a project for some reason 😁, so I prefer to run each group separate.

  • R0J0hound Great stuff, thank you for sharing!

    Would have been great to see Compare two values as well if you have the chance.

    Sprite.a = 1

    Sprite.b = 0

  • Thanks to this thread, I will be hunting down those "for each" blocks, seeing if I do indeed have some subevents with a quick "Sprite Inst Var = 5", and change this to "Evaluate Expression", measure, see how much improvement is gained.

    Is evaluate expression any better than compare two values? I never use the valuate, always use the compare.

  • My slight fear of a reply would be "measure" or "would this affect real world scenarios", but I feel the difference here is:

    I don't think this is an unusual or fake case. The issue came up while optimizing a project I've been working on for months. Since I can't share that project publicly, I made a smaller example. The numbers may not match a typical project, but they help isolate and show the problem, problem that I'm facing now.

    I think most people will understand the need for abstraction here.

  • If you are using Object has tags when you use only one tag all the time, you'd better reconsider using some instance variable instead.

    The CPU test shows massive changes in the CPU profile per groups. (tested with r449.2)

    Try it yourself, disable all the groups and enable them 1 by 1, then run the project and check the CPU profile: OneDrive

  • BTW fun fact, if you set opacity to a decimal number, I recall it eating CPU far more. Makes sense in some ways, C3 gotta convert it to int, but I recall it was a measurable different in cpu. Worth noting if you make your own opacity fading systems, better to wrap your opacity result with int() instead.

    Very interesting, thanks for sharing!