Termanator 3DRobert Cassels and Tim Mamtora6.111 Introductory Digital Systems LaboratoryDecember 9, 2004AbstractThis report describes the implementation in Verilog of a first person 3D Video game using the techniqueof ray casting. The goal of the game is to negotiate a 3D maze past opponents to the end of the level.The user interface is a keyboard controller with a VGA display on screen. The internal design consists ofnumerous blocks, a 3D Renderer to formulate the image on screen, positioning control for the player andgame characters as well as an AI block to control opponent movements and simple game logic to signal anddisplay constant items on screen. The keyboard and VGA interfaces were tested separately and first, beforebuilding in 3D elements and finally incorporating the game logic. The final outcome was a pleasing successwith working user interfaces and a 3D image on screen minus the AI characters.Contents1 Introduction 11.1 Game Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Basic Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Background Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3.1 Ray Casting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3.2 VGA Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3.3 Hardware Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Module Description and Implementation 32.1 Detailed Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 VGA Interface (TM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.3 Video Memory Access Controller (RC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 3D Renderer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.4.1 ROM Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.4.2 3D Ray Caster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.3 Wall Position Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.4 Position To Depth Squared . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.5 Hold Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.6 Pixel Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.7 Read Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.8 AIC SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.9 Screen X To Texture U . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.4.10 Screen Y To Texture V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.4.11 3D Render FSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.4.12 3D Renderer Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.5 Player Position (TM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.6 AIC Positions (TM) . . . . . . . . . . . …
View Full Document