TalicZealot / SotnRandoTools

A collection of tools to enhance the SotN randomizer experience.
https://taliczealot.github.io/
MIT License
23 stars 6 forks source link

Additional checks requested to be added for "Tourist" relic extension. #37

Closed eldri7ch closed 8 months ago

eldri7ch commented 9 months ago

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Not related to a problem with the tools as they are designed to function

Describe the solution you'd like

A clear and concise description of what you want to happen. Please remember to search for similar issues before writing anything, including in closed issues!

I would like to add thirteen new checks to the randomizer and have them supported by the tracker.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

I do not believe there are alternatives since the checks I am adding have never been added to any randomizer preset before.

Additional context

Add any other context or screenshots about the feature request here.

Attached image showing locations and a copy of my extension.js and casual.json showing the check locations.

image

extension_js.zip casual_json.zip

TalicZealot commented 9 months ago

I could, but this is another case where it's stepping outside of the scope of the original Randomizer, so individually adding support for features like this isn't very practical or the goal of this tool. Maybe I can add another system to parse custom locations.

To do that the json would have to provide an array of the new custom locations and their info. For example:

"customLocations": [{
    "location": "Bekatowa",
    "row": 38,
    "col": 111,
    "rooms": [
        {"address": "0x06BC61", "values": ["0x01","0x04"]},
        {"address": "0x06BC51", "values": ["0x01","0x04"]}
    ]
  }]

The rooms array is a list of rooms on the minimap in ram, from which the location can be checked or peeked. The values need to be checked manually by assessing what positions are reasonable for peeking and which ones could be problematic. Sometimes compromises are necessary.

eldri7ch commented 9 months ago

Why are there two instances of "{"address": "0x06BC61", "values": ["0x01","0x04"]}"? Is that simply to offer example that multiple rooms could be required for a single check?

TalicZealot commented 9 months ago

A location can potentially be checked or peeked from multiple rooms on the map. Those are two different rooms, the second address ends in 0x51. The map in ram is actually not represented in bytes but nibbles (half bytes) and each nibble has 4 bit toggles per quadrant of uncovered map, so there can be multiple values that represent a checked or peeked location that needed to be accounted for. This could also be done with bit mask checks, but it hasn't been necessary for me to convert everything to that.

eldri7ch commented 9 months ago

OK, I will assemble that, then. Thanks for the explanation.

eldri7ch commented 9 months ago

OK, so how would that work, then, if the preset file I am using is inheriting the checks from Casual or Nimble? Should I just include the "customLocations" language in the preset files utilizing the extension?

TalicZealot commented 9 months ago

Oh I see what you mean, I totally forgot about how the extensions are defined. Hmmm I guess this doesn't work then.

TalicZealot commented 9 months ago

I just don't want to commit to adding stuff like this manually every time. You might test these and it could turn out that half of them are dumb and need replacing. How about this: For a custom extension make a json with that name holding the customLocations array. That would need to be put in the tracker presets folder. When the tracker sees an extension it doesn't recognize it will look there. So in this case it would be tourist.json.

eldri7ch commented 9 months ago

That's a great idea. Will do.

eldri7ch commented 9 months ago

Trying to research how to get the data needed for this, what does row and column refer to? I can get the map addresses and the values, but the row and column are throwing me off.

TalicZealot commented 9 months ago

Those are coordinates to a room pixel in GPU ram. I think I used to have an easy way of calculating that by referencing the map image, but I don't remember at the moment. I will check tomorrow. If you want to play around with it the map texture starts at 0x08AE80 and every row is offset by 0x800, where every byte colors two pixels. So it must be something like get the raw 240x280 map and measure the center of the room then divide the x by 2.

TalicZealot commented 8 months ago

I've decided that my old way of doing those coordinates is really stupid, because it goes all the way back to the Lua tracker when I really didn't understand what was going on. So I'm going to be changing it to simply x,y coordinates on the map texture and I'll do any necessary math in code. Location coordinates will reflect the top left pixel of the room(internal part without border) or top left pixel of the location (for equipment locations which are a 2x2 square). Here are reference images of the map textures with increased visibility: normal inverted

New json signature would be:

"customLocations": [{
    "location": "JewelOfOpen",
    "x": 197,
    "y": 62,
    "secondCastle": false,
    "rooms": [
        {"address": "0x06BCC0", "values": ["0x10"]},
    ]
  }]
eldri7ch commented 8 months ago

I will move forward with this, then.

eldri7ch commented 8 months ago

When looking for "Values" Are you asking for all related values or just the bit that refers to that specific room?

so do you need this: "values": ["0x55","0x05","0x01"] or would just "values": ["0x01"] suffice since only one bit needs to be calculated as filled?

eldri7ch commented 8 months ago

Anyway, here's the file

tourist.json

TalicZealot commented 8 months ago

or would just "values": ["0x01"] suffice

Yes that is enough for cases when that is the only viewable position.

TalicZealot commented 8 months ago

Actually never mind, don't need a PPF because I realized this should also be possible for custom seeds, so I changed the settings a bit to allow for that. Another thing that might be a good idea to support would be if the checks should be shown as rooms or locations on the map like for equipment. This seems correct to me: test

eldri7ch commented 8 months ago

Perfect!

TalicZealot commented 8 months ago

Implemented in 1.6.5

eldri7ch commented 8 months ago

How will "Out of Logic" be handled? Just add the new checks in "lockLocationsAllowed" to the json files using those checks? Even if those checks' logic is inherited from another preset?

TalicZealot commented 8 months ago

I don't parse logic inheritance at all. With the base presets I don't have to since casual and speedrun are baselines. For custom locations you would need to provide that information in the preset.

TalicZealot commented 8 months ago

Alternatively you can add normal locks to casual and ool to speedrun, that's what I did to accommodate equipment locations.

eldri7ch commented 8 months ago

I did add them there, so if I move that JSON over, it will add their OOL to the tracker?

TalicZealot commented 8 months ago

The standard Out of Logic locks are grabbed from the speedrun preset and the normal locks from casual. Preset locks are loaded on top of that and can overwrite the defaults.

eldri7ch commented 8 months ago

Then everything should be good!

eldri7ch commented 8 months ago

The map doesn't accurately reflect the requirements for the checks. Also, it should be including the equipment checks. The only way to make it so that tourist didn't also increase the number of checks in Equipment was by ordering them so that Tourist also included all of the equipment checks.

Here are the files for Tourist, Casual, and Grand Tour which are the files involved.

grand-tour.json casual.json tourist.json image

eldri7ch commented 8 months ago

Here is a Grand Tour ppf in case it's needed.

Grand-Tour-MandalorianBus92.zip

TalicZealot commented 8 months ago

Also, it should be including the equipment checks. The only way to make it so that tourist didn't also increase the number of checks in Equipment was by ordering them so that Tourist also included all of the equipment checks.

I don't understand what you mean by that. Are you saying the tourist extension also includes all the equipment locations? If so the extension json would need to include a field that indicates which extension it extends. We can also use inherits to maintain the preset convention.

{
  "extends": "equipment",
  "customLocations": [...]
}
TalicZealot commented 8 months ago

The location Colosseum Green tea does not have consistent capitalization across files.

eldri7ch commented 8 months ago

OK, let me fix both of those

eldri7ch commented 8 months ago

tourist.json

Fixed

TalicZealot commented 8 months ago

Reworked and implemented in 1.6.6

eldri7ch commented 8 months ago

The tracker still shows no requirements for the additional checks. It shows the two in Chapel and Arena as well as the one in Caverns available to be checked with 0 relics.

eldri7ch commented 8 months ago

image

It should be inheriting the check logic from Casual per the grand-tour.json. This is planned for simultaneous launch with an expedition-style preset that will inherit Nimble logic, so having the tourist.json inherit check logic from somewhere else isn't a good idea.

TalicZealot commented 8 months ago

Can you make sure these locations are named identically in tourist.json, casual.json and speedrun.json

eldri7ch commented 8 months ago

I'm the idiot. I went to do as you asked and realized that updating the tracker replaces the files in that folder with the native preset json. It works now. Thanks!

TalicZealot commented 8 months ago

Oh yeah I suppose it would, totally didn't think about that. As long as nothing else comes up there won't be any updates so it won't be an issue.