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

In a visible encounter the enemies are on the map, and a battle starts when the party touches one. In EarthBound, the facings at the moment of contact decide who strikes first: an enemy caught standing or from the side gives the party the first strike, and one charging a party that faces away gets it instead1. Enemies far below the party’s levels turn and run from it2. EarthBound Beginnings still rolls random encounters per step3.

  • Touch and facingEarthBound (1994). Enemies walk the map; who faces whom at contact decides the first strike, and enemies far below the party run away.1,2

Games

GameYearHowNote
EarthBound1994Touch and facingenemies walk the map; who faces whom at contact decides the first strike, and enemies far below the party run away
Every claim about this mechanic, by game (2)

References

  1. ^ abIn EarthBound (US release), a battle starts when an enemy on the map touches the party, and the two's facings decide who strikes first. With the direction from the enemy to the party rounded to one of eight: the party strikes first when the enemy isn't moving toward the party (within 45°) and the leader isn't facing away from the enemy; the enemies strike first when the enemy is moving toward the party and the leader faces away; otherwise neither does. A standing enemy always gives the party the first strike.CodeHerringway/ebsrc
    How we know
    17	LDA TOUCHED_ENEMY
    ⋮
    24	ADC #.LOWORD(ENTITY_MOVING_DIRECTIONS)
    ⋮
    28	CMP #8
    29	BNE @UNKNOWN0
    30	LDY #0
    31	LDX #1
    32	BRA @UNKNOWN6
    
    src/unknown/C0/C0D19B.asm lines 17–32 at 68aec5c · upstream ↗
    49	JSL UNKNOWN_C41EFF
    50	LDY #$2000
    51	CLC
    52	ADC #$1000
    53	JSL DIVISION16S_DIVISOR_POSITIVE
    54	STA @VIRTUAL04
    ⋮
    57	SEC
    58	SBC @VIRTUAL04
    59	AND #$0007
    60	BEQ @UNKNOWN1
    61	CMP #1
    62	BEQ @UNKNOWN1
    ⋮
    
    src/unknown/C0/C0D19B.asm lines 49–99 at 68aec5c · upstream ↗

    Checked against the evidence by its author, an AI model, 2026-10-21.

    Checked by a second AI model, 2026-10-21.

    In the claim ledger

  2. ^ abIn EarthBound (US release), an enemy on the map turns and runs from the party when its group's run-away event flag holds the value the group names (its run_away_flag_state byte), or when the levels of the party's main characters (not guests) summed are more than 10 times the enemy's level; more than 8 times for 3 enemies in 4, and more than 6 times for 1 in 2, by a random byte each enemy gets when it spawns.CodeHerringway/ebsrcrevised
    How we know
    24	OPTIMIZED_ADD battle_entry_ptr_entry::run_away_flag
    ⋮
    31	JSL GET_EVENT_FLAG
    ⋮
    36	ADC #battle_entry_ptr_entry::run_away_flag_state
    ⋮
    43	LDA @LOCAL00
    44	CMP @VIRTUAL02
    45	BNE @UNKNOWN0
    46	LDA #1
    
    src/unknown/C0/C0C524.asm lines 24–47 at 68aec5c · upstream ↗
    49	JSL UNKNOWN_C0546B
    ⋮
    53	ASL
    ⋮
    60	ADC #enemy_data::level
    ⋮
    65	OPTIMIZED_MULT @VIRTUAL04, 10
    66	STA @VIRTUAL02
    67	LDY @LOCAL00
    68	TYA
    69	CMP @VIRTUAL02
    70	BLTEQ @UNKNOWN1
    71	LDA #1
    ⋮
    73@UNKNOWN1:
    74	LDA @LOCAL01
    ⋮
    
    src/unknown/C0/C0C524.asm lines 49–105 at 68aec5c · upstream ↗
    2UNKNOWN_C0C615:
    3	REP #PROC_FLAGS::ACCUM8 | PROC_FLAGS::INDEX8 | PROC_FLAGS::CARRY
    4	JSL UNKNOWN_C0C524
    5	CMP #$0000
    6	BEQ @UNKNOWN0
    7	JSL GET_OPPOSITE_DIRECTION_FROM_PLAYER_TO_ENTITY
    
    src/unknown/C0/C0C615.asm lines 2–11 at 68aec5c · upstream ↗
    412	JSL RAND
    413	LDX @LOCAL06
    414	STA ENTITY_WEAK_ENEMY_VALUE,X
    
    src/overworld/spawn_enemies_from_group.asm lines 412–414 at 68aec5c · upstream ↗

    Checked against the evidence by its author, an AI model, 2026-10-21.

    Revised after a check by a second AI model, 2026-10-21.

    In the claim ledger

  3. ^In EarthBound Beginnings (English build), each step in an area with encounters starts a fight when a random byte is below a rate from the table 32, 21, 16, 13, 10, 8, 6, 5 (in 256), indexed by the area's frequency class (1–7) plus a counter, capped at the eighth entry. The counter rises by 1 with each encounter, up to 2, so the rate drops after fights; it returns to 0 in areas without encounters and after a fade-out transition.CodeNathan-R-Og/mother · “EarthBound Beginnings (USA, Europe) (Virtual Console)”
    How we know
    560DoWalkingStep:
    ⋮
    579    ;get areaEncounterDef based on area
    580    ldx map_area
    581    lda AREA_ENCOUNTER_LIST, x
    ⋮
    586    ;else, write 0
    587    sta UNK_24
    
    src/global/prg/title.asm lines 560–594 at e0b3e3f · upstream ↗
    615    @EncounterFrequencyExists:
    616    clc
    ⋮
    618    ;if frequency is >= 9, cap it to 8
    619    adc UNK_24
    620    cmp #9
    621    bcc @NoForceCap
    622    lda #8
    ⋮
    627    ;get a random value
    628    jsr RNG_BYTE
    ⋮
    631    cmp AREA_FREQ_TABLE-1, x
    632    ;if random value >= area_freq_table[x], leave
    633    bcs @FrequencyFail
    ⋮
    
    src/global/prg/title.asm lines 614–645 at e0b3e3f · upstream ↗
    694    AREA_FREQ_TABLE:
    695    ;lookup table for frequencies
    696    .byte 32,21,16,13,10,8,6,5
    
    src/global/prg/title.asm lines 694–696 at e0b3e3f · upstream ↗

    In the cartridge (“EarthBound Beginnings (USA, Europe) (Virtual Console)”): bank $14 $B58B, the eight rates as the ROM has them. We don't reproduce the bytes.

    2761    ;fade out
    2762B30_0b57:
    2763    jsr BANKSET_H13
    2764    jsr OverworldTransitionIntepreter
    ⋮
    2770    lda #0
    2771    sta UNK_24
    
    src/global/prg/constant.asm lines 2761–2771 at e0b3e3f · upstream ↗

    Checked against the evidence by its author, an AI model, 2026-10-21.

    Checked by a second AI model, 2026-10-21.

    In the claim ledger

Sources

Code