A journey of 33 steps detailing thoughts, methods and tools used to recreate this classic game
Overview
Traffic Department 2192 is a top-down action shooter notable for colorful characters led by anti-heroine Marta Velasquez. The story unfolds over 59 missions as Vel and the Traffic Department team stop the Vultures from dominating the planet.
TD2192 is a game that I’ve played through quite a few times since it’s its initial release back in 1993. It remains a rare example of how excellent writing can carry a game. While the gameplay is dated, the characters and their story are timeless.
Project
This project started as a personal question of just how fast the programming portion of commercial title from the early 90s could be done using 21st century tools. The answer: fast! Combining reverse engineering with commercial game engines reduces the effort to a matter of days for one man. Naturally, we side-step the time-consuming and costly part: asset development.
Although the game itself and programming effort is unremarkable by today's standards, I decided to make this education for beginning developers. There's a lack of tutorials for projects of several thousand code lines that involve using many tools to bring together the final result. My goal is to document the effort and make the journey as instructional as possible. Happy learning!
Playable prototype in HTML5 -- (Play)
- Represents our work as up part 33 of the video series
- Framework complete, but content limited.
- Mission 1 is fully scripted — Remaining missions default to “destroy all ships”
- Briefing sequences complete through mission 5. No dialogue sequences afterwards.
GitHub repository -- (View)
- Includes the prototype source code in GameMaker
- Has the C and Python utilities we build to analyze and extract assets
- Also hosts the HTML5 build, but use the above link to play
Video series
Each video has a 15-30 second introduction. Here is a 13 minute preview video of all the introductions put together.
For all the project parts linked below, click on the title to go to the project page or click on the thumbnail to go to directly to the YouTube video.
Part 1: Project Introduction
Part 2: First Playthrough
Part 3: Assets Overview
Part 4: Assets – Converting SCR Files to Bitmaps
Part 5: Assets – Converting Faces to Bitmaps
Part 6: Assets – Converting BLK Files to Bitmaps
Part 7: Assets – Converting PIC Files to Bitmaps
PIC files take more work since they’re all different. Disassembler to the rescue!
|
|
Video runtime: 24:09 |
Part 8: Assets – Converting SHP/HEL/EXP Files to Bitmaps
We’ve learned all we need to know to pull out these assets. Let’s put together all we’ve figured out and knock these out quick!
|
|
Video runtime: 1:09 |
Part 9: Assets – Converting Menu Elements to Bitmaps
The menu graphics are packed in to a texture sheet-like archive. We see signs that it uses color cycling to simulate animation.
|
|
Video runtime: 7:54 |
Part 10: Assets – Converting Fonts to Bitmaps
Font assets are simple sprite fonts, not vector curves. We can use the same strategy for extraction that we used on the regular graphics assets
|
|
Video runtime: 7:05 |
Part 11: Assets – Analyzing Map Files
The Map files don’t conform to any standard except that of common sense. We’ll make use of that to understand how the MAP files work for our prototype.
|
|
Video runtime: 5:13 |
Part 12: Assets – Analyzing Dialogue Files
Dialogue files also have a custom encoding and have a more complex interaction with the game that we’ve seen so far
|
|
Video runtime: 8:24 |
Part 13: Assets – Analyzing Mission Files
Part 14: Assets – Sound and Music
Part 15: Prototyping with GameMaker Studio
Part 16: Prototyping – Top Level Design & Programming
Part 17: Prototyping – Introduction Design
Part 18: Prototyping – Introduction Programming
Part 19: Prototyping – Main Menu Design
Part 20: Prototyping – Main Menu Programming
Part 21: Prototyping – Mission Briefing Design
Part 22: Prototyping – Mission Briefing Programming
Part 23: Prototyping – Mission Gameplay Design
Part 24: Prototyping – Gameplay Map Programming
Part 25: Prototyping – Programming Ship Actions & Collisions
Part 26: Prototyping – Loading NPC Ships
Part 27: Prototyping – Programming the HUD
Part 28: Prototyping – Programming AI
Part 29: Prototyping – Finalizing Default Mission
Part 30: Prototyping – Mission Scripting
Part 31: Prototyping – Debriefing Design & Programming
The joke is on us – we already designed the mission debriefing back in part 22. Now we just need to add a little more code to close the loop.
|
|
Video runtime: 12:30 |
Part 32: Prototyping – Enhancements
Part 33: Prototyping – Loose Ends & Final Thoughts
Other Links
- gekk.info project - Another project to extract TD2192 mission scripts using Python. Uses some of my work and adds thoughtful notes about tackling reverse engineering projects.
FAQ
Why did you pick Traffic Department when you could have picked [some other game]?
A perfect storm of coincidence. Traffic Department is one of the games from younger days that I tend to pick up every few years. After a good round from early July 2016, I found this blog by a guy named Earok who aborted an otherwise impressive attempt to remake it. I wondered about how much effort it would take to make a working prototype. A few weeks later, I had an answer. So the real answer is that I didn’t choose the project, the Internet made me do it.
How long did it really take?
The playable prototype took between 30 and 40 hours across two weeks in late July/early August of 2016. Probably two of the days were off. The work flow of the video series follows my actual effort almost perfectly. My best detailed guess is:
- Day 1: Asset Sprites
- Day 2: Asset Maps
- Day 3: General time-wasting on disassembly
- Day 4: Sound & Music including several false starts
- Day 5: OFF
- Day 6: Introduction
- Day 7: Main Menu
- Day 8: Briefing (and 95% of debriefing)
- Day 9: OFF
- Day 10: Mission gameplay
- Day 11: Mission AI
- Day 12: Mission scripting
- Day 13 & 14: HUD and general tweaking
I then did some general work with a custom engine implementing the prototype. I don't intend on finishing that unless there's a larger community interest. Putting together this website and videos took me far longer than actually making the game. I started recording the creation of a second prototype three weeks after finishing the first. Almost no logical refactoring happened between the prototypes (mostly variable name changes and code consistency for clarity's sake). I posted about 2 videos per week between September and November, 2016. The code is very much in a 'first-pass' state.
Is this really a beginner programming project?
Absolutely. Throwing a modern game engine at a 25 year-old game is like pushing in a thumb tack with a sledgehammer. Casual knowledge of data structures is about the only thing you should need to know. Knocking out a project like this in a reasonable amount of time depends on tool-specific experience and your ability to pull an appropriate solution out of a hat. The largest hurdle blocking new programmers is sitting down and focusing on the work itself. Many of the more specialized points I demonstrate, like disassembly and asset exploration with Python, are optional.
Why didn’t you use [insert game development paradigm] in this project?
I probably didn’t think about it. If I did think about it, then I concluded that I didn’t need it. I didn’t prioritize code reuse at all since I don’t foresee extending or even revisiting the project once it’s complete. Maintainability is an afterthought.
Hey! The prototype isn’t finished! Why don’t you add the other missions?
That’s right, the framework is complete, but the content isn’t all there. I estimate the effort to make the prototype a full beatable game from part 33 of the videos would take another 10 to 15 hours of concentrated effort in scripting the individual missions just like I demonstrated with mission one. Getting the remaining dialogue sequences in there would probably only take about 2 hours. I’m debating if I want to simply brute force it or dedicate another part to extracting the goals directly from the original binaries. In any case, getting the full content in is the final step. Since there isn't much learning to be had by repeating the last video, I leave it to the folks that find this project. I don't actually expect this version to replace the original in any way.