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

Dungeon Map #117

Open
Kroc opened this issue Dec 2, 2024 · 6 comments
Open

Dungeon Map #117

Kroc opened this issue Dec 2, 2024 · 6 comments

Comments

@Kroc
Copy link

Kroc commented Dec 2, 2024

A big ask, but something for 3.0 perhaps? Most games have auto-mappers now and paper mapping isn't for everybody, or even possible when you're playing on a handheld, particularly if you're playing the game in short bursts.

@maxim-zhao
Copy link
Owner

I've given it a lot of thought over the years :). It could be behind the Pause button (or an on-screen menu!) because we can't really draw it on the screen; but it means storing info for every dungeon level for what you've seen, and then a bunch of code and new art assets to draw it. Each dungeon floor is 16x16 squares, and there are 62 of them, so that's 2KB of data as a bitmap.

Storing that data could go in an unused save RAM area but it might not be possible (without significant work) to make it part of the game save itself, and to "remember" all dungeons in the game.

@Kroc
Copy link
Author

Kroc commented Dec 4, 2024

It would not be absolutely necessary to permenantly retain the dungeon map, it could be reset each time you enter a dungeon, i.e. only store the map of the dungeon you're currently in

@maxim-zhao
Copy link
Owner

But many are multi-floor, and it may be annoying to only have a "memory" of the floor you are on. Maybe I can come up with a more efficient way of storing the visited tiles - eg by storing only the walkable tiles' visited state; but it's still a lot of data to also include in game saves, and having it be "global" to all saves, or "forgetful" so it is lost every time you load a save or start a new game, seems like a sacrifice.

Another slight issue is that some of the smaller dungeons share a 16x16 dungeon map. It would be weird to show that.

@maxim-zhao
Copy link
Owner

...in https://github.com/maxim-zhao/psrp/blob/master/disassembly/ps1-j-disassembly.asm we have the dungeons as emoji (including the ending). We have:
🌫x4377
📦x206
That's 572 bytes at one bit per byte, as a very rough estimate of the bits needed. If we consider storing bits for each tunnel visited, or only every second square visited (as each can imply the 9 squares around it), it'd cut it down a bit. But not enough.

@gensakudan
Copy link
Contributor

Each dungeon floor is 16x16 squares, and there are 62 of them, so that's 2KB of data as a bitmap.

It'd be possible to narrow this down a little:

  • Two of the 62 dungeon maps are used exclusively for the credits, so they don't need automapping.
  • The outermost perimeter of tiles for each map is always walls, so each map is effectively a 14x14 space.

This way, you could save 514 bytes. Which doesn't sound like a lot on paper, but I guess it's a ~3.5K difference when multiplied by the number of saves.

@maxim-zhao
Copy link
Owner

In the extended retranslation credits I do take advantage of the game's logic to wrap to the other side of the dungeon map, but indeed that doesn't need to be mapped.

One thing to bear in mind is that it is possible to store much more data in in ROM than the RAM we are considering here. We could store maps for each dungeon to signal the walkable tiles or routes, and then store data about which have been visited (or for what length) which might work out smaller. My best guess is about 10 bytes per dungeon level could do it, but that's still way more than would fit in a save slot.

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

No branches or pull requests

3 participants