Time is the issue

Barthoze

Chieftain
Joined
Apr 26, 2014
Messages
23
Location
St Maur des Fossés
Symptoms : Game is imbalanced on some points when played on slower speeds as Epic and Marathon

Examples :

  • Horse thief event
  • On normal speed, when building the first colony with the starting mounted unit, the horse thief event doesn't trigger
  • On marathon speed, when building the first colony with the starting mounted unit, the horse thief event

Chapel vs Tavern event
  • On Marathon speed, the low Revolt Turn cost makes it a no brainer, it's just better to choose any building than taking the low sum of gold.
  • On Normal speed, more thought out to be put at this decision. 200g is not something to leer at, neither are 2 turns of disorder.

First trade with native
  • On Normal speed,it is usually possible to fill around half of a slot with the staring gold
  • On Marathon speed, the native yields are much larger, thus such a trade is not possible, staring with the same amount of gold.

Basically, on marathon speed, the start is rougher, but the random events are much more bountiful than they ought to.

If this difference of behaviour is actually working as designed, then it's OK.

If not, all of this boil down to the same issue : the appropriate speed multiplier is missing on some parts of the game code, and thus break the balance.

I am currently auditing both C++ and Python code to bring back balance in costs.
Expect a patch shortly.
 
Hey Barthoze,

Nice to see another Frenchie over here. I hope you do play the game in French as I made a lot of efforts to translate it all. :D

I agree with your points. RayStuttgart has stated himself that the mod was optimized to be played on normal speed. And I agree with him.

Now, as you are willing to correct some speed bugs, I would like just to quickly point out that tripling the amount of exploration and military points in marathon makes those founding fathers impossible to get. On the other hand, political, religious and trade points are all well-balanced as they depend on your production, which is tripled as time goes thrice slower.

I have no easy solution here to propose on how to solve this. Personally, I would still advise to play in normal speed, so you don't necessarily have to bother.
 
As I have said, I have studied the code. The point is, most costs in the game get the right multipliers, such as most building/training costs, associated with the classic flow of the game. However, there are a few that don't, mostly pertaining to events, and they are not that hard to fix.

I have already modified the Python file that handles some events to behave correctly at all speeds.

I have found most of the entry points in C++ to correct this gamespeed issue.
At all game speeds, most multipliers are set to the same value, so using getGrowthPercent() is OK to default to in case of doubt.

Désolé Marla, je ne jouais pas à ce mod en Français. Je m'en vais donc corriger ça au plus vite, ce soir ou demain, promis.
Et sinon, j'ai trouvé pourquoi le jeu ne marchait bien qu'en vitesse normale et faisait des choses bizarres en Épique ou Marathon. Ce n'est pas très dur à corriger, je l'aurais avant dimanche prochain.
 
The point is, most costs in the game get the right multipliers, ...
However, there are a few that don't, mostly pertaining to events, ...

That is simply a bug.
Thanks for reporting. :goodjob:

I tried to think about Gamespeeds when implementing.
But I tested and played almost exclusively with Gamespeed "Normal".

We are all just human. :)
(And this mod has become really big.)

... and they are not that hard to fix.

Of course. :)
All it needs is somebody like you reporting it.

I have already modified the Python file that handles some events to behave correctly at all speeds.

Great. :thumbsup:
Could you please attach the file in this thread ?

I will try to take a look and add it to SVN.

If we will collect a few further bugfixes during the next months, we might even publish another release.
(Otherwise we might simply publish a "bugfix" download.)
 
Great. :thumbsup:
Could you please attach the file in this thread ?

I will try to take a look and add it to SVN.

I will do it, once I have reviewed and tested it. I rewrote it in a coding frenzy from yesterday afternoon to early this morning, so code may not be at its finest.

:cry: As expected, the poor Python file looks like what the cat dragged in.

Anyway, here is the gist of the bug-fix

Whenever you use
Code:
	event.getGenericParameter(1)
for a yield quantity, first define quantity like this

Code:
	quantity = event.getGenericParameter(1)
	Speed = gc.getGameSpeedInfo(CyGame().getGameSpeedType())
	quantity = quantity * Speed.getStoragePercent()/100

and use this number instead.
 
Anyway, here are the first part of the patch

This fixes, for Marathon and Epic speeds :
- in CvPlayer.cpp : the starting gold
- in CvPlayer.cpp : the improvement costs as built by pioneers
- in CvRandomEventInterface.py : the various yield quantities
 

Attachments

  • Time_issue.zip
    111.1 KB · Views: 154
Looks nice! :goodjob:
 
:king:SUCCESS:king:

The C++ modification I brought just worked, I just managed to run the game and everything clicked.

Complete Bugfix List :

  • Starting gold now scales with gamespeed
  • Improvement costs and pillage now scale with gamespeed
  • All event quantities now scale with game speed : gold, turns, culture, and fixed food quantities.
  • Edit : Tooltips and Colopedia show the right amounts
 

Attachments

  • time_issue.7z
    14 KB · Views: 159
Bump :

- FIXED : Diploevents trigger at the appropriates turns at all speeds
- FIXED : Give peace a chance for longer.

I think I got all the game parts right

TODO : The 20 turns limit is still hard in the help text.
More?
 
Thanks a lot for your great support. :goodjob:

I will take a look tomorrow probably.

By the way:

The first appearance of some diplo events was purposely not adjusted.
Otherwise players choosing slow Gamespeeds would need to play for hundreds of rounds to see some of those events the first time.

The frequency should already have been adjusted for all though.
Almost all DLL Diplo Events have timers.
 
TODO : The 20 turns limit is still hard in the help text.
More?
Well, as told in my earlier post, in Marathon speed, there's not enough exploration points on the map to allow European powers to unlock all the exploration founding fathers. Indeed, we need thrice more points to get an exploration FF whereas ther map is no bigger in the first place, so there are not more exploration points on it than in normal speed.

That means that at a certain stage of the game, you have fully discovered the whole map, met all civilizations and visited all native villages, but you still run out of exploration points while there are still about 5 or 6 of them to get. Those last ones are still blocked whereas all European powers have zero remaining exploration points. No one can take them.


Same thing about military points. The amount of military units are already balanced so that you're not supposed to have more military units in marathon than in normal speed (there are thrice more turns but you need thrice more money/yields to get units). However, with a similar number of military units, you still need thrice more military points (essentially earnt in accumulating XP) to get military FF.

Once again, that's impossible. On my Marathon game in a gigantic map, two thirds of the military FF couldn't be unlocked by anyone because the amount of XP necessary to have them are just impossible to achieve.


However, everything was OK with political, religious and trade points, as those are generated at each turns, and there are indeed thrice more turns in marathon than in normal. So the fact to triple their number to get founding fathers is all OK. But that's not the case for military and exploration points.
 
Alright, maybe I should let you see all that by yourselves. Here you can download my RAR 2.2 savegames from my christmas holidays. It's played in marathon/gigantic (not compatible with version 2.3).

DOWNLOAD LINK:
paul-de-chasseigne-1757-april.zip

628 turns have been played. Overall, the game became really tedious... and as I had no time to play since the end of my holidays, I'm not sure I'll be able to ever achieve independence in it (hence why I wouldn't recommend to play in marathon). But as you can see here, the map is all discovered, I have an army of more than 100 military units, but there is no way I could get more exploration and military FF.
 
]@Ray, I could not tell if the lack of speed factor on some variables was truly on purpose or not.
I will however take this into account, if you provide me the list, and lower the minimal first round increase on some diplo events, who triggered much earlier than they should. It is quite frustrating to see a bishop you have absolutely no chance to pay for early in game.



@Marla:
I did not bother yet to fix the Founding fathers on these game speeds because I do not like them much. It's as simple as this. Everything will come in its time.

So time is also the issue, but not in the expected way.
The main issue is that Exploration and Military scale in map size, more so than in time

- Exploration points generated through map discovery must scale with map size because of more things to discover for same number of fathers, a tiny map should provide more points per tile than a gigantic one.

so should Military points generated through combat. A bigger map means more things to fight against and for, so battle and objectives on a tiny map are much more worth than the same one on a gigantic map.

These are not the single way to get those founding father points, though. Converting a few lumber mills to these points should do the trick.

I like the events, I don't like the founding fathers much. They are still broken yet, but the fix I provide doesn't make them any harder to get.

This also begs the question, what is the recommended map size for RaR in normal speed?

It means a working solution for this issue is :
  • The military and Exploration points necessary to earn the Founding father must scale with map size and gamespeed, and not with gamespeed alone.
  • The exploration points and military points gained through events must also scale up with map size and gamespeed- finding the amazons on a gigantic map is more a stroke of luck than anything.
  • Exploration and military points gained by the other games mechanics, except the lumber mill must get the time speed multiplier.
  • Exploration and military points gained through the lumber mill are left alone, as they scale with both gamespeed and map size
 
This also begs the question, what is the recommended map size for RaR in normal speed?

MapSize "Gigantic" would be my recommendation.
(If your machine is not too old.)

I personally never play any other MapSize.
 
MapSize "Gigantic" would be my recommendation.
I used to think the same way, but stepping one size down makes no major change in gameplay. However the impact on performance is significant. The time the AI spends on a turn is not linear dependent on number of plots. It's n^2 and I suspect there are some 2^n calculations as well.

To answer the question in a more simple way: the bigger the better, but don't pick anything where you wait longer than your patience.
 
@Barthoze:

Why did you revert Nightinggales Network fixes for Bargaining ? :confused:

I am no specialist for network issues.
But Nightinggale had purposely changed those lines.

If that was just an accident, that is no problem.
(That is the reason after all, why I check all commits.)

If you did it on purpose, please explain why.

CvPlayer.cpp

Code:
	/// random network fix - start - Nightinggale
	int randomValue = GC.getGameINLINE().getSorenRandNum(randomBase, "Bargaining Sell");
	//int randomValue = std::rand() % randomBase;
	/// random network fix - end - Nightinggale

Code:
	/// random network fix - start - Nightinggale
	int randomValue = GC.getGameINLINE().getSorenRandNum(randomBase, "Bargaining Buy");
	//int randomValue = std::rand() % randomBase;
	/// random network fix - end - Nightinggale

Edit:

As I already said, Players playing on Marathon will now have to wait very long for the first appearance of some of the DLLDiploEvents.
(In some cases they will need to play 300 rounds, before they will see such an event the first time.)

I had thus purposely not modified the first appearance but only the frequency (and prices).

But if that is the way people choosing Marathon want it to be, that is fine for me as well. :dunno:
(I never play Marathon and thus don't really care.)

So leave that as it is. :thumbsup:
(You play that Gamespeed yourself and thus probably know better.)

Edit 2:

Otherwise I am fine with all of your changes. :thumbsup:
(I checked all files commited.)
 
Normally network games will desync if random numbers do not come from the game engine itself. In this specific case it is reversed and it will desync if the number comes from the game engine.

The reason is that this code is not run in sync on all computers, but only one. Each time the game random function is called, it generates a new random seed and suddenly the random seed is no longer in sync.

Singleplayer is unaffected by this. It's a network sync only issue.
 
@Nightinggale:

Thanks for the explanation to your fix. :thumbsup:

@Barthoze:

Could you please (re-)correct the code with Nightinggale's network fix then ?
(Please upload again the modified file and a dll generated with that.)

Thanks again for all corrections considering gamespeed issues. :goodjob:
(You will of course get credits for your work when we publish again.)
 
Top Bottom