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.

User avatar
DxDyDzD
Rank: Blue Bomber
Location: War Room

Re: RNG Discussion

Postby DxDyDzD » Thu Apr 27, 2017 11:37 pm

Got caught in a death spiral while attempting Hourglass 5/450. Returned to the same RN after 380 advances.

I was using an Inf to advance RNs by wobbling the cursor between 2S1E and 1S2E every frame. This advances the RN by 1 or 2. It took 250 frames to return to the starting RN.

Full sequence below. Wall of text warning
Spoiler: show
996692770 0
1497331106 1
106419033 2
277559600 3
1098235837 4
1899126594 5
835284825 6
743103938 7
1109825076 8
691715243 9
633967453 10
1871745565 11
1679883952 12
2007233616 13
1406338859 14
1185387942 15
1955906484 16
141010969 17
1534387650 18
1331121424 19
996752610 20
1881761478 21
270989529 22
1996334237 23
278724857 24
1897264432 25
633168976 26
1413285675 27
1224335051 28
1230782301 29
69763028 30
84669465 31
983393730 32
512183568 33
1298742498 34
1421586411 35
1265170708 36
262597657 37
1144153538 38
1679698045 39
260045195 40
164970041 41
81744322 42
56909657 43
1007401264 44
964767092 45
2103693337 46
991534237 47
1948235732 48
767470324 49
1696063513 50
315895526 51
1553920656 52
1029702589 53
1387707056 54
547217926 55
1131201314 56
523409972 57
59746914 58
1023272061 59
74611083 60
18918384 61
272442155 62
1111140336 63
522878617 64
1768899449 65
768922342 66
297412971 67
719203750 68
500323837 69
72986141 70
1233766356 71
248668624 72
352636422 73
1308218731 74
1085152093 75
1901077606 76
2014493035 77
133293186 78
2044646672 79
434013702 80
1505678699 81
898505565 82
932792569 83
592732902 84
1627849945 85
74626790 86
1556963398 87
97421529 88
198269817 89
315104267 90
225947193 91
734763750 92
378724422 93
165578969 94
260585190 95
172693282 96
1496755325 97
758029853 98
2010967142 99
1055017908 100
2087364633 101
2025420811 102
28941296 103
618977798 104
762505140 105
2097115453 106
1797812034 107
2124527741 108
1371030192 109
1387174114 110
1801634356 111
419792336 112
106281917 113
338934448 114
1079594941 115
824280020 116
1826976793 117
459555120 118
103933008 119
609926662 120
2059205117 121
1575094667 122
1574200011 123
500360176 124
1834848482 125
891573373 126
1063774018 127
1004302169 128
682885716 129
314490758 130
498118288 131
657809195 132
1900207819 133
1884194946 134
1347629181 135
2038551801 136
1842668262 137
1022222406 138
690166562 139
1716155810 140
175625049 141
1322540482 142
1898204432 143
345137524 144
38452688 145
1181849387 146
392758109 147
1716762288 148
123869410 149
1435381739 150
802748692 151
276978128 152
1041653840 153
182234045 154
500770918 155
1413457698 156
355848464 157
1800434621 158
2022750896 159
1487341209 160
798489172 161
112817762 162
242452752 163
252315142 164
125602886 165
1850673369 166
1264372016 167
2090432153 168
1710357076 169
1954117218 170
299974635 171
121118118 172
332158461 173
2101231718 174
662667920 175
2097096784 176
604033104 177
1997824665 178
224070813 179
899865702 180
1806004294 181
1850434630 182
662702297 183
208905373 184
1984608212 185
1972733538 186
1104475846 187
1259890320 188
601064381 189
39987302 190
137490502 191
2010567165 192
929462082 193
429626347 194
628184194 195
449668953 196
1154623206 197
1619934132 198
707344994 199
1658652944 200
467872409 201
1007254100 202
124651691 203
2004489053 204
445232816 205
1201805538 206
1838034923 207
189181936 208
1920227846 209
1277056363 210
223072825 211
1426472825 212
1745535133 213
73480148 214
93835142 215
1011115371 216
1336304770 217
189116541 218
351393017 219
54696386 220
1367002384 221
1644323188 222
1663445894 223
956303869 224
503094228 225
1752218941 226
1169672880 227
76650722 228
315352774 229
1700797803 230
107326886 231
849499645 232
1343261067 233
108740153 234
1840356070 235
1499801963 236
881882827 237
1596651065 238
1374891312 239
165232573 240
1409441602 241
456599092 242
633238406 243
680350498 244
349589776 245
756202722 246
148764944 247
927055074 248
60984153 249
931075229 250
246574768 251
2141207924 252
87225515 253
347659394 254
832595801 255
308272578 256
1548729030 257
570400107 258
1368464221 259
685628226 260
2093927110 261
1006102160 262
1376860825 263
97333552 264
177239705 265
1310999417 266
457645067 267
1616958155 268
1930224624 269
387813602 270
1869445392 271
1276230882 272
142473488 273
2010383878 274
1185563426 275
948682438 276
265063202 277
476495558 278
137736116 279
1038624793 280
913181268 281
1423930978 282
174744701 283
300654109 284
1011824011 285
728443888 286
134779106 287
663582992 288
1937732541 289
67905638 290
1532995362 291
2014396102 292
1157700971 293
758342786 294
232557547 295
216571302 296
1869221081 297
1722810379 298
1068950804 299
1554775650 300
164904939 301
142389232 302
1234159549 303
2129635430 304
1195503686 305
654009414 306
389473350 307
643977725 308
1209132281 309
293415947 310
1896122790 311
144720820 312
1744882859 313
1728025437 314
1487667156 315
1139686717 316
2142601611 317
534789689 318
220455947 319
1402646073 320
506773369 321
651570772 322
1646589538 323
1033828038 324
1016021501 325
1643598512 326
1469655851 327
53848048 328
1090607622 329
294690448 330
664905808 331
1480193250 332
1586690320 333
2080189081 334
763385282 335
1105883554 336
1530886123 337
581995357 338
952472093 339
918018589 340
212373753 341
225029131 342
1046027248 343
1797427426 344
290289936 345
768120912 346
261055129 347
1949427723 348
240060838 349
2056274868 350
1720915408 351
2132673762 352
294039531 353
2089351444 354
1000795161 355
837370160 356
111422836 357
1532968400 358
464773200 359
15510461 360
256302914 361
580780450 362
76904427 363
1674311956 364
1475051106 365
65889405 366
552012756 367
695909693 368
269095892 369
658806955 370
298699321 371
87768953 372
628951490 373
823896189 374
197580025 375
21441547 376
1618699540 377
530916084 378
877378438 379
996692770 380

User avatar
ALAKTORN
Location: Italy

Re: RNG Discussion

Postby ALAKTORN » Sat Apr 29, 2017 12:25 am

Yes, I’ve mentioned that before. And whether you get stuck in a small loop or not all depends on the starting seed, so you have to reset the game to get out of it.


Return to “Days of Ruin/Dark Conflict General”

Who is online

Users browsing this forum: No registered users and 1 guest