Jump to content

Recommended Posts

37 minutes ago, sim4seasons said:

Yes, in many ways we can see that a lot of features of the mode are active; I tried to install it via the mod page in the game, and also manually. Both time activated and working in the game, except for that F4 key that should make the hotkeys config menu appears in game...

Thanks for your answer !

Guten tag @sim4seasons . Thanks for liking the mod, you are welcome :D 

As for the 
F4 key for shortcuts: it doesn't work because the newest 0ad now has an official hotkey editor, so I removed the one I did to not confused/duplicate functionality.

Link to comment
Share on other sites

  • 2 weeks later...

Hello !

Thanks for your answer, that's really great from you to take the time :)

Tell me if I'm mistaken but in the official hotkey editor, we can't allow hotkeys for building creation, am I right ? If yes, how do you do to set up hotkeys for that specific topic ?

Thanks again,

Sim.

Link to comment
Share on other sites

  • 8 months later...
  • 2 weeks later...

Hi, I would like to add an units lost counter to the autociv overlay panel:

image.thumb.png.4c13990ba4bd24311b8b30336695a11a.png

I am trying to do this by appending  " Lost": state => state.unitsLost to the stats dictionary of autociv_statsoverlay.js:


 

    stats = {
        " P": state => state.phase,
        " Pop": state => state.popCount,
        " Sup": state => state.classCounts_Support,
        " Inf": state => state.classCounts_Infantry,
        " Cav": state => state.classCounts_Cavalry,
        " Sig": state => state.classCounts_Seige,
        " Chp": state => state.classCounts_Champion,
        "   Food": state => Math.round(state.resourceCounts["food"]),
        "   Wood": state => Math.round(state.resourceCounts["wood"]),
        "  Stone": state => Math.round(state.resourceCounts["stone"]),
        "  Metal": state => Math.round(state.resourceCounts["metal"]),
        " Tec": state => state.researchedTechsCount,
        " Kil": state => state.enemyUnitsKilledTotal,
        " Lost": state => state.unitsLost ?? 0,
    }

But the problem with this code is that the lost number stays at 0 as seen in the screenshot above. Evidently, the name of the units lost attributes is something different. What is name of the attribute counting the units lost? How can I find the list of possible session state attributes to query from? Thanks.

Link to comment
Share on other sites

/gui/session/objectives/autociv_statsOverlay.js
gets states from
/simulation/components/GuiInterface~autociv.js

you need to add something like
"unitsLost": cmpPlayerStatisticsTracker?.enemyUnitsKilled.total ?? 0,
to ~line 210

except you now don't want enemyUnitsKilled.total but something like unitsLost.

What does cmpPlayerStatisticsTracker offer next to enemyUnitsKilled?
rg enemyUnitsKilled
and find
public/simulation/components/StatisticsTracker.js
look and find
    this.unitsLost = {};
    this.enemyUnitsKilled = {};

so your gues of the name was right. Just add it to /simulation/components/GuiInterface~autociv.js too.
I didn't test it actually but thats the way I gues. Hard for me too to grep the right value.

  • Thanks 1
  • Haha 1
Link to comment
Share on other sites

I messed with autociv stats too. I calculated extra statistics for the currently selected player.
Here is the actual gather rate for wood shown incl. the way to the storehouse and collisions.

4 woman + 4 inf have 4*0.7 + 4* 0.75 = 5.8 wood gather rate at 100% set. No upgrades.

I made some snapshots to show how the actual gather rate drops with longer distance. Tbh I expected it to be worse.

With this value I wanted to make a mod with recommendations on the game play as spectator or in the replay. Like now would be the time for the ax upgrade. But now I am reluctant to share.

A) Because of the bad state of abuse of cheats in the community. I don't want to add fuel to the fire. Some would just automate the upgrade.

B) It's still a buggy sketch, and because of A i don't know if I continue this.

It's not too hard to do if someone wants to, but still a bit more than getting another value from the current statistics. The results are quite interesting though. Also I don't know if it's even intended to know the game so well.

1.png

2.png

3.png

4.png

5.png

6.png

7.png

8.png

9.png

10.png

Link to comment
Share on other sites

16 hours ago, ffm2 said:

4 woman + 4 inf have 4*0.7 + 4* 0.75 = 5.8 wood gather rate at 100% set. No upgrades.

Thank you ffm2, I have got it working! With regards to calculating the gathering rate, could we save the total resources on the previous turn, then do a gradient calculation:

gathering_rate = (current_count + spending - previous count) * turns per second

This allows us to ignore the details of upgrades, unit types and other factors. We need to account for the resources spent between the turns, e.g. the player gathered 20 wood in 200ms but spent 200 wood for a barrack.

In your screenshot, what are the Hou, Bar, Fiel and Civ values? What are the average % values?

Link to comment
Share on other sites

16 hours ago, ffm2 said:

With this value I wanted to make a mod with recommendations on the game play as spectator or in the replay. Like now would be the time for the ax upgrade. But now I am reluctant to share.

I think this is a great idea! I have thought about it as well and I've made a simple script to analyze the replay commands. I think it would be possible to make an in-game service which advises the player what they should do. This would be very helpful for new players (such as myself) to improve their skills!

Regarding your cheating concerns, I found that replay files are not fully written to the replay folder until the game has finished. Therefore you can go ahead with your replay analysis mod without worries :)

Link to comment
Share on other sites

8 hours ago, AInur said:

In your screenshot, what are the Hou, Bar, Fiel and Civ values? What are the average % values?

It's number of houses, barracks, fields and civilizations and has nothing to do with the second line.

In the second line are only the gather rates (incl. way) lined under and attached debugging info for me. The last % is the gather rate in relation to the maximum of 5.8.

The replay file is written instantly. When spectating a live game I regularly use it to check out the replay to see which player uses quickstart, which some players use in even in rated 1v1s.

I think it would be a great analysis tool, like a chess engine (although this wouldn't cover all strategies). But chess engines are also used for cheating. So I'd rather have no analysis and no more added cheating than more analysis incl. more cheats.

  • Like 1
Link to comment
Share on other sites

@ffm2 In the counters panel, do you think it is possible to display the count of each unit type? For example, accurate to the number of spearman and the number of archers? If so, how would I be able to retrieve the stats?

15 hours ago, ffm2 said:

The replay file is written instantly.

For multiplayer, yes that is the case. However, the singleplayer games are not written instantly, from what I have seen. Maybe my file manager didn't refresh quickly enough.

 

Link to comment
Share on other sites

Couldn't find it in a reasonable time. It's maybe feasable, maybe hard with extra code. I don't see the benefit with all subtypes like pikemen, slingers of each civ. You have to dig through the code, that's why I've written my procedure to grep above.

Link to comment
Share on other sites

On 23/10/2024 at 11:19 AM, AInur said:

In the counters panel, do you think it is possible to display the count of each unit type? For example, accurate to the number of spearman and the number of archers? If so, how would I be able to retrieve the stats?

Sorry for the late answer, but, yes, that is possible. Look for the "typeCountsByClass" in the playerstates (part of the simulation state). It stores how many units of each template a player currently controls.

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Dunedan said:

What does that mean?

This means that autociv doesn't appear in mod checks. And with the new rule about signing mods we can no longer do that since it touches the simulation codes https://gitea.wildfiregames.com/0ad/0ad/wiki/Mod_Verification_Processee  Just like ProGUI, users will want to keep the mod hidden because an incorrect order such as users having community mod enabled first and autociv second while others have autociv first will cause players to not be able to join games with each others.

  • Like 1
  • Thanks 1
Link to comment
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.

 Share

×
×
  • Create New...