Jump to content

Recommended Posts

Feedback:

- I no got errors;

- Have to decrease the size a little bit, it’s reaching to the civ shield;

- It would be interesting to show only the population of soldiers, alongside the total population;

- Just below in the left corner, show the techs that are being searching by the players.

Overall it's very good, congratulations.

Link to post
Share on other sites
  • Replies 108
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Is the dream real? cc @leitoso

For some time now I've been wanting to make a spec mod. Currently the 'chrome', 'dashboard' or whatever the overlay is named provides little insight to what the player is doing. This is true for both

Well, quick and dirty it is then:     The sharpness of the text leaves to be desired, I wonder if there's a way to improve it.

Posted Images

The resources overlay is part of leite's mod. Mine is just the production for now, researching techs are displayed with the other production items (techs, buildings, units).

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

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.

Link to post
Share on other sites
9 hours ago, badosu said:

Hmm... it seems the colormap is not working  as expected. I copied it so I am not really familiar with, I'll find a solution and upload the fix.

Are you using some kind of mod that changes players colors?

I've specced some games already and the only error I had was when I resigned as a player so I am not sure how to reproduce.

4Ryn3u9.png

  • Haha 1
Link to post
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 post
Share on other sites
1 minute ago, badosu said:

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

so add to .json this

"dependencies": ["0ad=0.0.23","autociv>=x.x.xx"]
Link to post
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 post
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 post
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 post
Share on other sites
Posted (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 :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 post
Share on other sites
Posted (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 by badosu
Link to post
Share on other sites
Posted (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

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 post
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 post
Share on other sites
Posted (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 by badosu
  • Like 1
  • Thanks 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...