On this page
  1. Related
  2. Games
  3. References
  4. Sources

Level scaling ties what a player fights to something that grows as play goes on, rather than to the place alone. In Lufia II’s Ancient Cave, the floor number picks six enemy kinds from a 200-entry table1, and the enemies keep the stats of their own records at any depth2.

Games

GameYearHowNote
Lufia II: Rise of the Sinistrals1995Depth poolthe floor picks six enemy kinds from a 200-entry table, and each keeps its own stats

References

  1. ^ abCodeCellenseres/Lufia2Decomp · “Lufia II - Rise of the Sinistrals (USA)” · vinheim3/lufia2-disasmcave_objects.c 95–136; bank_003.s 4029–4068; +1 files
    How we know
    src/cave/cave_objects.c at 6fc15bb
    Our readingat 20 objects, add none99–100keep the spot's column and row101–104index = (floor - 1) × 2 + random(6); monster = table $94:D95C[index], kept at $7F:F966 + slot106–117the monster's sprite gives the object's size118–131

    In the cartridge (“Lufia II - Rise of the Sinistrals (USA)”): $83:9A37, the random(6) call and the add (A9 06 20 1B 9E 18 65 54 E2 30 AA), which the disassembly decodes with a 16-bit accumulator as lda #$2006.w and mvn. We don't reproduce the bytes.

    4029Call_03_9a1c:
    4030	phx                                                  ; $9a1c : $da
    4031	ldx $e731.w                                                  ; $9a1d : $ae, $31, $e7
    4032	cpx #$0014.w                                                  ; $9a20 : $e0, $14, $00
    4033	bcs br_03_9a69                                                  ; $9a23 : $b0, $44
    ⋮
    4035	lda $8f                                                  ; $9a25 : $a5, $8f
    4036	sta $e6b1.w, X                                                  ; $9a27 : $9d, $b1, $e6
    4037	lda $91                                                  ; $9a2a : $a5, $91
    4038	sta $e6d1.w, X                                                  ; $9a2c : $9d, $d1, $e6
    4039	txy                                                  ; $9a2f : $9b
    4040	lda $e696.w                                                  ; $9a30 : $ad, $96, $e6
    4041	dea                                                  ; $9a33 : $3a
    ⋮
    
    code/bank_003.s lines 4029–4068 at aab3894 · upstream ↗
    src/cave/ancient_cave.c at 6fc15bb
    Our readingtarget = random(4) + 4 placement tries720–724each: a random cell, a spot within it; skip near the start or a placed object, else add726–7541 floor in 16 (a byte below $10): look for a 2 × 2 block of one room, each taken with odds 128 in 256653–66813 tries at random spots in it, each added unless near the start or an object676–697

    Claim page

  2. ^ abCodevinheim3/lufia2-disasmbank_003.s 4040–4043
    How we know
    4040	lda $e696.w                                                  ; $9a30 : $ad, $96, $e6
    4041	dea                                                  ; $9a33 : $3a
    4042	asl                                                  ; $9a34 : $0a
    4043	sta $54                                                  ; $9a35 : $85, $54
    
    code/bank_003.s lines 4040–4043 at aab3894 · upstream ↗

    Claim page

Sources

Code