Skip to content

Minimap tile creator#169

Merged
Miepee merged 13 commits intomainfrom
minimap-tiles
Oct 7, 2025
Merged

Minimap tile creator#169
Miepee merged 13 commits intomainfrom
minimap-tiles

Conversation

@biosp4rk
Copy link
Copy Markdown
Collaborator

@biosp4rk biosp4rk commented Aug 29, 2025

  • Added minimap tile creator that can create new minimap tiles based on a MapTile object
  • Modified change_minimap_tiles in door_locks.py to create an add new tiles when they don't already exist
    • Uses existing fallback if there are no more blank tiles (but this probably won't happen in practice)
  • Blank minimap tile IDs are hardcoded (BLANK_TILE_IDS in minimap_tiles.py)

Fixes #164

@biosp4rk biosp4rk marked this pull request as draft September 1, 2025 22:27
@biosp4rk
Copy link
Copy Markdown
Collaborator Author

biosp4rk commented Sep 1, 2025

Still needs work to account for transparent tiles and item tiles

@biosp4rk biosp4rk marked this pull request as ready for review September 5, 2025 19:18
Copy link
Copy Markdown
Contributor

@Miepee Miepee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine for me, but would appreciate a look from @duncathan if possible

tile next to them. Non-item tiles can use any blank tile, but solitary tiles are preferred
to save more tiles for item tiles."""
valid_tile_id: int | None = None
for tile_id in blank_tile_ids:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iterating over a set is generally inadvisable because the order is not guaranteed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order does not matter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're trying to maximize open space, then it does matter since otherwise you could end up running out of viable slots for item tiles if you get unlucky enough with the random order you get. it would be much more robust and predictable to iterate over sorted(blank_tile_ids)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would use the same amount of space whether they're sorted or not. If you look at the code, non-item tiles explicitly check for solitary tiles so that tile pairs are saved for item tiles

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider a trivial example where you have two item tiles to make and four blank spaces, {0, 1, 2, 3}. if the first item tile happens to land on index 1 first, it'll take up tiles 1 and 2 and there will be no space for the second one

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now. I don't think it will be an issue in practice but I can change it

@Miepee Miepee merged commit a80e49c into main Oct 7, 2025
8 checks passed
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.

DLR: Create minimap tile builder

4 participants