Fengist's Forum Posts

  • > So, in my tests, bounce disabled made no significant difference.

    That's because you also have Pathfinding behavior with obstacles=solid and regenerating map on every tick.

    Originally, that project was a response to this thread:

    construct.net/en/forum/construct-3/how-do-i-8/artificial-intelligence-145117/page-2

    The pathfinding regeneration was added because the end user can right click to drop blocks with the solid behaviour as the test was running. It was just meant to be a crude example and I likely forgot and just left it in there. Thanks for helping define this problem though.

  • We identified performance degradation linked to the roll out of the new arcade (namely from significant increase in visitors including web crawlers). In response we've taken a few steps to significantly improve performance, and are upgrading our webservers to add additional capacity. From what I'm measuring, everything should be running a lot smoother now.

    It's back again.

    Critical error

    This should not of happened. Please contact support.

    System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at C3.Code.Controls.Application.Caching.Redis.PubSub.PubSubController.OnSubscribed(RedisChannel channelName) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Redis\PubSub\PubSubController.cs:line 58 at C3.Code.Controls.Application.Caching.Redis.PubSub.PubSubController.SubscribeToCacheKey(RedisChannel cacheKey, Action`2 onMessageReceived) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Redis\PubSub\PubSubController.cs:line 46 at C3.Code.Controls.Application.Caching.Manager.Manager.Callbacks.OnGotten[T](String cacheKey, CacheType fromType, T objectGot) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Manager\Callbacks.cs:line 99 at C3.Code.Controls.Application.Caching.Manager.Manager.Get[T](String key, Func`1 getFromExternFunction, Boolean skipLocalCaches) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Manager\Manager.cs:line 158 at C3.Code.CachingNew.Methods.GetCachedHashSet[T](String cacheKey, Func`1 getFromExternFunction) in C:\Construct.net\Source\C3Alpha2\Code\CachingNew\Methods.cs:line 115 at C3.Code.Caching.SystemMessages.MessageReportIDs.OnNewReportCreated(MessageReport newReport) in C:\Construct.net\Source\C3Alpha2\Code\CachingNew\SystemMessages\MessageReportIDs.cs:line 31 at C3.Code.Models.SystemMessages.MessageReport.PostCreated(DBContext db) in C:\Construct.net\Source\C3Alpha2\Code\ModelsNew\SystemMessages\MessageReport.cs:line 72 at C3.Code.BaseClasses.CachingNew.DatabaseBackedCachableModel`2.OnCreated(DBContext db, T newRec) in C:\Construct.net\Source\C3Alpha2\Code\BaseClasses\CachingNew\DatabaseBackedCachableModel.cs:line 217 at C3.Code.BaseClasses.CachingNew.DatabaseBackedCachableModel`2.CreateNew(DBContext db, T2 newRec) in C:\Construct.net\Source\C3Alpha2\Code\BaseClasses\CachingNew\DatabaseBackedCachableModel.cs:line 202 at C3.Code.BaseClasses.CachingNew.DatabaseBackedCachableModel`2.CreateNew(T2 newRec) in C:\Construct.net\Source\C3Alpha2\Code\BaseClasses\CachingNew\DatabaseBackedCachableModel.cs:line 209 at C3.Code.Helpers.SystemMessages.Reports.CreateSystemMessage(String title, String reportData, MessageType messageType, String ipAddress, Int32 cap) in C:\Construct.net\Source\C3Alpha2\Code\Helpers\SystemMessages\CreateReport.cs:line 67 at C3.Code.Helpers.Error.Functions.RecordError(Exception exception) in C:\Construct.net\Source\C3Alpha2\Code\Helpers\Error\Functions.cs:line 75 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

  • dropbox.com/s/qi2o2hzl5aji851/BulletAndSolid.c3p

    Much more refined than mine and the same results. Thanks for 'cleaning up' my test ;). My old laptop hit 5fps before 1000 ants.

  • Do you have "Bounce off solids" set in Bullet behavior? I can reproduce the same issue, but only when I set Bounce off solids=yes for ants.

    So it looks like a bug, I'm guessing Bullet still tries to check collisions with disabled solids.. (or rather it checks if Solid is enabled 300*300=90000 times per tick)

    EDIT: Ashley Here is my project, at ~1000 ants fps drops below 10. But if you remove disabled Solid behavior, it runs at 60 fps with 3000 ants.

    https://www.dropbox.com/s/qi2o2hzl5aji851/BulletAndSolid.c3p?dl=0

    I did have bounce enabled. So, disabled it and ran the tests again.

    Test 1: 17ms per tick w/3000 ants. 0 collision checks.

    Test 2: 22ms per tick w/3000 ants. 26,548 collision checks per tick which didn't change from 0->3000 ants!?

    I saw peaks of 1.5+ million checks per second.

    Test 3: 95ms per tick w/500 ants. 0 collision checks. Still the huge lag even with solid disabled.

    Test 4: 62ms per tick w/300 ants. 300,000 collision checks per tick witch hit the 5+ million/sec mark

    So, in my tests, bounce disabled made no significant difference.

  • Performance could well depend entirely on the specific events you're using, but unless you share an actual project file nobody can see that.

    twistedvoid.com/c3examples/collision1/Collision1.c3p.

    Do note there are some extra sprites and some checks for those sprites in the ant's wondering routine. I started with another test I created and just couldn't be bothered to remove them. But, because those checks are in all of the tests it still should provide a comparable baseline.

  • If you're running Windows ctl-alt-del and bring up task manager. Select the performance tab. Keep a watch on the charts as your app runs. If you're seeing some wild spikes in say disk activity or cpu usage, then it's likely a background process causing the stutter or even the browser itself.

  • One of the things I paid attention to while creating this test was collision checks when running in debug mode.

    In the first test with no 'solid' object to collide against, it still peaked at around 180 collision checks per tick. So, even though there was nothing to collide against, it still performed collision checks. I thought this was caused by the anthill which had 0 behaviours but enable collisions was ticked on. So, I set it's collisions enabled to false on the anthill and still got the 180 collision checks. No idea what it's checking collisions for.

    The second test, with just 20 blocks with solid behaviour... get this... 90,000 checks per tick at ~3000 ants. That was over 3.5 million checks per second. With collisions disabled on the block sprite, 0 collision checks.

    The third test... boggle... ZERO collision checks. I ran this test also with the collision enabled set to false and, as expected, zero collision checks and it ran smoothly. So even though it's saying zero collision checks, apparently it still is.

    The fourth test, expected but not this big, 500,000 collision checks per tick at peak. That's 1,666 collision checks per tick, PER ANT, 7.5 million per second. And, I ran this with collision disabled and it too has zero collision checks and ran smoothly.

    I ran one other test with the solid behaviour disabled on the blocks and, this was kinda unexpected but expected, zero collision checks.

    I'm pretty sure my test is accurate. I can't explain why the ants with solid disabled caused such lag but the block sprites with solid disabled didn't. My only guess is, that in the second test there aren't enough block sprites to make a visible difference. If you notice in the third test, it seems to run ok till ~100 ants are running around before the lag starts to hit.

  • No difference between tests 1 and 2 on my laptop, all the way to 3000 ants

    With solid behavior added to ants, things do deteriorate pretty quickly.

    Did you try running it with MS Edge? On my 8 core AMD in Chrome there was like a 3-5 ms drop in performance between the first and second but it stayed around 17ms. Running Edge... wow... it sucked.

  • Looking into this, looks like a possible Azure network problem. It seems to of resolved itself as of time of writing.

    raikoification what version are you using? The saves are not tied to our network at all as far as I am aware.

    It was strange. In the editor I could keep reloading and sometimes it gave me the right version, sometimes it logged me in and sometimes it didn't.

  • So I was goofing off with some solids and ran into a head scratcher. The more solids I added to the layout, the slower it became... by a lot. So, I created this little test project. Have a look and you'll see what I mean.

    twistedvoid.com/c3examples/collision1

    *Edit

    Here's a new version compiled in r161 after the patch for a comparison:

    twistedvoid.com/c3examples/collision2

    *end Edit

    There are 4 tests that are conducted and I recommend running them in Chrome. If you want to see how bad Edge is when running a Construct project, try these tests with it.

    Test 1: Creates 3000 ants on the layout. This is the control. Each ant has a 4 frame animation. It has 3 behaviors: Bullet, pathfinding and bound to layout. In particular pay attention to the time at the top. This is the time in ms it takes to perform a tick. Depending on your machine, you shouldn't see it change a lot even when it gets close to 3000 ants on the screen.

    Test 2: Same conditions as above with this following exception: 20 square sprites with the 'solid' behavior have been added. Again, watch the timer as it gets closer to 3000 ants.

    Test 3: This is the serious wtf. Same ant parameters as the control except that the 'solid' behavior has been added to the ants however, it's disabled. This test only has 500 ants and if you watch the timer again, you'll see why it's only 500.

    Test 4: Same test as above except, the ant's 'solid' behavior has been enabled (more or less to prove that it was disabled in the previous test.) This test only has 300 ants and there's a good reason. 500 ants will turn most any machine into a snail. This test, has pretty predictable results.

    The second test is the one that clued me in to the 'solid' behavior and the affect that even a few of them can have on a project. The 3rd test was totally unexpected. Why should there be that much lag caused by adding a disabled behavior????

  • Getting the same error with Chrome.

    Switched to Edge and get this... it came up with a big red warning letting me know the site was unsafe.

    And it's crashing incessantly in Edge as well.

  • getting the same error trying to load the editor.

  • And here's newt 's example modified to use an array of 5 possible switch combinations.

    https://www.twistedvoid.com/c3examples/ArraySwitches.c3p

    Take note of the added file "SwitchList.json"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's not going to be any easy answer to this since it's not built into C3. You're either going to have to find a plugin that works as mentioned above or

    do a JS version using JQuery

    jqueryui.com/datepicker

    or, an HTML version using the HTMLElement plugin

    w3schools.com/tags/att_input_type_date.asp

  • The simplest method would be to use a string variable.

    Each input set the variable to the current value and the new input.

    On input variableString set value to variableString& input

    You would also need a counter to tell it when to check.

    When it's time to check, compare varaibleString to another variable with the correct order.

    Newt has the solution with one suggestion. An array.

    As they turn the switches on, build a string of switch numbers. When the last one has been turned on, compare that to a string in an array. This way, you can have as many sequences as you wish.