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

Commit 0290f6d

Browse files
fix a bunch of stuff, re-implement random places generation only using available floor triangles now, way faster. config fixes
1 parent 583c18f commit 0290f6d

File tree

9 files changed

+1236
-919
lines changed

9 files changed

+1236
-919
lines changed

.vscode/launch.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"cwd": "${workspaceFolder}",
1515
"args": [
1616
"--shuffle-objects",
17-
"--shuffle-entries",
18-
"--shuffle-skybox",
19-
"--shuffle-text",
20-
"--shuffle-colors",
17+
// "--shuffle-entries",
18+
// "--shuffle-skybox",
19+
// "--shuffle-text",
20+
// "--shuffle-colors",
2121
"--disable-cutscenes",
22-
"--shuffle-instruments",
22+
// "--shuffle-instruments",
2323
"SM64_US.z64"
2424
],
2525
"env": {

Config/README.md

+77-9
Original file line numberDiff line numberDiff line change
@@ -7,112 +7,148 @@ The order in which these files are loaded is sorted alphabetically. If you requi
77
# Documentation
88

99
## `name`: `string`
10+
1011
Sets a name for the configuration file, this name will be shown in the CLI to help users figure out which configuration was used for their ROM.
1112

1213
## `rom`: `object`
14+
1315
Starts the definition of ROM specific configurations
1416

1517
### `rom[].checksum`: `int,int[]`
18+
1619
Checksum(s) that will match this specific ROM configuration as hex numbers, i.e. `0x0000001`. If any of these checksums match, it will use this configuration.
1720

1821
### `rom[].name`: `string`
22+
1923
Name of this ROM configuration, can include information about Endianess, Region, ROM-Type (Extended, Vanilla) to further narrow down which configuration was used. This information is only visible when using the CLI.
2024

2125
### `rom[].macro_table_address`: `int`
26+
2227
Start of Macro Object Preset Table. This table is used to determine which macro preset id corresponds to which object. If you're unsure about this, it is most likely the same as the default. Check `sm64.vanilla.yml`
2328

2429
### `rom[].special_macro_table_address`: `int`
30+
2531
Start of Special Macro Object Preset Tabel. This table is sued to determine which special macro preset id corresponds to which object. If you're unsure about this, it is most likely the same as the default. Check `sm64.vanilla.yml`
2632

2733
### `rom[].defined_segments[]`
34+
2835
This section defines segments that are loaded by default. This varries by region. If you're unsure about this, it is most likely the same as the default. Check `sm64.vanilla.yml`
2936

3037
### `rom[].defined_segments[].segment`: `int`
38+
3139
Segment ID of the segment that will be auto-loaded in this particular ROM.
3240

3341
### `rom[].defined_segments[].read_addresses`: `bool`
42+
3443
Should the addresses defined as `start` and `end` be used to look up the addresses that define the segment, or are the addresses themselves the addresses that define this segment. If `read_addresses` is true, it will read the defined `start` and `end` addresses to determine the start and end.
3544

3645
### `rom[].defined_segments[].start`: `int`
46+
3747
Start of segment
3848

3949
### `rom[].defined_segments[].end`: `int`
50+
4051
End of segment
4152

4253
## `levels`
54+
4355
This will define which levels this ROM contains and also their paintings, if they have one. It is also used to determine which levels have special properties, like `overworld`, `slide` and many others. see [level properties](#level-properties)
4456

4557
### `levels[].name`: `string`
58+
4659
The name of the level. Displayed as information for the user and to make this file human readable.
4760

4861
### `levels[].course_id`: `int`
62+
4963
The internal course-id. Not the games course numbers.
5064

5165
### `levels[].properties`: `object`
66+
5267
Properties that this level contains. These can disable/enable certain functionality, alter rules, ensure order, define the painting for this level and many more. See [level properties](#level-properties).
5368

5469
### `levels[].exclude`: `object`
70+
5571
Properties that this level **can not** contain. See `levels[].properties`
5672

5773
### `levels[].areas[]`
58-
If a level contains different areas with different properties, those can be defined here as well.
74+
75+
If a level contains different areas with different properties, those can be defined here as well.
5976

6077
### `levels[].areas[].id`: `int`
78+
6179
ID of the area, so it can be identified by the program.
6280

6381
### `levels[].areas[].name`: `string`
82+
6483
Name of the area, for human readability and user information in the CLI.
6584

6685
### `levels[].areas[].properties`
86+
6787
Properties that this area contains. These disable/enable certain functionality, alter rules, ensure order, define the painting for this level and many more. See [level properties](#level-properties).
6888

6989
### `levels[].areas[].exclude`: `object`
90+
7091
Properties that this level **can not** contain. See `levels[].properties`
7192

7293
## `object_randomization`
94+
7395
Start of nested object definition table. This sections consists of `rules`, defining which rules to enforce for this group, `match`, defining which objects it should match with and `objects`, defining more specific objects or types of objects that need special properties too.
7496

7597
### `object_randomization.rules`
98+
7699
Which rules to enforce for this object definition group. See [rules](#rules) for a complete list and documentation of rules.
77100

78101
### `object_randomization.match`
102+
79103
Which objects will match this object definition group. This key is optional and without it, object definition groups can be used to group together multiple objects that should all have the same or similar rules. See [matching](#matching) for a complete list of ways to match different kinds of objects.
80104

81105
### `object_randomization.for`: `string[]`
106+
82107
You can use this property to "copy" a set of rules here. Use the full name of the object definition group you want to include here.
83108

84109
### `object_randomization.objects[]`
110+
85111
This allows you to nest more objects. `object_randomization` is the root definition, defining default rules. All rules further down the table will overwrite rules defined closer to the root.
86112

87113
# Level Properties
88114

89115
## `overworld`: `bool`
116+
90117
This will enable this level to be searched for level entries. All levels containing this property will be searched.
91118

92119
## `shuffle_warps`: `array`
120+
93121
This will enable this level to be searched for specific warps to specific levels, that can be shuffled with other warps. For example to shuffle between only the cap-levels in vanilla.
94122

95123
### `shuffle_warps[].to[]`
124+
96125
Warps to _which_ levels can be found with this property?
97126

98127
### `shuffle_warps[].to[].course_id`: `int`
128+
99129
Defines the course-id that should be matched.
100130

101131
### `shuffle_warps[].to[].area_id`: `int
132+
102133
Defines the area-id that should be matched.
103134

104135
### `shuffle_warps[].with[].course_id`: `int`
136+
105137
Defines the course-id that it can be shuffled with. The program will select one of the entries in `with`
106138

107139
### `shuffle_warps[].with[].area_id`: `int`
108-
Defines the area-id that it can be shuffled with. It will only match complete sets, so if your `with` entry is
140+
141+
Defines the area-id that it can be shuffled with. It will only match complete sets, so if your `with` entry is
142+
109143
```yml
110144
- course_id: 0x01
111145
area_id: 0x01
112146
```
147+
113148
it will use the whole set of `course_id` and `area_id`
114149

115150
## `shuffle_painting`: `object`
151+
116152
This will enable painting shuffling. The paintings are hardcoded right now. This will soon be altered to include the texture positions that need to be exchanged. For now, the valid values are:
117153

118154
The painting of a level can be defined, if the level can be associated to one. This will allow the randomizer to shuffle the various defined paintings in the game, to either: randomize them unrelated to the current randomized level entries, change them according to the randomized level entries, or fully replace them with a custom painting, if applicable. See [paintings](#paintings)
@@ -130,61 +166,84 @@ The painting of a level can be defined, if the level can be associated to one. T
130166
- `painting_sl`
131167

132168
## `slide`: `bool`
169+
133170
This will enable special checks and rules for slide levels, such as:
171+
134172
- Spawn must remain about the same height, otherwise you start in the middle of the slide.
135173
- Coin/Object spawns are less restrictive about slope placement, so it can still be placed on the slide.
136174

137175
## `fly_stage`: `bool`
176+
138177
This will enable special checks and rules for level with a wing-cap available, or where a wing-cap is your main method of movement.
178+
139179
- Spawns can be over death-floor
140180

141181
## `disable_water_check`: `bool`
182+
142183
Use this in level where water can be changed, to allow the program to place objects underwater.
184+
143185
- Disables underwater rules
144186

145187
## `requires_key`: `int`
146-
Defines which "key" is needed for this level, if it were unshuffled. In combination with `key_receive` you can define which levels need to be available before *this* level can be reached.
188+
189+
Defines which "key" is needed for this level, if it were unshuffled. In combination with `key_receive` you can define which levels need to be available before _this_ level can be reached.
147190

148191
## `key_receive`: `int`
192+
149193
Defines that this level will reward the player with a "key" after completion. Can be used to ensure correct order of levels.
150194

151195
## `continues_level`: `int`
196+
152197
Defines that this level will _continue_ as another level, i.e. bowser and bowser-fight levels. This is to ensure that the exit warps in the _continued_ level are also changed to the same exit warps as the current level. The value passed is the `course_id` of the target level.
153198

154199
## `disabled`: `object, bool`
200+
155201
The `disabled` as a boolean property disables all randomization properties for this level or area. Includes `object_randomization`, `painting_shuffle` and `entry_shuffle`
156202

157203
If an array of properties is defined, only those will be disabled.
158204

159205
## `end_game`: `bool`
206+
160207
Defines that this marks the end of the game.
161208

162209
# Rules
163210

164211
## `drop_to_floor`: `bool,string`
212+
165213
If set to string `force`, it will `drop_to_floor` even underwater. Otherwise underwater this rule will be ignored, so things float at any height in water.
166214

167215
This will set this object to drop down onto floor level when its position will be defined.
168216

169217
## `no_floor_required`: `bool`
218+
170219
If this property is set, the floor check will be skipped if no floor is found
171220

172221
## `max_slope`: `float`
222+
173223
Defines the maximum slope allowed. `1.0` is a wall. `0.0` is completely flat floor. A value of `0.0` will ensure only completely flat floors are considered as valid positions.
174224

175225
## `min_y`: `int`
226+
176227
Minimum absolute `y` coordinate of this object. Useful to limit spawning to be above a certain height. Use Quad64 to look up positions.
177228

178229
## `max_y`: `int`
230+
179231
Maximum absolute `y` coordinate of this object. Useful to limit spawning to be below a certain height. Use Quad64 to look up positions.
180232

181233
## `bounding_box`: `[int, int, int]`
234+
182235
Defines a bounding box for this object to check if it might clip into floor/walls. The order is `length` x `width` x `height`
183236

237+
## `max_uneven_distance`: `float or int`
238+
239+
When using bounding box, a floor check is done for all 4 corners. If the max distance from the objects bounding box and the floor it hit is bigger than this configured value, the position will be rejected.
240+
184241
## `spawn_height`: `[int, int]`
242+
185243
Defines the minimum and maximum spawn height allowed. The program will select a value between these two. For reference: Triple-Jump height is ~550
186244

187245
## `underwater`: `bool,string`
246+
188247
Allowed properties: `allowed`, `only`, `never`
189248
If this property is set to `true` it will be `allowed` - if this property is set to `false` it will be `never`
190249
`allowed` - Can be both above and underwater
@@ -194,50 +253,59 @@ If this property is set to `true` it will be `allowed` - if this property is set
194253
# Matching
195254

196255
## `[default]`: `int,int[]`
256+
197257
If no other properties are necessary, you can directly define the behaviour address this object is supposed to match with. i.e.:
258+
198259
```yml
199260
- match: 0x13002250
200261
```
201262

202263
or to define multiple:
264+
203265
```yml
204266
- match:
205-
- 0x13002250
206-
- 0x13002251
267+
- 0x13002250
268+
- 0x13002251
207269
```
208270

209271
## `behaviour`: `int,int[]`
272+
210273
Can match one or more behaviour script addresses as integers. Same as `[default]`
211274

212275
## `source`: `string`
276+
213277
Allowed values:
278+
214279
- `PLACE_OBJ` spawned with the `0x20` command
215280
- `MACRO_OBJ` spawned with the `0x39` command
216281
- `SPECIAL_MACRO_OBJ` spawned with the `0x2E` command
217282
- `MARIO_SPAWN` marios spawn inside this level via level command `0x2B`
218283

219284
## `course_property`: `string`
285+
220286
Matches specific property keys from a course.
221287
See [level properties](#level-properties)
222288

223289
## `bparam[n]`: `any`
224-
This is to match specific behaviour parameters. There is 4 in total from [1-4]. Only `0x20 (PLACE_OBJ)` objects will have all 4. Look up Behaviour Scripts for SM64 to find which behaviour parameters do what.
225290

291+
This is to match specific behaviour parameters. There is 4 in total from [1-4]. Only `0x20 (PLACE_OBJ)` objects will have all 4. Look up Behaviour Scripts for SM64 to find which behaviour parameters do what.
226292

227293
## Misc. Information
228294

229295
#### Debugging Mode
296+
230297
Using the Environment variable "SM64R" you can select different debugging modes. The allowed modes are
231298

232-
* `PRINT` - Enables more verbose output
233-
* `PLOT` - Plots level geometries using plot.ly. Install requirements-dev to use.
299+
- `PRINT` - Enables more verbose output
300+
- `PLOT` - Plots level geometries using plot.ly. Install requirements-dev to use.
234301

235302
#### Positioning of Objects, Bounds, etc.
303+
236304
When taking the position from the plot.ly graphs, be sure to convert all positions from the labels like so:
237305

238306
in Plotly: `[X, Y, Z]`
239307
in Config: `[-X, Z, Y]`
240308

241309
i.e. when taking the position from `[100, 200, 300]` plot.ly use it in the config as `[-100, 300, 200]`
242310

243-
This issue is occouring because plot.ly and sm64 use different conventions for the order and directions of vectors. :shrug:
311+
This issue is occouring because plot.ly and sm64 use different conventions for the order and directions of vectors. :shrug:

0 commit comments

Comments
 (0)