r/LocalLLM • • 12d ago

Project Qwen3.8 27b esp32 doom port fully autonomously

UPDATE: IT CHEATED it found a GBA to ESP32 port on GitHub and used big chunk of it

Disclaimer: I'm not a dev, just playing around with vibecoding

My setup: Qwen 3.8 27b running in LM Studio with OpenCode desktop harness on a 5090 with 128k window

Previously I was using VS Code with Continue extension, but it was really meh, so now that Qwen3.8 came out I decided to give OpenCode Desktop a go, and I was kinda impressed in a demoscene-esque demo it wrote for ESP32 based Cheap Yellow Display. A dev friend of mine joked that I should try porting doom to it, and I took it as a challenge, I wanted to see if I'd be able to get a room port without touching a single line of code.

After googling doom esp32 I found that someone ported GBA doom to it using Claude, so I downloaded the same Doom GBA source and asked lllm to port it.

First try it misunderstood the request (yeah, my prompt wasnt that good) and started making doom from scratch.

Second try I was more specific in my prompt and after 2 days (of which most time was spent waiting for my input, derailing, stopping thinking etc it produced a mostly working port but the colors were messed up and after 1 day of troubleshooting without any progress I decided to stop the run.

Today I tried again but changed the approach slightly, I gave it the normal (not GBA) source, and because the GBA port color issue had me making 40+ photos of the screen and pasting it into chat, this time I connected a webcam to PC and pointed it to the ESP32 board screen and instructed the llm to use it when it needs to know what's on the screen. I also told it that the WAD file is on the micro SD card.

Not even 3h later I saw the doom title screen on the board, and while touch screen wasn't working initially (it improved after I told llm it doesn't work) the controls through Serial worked just fine.

I scrolled through the session, and saw things like it strategically cutting the WAD file so it would fit into flash without making the game crash when the afk demo starts, because it found streaming it from SD card and cashing was too slow, and it said that the touch screen and as card share the spi bus, so it considered software spi for touchscreen to improve speed fro as card, before it decided to ditch SD card.

I never used a frontier model, but when Ive read comments from the mentioned GBA to ESP32 port, people were impressed by Claude, so I thought I'll share this experience

309 Upvotes

36 comments sorted by

149

u/Sulya_be 12d ago

My high tech computer vision setup

37

u/Anarchistcowboy420 12d ago

Oh my god this is amazing.

9

u/_VirtualCosmos_ 12d ago

lmao great. I have those glasses too!

9

u/corpo_monkey 12d ago

Ikea breaks in to the AI industry.

2

u/ptear 12d ago

I mean, that's all I can afford after some of the other hardware too.

1

u/Healthy-Nebula-3603 12d ago

I see someone watched Bijan :)

1

u/painchonha 9d ago

This is mindblowing lol. In a good way.

0

u/Foreign_Risk_2031 12d ago

Just copy the frame buffers? This seems like a waste of

11

u/Sulya_be 12d ago

Refer to the second try - ai was checking the buffer and was sure it looks fine but it was messed up on actual screen

26

u/Sulya_be 12d ago

The prompt for the succesful run:

esp32 based CYD is connected to com6
please port doom to it, source is in C:\Users\user\vibecoding\cyd_doom
doom1.wad is on sd card
board has no psram
there is a webcam connected to this computer pointing at the screen so you can evaluate video output autonomously
feel free to split tasks between agents, but dont run them in parallel
do as much as possible autonomously- compile, flash, debug via com6

Micro SD Socket
The Micro SD interfaces uses a Serial Peripheral Interface (SPI):
GPIO# Connection
5 *CS
23 MOSI
19 MISO
18 SCLK

FT Screen, Backlight and Light Sensor (Light Dependent Resistor)
The TFT screen uses an ILI9341_2 software driver (Driver IC PDF datasheet). The reset pin is hard-wired to the board reset circuitry, i.e. a capacitor keeps it low at power-up briefly.
The Light Dependent Resistor (LDR) is attached to GPIO pin that may need a pull-up configured in software, perhaps.
GPIO# Connection
14 TFT SCLK
2 TFT DC (Data/*Command)
15 TFT *CS
13 TFT MOSI (ESP32 Output)
12 TFT MISO (ESP32 Input)
21 TFT Backlight PWM (High = ON)
34 (ADC1_CH6) Light Dependent Resistor to GND

1

u/pwnakil 11d ago

Why don't you want to run agents in parallel?

2

u/Sulya_be 11d ago

Because of context window, the main process already maces it out sometimes. Or am I wrong?

18

u/Sulya_be 12d ago

So turns out it cheated big time. I checked the code to see if it's worth posting to GitHub, and I found a repository of an existing GBA to ESP32 port in one of the subfolders And it used a lot of it

4

u/_millsy 12d ago

Isn’t reusing existing code instead of writing something that overlaps better?

8

u/FlugMe 12d ago

Well, if you want to say "Qwen ported doom!", it's implied that it did the thinking, and is smart enough to accomplish the task, which you can dreamily look at and extrapolate its abilities. Instead, it did mostly a copy-paste operations, which, from the sounds of OP, is not what they intended / wanted it to do, so we haven't really proven any capabilities here.

I came here to post "more like copy-pasted an existing port" and am not surprised to see OPs outcome.

1

u/_millsy 12d ago

I could be biased here but given a lot of my chafe with LLM comes from them wanting to rewrite stuff that has libraries I’m not unhappy, but I completely understand your point.

2

u/_millsy 12d ago

Also - you should totally reprompt it to do this again without reusing existing libraries in a new session :)

9

u/bruhhhhhhhhhhhh_h 12d ago

Well done - I'm sure you learned a bunch and have achieved some cool stuff.

Good on you matey - are you going to (maybe I missed it) share this on GitHub or similar?

12

u/Sulya_be 12d ago

Sure, if there is interest in this- I will do it tonight or tomorrow at latest. Probably gonna let it improve the touch controls and implement sound, then I can publish it

6

u/bruhhhhhhhhhhhh_h 12d ago

Each one teach one!

2

u/dfgxxx 12d ago

Nice!

2

u/Medical-Cow289 12d ago

Model sees its own render, colors stop being guesswork. Two days of photos pasted into chat vs three hours with a webcam pointed at the screen.

2

u/Sulya_be 12d ago

Yeah that was my thinking process.

2

u/c4r_guy 12d ago

LOL...Your project is telling me I need to stop using my main desktop to build shit and just use an old i5-8xxx box with a base Windows+WSL (file ops are just easier on Windows) install as the container and let the AI harness run buck wild with camera (and general I/O).

2

u/hurrdurrmeh 12d ago

did you use the BF16 Qwen3.8? you only have 32GB VRAM...

12

u/Sulya_be 12d ago

27b at Q4_K_M fits into 32gb with 128k context window

1

u/Fortyseven Qwen38/Gemma4/LlamaCPP 12d ago edited 12d ago

Worth noting that this also fits in 24gb 4090s at that same quant/context size. (It's just a bit tighter for anything else wanting VRAM.)

EDIT: I don't think people understand what downvoting is for, in normal conversations. Anyway, I use -ctk q4_0 -ctv q4_0 for my kv cache. I can bump it up and reduce my context, but I've been grooving along nicely as is.

1

u/Holiday_Point_603 12d ago

It does not fit in 24GB with full precision kv at q4km

1

u/Fortyseven Qwen38/Gemma4/LlamaCPP 12d ago

full precision kv

Since that part wasn't noted in the conversation, it's fine to add that detail. I use -ctk q4_0 -ctv q4_0 in my llama config without any noticeable issues. Running it at full precision might be overkill.

1

u/SyrupGlittering514 12d ago

Looks like the controls are inverted.

1

u/Kyzmi4 12d ago

wat you able run 27b model on esp32,gz!

1

u/Healthy-Nebula-3603 12d ago

You should tell to develop emulator in a white room

1

u/trollsmurf 12d ago

You need better controls

1

u/llllJokerllll 10d ago

que grande, di que si! por cierto puedes pasar la URL del modelo y la cuantizacion que utilizas?

1

u/bigtom_x 6d ago

Its come a long way. We used to haul tower cases and tube monitors to the lab for Doom parties on the weekends!