I Made a 32-bit Computer Inside Terraria
TLDRIn an innovative journey, a person dedicates 600 hours over five months to create a fully functional computer inside the sandbox adventure game Terraria. Using the game's wiring system, they simulate the inner workings of a computer, overcoming challenges with logic gates and circuitry to build a prototype and eventually a complete computer capable of running programs like Pong, Conway's Game of Life, and even rendering a 3D world. To tackle performance issues, a custom mod called WireHead is developed, drastically improving execution speed. The project, compared to monumental achievements like Gutenberg's press or the Eiffel Tower, showcases a blend of creativity, technical skill, and perseverance, pushing the boundaries of what can be achieved within a video game environment.
Takeaways
- π The creator views the project as their greatest achievement, comparable to historical feats like Gutenberg's press or the Eiffel Tower.
- π¬ Using Terraria's wiring system, the creator simulated the inner workings of a computer within the game, transcending its intended sandbox adventure gameplay.
- βοΈ The project utilized a unique type of logic gate within Terraria, sidestepping traditional gates due to their complexity and timing issues.
- π» The in-game computer operates on simple logic gates arranged in complex configurations, emulating the basic building blocks of real-world computers.
- π§ Prototyping revealed limitations and learning opportunities, particularly around the custom and limited instruction set used.
- β‘ The full-scale computer required extensive work and innovation, including overcoming significant performance limitations.
- π¨βπ» By re-implementing Terraria's wiring system with a custom mod, the creator drastically improved performance, achieving 5000 instructions per second.
- π± The project expanded to include an over-engineered software toolchain, supporting development in "Computerraria" with programmatic control over Terraria.
- β‘οΈ Demonstrations of Pong, Conway's Game of Life, and 3D rendering showcase the computer's capabilities and the potential for complex program execution within Terraria.
- π The project is open source, inviting further exploration and development from the community, with future aspirations like running a simplified version of Terraria within itself.
Q & A
What is the main achievement described in the video?
-The main achievement described is creating a fully functional computer inside the video game Terraria, capable of running programs like Pong, Conway's Game of Life, and even simple 3D rendering.
How long did it take to build the computer inside Terraria?
-According to the script, building the full computer took around three months of active development.
What is the purpose of the 'WireHead' mod created by the developer?
-The 'WireHead' mod overrides and replaces the entire wiring system in Terraria with a custom version, significantly improving performance and enabling the computer to run at around 5000 instructions per second.
What is the significance of the logic gates used in building the computer?
-The logic gates, which take in inputs and emit outputs based on simple logic, are the basic building blocks used to create the computer's various components, such as the arithmetic logic unit (ALU) and control unit.
What real-world instruction set was implemented in the computer?
-The developer implemented the official RISC-V instruction set in the computer, enabling more advanced functionality compared to the custom, limited instruction set used in the initial prototype.
What challenges were faced during the development process?
-Some challenges mentioned include debugging complex wiring issues, overcoming performance limitations due to lag caused by the game engine's inefficient handling of large wiring projects, and optimizing programs like Conway's Game of Life to run reasonably fast.
What additional tools and infrastructure were developed to support the computer?
-The developer created an extensive software toolchain, including programmatic control of the Terraria world, a high-level Rust application driver, support for running official RISC-V instruction set compliance tests in-game, and continuous integration with automated regression testing.
What programs or applications were successfully run on the computer?
-The script mentions running Pong with real-time user input, Conway's Game of Life (although at a slow speed), and a simple 3D rendering program capable of displaying a 3D world from a specific coordinate.
What are the developer's future plans for the project?
-The developer mentions wanting to create a simple version of Terraria running inside the game Terraria as the next milestone for the project.
How can others get involved or learn more about the project?
-The script states that everything done so far is open-source and available on public GitHub repositories linked in the description. Interested individuals with software experience can check out the repositories and potentially contribute programs using the provided Rust interface.
Outlines
π₯οΈ Introducing the Extraordinary Terraria Computer
The author details their remarkable achievement of creating a fully functional computer within the sandbox game Terraria. They provide background on Terraria and its wiring system, which they used to simulate the inner workings of a real computer using logic gates. The author describes the initial prototype they built, demonstrating basic operations like calculating Fibonacci numbers, and explains the fundamental components of a computer, such as the CPU, memory, and instruction set. The prototype, while limited, served as a proof of concept for the larger project.
βοΈ Building the Full-Scale Terraria Computer
This paragraph delves into the process of constructing the full-scale computer within Terraria. The author discusses the challenges faced, including extensive manual work due to limited copy-paste functionality, as well as the need to adhere to a real-world instruction set. After three months of active development and learning about digital logic and CPU design, the author successfully built a complete computer from scratch within the game. The sheer scale of the final computer is highlighted, and the author shares the debugging struggles, emphasizing the complexity of the project.
π Optimizing and Running Programs on the Terraria Computer
The author addresses the issue of lag caused by Terraria's game engine not being optimized for massive wiring projects. To overcome this, they developed a mod called WireHead, which overrides and accelerates the game's wiring system, enabling the computer to run at much faster speeds. The author showcases various programs running on the computer, including Pong with real-time user input, Conway's Game of Life, and even a 3D rendering program. Future goals, such as running a simple version of Terraria within the game itself, are discussed. The author encourages others to explore the open-source project and contribute programs using the provided Rust interface.
π΅ Closing Remarks
The final paragraph serves as a closing remark, with the author thanking the viewers for watching and encouraging them to like, subscribe, comment, and explore the project's GitHub repositories. The author expresses willingness to create a detailed technical video if there is audience interest.
Mindmap
Keywords
π‘Terraria
π‘Wiring System
π‘Logic Gates
π‘CPU (Central Processing Unit)
π‘ALU (Arithmetic Logic Unit)
π‘Registers
π‘Pong Clone
π‘Instruction Set
π‘WireHead Mod
π‘Optimization
Highlights
As Gutenberg with his press or Eiffel with his Tower, the author has brought forth their genius upon the world by creating a Pong clone running inside the game Terraria.
Terraria is a sandbox adventure game where you explore the world and fight bosses to progress, often compared to a 2D Minecraft clone.
The author simulated the inner workings of a regular computer inside Terraria using the game's wiring system, which allows triggering tiles like doors or traps.
The basic building block of computers, logic gates, take inputs and emit outputs based on simple logic, enabling complex computations through combinations.
The author exclusively used a specific type of logic gate in Terraria, where the output emits a signal if the input triggers and the state is on.
The entirety of the in-game CPU uses only these logic gates in various convoluted configurations.
After tinkering with the logic gates, the author spent two weeks building a functional but simple prototype computer in Terraria.
The prototype demonstrated the high-level functionality of computers, executing instructions from memory, performing arithmetic, and using registers.
Building the full-scale computer took around three months of active development, during which the author learned a lot about digital logic and CPU design.
The final computer has 100 kilobytes of memory and runs much faster than the prototype, thanks to the author's custom WireHead mod that overrides and accelerates Terraria's wiring system.
The computer runs programs like Pong, Conway's Game of Life, and even a 3D rendering engine, albeit slowly due to computational limitations.
The author plans to run a simple version of Terraria inside the in-game computer as the next milestone.
The project, including the WireHead mod, Rust interface, and continuous integration setup, is open-source and available on public GitHub repositories.
The author invites others to check out the project and contribute programs using the Rust interface.
The author expresses gratitude for watching and requests likes, subscriptions, comments, and GitHub stars for support.
Transcripts
5.0 / 5 (0 votes)
Thanks for rating: