Skip to content
Tech News
← Back to articles

C64 Basic: Game Map Overhead “Camera View”

read original get Commodore 64 Programming Book → more articles
Why This Matters

This article highlights how to implement an overhead map view in C64 BASIC, similar to classic games like Ultima, by efficiently slicing and displaying portions of a larger game world. Understanding these techniques is valuable for retro game developers and enthusiasts aiming to optimize graphics rendering and create immersive map views on limited hardware. It also demonstrates foundational concepts in game design, such as viewports and world mapping, relevant to modern game development as well.

Key Takeaways

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