PCM.daily banner
22-11-2024 03:43
PCM.daily
Users Online
· Guests Online: 90

· Members Online: 0

· Total Members: 161,773
· Newest Member: Jerrysog
View Thread
PCM.daily » Pro Cycling Manager 2006-2020 » Pro Cycling Manager 2019
 Print Thread
Sprint Simulation is broken due to a wrong operator
00Visor
(TLDR: Sprint Simulation is broken due to a wrong operator making your sprint helper effect you negatively instead of positively)

I started a simulation career and quickly stumbled on the issue that you couldn't get good results in sprints.

I found in this forum that you can edit the simulation files in the XML directory.

Some people claimed that


<inrace_order name="JOUER_LA_VICTOIRE_SI_SPRINT_MASSIF" coeff="20"/>
<inrace_order name="IA" coeff="30"/>
<inrace_order name="ETRE_POISSON_PILOTE" coeff="5"/>


Gives an unfair advantage to AI. (AI players get 30 coeff, your sprinter gets 20, your sprint helpers 5.)

So people advised setting the first value to 30 and you get better results.

There is however a segment on the end that says something about your sprint helper score.


  <!-- ======================== Score du poisson pilote ========================== -->

  <function name="PoissonPilote" log="2">

    <operator type="random_between">
      <range min="76"   max="99"    min_output="10"    max_output="15"/>
      <range min="74"   max="76"    min_output= "9"    max_output="14"/>
      <range min="72"   max="74"    min_output= "9"    max_output="13"/>
      <range min="70"   max="72"    min_output= "8"    max_output="12"/>
      <range min="68"   max="70"    min_output= "5"    max_output="10"/>
      <range min="66"   max="68"    min_output= "2"    max_output= "7"/>
      <range min="64"   max="66"    min_output="-2"    max_output= "2"/>
      <range min="62"   max="64"    min_output="-5"    max_output= "0"/>
      <range min="60"   max="62"    min_output="-2"    max_output="-5"/>
      <range min="0"    max="60"    min_output="-15"   max_output="-10"/>
    </operator>


This could be the intended to be the missing ~10 points I thought. So I wanted to test what this sprint helper score actually does in the game.

So I set that the output values very high (something like 1000) and my sprinter actually got ... LAST! Out of the whole peloton.

I made a lot of other tests like taking a very bad sprinter and setting the values to -1000. He won. Smaller values also have a good/bad effect, so I could rule out that it was just an integer overflow.

So higher min_output/max_output values actually effect your sprinter negatively. Some programmer probably put the wrong operator and it was never realized for years.

So if you reverse all the values (pay attention min_ouput is -15 and max_output is -10 and so on), you actually fix all issues. Those are the missing 10 points of "JOUER_LA_VICTOIRE_SI_SPRINT_MASSIF", so you can leave that at 20. Testing provided good results for me, of course I can not promise that they aren't other weird issues.

Its crazy that such a huge bug has probably been in the game since the simulation was coded the first time. It seems most of the games code hasn't been touched in years and probably the guy who coded this doesn't even work there anymore, so they don't wanna touch it.
 
tomcat9
00Visor wrote:
Its crazy that such a huge bug has probably been in the game since the simulation was coded the first time. It seems most of the games code hasn't been touched in years and probably the guy who coded this doesn't even work there anymore, so they don't wanna touch it.


Probably it was broken since 2010, because I'm playing now PCM 2006 and in this edition everything is fine with sprints (and with cobbled stages too).
Let's save the history of PCM together!

Just write me a PM if you have something for old PCM Editions (from 2005 to 2014) - databases, stages, shirts etc. and we'll share it.
 
cunego59
That's kind of wild. I noticed a similar pattern at times, but thought of it as just bad luck.

So I understand it correctly that the points of the sprint helper get added to your main sprinter's value, and the five points for the "poisson pilote" are the sprint helper's own chances of a good result, right? Do you know what/how the game calculates, when you assign more than one rider to help your sprinter?

Thanks a lot for the insight already, btw!
Edited by cunego59 on 14-06-2020 10:47
 
Ripley
Nice find! I believe in one PCM version I made the change Tiemen suggested and my sprint results were better, but this looks to be the real answer to the problem.
i.imgur.com/6Km77FO.png

pcmdaily.com/files/Awards2019/team%20story.png
pcmdaily.com/images/mg/Awards2020/avatar.png
 
Kiserlovski01
What exactly do you mean by reverse the values?

The min_output and max_output on each line should be swapped or the values on the last line should be on the first, those on the second to last on the second line, and so on?
 
cunego59
The absolute value should be the same, but plus has to become minus and minus has to become plus, because a positive value in the code has a negative impact on the simulation results (and the other way around). And then you have to basically switch the two columns, because if you just put a minus in front of the positive values, you'd have for instance min_output=-10 and max_output=-15, which doesn't work. So the "corrected" code would look like this:


<operator type="random_between">
      <range min="76"   max="99"    min_output= "-15"    max_output="-10"/>
      <range min="74"   max="76"    min_output= "-14"    max_output="-9"/>
      <range min="72"   max="74"    min_output= "-13"    max_output="-9"/>
      <range min="70"   max="72"    min_output= "-12"    max_output="-8"/>
      <range min="68"   max="70"    min_output= "-10"    max_output="-5"/>
      <range min="66"   max="68"    min_output= "-7"    max_output= "-2"/>
      <range min="64"   max="66"    min_output="-2"    max_output= "2"/>
      <range min="62"   max="64"    min_output="0"    max_output= "5"/>
      <range min="60"   max="62"    min_output="2"    max_output= "5"/>
      <range min="0"    max="60"    min_output="10"   max_output="15"/>
    </operator>


I think it would also make sense to adjust some of those values to have better leadouts give an even bigger advantage (a leadout with 69 gives just 5 coefficient points more than a leadout with 79), but that's maybe debatable and definetely needs testing, I guess.

The value in that table by the way is, if I understand the xml correctly, a weighted value of flat, sprint and acceleration, with flat given a weight of 1 and sprint and acceleration a weight of 2, respectively.
 
cunego59
cunego59 wrote:
Do you know what/how the game calculates, when you assign more than one rider to help your sprinter?

Did some testing myself here (thinking about doing a sim-only career myself, so this is very interesting to me). Had my sprinter have two assigned helper, one with a value of 499 to 500 in the xml, the other with -499 to -500. It appears as though the game simply selects one of the two to be the leadout at random, as my sprinter always finished either first or last. So, no use of having more than one good support rider for your sprinter if you only simulate.
 
00Visor
Wow, didn't expect so many replies so quickly. Great that a lot of you are interested in this.

Cunego59 posted correctly how the "reversed values" should look like. Kinda funny that they even made an error in the original files putting "-2" as min_output and "-5" as max_output (-5 is the smaller than -2).

I didn't test with more than one sprint helper. Strange that it just selects at random and not selects the best one. But that's an issue you can deal with as a simulation player.

@Cunego59: Of course we don't know how it's coded and if 10 points from Sprint Helper just gets added and has the same effect as increasing JOUER_LA_VICTOIRE_SI_SPRINT_MASSIF by 10. But it seems like that and would make sense why AI has 10 points more. Of course you could modify the values to your liking, its correct that a better sprint helper doesn't really have a big effect. You could also make the argument that getting more than 10 points gives you an unfair advantage over the AI. I guess that's subjective.



If we want to further improve the simulation files (I hope I don't go offtopic here): The only other big issue I found so far is that the HIL stat is not used at all. The hill simulation files just use MO for mountain (and I did some test to confirm it really works like that).

It would be great if anyone finds out the variable for the HIL stat. They are used in the XML files like <inrace_charac name="MO" coeff="8"/>. They usually use french words like Cobble is not CO or COB, but PAV for pavé. Other used stats are SP, ACC, END, RES, FL, BAR. I tried HI, HIL, HL, VA, VL, VAL, CO, CL, COL. Which all don't work. They might actually not load the variable at all, than there is not hope.

If HIL remains indeed useless in simulations, we could potentially band-aid it by making FL and END more important for hill stages. The hassle is that you would to correct rider stats and young rider generation. So it would be much better to just find the HIL stat for XMLs.

There are very few sources on the internet about. ppanther posted optimized files 7 years ago in this forum which aren't accessible anymore. But he also claimed that just "HIL" works which I couldn't replicate in PCM2019.

Sources:
https://pcmdaily.com/forum/viewthread...d_id=23769
https://pcmdaily.com/forum/viewthread...rowstart=0
https://steamcommunity.com/app/936140...457590818/ (last post)
Edited by 00Visor on 13-06-2020 12:55
 
cio93
Crazy find! That's much appreciated work right here, thank you!

For me as a veteran with easily over 5000 hours across all PCMs of the last decade, the big news is already that my usual strategy of just setting the entire team to support my sprinter on flat stages is very detrimental Shock

You'd think that even without the human input +/- error, the game would be smart enough to assign the weaker helpers as water carriers or relay train participants and only the best two sprinters as the actual leadout.

To go beyond that, does anyone have any clue how the game calculates breakaway success rates in simulated flat stages?
Would the best way to ensure a bunch sprint be to assign the unused riders to the GC leader (or a random rider if there is none, like in a flat classic) and put them on relay?


So a TL;DR for the findings of you and cunego, correct me if I'm wrong:

1) fix the XML
2) only assign your second best sprinter as a helper for your sprinter
 
cunego59
00Visor wrote:
The hill simulation files just use MO for mountain (and I did some test to confirm it really works like that).

My first thought was that maybe MO is a substitute for a combined MO/HIL stat depending on how the stage is rated. Because iirc, there's some ratio in the stage file that determines how hilly/mountaneous it is, right? Or was that in some earlier version? But I simulated LBL a few times with Alpecin, and MVDP (69 MO, 79 HI or something like that) never even finished inside the Top 40, which was pretty jarring.

Also, if you say you tested that, I assume you had some riders finish highly in hilly races with 80 MO and 60 HIL or something like that? Or how did you test it?

Could it also be possible that for some weird reason, BAR relates to the hill stat? I realize it's usually the fighting stat, right? So, the probability with which someone attacks or is in the breakaway. But it also features heavily in the calculations for "Leaders" and "Force des Puncheurs" in the Hill_Puncheurs xml and in "PreClassification_SmallGroups" in the Hill_Main xml, although I can't say that I have completely understood what all of these things do yet Grin

Going to look into that a bit more later or tomorrow. Interesting stuff for sure, but also potentially very disheartening if you want to do a sim-only career ...
 
tomcat9
00Visor wrote:

The only other big issue I found so far is that the HIL stat is not used at all. The hill simulation files just use MO for mountain (and I did some test to confirm it really works like that).


Yes, the HIL stat is completely broken too. When I played PCM 2017 I also noticed that the HIL stat is useless when you ride with effort < 85 And in simulation mode the hill specialist almost always lost to climbers in hilly classics... In this way Cyanide didn't solve this problem until now.

00Visor wrote:They usually use french words like COB = PAV for pavé in the XMLs. I tried HI, HIL, HL, VA, VL, VAL, CO, CL, COL. Which all don't work. They might actually not load the variable at all, than there is not hope.


Sure, because it's a problem of the game engine. I found an interesting discussion (mostly in English) about hillstat bug on official Cyanide forum: https://forums.let...mp;t=21742
Let's save the history of PCM together!

Just write me a PM if you have something for old PCM Editions (from 2005 to 2014) - databases, stages, shirts etc. and we'll share it.
 
Ad Bot
Posted on 22-11-2024 03:43
Bot Agent

Posts: Countless
Joined: 23.11.09

IP: None  
00Visor
1) fix the XML
2) only assign your second best sprinter as a helper for your sprinter


That's correct. I could attach Cunego's corrected code to the top post.

Regarding breakaways, you can have look yourself in the breakaway XMLs. To be honest it's very difficult to understand how all of that works as it's sparsely documented and would probably require intensive testing.

Some probable lines are:
Spoiler

  <!-- Valeur d'un coéquipier pour rouler sur l'échappée -->
  <!-- (3 PL + 2 RES + 4 MO + 1 END + [x, MO <-> END])/ 11 -->

  <function name="TeamateValue" log="2">

    <operator type="ponderate">
      <weight value="3"/>
      <weight value="2"/>
      <weight value="4"/>
      <weight value="1"/>
      <weight value="1"/>
    </operator>

    <inrace_charac name="PL"  log="1"/>
    <inrace_charac name="RES" log="1"/>
    <inrace_charac name="MO"  log="1"/>
    <inrace_charac name="END" log="1"/>

    <function log="2">
      <operator type="get_between"/>
      <variable name="x"/>
      <inrace_charac name="MO"/>
      <inrace_charac name="END"/>
    </function>

  </function>
  <function name="ProbaBase_Classic" log="2">
    <operator type="switch">
      <case value="1" output="0.70"/>
      <case value="2" output="0.75"/>
      <case value="3" output="0.80"/>
      <case value="4" output="0.85"/>
      <case value="5" output="0.90"/>
      <case value="6" output="0.95"/>
      <case value="0" output="0.99"/>
    </operator>
    <variable name="TeamRank"/>
  </function>

  <function name="TeamateWork_Classic" log="2">
    <operator type="switch">
      <case value="0" output="0.15"/>
      <case value="1" output="0.10"/>
      <case value="2" output="0.08"/>
      <case value="3" output="0.05"/>
      <case value="4" output="0.05"/>
      <case value="5" output="0.03"/>
      <case value="6" output="0.01"/>
      <case value="7" output="0.01"/>
    </operator>
    <variable name="TeamateRank"/>
  </function>


That says something about Base Probability (ProbaBase?) and "TeamateValue", "TeamateWork" and "TeamateRank" values. Maybe someone with good french can confirm if the first comment is about a teammate in the breakaway or chasing it. But what has a variable "TeamRank" to do with Probability Base?

cunego59 wrote:
Also, if you say you tested that, I assume you had some riders finish highly in hilly races with 80 MO and 60 HIL or something like that? Or how did you test it?


Yes I have a test file with a 85 MO and 60 HIL rider and one vice versa. I am very sure the MO stat is really just mountain.

The puncheur files are for attacks at the end. It checks if PRENDRE_RISQUE_DANS_FINAL tactic is selected. I don't really know what tactic that could even translate too - in the game tactic selection.

But the results for hill and mountain stages seem to be mainly affected by the "_Main" xmls and by the "PreClassification" and "Classification". "PreClassification_SmallGroups" seems confusing for me. BAR mainly has an effect on the puncheur and breakaway files of both hills and mountains. Not in the main files.

tomcat9 wrote:
Sure, because it's a problem of the game engine. I found an interesting discussion (mostly in English) about hillstat bug on official Cyanide forum: https://forums.let...mp;t=21742


The site doesn't load for me right now. But I would be really interested to see that discussion.
Edited by 00Visor on 13-06-2020 14:04
 
cunego59
00Visor wrote:
[quote]cunego59 wrote:
Also, if you say you tested that, I assume you had some riders finish highly in hilly races with 80 MO and 60 HIL or something like that? Or how did you test it?


Yes I have a test file with a 85 MO and 60 HIL rider and one vice versa. I am very sure the MO stat is really just mountain.

The puncheur files are for attacks at the end. It checks if PRENDRE_RISQUE_DANS_FINAL tactic is selected. I don't really know what tactic that could even translate too.

But the results for hill and mountain stages seem to be mainly affected by the "_Main" xmls and by the "PreClassification" and "Classification". "PreClassification_SmallGroups" seems confusing for me. BAR mainly has an effect on the puncheur and breakaway files of both hills and mountains. Not in the main files.

I just did a test by switching every "MO" to "HIL" in the "Hill_Main" xml, and immediately Van der Poel won the first simulation of LBL ahead of Kwiatkowski. Two more simulations and again, all top climbers that don't have a great hill stat are gone. Side effect is that now someone like Keukeleire can be really good, but with some tinkering, we should be able to make this more realistic. I should mention, I'm doing this for the xml file for PCM20, so maybe they changed something from PCM19, but HIL does seem to work.

00Visor wrote:
tomcat9 wrote:
Sure, because it's a problem of the game engine. I found an interesting discussion (mostly in English) about hillstat bug on official Cyanide forum: https://forums.let...mp;t=21742


The site doesn't load for me right now. But I would be really interested to see that discussion.

Apparently, pcmdaily converts links to have a "https", and the Cyanide forums don't have that. If you remove the s in your browser, it should work.

I remember that discussion back then and it's an interesting read (also brought me the insight that stamina no longer only has an impact on races longer than 200km), but it only addresses issues with the 3D racing, not the simulation.
Edited by cunego59 on 14-06-2020 10:46
 
00Visor
@cunego59: Are you sure HIL really works? If you just remove the MO coeff, Van der Poel could just win through PL and END. And of course the pure climbers are off. That's the results that I get. It would be great if you can give an average rider 85 HIL in a database and test it. Could also set PL and END coeff to 0 and maybe remove the random variable.

Thanks for https tip. The forum thread seems to talk about 3D and not simulation though.

For the translation of XML tactic values like "PRENDRE_RISQUE_DANS_FINAL" to ingame tactics, the databse provides some insight in the STA_SIMULATE_xx tables, though I don't fully understand it yet.
Edited by 00Visor on 13-06-2020 14:27
 
cunego59
00Visor wrote:
@cunego59: Are you sure HIL really works? If you just remove the MO coeff, Van der Poel could just win through PL and END. And of course the pure climbers are off. That's the results that I get. It would be great if you can give an average rider 85 HIL in a database and test it. Could also set PL and END coeff to 0 and maybe remove the random variable.

Yes, you're right, unfortunately. Moved Kwiatkowski's hill stat down to 66 and he still gets good results. Seems like it only looked that way because puncheurs are mostly the ones with good END and FL combinations ... oh well, I'll try some more at another point Wink
 
00Visor
Ok, I'm gonna attempt a pseudo-fix for the Hill Simulations. It's probably gonna be quite a rabbit hole to go down. Only read if you are really interested Grin.

I like the way Endurance is coded, it actually seems to be affected by stage length in simulations, so I'm not gonna touch it. PL, the flat stat, will become more important for Hill stages and RES will be the equivalent for mountain stages. It's already kinda set like that, except PL is commented out in the Hill simulations.

To not make huge adjustments, we will increase the coefficents so PL and RES have half the effect that MO has. I think thats fair even with exisiting values.

Now because the HIL stat doesn't exist in simulations we will set all MO and HIL values of riders in the database to the maximum of the 2.

To balance these changes, we will give them a penalty to PL or RES, so our XML sums achieve the values intended. The penalty will be double the MO-HIL difference, because PL/RES have half the effect on the stages.

Example:
Rider 1: PL 75, MO 70, HIL 75, RES 75
Rider 2: PL 75, MO 75, HIL 70, RES 75

After changes:
Rider 1: PL 75, MO 75, HIL 75, RES 65
Rider 2: PL 65, MO 75, HIL 75, RES 75

You will get slight effects on other stages, especially with the PL stat, but I don't think there are too many riders with a considerable higher MO than HIL stat who care too much about timetrials or sprints. It's possible we can make adjustments to other XMLs if necessary.

I hope to set up a macro so you can edit existing database tables. (would also work for savegames)

Now to go further down the rabbit hole, we have to edit the classification of "Puncheurs" and their training. That can be done in the database. We also have to edit the generation of young talents. That can be done in another XML folder.
Edited by 00Visor on 13-06-2020 15:51
 
cunego59
I went to the PCM Discord Server to ask about the xmls. Firstly, there is indeed no code for the hill stat and the MO variable is supposed to work as a ratio stat depending on the stage file, but that doesn't work as intended.

Secondly, though, it turns out that there has been quite some work done on the simu xmls for PCM19. Davy from PCMWorld has made some revamped files that can be downloaded here. His feature list is as follows:

- Fair mass sprints. No dissadvantage for humans anymore vs AI.
- Cobble specialists win cobble races
- Gave hill specialists more chances in hill classics (instead of favouring mountain specialists)
- Average/Difficult Hill stages in GT's are not only for GC contenders but also for hill speciliasts
- Easier hill stages in GT can end in a sprint with a mediumsized group favoring the strong sprinters who can survive a difficult stage
- In general, hill stages in GT will have smaller gaps between groups than in the default game
- More chance of breakaway winning mountain stages in GT. (like IRL and making it more difficult for GC contenders to win points jersey)
- Flat stages can be won by more sprinters, in the default game it's mostly the same sprinter that wins al flat stages
- Tried to avoid breakaway winning champs elysees stage (first results are promising but don't know for sure if I can 100% avoid it in the xml files)

He also points out that because they were made for PCM19, he can't guarantee they work just as well for PCM20, and also Cyanide seems to have already taken over some of his work for PCM20 or maybe improved on it (though apparently not for hills, I assume). So some testing should definetely be done (everyone feel free to join Wink ), but I think this is a very good basis to continue the work on a more realistic simulation (or already the solution, if they still work).

One example of a season with his files (again, for PCM19):
davystorageaccount.blob.core.windows.net/pcmstoryblobcontainer/seasonOverview.png

 
00Visor
Nice to get some confirmation. But sad that we indeed can't use the HIL stat. If Cyanide is aware of this issue and are using some of his work, why are they not fixing this? Are they indeed unable to understand and change their own code?

Very nice to see another attempt at optimizing the XML files. He made some good changes that I also did.

His sprints are not fair, because he didn't know about the operator bug.

Mainly I don't know how he claims that hill specialists have better chances if he can't use the HIL stat.

His stats used in the main classification for hill stages are:

<inrace_charac name="MO"  coeff="2" log="2"/>
    <inrace_charac name="RES"  coeff="3"/>


So his approach is to make RES even more important than MO for hill stages. Still many climbers have high res and the hill stat can't be used.


If that Discord is official, I would like to engage in some discussion. Where can I find it? Maybe he knows more about what the different sections of the XML actually mean.

My firsts tests with an alternated database where pure climbers have a bad PL and pure puncheurs have a bad RES work quite well. Just need some finetuning so pure climbers don't lose too much time on hill stages in GTs. For that it would be really good to have more understanding of the XMLs.
 
cunego59
You can join the Discord-Server via this link: https://discord.gg/9kxcCUy

It is indeed the official server, used for bug reports, official announcements of the developers and such. And lots of discussion among users, of course.

When it comes to the specific changes, it's important to note the possibility of different stat matrices. He did this with the PCM World DB, so it's possible that the resistance stat is distributed differently there. In addition, at least as far as I'm aware, he didn't do this with a simulation only career in mind, so his files had to work without adjusting the stats of the riders. I haven't gone through the files myself yet, I've just seen some of his test results.

You can find the short discussion I had regarding the files and the respective users in the PCM Topics - #general chat on the server.
 
thanksreggie
Hi, I wanted to take a look on TT simulation xmls, but I could not find anything like that. Do you know how this is simulated?
 
Jump to Forum:
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Latest content
Screenshots
Presentation - Pic 2
Presentation - Pic 2
PCM 08: PCM Fusion DB
Fantasy Betting
Current bets:
No bets available.
Best gamblers:
bullet fighti... 18,376 PCM$
bullet df_Trek 17,374 PCM$
bullet Marcovdw 15,345 PCM$
bullet jseadog1 13,552 PCM$
bullet baseba... 10,439 PCM$

bullet Main Fantasy Betting page
bullet Rankings: Top 100
ManGame Betting
Current bets:
No bets available.
Best gamblers:
bullet Ollfardh 21,890 PCM$
bullet df_Trek 15,520 PCM$
bullet Marcovdw 14,800 PCM$
bullet jseadog1 13,500 PCM$
bullet baseball... 7,332 PCM$

bullet Main MG Betting page
bullet Get weekly MG PCM$
bullet Rankings: Top 100
Render time: 0.43 seconds