Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine area light #99

Merged
merged 10 commits into from
Sep 27, 2022
Merged

Conversation

chriscauley
Copy link
Collaborator

@chriscauley chriscauley commented Sep 22, 2022

Front end changes

  • Area randomization is no a select with off, light, and full
  • light area checkbox is gone and area layout was moved up
  • Changes to how area randomization is displayed on customizer page

Randomizer changes

  • area arg can now be off, light, full
  • areaList arg added
  • lightAreaRandomization flag removed
  • area arg and areaList arg are used to make areaRandomization and lightRandomization boolean variables that are passed in in the same manner as the previous flags were

Misc

  • I don't understand any of the changes I made in the utils/ and tools/ folders.
  • lightAreaRandomization removed from all presets.
  • areaRandomization turned to off/light/full in all presets

Changes result in identical rom files

This is a script I wrote to ensure that the exact same settings do change how the rom is generated. This script will:

  1. Checkout master
  2. Generate a rom with a fix seed with a) no area randomization b) area randomization and c) light randomization
  3. Store the output of 2. to a file
  4. append the md5 hash of the rom file to the same output file
  5. Repeat steps 2-4 with this branch
  6. Print the diff of the two output files
  7. If everything worked the result will look like the following (the only difference between output files is the time it took to run the script

image

set -e

function doit() {
    BRANCH="$1"
    NAME="$2"
    shift
    shift

    python3 randomizer.py \
            --rom super_metroid.smc \
            --startLocation "Green Brinstar Elevator" \
            --seed 1 $@ > _$BRANCH/$NAME.output

    mkdir -p _$BRANCH
    mv *.sfc _$BRANCH/$NAME.sfc
    ls _$BRANCH/$NAME.sfc
    cd _$BRANCH
    md5sum $i.sfc >> $NAME.output
    cd ..
}

if [[ "$1" == "-f" ]];
then
    rm *.sfc -f

    # do non-area-random, area-random, and light-area-random with old code                               
    git checkout master
    doit master off
    doit master full --area
    doit master light --area --lightArea

    # do non-area-random, area-random, and light-area-random with new code                               
    git checkout combine_area_light
    doit head off
    doit head full --area full
    doit head light --area light
fi

set +e

for i in off full light;
do
    echo
    echo --- head vs master  for $i ---
    diff _head/$i.output _master/$i.output;
done

@chriscauley chriscauley marked this pull request as ready for review September 22, 2022 18:50
@theonlydude theonlydude merged commit 093cf86 into theonlydude:master Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants