GameDev Book
  • Introduction
  • Math
    • Trigonometry
    • Vectors
    • Hexagon grid math
    • Line Intersection
    • Cubic Bezier curves ("shoot into a pillow")
    • Voronoi Maps
  • Graphics
    • A Low-Res Display in Unity
    • Raycasting for a first-person city display (as seen in Cars64)
    • Pseudo3d for roads (as seen in Driving64)
    • Raycasting for terrain (as seen in Comanche's "Voxel Space")
  • Game Systems
    • Item Registry
    • Behavior Variables
    • Game State Stack (aka "Action Stack")
    • Visibility - 3d Fog of war (Joy Division progressive horizon)
    • Visibility - 2d shadow casting
    • Spatial Partitions
      • Grid
      • BSP
      • k-D Tree
      • "loose" Octtree
    • Generating code from a Domain-Specific Language
  • AI
    • Behavior Trees
    • Influence Maps
    • Neural Nets
    • Genetic Algorithms
    • Racing Line
    • Flocking using Craig Reynolds' "Boids"
    • Monte Carlo Tree Search (MCTS)
    • Pathfinding: Disk-based corridor map
    • Shoot-em-up waves
  • Physics
    • Physics using Particle Systems
    • Car Physics
  • Procedural Content Generation
    • Terrain Generation
    • Markov Chains for pronounceable names
    • Constrained Tile Placement
    • Maze Generation
  • Sound / Music
    • Procedural Sound Generation
    • Adaptive Music System
  • User Interface
    • Steering systems
      • Virtual joystick
      • Drag in viewport
    • Bitmap Font Rendering
    • Vector Font Rendering
  • Appendix: Ludography
    • Games I've worked on
    • Other Games worth checking out
Powered by GitBook
On this page
  • LOW REZ GAME JAM
  • Scene setup

Was this helpful?

  1. Graphics

A Low-Res Display in Unity

I don't want this book to be a tutorial on how to do things in Unity, but this is a fun technique, and maybe it'll be useful for other game engines.

LOW REZ GAME JAM

In 2016 and 2017, I competed in a couple of game jams where the constraint was that you only had 64 pixels x 64 pixels for your display. This was a little bit more forgiving than the 40 pixel x 48 pixel "low res" graphics mode of the Apple ][ that I learned to program on.

I was able to write to a texture in Unity and draw a screen-oriented quad with that texture, which provided good results. Having the CPU modifying texture data isn't great for GPU performance, but the games I was working on didn't need a lot of speed (one primitive, 4096 texels per update) that's not that demanding.

Scene setup

For a project like this, you can use a 2d or 3d project. Create a single quad in the scene, and place it where it fills the camera's view. I use an orthographic camera, which seems like it might be slightly more efficient, but probably not worth worrying about.

I attached a C# script to that quad, and inside the script, I create a new Texture2D for my use:

Texture2D texture = new Texture2D(64,64);
renderQuad.material.mainTexture = texture;
texture.filterMode = FilterMode.Point;

And then in Update, I call into my game mode drawing code, which fills out a framebuffer object, which I then copy into the texture:

texture.SetPixels32(frameBuffer);
texture.Apply();

For some projects, I maintain a palette for more authentic constraints, but I often just draw using 24-bit RGB values.

PreviousGraphicsNextRaycasting for a first-person city display (as seen in Cars64)

Last updated 5 years ago

Was this helpful?