Settings

Theme

Computerraria: A fully compliant RISC-V computer inside Terraria

github.com

289 points by inickt 3 years ago · 44 comments

Reader

misprit7 3 years ago

Hey I'm the one who made this, if anyone is interested in the specifics I'm happy to go into details!

Also as another comment indicates probably a better explanation of the project is the video I made about it: https://youtu.be/zXPiqk0-zDY

  • havercosine 3 years ago

    This is a super impressive achievement.

    - What would you say is your biggest learning from this experiment? - What were the Aha! moments you experienced while learning like this? For example, something you vaguely understood before but is now super clear to you.

    • misprit7 3 years ago

      I would say the RISC-V immediate encodings were like that, on first look they seemed completely random but as soon as I started implementing the decoder I realized they were geniusly crafted to make my life as easy as possible.

  • barelyauser 3 years ago

    How much time you spent on this project?

  • FloatArtifact 3 years ago

    With your future prospects, where do you see yourself in 5 years?

    • garciasn 3 years ago

      Writing advanced Excel macros to power PowerPoint presentations.

      Duh.

    • eklitzke 3 years ago

      With a bit of luck he could get an internship on an SRE team supporting ads data pipelines at Google.

    • nerpderp82 3 years ago

      Dual PhDs from Tom7 and James Mickens.

    • DrThunder 3 years ago

      Staring at a screen for 40+ hours a week realizing everything digital is essentially worthless. I'm sure he'll make good money though.

      • throwawaylinux 3 years ago

        > worthless

        > money

        There appears to be some fundamental misunderstanding here.

        • DrThunder 2 years ago

          Not really, unless you're a complete dunce. Money can be obtained in various ways that don't require soul sucking work of letting your life slip away in computer chair staring at screens. Anyone with a decently average emotional IQ knows this.

  • klyrs 3 years ago

    I love it! Impressive use of 4 metal layers!

inicktOP 3 years ago

A friend sent me the YouTube video, which is a fantastic watch: https://www.youtube.com/watch?v=zXPiqk0-zDY.

Minecraft computers have been done for a while now, but seeing a full RISC-V computer running programs is really impressive, and frankly just seems really cool. The programs are written in Rust, and then compiled to run in game. Plus, the author needed to write their own mod to make the Terraria wiring efficient enough to support the computer: https://github.com/misprit7/WireHead

  • ericbarrett 3 years ago

    I lost it when he dropped the containerized CI pipeline! Shows he was thinking about the whole process, not just the (literally) fiddly bits. Incredibly broad set of skills the author demonstrated.

  • fbdab103 3 years ago

    I cannot believe he did the wiring "by hand". Loved the bug example he highlighted, which I hope is something he can reference later in life, "What's the most difficult bug you ever fixed?"

    • jiggawatts 3 years ago

      Even with the "cross-eyed" trick to overlap the left and right sides, I could not spot the error. How in the world did he find it!?

smudgy 3 years ago

Holy shit! Game, optimizations, code, test suite and even a simple 3D render - not to mention a well edited video game with a great sense of humor, gags, memes and the obvious next step already in the works.

This guy is going places!!

vbezhenar 3 years ago

Play https://nandgame.com/ if you're interested in those kinds of things.

Xeamek 3 years ago

Now we need a terraria build for RISC, so we can play terraria in terraria

jcmontx 3 years ago

Tbh, the video was better explained than my college computer architecture lessons

thebeardisred 3 years ago

Fully compliant to RISC-V how? Is it conforming to a specific RVI profile? The project states "By emulating a complete rv32i instruction set inside the wiring system of Terraria, we push back speeds to the early 70s era, tossing the ball firmly back into the court of silicon engineer without losing any software functionality."

So this is building a RISC-V *microcontroller* but what version of the ISA? 2.2 from 2017? Is it sucessfully passing conformance tests (https://github.com/riscv-software-src/riscv-tests)? I don't want to dunk on the project, but the title is over-selling and not scoping the context of the work. I look forward to some more updates from @misprit7!

Note: I'm the working group lead for distro-integration within the RISC-V Software Ecosystem (RISE) group.

  • misprit7 3 years ago

    I'm the one who made this. It's rv32i, and yes the 2017 specs. It passes every rv32i test in the repository you sent, see the test/ folder for the riscof plugin I wrote. I also have CI in a docker to headlessly run Terraria and programmatically run all these tests whenever the world changes on the main branch.

    I'm not throwing around fully compliant lightly here!

  • vessenes 3 years ago

    If you watch the video or check the github repo, (and you really should watch the video, it's fantastic), you'll see he has a full conformance test run in-game as part of a custom built CI/CD pipeline. In Terraria. I really enjoyed writing that.

ehnto 3 years ago

It seems I have underestimated Terraria as a sandbox game.

classified 3 years ago

Roger me sidewise, this is wonderfully crazy. I foresee a bright future for the creator.

deskamess 3 years ago

Very impressive and in such a short time frame. So is the schema for this design only in the game? I assume if the game is saved it can be loaded on another computer? But can the schema/layout be emitted to a file so it can be parsed elsewhere?

nottorp 3 years ago

Hmm I wonder if they ever fixed Terraria for Mac OS. I bought it based on hype but it wasn't handling my laptop display right so I never found out what it's about.

  • Unbeliever69 3 years ago

    Haven't had any problem playing on Steam for Mac OS once you get your resolution settings correct.

    • nottorp 3 years ago

      Just tried and mouse's still confined to less than full screen at 1280x800.

      I think it was worse 5 years ago. Will try again in 5 years.

      • quenix 3 years ago

        I don't get this bug playing fullscreen at 1440p on M1 macOS... maybe play around with the settings a bit?

  • IG_Semmelweiss 3 years ago

    I am paraphrasing others here, but its supposed to be a 2D minecraft game

sacnoradhq 3 years ago

Cross-compile an emulator to RISC-V, then the false vacuum decays and cats and dogs live together.

kayson 3 years ago

Awesome to see something like this in Terraria instead of the usual minecraft!

birdyrooster 3 years ago

The pitch is fantastically well written, for what it’s worth.

lionkor 3 years ago

Next step: Self-hosted.

pkphilip 3 years ago

This is beyond impressive!!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection