RNG Discussion

Talk about the shiny-new post-apocalyptic Advance Wars game here.
User avatar
ALAKTORN
Location: Italy

RNG Discussion

Postby ALAKTORN » Thu Mar 05, 2015 3:33 am

Just posting for posterity or something.
USA RAM address: 0x214BFA8

1 step formula (written in C): x_new = ((((4*x_old+2) * (4*x_old+3)) & 0x7fffffff) * 8 / 7) & 0x7fffffff;

AI’s day doesn’t have a frame-based advance like in AWDS, and when loading a save it advances the RNG with 2 “map loading” advances (12 + 12 steps).

Edit: Writing a bit of the RNG sequence:
0 → 6 → 802 → 11779782 → 286633908 → 453818978 → 2054565282 → 783827216 → 593729616
Last edited by ALAKTORN on Thu Apr 06, 2017 1:03 pm, edited 1 time in total.

GipFace
Rank: Lord of Children Games

Re: RNG Discussion

Postby GipFace » Thu Mar 05, 2015 1:09 pm

So what's the seed?

User avatar
ALAKTORN
Location: Italy

Re: RNG Discussion

Postby ALAKTORN » Thu Mar 05, 2015 8:54 pm

What do you mean? Starting seed is 474809046 but I don’t know what you want to do with that.

Edit: Oh wow the seed seems to be determined by some kinda timing. Got 539828321 just now. If I pause the emulator on the start screen, wait some time, then soft reset, it’s seeded to a number a few dozens bigger. If I soft reset as fast as possible it’s seeded with a +1.
Last edited by ALAKTORN on Sat Apr 08, 2017 7:49 am, edited 1 time in total.

User avatar
ALAKTORN
Location: Italy

Re: RNG Discussion

Postby ALAKTORN » Wed Apr 05, 2017 10:09 am

The Luck formula does appear to be simply a modulo 11 at the end of it. So it’s a d11 instead of a d10 like the older games, and that’s why you can get 10% Luck damage.

Edit: What the fudge, it seems to be determined a different way on AI’s turn… freezing the RNG for +10% attacker and +0% defender on my turn gives a different result on AI’s turn… /// This is weird. I’m testing Hourglass. Inf attack on Wood Tank with RN 29 estimates 11% with 51% counter, which is 10/0 Luck. But when the Inf actually attacks, the attack ends as 11% and 58% counter.

Looking further into this, the attacks work as normal. Attacker’s Luck first, defender’s Luck second. Those are fine. It’s the AI estimation that’s for some reason doing something else entirely.

AAAAAAAA I’ve completely forgotten how estimations work, freezing the RNG gives different estimation from actual result in AWDS too so I don’t know what’s going on. ._. /// OK I think it’s just shifted 1 ahead. Because when the AI estimates a battle, it doesn’t just do the 2 Luck advances, but first it does some more basic unit-selecting-related advance. So if RN 0 gives +6/+10 (0 → 6 → 802 (modulo 11 = 10)), for the estimation it will take the +10 for the attacker and will get +3 (802 → 11779782 (mod 11 = 3)) for the defender. Welp, mystery solved… thank god.

So frozen RN 194 makes it attack and the attack ends 7% with 65% counter which is 5/10 Luck.

RN 12 gives +10/+0 Luck. RN 65 gives +0/+10.

http://i.imgur.com/NvUtAuL.png

WOW fudge this game. :( Bike decides not to attack 5HP Vet Tank despite dealing 15% and taking 25% counter, that’s 1050F vs. 625F counter, it should work. :( Maybe the stupid Bikes have a 2× multiplier…

Edit: Just went through Tatter River’s D2D to put it on the website and noticed on second to last day Lin builds an Infantry 1S of HQ but doesn’t attack your capping Inf, it loads into a TC instead. Wtf.

User avatar
ALAKTORN
Location: Italy

Re: RNG Discussion

Postby ALAKTORN » Wed Apr 12, 2017 4:45 am

What in the fudge. O_o I think you can RNG manipulate with cursor position. Maybe it has to do with the AI having to scroll the map, which changes the RNG. Edit: Nvm I have no fudge idea how it works. You can reload a save and get 2 different outcomes on C5 New Allies… /// Frozen RNG gives different positions for attacks on Fragment Isle, lol. Wtf is going on.

Also, you can draw a path with AI units too, even though the arrow doesn’t appear, it’ll still calculate the path and advance the RNG.

Edit: This RNG is so bad that it can get stuck looping the same ≈ 140 values… wow.

Edit2: I think this game might have different AI behavior based on CO… on Fragment Isles, I’ve never seen Brenner’s 5HP Plain Inf attack your Factory Inf, but Lin’s even 4HP Plain Inf can attack your COZ (Penny) Factory Inf.


Return to “Days of Ruin/Dark Conflict General”

Who is online

Users browsing this forum: No registered users and 1 guest