Monte Carlo? PRNG? Both? Neither?

General feedback and discussion of the game.

Moderator: Forum Moderators

Post Reply
Merkin
Posts: 5
Joined: April 24th, 2020, 1:45 am
Location: Portland, OR

Monte Carlo? PRNG? Both? Neither?

Post by Merkin »

Newbie here.
I assume that Monte Carlo and PRNG are both different ways of calculating damage and other semi-random numbers.
What's the effect on game play with one or the other, or both, or none?

I skimmed the forum for info, but kept running into math nerd terms that were WAY over my head. So if someone could spell it out simply, or point me to an existing thread that would be awesome.

The more hours I spend in this game, the more convinced I am that it will take dozens of hours to learn the basic mechanics and strategy, and thousands of hours if I want to get good at it, kinda like chess. It's a daunting prospect, but for the foreseeable future I've got nothing but time.
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Monte Carlo? PRNG? Both? Neither?

Post by Pentarctagon »

There isn't any effect on gameplay - it's not used for determining whether a unit hits or misses in actual combat. Where it is used, for example, is the damage calculation window, where it estimates the chances of particular combat outcomes rather than calculating the every single potential outcome. This is much faster for situations where units have a lot of strikes and other weapon specials (ulfserker vs ghost is a mainline example, but add-ons especially can have units with tens of strikes or more).
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Merkin
Posts: 5
Joined: April 24th, 2020, 1:45 am
Location: Portland, OR

Re: Monte Carlo? PRNG? Both? Neither?

Post by Merkin »

TY!
fire-emblem
Posts: 23
Joined: April 16th, 2020, 5:59 am

Re: Monte Carlo? PRNG? Both? Neither?

Post by fire-emblem »

carlo or prng?

they should put all this stuff on a concise clean faq wiki

forums are mess
User avatar
Atreides
Posts: 1059
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Monte Carlo? PRNG? Both? Neither?

Post by Atreides »

Which is the most accurate? My laptop is fast, speed not a problem.
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Monte Carlo? PRNG? Both? Neither?

Post by Pentarctagon »

PRNG is more accurate but can be painfully slow in certain circumstances, and I doubt you'd ever actually see much of a difference beyond maybe 0.1% either way in the damage calculations window.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Monte Carlo? PRNG? Both? Neither?

Post by Pentarctagon »

Atreides wrote: August 17th, 2020, 8:22 pm Which is the most accurate? My laptop is fast, speed not a problem.
To clarify, are you talking about the experimental PRNG option in the advanced preferences, or the RNG wesnoth normally uses to determine hits and misses, when you say "PRNG"?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Atreides
Posts: 1059
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Monte Carlo? PRNG? Both? Neither?

Post by Atreides »

Hmm, I had to look it up. Kinda thought it was a simple toggle. I see there is a Monte Carlo sim which I believe you explained as affecting how the damage estimates are shown. The default seems to be on. Turning it off would increase accuracy by a fraction of a % is what I gather from your post.

Then there is the experimental PRNG which is not well explained at all. It defaults off. It _seems_ to be a different combat system?
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Monte Carlo? PRNG? Both? Neither?

Post by Pentarctagon »

To more fully explain then:
  • The default RNG is, a bit more technically speaking, a PRNG called Mersenne Twister. Its only goal is to generate random numbers, which are then used by the combat system to determine hits and misses.
  • The experimental PRNG combat option modifies how hits and misses are determined in order to try to prevent highly unlikely outcomes from happening (two mages missing all their attacks in a row, for example). It's only available for single player.
  • Monte Carlo doesn't have any affect on the actual combat, but it makes it much faster to find the likely outcomes of combat (for example, when displaying the damage calculations window). In regular gameplay you wouldn't notice any difference between Monte Carlo being enabled or disabled, however in some scenarios (like the SX RPG/SXC maps) where units can have several hundred or more HP, tens of strikes, berserk, drains, etc, it can become very noticeable when Monte Carlo is disabled.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Atreides
Posts: 1059
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Monte Carlo? PRNG? Both? Neither?

Post by Atreides »

Thank you for the explanation. I also read a thread about the experimental PRNG (and found the inline help as well) and realize it's not for me. I like dice rolling and insane results one can fume and rant and rave about. That's sometimes the best part. :) Chess never really appealed to me.

I ran a turn with Monte Carlo off and saw no slow down at all. I do have a lot of era's installed so I'll know what to look for in case some of them start acting funny (slow). I'll keep it off as I like more accuracy on principle, even if the difference is negligible. ;)

p.s. single player I did not understand until I read the aforementioned thread. It means campaigns. Did not come across this term before although I realize now that it is but an inversion of the so called multiplayer mode which I 99% of the time play as a single user vs computer players. Thus the confusion.
Post Reply