Changes: see edits at the end ==== So the UI in PA in some scenarios lags. At least some of them are caused by tooooo many Knockout updates happening. The way knockout works in some cases creates a substantial amount of unecessary duplicate updates, or updates that are invalidated mere nanoseconds after they came to be. There is a Knockout extending library called "Knockout deferred updates" that fixes this by introducing asynchronous processing. That's dangerous, as it may change the way some stuff works out, so this may create hard to reproduce bugs that are not easy to fix. However a few quick tests I did showed nothing wrong and ... well see for yourself. In the following video I try to select a ton of engineers and place a turret as quickly as possible. First it has ko deferred updates enabled: then I disabled it and suddenly I cannot instant press x anymore and place the turret because I am faster than the UI can process the select. The mod is on pamm. It shadows the knockout library and just appends ko deferred at the end of it. I don't think this can break in a bad way from patches. Unless maybe Uber adds ko deferred into the base game, in that case it would be loaded twice. No idea what that would do. EDIT: Forgot to link the github of the lib: https://github.com/mbest/knockout-deferred-updates So as a reminder: I am not the author of the actual magic. I just added it to PA EDIT 2: So this seems to work out pretty well, let's call this a [REL] instead. Reports so far all go like: "no lag at all anymore, no new bugs". So it seems to be more or less save to use. EDIT 3: Updates the mod (version 3 now): - Fixed some horrible bugs in the lobby by simply only loading the magic in the actual ingame scene. This should also fix all potential issues in any other scene. Only ingame is now affected. - Fixed the chat not going downwards ingame via a bit of UI mod code - additionally include https://github.com/NobleJS/setImmediate, it is used by ko deferred to speed up processing even more and at least in this demo it has a pretty noticeable effect: http://jphpsf.github.io/setImmediate-shim-demo/ - This mod now also fixes the unclickable area in the top of the ingame view. That is unrelated to ko deferred, but I am too lazy to do an extra mod for it and I wanted it fixed.
Gonna try this later, but What mod changes icon colors when selected?!?!? I've been looking for soooooo long
REALLY!? I guess that's no surprise, my settings list is so long with all the mods I have that I could have easily missed it.
Tried the mod and it looks very promising. No lags AT ALL. And no [new] bugs encountered so far. With this I can finally work on raising my APM Edit: woah left pa open and got 600 air fabbers, and its smooth as hell
Just made a test with more than 1k fabber (mix of T1/T2 air/bot/vehicle) and selection is swift, without that mod I used to hang 5 to 10 seconds when selecting a mix of approximately 20 T1 + 1 T2. Awesome job !
PA tries to eat 10 cookies at once, and then PA chokes on cookies. Mod feeds PA one cookie at a time so that PA doesn't choke on cookies.
Hi, at the risk of sounding like a total newb at javascript I seem to be having the same issues. I have tried to add this mod the PA without success can anyone give some quick and dirty instructions on installing this I have added the new knockout 3.1.0.js and knockout-deferred-updates.min.js to ui_mod_list.js. and i have tried to activate it via the ko.computed.deferupdates = true but i don't seem to come up with the same result as you guys, there is no change. Thank You Ryan Trippett
Is the use of boot.json required - i.e. does the script have to be loaded before KO is used? If not, the normal way for mods to include scripts would break less easily. Another way would be to append kodef.js to the end of knockout-2.2.1.js - because the KO library has version number in its name, shadowing it should cause no problems, because if Uber updates the file they will create a new file under a different name.
@orfjackal I did put in roughly 3 minutes into thinking how to make this a mod. There may be better ways for sure. I assumed the ko deferred needs to be loaded before any ko code is used because I doubt the library would have a chance to change anything of the behavior on an already created ko.computed. I may be wrong. I guess after this breaks due to a patch I'll look into it more. Appending it to the knockout file sounds like a very good idea. EDIT: Actually I have time now, while after patches ... ah gonna add it to the end of the knockout file. @Trippet: There is a sticky topic with a mod manager. Download it, open the available mods tab and search ko. Click install. You're done. That's actually not correct. It's more like: PA tries to eat 10 cookies at once, but having only 2 hands they drop to the floor and it takes a while to gather them all and eat them. The mod crunches the 10 cookies in a mixer, adds water and serves PA a cookie shake that's very easy to drink and hopefully just as tasty.