Digger video game using Atmel Mega32

Introduction

Sound Bite

We implemented a black-and-white video (TV) game adaptation of the old DOS classic known as Digger, by Windmill Software.
Summary
On the Game Start screen, a choice between a multiplayer mode and an AI mode is offered. The multiplayer mode supports three players simultaneously for the Digger and both Nobbins. In the AI mode, one player controls the Digger and the Nobbins are AI-controlled.
Digger video game using Atmel Mega32

In this game, the Digger tunnels its way through an underground mine, in an attempt to consume all the emeralds to win. On the other hand, two non-tunneling Nobbins chase the Digger and attempt to catch it before all the emeralds are gone. Every now and then, a random emerald gains special markings which distinguish it from the others. If the Digger can consume that emerald before the markings disappear, the Digger gains a speed boost for a limited time

Motivation

If the Digger successfully consumes all emeralds, the time taken to complete the game is displayed on the screen, along with the best time so far. If the Nobbins catch the Digger, only the best time is displayed, along with a ‘lose’ message.
We chose to implement a game because we both enjoy games and wanted to make one of our own. In particular, we chose Digger because we felt that this game had sufficient complexity for a final project. Additionally, at least one of us was able to provide input on the how the game should work, having played it many times before.
On a more personal note, Chien Chern’s father enjoys playing this game immensely and Chien Chern thought it’d be cool to be able to tell his father that he made the game he still plays almost every night.
High Level Design
Rationale and sources of your project idea
The rationale of the Digger game is pure enjoyment! Although we had to adapt our game from the original to suit time and hardware constraints, we held true to this principle. The source of this idea was the original Digger itself, by Windmill Software.
Background Math
Beyond simple arithmetic, no mathematics was required for this project.
Logical Structure
The hardware of the game consists of 3 Sega Genesis 6 button controllers, an Atmel Mega 32 MCU, and a television. The 3 controllers interface with the MCU via ports B (Digger controller) and C (two Nobbin controllers). The MCU sends its signal to the television via Port D.

Lastly, we implemented a galvanic skin response (GSR) sensor to go with the game, but finally did not to include it. More details on the hardware, including the GSR, are available in the hardware section.
The software of the game resides entirely in between frames, with the exception of the initialization code. The initialization code initializes various variables, including the game start splash screen. There are three main while loops in between frames, and only one of them runs at any time. The first loop is the Game Start loop. It constantly checks to see which mode the player has selected, sets the flag for either AI or multiplayer and draws the game map. The second loop is the In-Game loop. It runs in-game code and holds the bulk of the code. The last loop is the Game End loop. It draws the game end splash screen and keeps track of the best time so far. More details on the software are available in the software section.
Hardware/Software Trade-offs
Initially, we thought that we would have to choose between implementing the GSR and the AI, due to limited flash memory. However, we were able to reduce our code size substantially (more details in the code size optimization subsection of software).
Standards
Our code generated a non-interlaced, black-and-white TV signal based on the National Television System Committee (NTSC) standard. Therefore, our game can be played on any television that complies with this standard.
To the best of our knowledge, we relied on no other standards in this project.
 
For more detail: Digger video game


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top