Explanation of how to create an Ultima-style map view turns into an adventure in C64 BASIC optimisation
Games like Ultima have a classic overhead camera view rather than the moving character view that I have been showing in my retro roguelike. How is that implemented?
Jay in the Commodore 64 Ultimate Development & Modifications Facebook group asked:
Here is my answer (which on reflection wasn’t as helpful as it could have been):
The way to do it with c64 characters is the map defines the whole potential area and the “camera view” is a slice of that starting at x, y of the map. So if the map is 100,100 you need x to x+11, for y to y+11 rows. I’m sure someone has code already if not I can come back with some
Rather than leave that as it was, I felt I needed to offer a better solution, plus it is a good challenge to walk through in a blog post, so here we are.
View Port Versus Map
As I mention briefly in my response, the main mental split is between the “world map” and the visible portion. We are simulating a viewport or portal into the whole, and solutions will involve taking the correct slices out of the bigger version and pasting them onto the game screen.
Our player has a X and Y coordinate that represent their horizontal/left and vertical/top position in the world
and coordinate that represent their horizontal/left and vertical/top position in the world The world map is the whole potential area living in memory, independent of who or what’s on screen this second
... continue reading