Jump to content

Spec mod


badosu
 Share

Recommended Posts

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 by badosu
  • Like 2
Link to comment
Share on other sites

@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 by badosu
Link to comment
Share on other sites

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 :/

Link to comment
Share on other sites

`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 by badosu
Link to comment
Share on other sites

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

  • Thanks 1
Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

:(

  • Thanks 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

@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 :thumbsup:

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 :laugh:)
- Compatible with or without autociv/mods that alter player color

 

prodmod.pyromod

Edited by badosu
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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 by badosu
Link to comment
Share on other sites

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

1394594335_Screenshotfrom2020-07-2413-21-46.thumb.png.42e4b2b909ec9a5347991cd183d751c8.png

Spoiler

4v4 mid game with tooltip on mouse hover (I'll probably end up grouping ptol houses, not sure yet)

2076587505_Screenshotfrom2020-07-2413-30-13.thumb.png.573418b3b8a78fe2b62e85ea71daf68f.png
 

 

prodmod.pyromod

Edited by badosu
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by badosu
  • Thanks 1
Link to comment
Share on other sites

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.

Screenshot from 2020-07-27 02-53-30.png

prodmod.pyromod

  • Thanks 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...