One thing that has popped up on Twitter over the past month or so scroll down was how old games had a limited amount of RAM, so data had constant addresses in RAM and that’s where memory hacking came into play. I’ve been fooling around with shaders a little bit lately, and I thought it would be cool to play a first person game on a ZX Spectrum.
That’s where this game idea came from. You play as a person stuck in a Holodeck-esque area, and you can navigate it with keyboard+mouse controls (or a 360 controller?). The “gimmick” in this game is a portable computer the player carries around that has the ability to PEEK and POKE memory addresses. This could change anything from the position or orientation of the player, to the level data that builds the world. (If someone knows beforehand the correct memory addresses, they could just make the win condition be accessible at the start of the game. This is perfectly fine, but is also the reason I won’t add high scores.)
Here’s a Vine video of the game-so-far in action (Sorry. I can’t use an Xbox controller with one hand.):
How the shader works:
- Render game to a 256×192 render texture.
- Render that render texture to another 256 rendertexture (this makes the framerate stable regardless of window resolution? I was getting ~33fps on a 1208×960 window before doing this, and ~180fps afterwards), using the shader:
- Average all colors in a 8×8 block that AREN’T black.
- Find the closest color in the ZX palette to the average.
- If the original pixel isn’t black, make the non-black pixels in the 8×8 square equal to the closest color to the average.
- Render the newer render texture to the screen.
TADA. This makes the game render close to how a ZX Spectrum would. The ZX Spectrum had a 256×192 resolution, with a colored border that could be changed to any of the bright colors. The 256×192 screen was divided in 8×8 px regions which could consist of two colors in the bright or dark palette. In Holodeck Game, it’s black and another color. This makes it way easier for me to develop and the game looks fine and unique as it is.
Oops. Not month or so.
@mcclure111 So like direct game data manipulation/corruption and such
— Paul Pridham (@madgarden) October 3, 2013
It turned out there weren't enough pixels in the source image, so it ran off the end, into uninitialized memory…which happened to contain
— mcc (@mcclure111) January 28, 2013
Andi if you are reading this I am sorry for making a game with the hacking you’d like be a first person “shooter”. You get carsick from those. 🙁