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 someRather 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 MapAs 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 worldThe world map is the whole potential area living in memory, independent of who or what’s on screen this secondThe playable area on screen is just a fixed size camera view, it’s a slice of the map starting at some (x, y) position within the wholeFor a 100×100 map you only ever draw x to x+10 across and y to y+10 down (ie. 11 tiles each way for an 11×11 window)Another wrinkle, of course, is however we draw it, we also want to center the gameplay on the player character, so there also needs to be an additional offset from the top, left, so the sprite or whatever is in the middle vertically and horizontally rather than always at the top left of our game screen.You can now follow the tutorials and edit the code right in your web browser with the Online Retro IDE– No downloads, configuration, etc necessary, and it is free...
First seen: 2026-05-26 14:35
Last seen: 2026-05-27 06:45