Skip to content
This repository was archived by the owner on Oct 28, 2022. It is now read-only.

Commit 8e6e96b

Browse files
reworked random placement
1 parent 45f5af6 commit 8e6e96b

15 files changed

+2849
-2160
lines changed

.vscode/launch.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
// "--shuffle-skybox",
1919
// "--shuffle-text",
2020
// "--shuffle-colors",
21-
"--disable-cutscenes",
21+
// "--disable-cutscenes",
2222
// "--shuffle-instruments",
2323
"SM64_US.z64"
2424
],
2525
"env": {
26-
"SM64R": "PLOT"
26+
// "SM64R": "PLOT"
2727
}
2828
}
2929
]

Config/sm64.vanilla.yml

+5
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,11 @@ collision_groups:
507507
- WATER_FLOWING
508508
- SLIPPERY
509509

510+
# Define a list of behaviours that should be used for geometry. This can include
511+
# the rocks from JRB, platforms from RR or the
512+
use_behaviour_geometry:
513+
- 0x130005B4
514+
510515
# Start object randomization section. Can be deeply nested with groups, sub-group, etc
511516
# This segment will define all randomizable objects, that will be moved around in a level.
512517
# - Groups can be created (without a "match") property to organize multiple different objects together

Data/configurableParams.json

+8-47
Original file line numberDiff line numberDiff line change
@@ -107,64 +107,25 @@
107107
"help": "Shuffle Dialog text, for signs, npc dialog, level dialog and prompts."
108108
},
109109
{
110-
"name": "disable-cutscenes",
111-
"label": "Disable Cutscenes/Intro",
112-
"category": "gameplay",
113-
"type": "checkbox",
114-
"default": {
115-
"CLI": false,
116-
"WEB": true
117-
},
118-
"help": "Disables some of the games cutscenes. (Peach Intro, Lakitu Intro, Bowser-Text on Entry)"
119-
},
120-
{
121-
"name": "disable-starwarp",
122-
"label": "Disable Star-Warp",
123-
"category": "gameplay",
110+
"name": "shuffle-instruments",
111+
"label": "Instrument-Set Shuffle",
112+
"category": "aesthetics",
124113
"type": "checkbox",
125-
"disabled": "work-in-progress",
126114
"default": {
127115
"CLI": false,
128116
"WEB": false
129117
},
130-
"help": "Disables automatically leaving the level when you collect a star. This way, all stars act like a 100-Coin star or a Bowser 8-Reds Star"
131-
},
132-
{
133-
"name": "stardoor-requirements",
134-
"label": "Stardoor Requirements",
135-
"category": "gameplay",
136-
"disabled": "work-in-progress",
137-
"type": "select",
138-
"options": [
139-
{ "value": "vanilla", "label": "Vanilla" },
140-
{ "value": "random", "label": "Random" },
141-
{ "value": "open", "label": "All Open" }
142-
],
143-
"default": "vanilla",
144-
"help": "Changes how the doors to levels require different amounts of stars to be collected beforehand. Random means all doors require stars, but the amount will be random. Open simply means all doors are open from the start."
118+
"help": "Shuffles instrument sounds around. Many different objects and songs use different instrument sets, as the N64 can't load all at once. This will shuffle them around. Might be wacky."
145119
},
146120
{
147-
"name": "keydoor-requirements",
148-
"label": "Keydoor Requirements",
121+
"name": "disable-cutscenes",
122+
"label": "Disable Cutscenes/Intro",
149123
"category": "gameplay",
150-
"disabled": "work-in-progress",
151-
"type": "select",
152-
"options": [
153-
{ "value": "vanilla", "label": "Vanilla" },
154-
{ "value": "open", "label": "All Open" }
155-
],
156-
"default": "vanilla",
157-
"help": "Changes how the locked keydoors in the castle work. Vanilla means you will require the usual keys from the Bowser fights. Open means they're simply open from the start."
158-
},
159-
{
160-
"name": "shuffle-instruments",
161-
"label": "Instrument-Set Shuffle",
162-
"category": "aesthetics",
163124
"type": "checkbox",
164125
"default": {
165126
"CLI": false,
166-
"WEB": false
127+
"WEB": true
167128
},
168-
"help": "Shuffles instrument sounds around. Many different objects and songs use different instrument sets, as the N64 can't load all at once. This will shuffle them around. Might be wacky."
129+
"help": "Disables some of the games cutscenes. (Peach Intro, Lakitu Intro, Bowser-Text on Entry)"
169130
}
170131
]

README.md

+40-70
Original file line numberDiff line numberDiff line change
@@ -8,163 +8,133 @@
88
</a>
99
</p>
1010

11-
1211
# Super Mario 64 ROM Randomizer Generator
1312

1413
This is a work in progress project to build an [OoT-Randomizer](https://www.ootrandomizer.com/)-style randomizer for Super Mario 64, that is highly configurable but easy to use.
1514

1615
# Features
1716

1817
- Works on all endianess' (`.z64`, `.n64`, `.v64`) and all regions (America, Europe, China, Japan, Japan Shindou).
19-
- Works on ROMhacks (**Please note:** Romhacks can be vastly different. Please contact us in the discord if you have any trouble.)
20-
- Randomizes Level Entries - Every Level will be a different one
21-
- Randomizes Castle Paintings - To visually match the entrance of the level it now leads to.
18+
- Randomizes level entries - Every level will be a different one
19+
- Randomizes Castle paintings - To visually match the entrance of the level it now leads to.
2220
- _New_: Levels without a castle painting will show a painting visually matching the original style, by the talented [Mika](https://not-very-artistic.tumblr.com/)
2321
- Byte alignment for running on real hardware. Default is `8`
24-
- Randomizes Dialog
25-
- Randomizes Music
26-
- Randomizes Mario's Outfit
27-
- Randomizes Coin Colors
28-
- Randomizes Objects in Level
29-
- Randomizes Musical Instruments
30-
- Randomizes Skybox
31-
- Disables Cutscenes
32-
- Disables Level Intros
33-
- ~~Disable Keydoors~~ (Currently disabled)
22+
- Randomizes dialog
23+
- Randomizes music
24+
- Randomizes mario's outfit
25+
- Randomizes coin colors
26+
- Randomizes objects in level
27+
- Randomizes musical instruments
28+
- Randomizes skybox
29+
- Disables cutscenes and level intros
3430
- ...many more to come
3531

32+
This program theoretically works on romhacks. I don't have the time to create and maintain configurations for romhacks. If you have experience and want to contribute, please ping me and I will try and help you out.
3633

3734
The application is supported on everdrive. To ensure everdrive compatibility, please change the name to a shorter one, as that seems to cause issues. For further help, please visit the Discord Server.
3835

39-
4036
Also auto extends ROM to work with the randomizer. If this fails, extend your ROM manually and use either [sm64extender](https://www.smwcentral.net/?p=viewthread&t=77343) or [Super Mario 64 ROM Extender](http://qubedstudios.rustedlogic.net/Mario64Tools.htm).
4137

4238
# Web
39+
4340
For extremely simple usage, simply use our existing web generator, found here: https://andrelikesdogs.github.io/sm64-randomizer/
4441

4542
![SM64 Randomizer Generator Web Edition](https://i.imgur.com/78OiLPZ.png)
4643

4744
### Usage
45+
4846
Follow instructions on the website. Upload your original SM64 rom, select the settings and press "Queue for generation" you'll quickly receive your randomized ROM.
4947

5048
# GUI
49+
5150
The randomizer includes a simple GUI for easy setup without any knowledge about the command line. Simply download the latest [release](/releases/latest) and open `SM64 Randomizer GUI`.
5251

5352
![SM64 Randomizer GUI](https://i.imgur.com/erEk4Dh.png)
5453

5554
### Install
55+
5656
1. Download the [latest release](/releases/latest)
5757
2. Extract **all files** in a folder of your liking
5858
3. Run SM64 Randomizer Generator.exe
5959

6060
### Usage
61+
6162
1. Select an Input ROM
6263
2. Select an Output (will be automatically determined to <rom-name>.out.<file-extension>)
6364
3. Select your settings
65+
6466
- Choose a custom seed to share with friends who use the same tool
6567
- Copy the settings string to copy your current settings to share with friends. Does not include seed.
68+
6669
4. Press "Generate"
6770
5. Run output file on your emulator/console. :tada:
6871

6972
# CLI
70-
For expert users who want to tinker with configurations, settings and test various roms, it's easier to use the program in CLI mode. To do this, run the application with additional arguments, and it will automatically work as a terminal tool. (For server owners: No graphical interface is required, if more than one argument is given.)
73+
74+
For expert users who want to tinker with configurations, settings and test various roms, it's easier to use the program in CLI mode. To do this, run the application with additional arguments, and it will automatically work as a terminal tool.
7175

7276
### Install
77+
7378
1. Download the [latest release](/releases/latest)
7479
2. Extract **all files** in a folder of your liking
7580
3. Run SM64 Randomizer Generator.exe in your terminal
7681

7782
### Usage
83+
7884
```
7985
python main.py ./Super_Mario_64_(U)_[!].z64 --shuffle-levels --shuffle-mario-color --shuffle-paintings match --seed 123
8086
```
8187

82-
_Note: Works on all versions of the game, as well as **ROM Hacks** (with some tweaking, contact us in [Discord](https://discord.gg/2ZYfhcB) for help)_
88+
_Note: Works on all regions of the original SM64_
8389

8490
Output will be a file with the same name, ending in `.out.z64`. Run this on your emulator/console.
8591

8692
```
87-
Super Mario 64 Randomizer (Version: 0.8.0)
88-
89-
usage: main.py [-h] [--no-extend] [--alignment ALIGNMENT] [--out OUT]
90-
[--version] [--seed SEED]
91-
[--shuffle-paintings {vanilla,match,replace-unknown,random}]
92-
[--custom-painting-author {disable,mika}] [--shuffle-skybox]
93-
[--shuffle-entries] [--shuffle-mario-outfit] [--shuffle-music]
94-
[--shuffle-objects] [--shuffle-colors] [--shuffle-text]
95-
[--disable-cutscenes] [--disable-starwarp]
96-
[--stardoor-requirements {vanilla,random,open}]
97-
[--keydoor-requirements {vanilla,open}] [--shuffle-instruments]
93+
Super Mario 64 Randomizer (Version: 0.10.1)
94+
95+
usage: main.py [-h] [--no-extend] [--alignment ALIGNMENT] [--out OUT] [--version] [--seed SEED] [--shuffle-paintings {vanilla,match,replace-unknown,random}] [--custom-painting-author {disable,mika}] [--shuffle-skybox] [--shuffle-entries]
96+
[--shuffle-mario-outfit] [--shuffle-music] [--shuffle-objects] [--shuffle-colors] [--shuffle-text] [--shuffle-instruments] [--disable-cutscenes]
9897
rom
9998
10099
positional arguments:
101100
rom
102101
103102
optional arguments:
104103
-h, --help show this help message and exit
105-
--no-extend disable auto-extend of ROM, which might fail on some
106-
systems
104+
--no-extend disable auto-extend of ROM, which might fail on some systems
107105
--alignment ALIGNMENT
108-
Specify the byte alignment. If you know this value,
109-
you have a higher change of successfully randomizing
110-
romhacks.
106+
Specify the byte alignment. If you know this value, you have a higher change of successfully randomizing romhacks.
111107
--out OUT target of randomized rom
112108
--version show program's version number and exit
113-
--seed SEED Allows you to play the same version as a friend,
114-
simply enter the same seed as them and you will be
115-
playing the exact same ROM.
109+
--seed SEED Allows you to play the same version as a friend, simply enter the same seed as them and you will be playing the exact same ROM.
116110
--shuffle-paintings {vanilla,match,replace-unknown,random}
117-
Change the behaviour of how the paintings in the
118-
castle are shuffled ("match" - matches randomized
119-
levels, i.e. painting = level, "random" -
120-
independently randomize paintings, "off" - leave
121-
paintings untouched)
111+
Change the behaviour of how the paintings in the castle are shuffled ("match" - matches randomized levels, i.e. painting = level, "random" - independently randomize paintings, "off" - leave paintings untouched)
122112
--custom-painting-author {disable,mika}
123-
This property allows changing the custom paintings to
124-
a different author, if you want to add your own, see
125-
the sm64.vanilla.yml
126-
--shuffle-skybox Randomizes the sky-texture between different levels.
127-
The black skybox is excluded.
128-
--shuffle-entries Shuffles the levelentries. When you enter a level, you
129-
will end up at a random one.
113+
This property allows changing the custom paintings to a different author, if you want to add your own, see the sm64.vanilla.yml
114+
--shuffle-skybox Randomizes the sky-texture between different levels. The black skybox is excluded.
115+
--shuffle-entries Shuffles the levelentries. When you enter a level, you will end up at a random one.
130116
--shuffle-mario-outfit
131117
Randomizes parts of Marios Outfit.
132118
--shuffle-music Randomizes most songs in the game.
133119
--shuffle-objects Shuffles Objects in Levels
134120
--shuffle-colors Shuffle various colors in the game
135-
--shuffle-text Shuffle Dialog text, for signs, npc dialog, level
136-
dialog and prompts.
137-
--disable-cutscenes Disables some of the games cutscenes. (Peach Intro,
138-
Lakitu Intro, Bowser-Text on Entry)
139-
--disable-starwarp Disables automatically leaving the level when you
140-
collect a star. This way, all stars act like a
141-
100-Coin star or a Bowser 8-Reds Star
142-
--stardoor-requirements {vanilla,random,open}
143-
Changes how the doors to levels require different
144-
amounts of stars to be collected beforehand. Random
145-
means all doors require stars, but the amount will be
146-
random. Open simply means all doors are open from the
147-
start.
148-
--keydoor-requirements {vanilla,open}
149-
Changes how the locked keydoors in the castle work.
150-
Vanilla means you will require the usual keys from the
151-
Bowser fights. Open means they're simply open from the
152-
start.
121+
--shuffle-text Shuffle Dialog text, for signs, npc dialog, level dialog and prompts.
153122
--shuffle-instruments
154-
Shuffles instrument sounds around. Many different
155-
objects and songs use different instrument sets, as
156-
the N64 can't load all at once. This will shuffle them
157-
around. Might be wacky.
123+
Shuffles instrument sounds around. Many different objects and songs use different instrument sets, as the N64 can't load all at once. This will shuffle them around. Might be wacky.
124+
--disable-cutscenes Disables some of the games cutscenes. (Peach Intro, Lakitu Intro, Bowser-Text on Entry)
158125
```
159126

160127
# Contributing: Getting Started
128+
161129
To work on this repository, follow the following steps. Please also definitely join the [discord](https://discord.gg/2ZYfhcB) for help.
130+
162131
1. `git clone` this repository
163132
2. Make sure you somehow have python >3.6 (Mac OSX I suggest `brew install`, Linux I suggest `apt install python3`, windows I suggest the installer)
164133
3. Create a `venv` via `python3 -m venv .` while inside the folder
165134
4. Install dependencies via `pip install -r requirements-dev.txt`
166135

167136
# Special Thanks
137+
168138
- [hack64](http://hack64.net/)'s wonderful SM64 hacking resources, clean, easy to use and great in-depth details
169139
- [SimpleFlips](https://www.youtube.com/user/SimpleFlips) Discord-Server for help with SM64 hacking/weirdness (especially Felegg)
170140
- Durkhaz for the amazing logo

__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.10.0'
1+
__version__ = '0.10.1'

sm64r/CLI.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def generate_output_path(rom_in: Path):
9090
def run_with_parsed_args(opt_args: argparse.Namespace):
9191
rom_path = Path(opt_args.rom)
9292
out_path = opt_args.out or rom_path.with_suffix(f'.out{rom_path.suffix}')
93+
start_time = time.time()
9394

9495
if not rom_path.exists():
9596
raise Exception("invalid file, does not exist")
@@ -99,6 +100,7 @@ def run_with_parsed_args(opt_args: argparse.Namespace):
99100
opt_args.seed = randint(1e10, 10e10)
100101

101102
with ROM(rom_path, out_path, opt_args.alignment) as rom:
103+
102104
try:
103105
rom.verify_header()
104106
except Exception as err:
@@ -150,8 +152,6 @@ def run_with_parsed_args(opt_args: argparse.Namespace):
150152
# rom.match_segments(0xD78271)
151153
# rom.match_segments(0xA8181C) # texture for question mark
152154

153-
start_time = time.time()
154-
155155
music_random = MusicRandomizer(rom)
156156
if opt_args.shuffle_music:
157157
music_random.shuffle_music(ALL_LEVELS)
@@ -199,18 +199,18 @@ def run_with_parsed_args(opt_args: argparse.Namespace):
199199
gameplay_stuff = Gameplay(rom)
200200
if opt_args.disable_cutscenes:
201201
gameplay_stuff.disable_all_cutscenes()
202-
if opt_args.disable_starwarp:
203-
gameplay_stuff.disable_starwarp()
204-
205-
stardoor_randomizer = StardoorRandomizer(rom)
206-
if opt_args.stardoor_requirements != "vanilla":
207-
if opt_args.stardoor_requirements == "open":
208-
stardoor_randomizer.open_level_stardoors()
209-
elif opt_args.stardoor_requirements == "random":
210-
stardoor_randomizer.shuffle_level_stardoors()
211-
212-
if opt_args.keydoor_requirements != "vanilla":
213-
stardoor_randomizer.open_keydoors()
202+
# if opt_args.disable_starwarp:
203+
# gameplay_stuff.disable_starwarp()
204+
205+
# stardoor_randomizer = StardoorRandomizer(rom)
206+
# if opt_args.stardoor_requirements != "vanilla":
207+
# if opt_args.stardoor_requirements == "open":
208+
# stardoor_randomizer.open_level_stardoors()
209+
# elif opt_args.stardoor_requirements == "random":
210+
# stardoor_randomizer.shuffle_level_stardoors()
211+
212+
# if opt_args.keydoor_requirements != "vanilla":
213+
# stardoor_randomizer.open_keydoors()
214214

215215
skybox_randomizer = SkyboxRandomizer(rom)
216216
if opt_args.shuffle_skybox:

0 commit comments

Comments
 (0)