badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 (edited) New development version: - Adjusted positioning for production row when not observer and playerid > 1 - Small visual adjustments - Decreased update delay from 1s -> 500ms - Small optimizations and refactoring - Do not show remaining time for buildings without assigned workers - Do not display progress bar when foundation has not started - Small adjustments in preparation for Units display mode - Fixed transition when player resigns -> observer mode prodmod.pyromod Edited July 24, 2020 by badosu 2 Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 (edited) @nani Suggested I did some benchmarking and I noticed the performance is atrocious. 93% of time is spent on retrieving entity states from `GetMultipleEntityStates(Engine.GuiInterfaceCall("GetNonGaiaEntities"))`, making each production iteration spend ~100ms on mid game 4v4. Personally, I've not noticed any jittering or relevant performance loss in-game, but that may be due to the async nature of js. Anyway, trying to get entities per player is even slower as more IPC calls are needed. Is there a way to invoke the `RangeManager` passing some kind of query with the currently exposed interface? If it's possible, but the interface is not implemented, can that be done as a mod (and not cause OOS)? I appreciate any input here. Edited July 24, 2020 by badosu Quote Link to comment Share on other sites More sharing options...
nani Posted July 24, 2020 Report Share Posted July 24, 2020 Measure the getMultipleEntityState and the engine call separatly. get state is a very heavy operation as it returns all kind of data when you only really need some (you can create your custom get entity state specific data function I guess) if irrc the get state function uses a local cache to increase performance but also gets cleared every new simulation turn as (state data changes) so the cache might not be much of use in this case :/ Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 (edited) `GetNonGaiaEntities` is quite fast, the problem is `GetMultipleEntityStates` which performs a myriad of checks and operations to bring all possible state detail of a particular entity, considering all possible entity types, combat details for unit position, etc... I guess I can patch the gui interface to bring only the details I need and hopefully optimize a bit, not sure that won't trigger an OOS though. Edited July 24, 2020 by badosu Quote Link to comment Share on other sites More sharing options...
nani Posted July 24, 2020 Report Share Posted July 24, 2020 Adding new methods to the GuiInterface component doesn't trigger OOS and if you only extract data from the simulation then you can guarantee no OOS as it doesn't affect the simulation 1 Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 Yes, I'm actually making use of autociv code that does that, found by accident after I noticed overwriting the exposed functions broke the added functions by autociv. Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 (edited) New development version: - Big optimization in code that retrieves production from players, reduced from > 100ms to < 10 ms in late game 4v4, accounting for GUI. Thanks @nani prodmod.pyromod Edited July 24, 2020 by badosu 2 Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 New development version: - Inline more stuff related to production retrieval, everything under 5 ms late game 4v4 prodmod.pyromod Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 @nani Any idea with patchApplyN is not available on simulation/components? I brought the definition to simulation/components/autociv_patchApplyN.js and it's still not working.@go2die It should work with autociv loaded before prodmod and without the colors mod. Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 meh, I want to make it work without autociv, so for the development version it's fine as it is As soon as I figure out how to make dynamically colored sprites the colors mod should work together too Quote Link to comment Share on other sites More sharing options...
nani Posted July 24, 2020 Report Share Posted July 24, 2020 I dont know what load order the simulation files have. The file might be being loaded after its used or not accesible from that folder, try copying the file where you use it but be careful to not name it the same as the others. 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 24, 2020 Report Share Posted July 24, 2020 autociv_patchApplyN(GuiInterface.prototype, "ScriptCall", function (target, that, args) { let [player, name, vargs] = args; return name in prodmod_exposedFunctions ? that[name](player, vargs) : target.apply(that, args); }) Did you forget to declare it somewhere? Can't call it without defining it eg with function keyword? Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 (edited) @Stan` The problem is the `autociv_patchApplyN` function is not available to that file, which is puzzling since I am using the same format as autociv is. Anyway, I already put the definition and the same file as GuiInterface and called it a day New development version: - Dynamically colored sprites - Brighten progress bar if the player color is too dark (most difficult thing I've done on this project so far ) - Compatible with or without autociv/mods that alter player color prodmod.pyromod Edited July 24, 2020 by badosu 1 1 Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 (edited) Next steps: - Provide option to hide/show production on menu - Provide hotkey to hide/show production - Implement and provide option/hotkey for similar view, but for current units/techs the players have - Put text saying if it's production or units Edited July 24, 2020 by badosu Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 24, 2020 Report Share Posted July 24, 2020 Would be nice if you could post more screenshots Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 (edited) New development version: - Fix issue with single player not adjusted for optimizations Screenshots (on a 4k monitor with 1.5 gui scaling, let me know your experiences with other resolutions/scaling factors): Spoiler Single Player Spoiler 4v4 mid game with tooltip on mouse hover (I'll probably end up grouping ptol houses, not sure yet) prodmod.pyromod Edited July 24, 2020 by badosu 1 1 Quote Link to comment Share on other sites More sharing options...
badosu Posted July 24, 2020 Author Report Share Posted July 24, 2020 (edited) New development version: - Eye candy - Yak shaving prodmod.pyromod Edited July 24, 2020 by badosu 1 Quote Link to comment Share on other sites More sharing options...
badosu Posted July 25, 2020 Author Report Share Posted July 25, 2020 (edited) Hopefully the last update for the foreseeable future: - Add Units mode (enabled by default), can toggle to Production mode and (in the future) Tech mode prodmod.pyromod Edited July 25, 2020 by badosu 1 Quote Link to comment Share on other sites More sharing options...
badosu Posted July 26, 2020 Author Report Share Posted July 26, 2020 Well, after all the trouble optimizing and getting units via entity queries I discovered that it comes from the simulation state already. Why are technologies brought by the technology manager interface not being retrieved? The simulation state is bringing also empty techs. Quote Link to comment Share on other sites More sharing options...
badosu Posted July 27, 2020 Author Report Share Posted July 27, 2020 (edited) Ok, technology seems to be giving more trouble than I expected. So I am updating with a prerelease version: - Add hotkeys and configs, defaults: hotkey.prodmod.toggleVisibility = "Ctrl+Space" // Self evident hotkey.prodmod.toggleMode = "Shift+Space" // If visible toggle mode, if not visible show and toggle mode hotkey.prodmod.quickShowUnits = "Space+q" // Quick view, hide when key is unpressed hotkey.prodmod.quickShowProduction = "Space+w" // Quick view, hide when key is unpressed prodmod.enabled = "false" // visible at start One small hiccup is that the units display differentiates between rank levels but I am not displaying the ranks themselves, I am still considering if I unify the unit counts or display with separated ranks. prodmod.pyromod Edited July 27, 2020 by badosu 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 27, 2020 Report Share Posted July 27, 2020 For techs @wraitii might know Quote Link to comment Share on other sites More sharing options...
badosu Posted July 27, 2020 Author Report Share Posted July 27, 2020 Ok, ranks implemented, unfortunately it's getting a bit crumpled on the small image: Now, this warning I've been having for a while, no idea why it happens. My layout might be messing something up that the renderer does not like: `ERROR: CRenderer::EndFrame: GL errors GL_INVALID_VALUE (0501) occurred` It does not hinder the functionality or visual, but definitely something that requires being addressed before release. prodmod.pyromod 1 Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 27, 2020 Report Share Posted July 27, 2020 I think for techs and such, it might be because they're using a Map() object which doesn't print much when printing it? Quote Link to comment Share on other sites More sharing options...
badosu Posted July 27, 2020 Author Report Share Posted July 27, 2020 8 hours ago, wraitii said: I think for techs and such, it might be because they're using a Map() object which doesn't print much when printing it? researchedTechs, which is the one I need to use is a Set and is coming off as empty 7 hours ago, go2die said: maybe to be able to select position would be cool. On my case it just got into minimap Did u make the window smaller? What is your resolution? Quote Link to comment Share on other sites More sharing options...
badosu Posted July 27, 2020 Author Report Share Posted July 27, 2020 Unfortunately can't do much in that case, except for lowering the vertical distance between rows. Otherwise it would overlap with the hero and chat notification panels. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.