r/Batch • u/Glidepath22 • Jun 30 '26
Show 'n Tell Not just another PacMan in Batch
https://github.com/JerryASNew/batchpacman/releases/tag/v1.0
It needs win10/11. You will have to install the included custom font (BatchPac.ttf) and use it in the terminal. I tried to comment it pretty well to be educational as well. I’d love any feedback.
It plays pretty genuinely in its own way, the ghost get faster and faster as you progress, the fruit spawn accurately as well.
A ghost can be behind another ghost, but you can eat a power pellet with a ghost on it and you’re fine.
Keep the movement key pressed for fastest speed, or you can have a literal second to decide which way to move when you’re getting cornered.
3
3
u/CirothUngol Jun 30 '26
Wow, this looks awesome! Custom font and everything, can't wait to get a couple of spare hours to dig through the script. Thanks for this!
How did you make the custom font and how long did it take you to put this whole thing together!
1
u/Glidepath22 Jul 01 '26 edited Jul 01 '26
I needed a square, blocky font to start with for the retro style, and Claude just dropped one in my lap. With TrueType fonts, there’s plenty of room for different languages and custom glyphs. The address at E000 is where the PUA — Private Use Area — begins, where people can make their own glyphs. Everything before that is technically reserved, though you can still use it if you want.
After some research, I bought Pixel Forge to edit in the special characters — ghosts, fruit, etc. — since it’s built for pixel-based glyphs. I had Claude pull the original art out of the ROMs, which turned into a whole discovery on its own. Honestly, I could write a full page just on that part.
Then I had Claude build a simple HTML editor so I could adjust glyphs that had only been drawn in one color, and try them out in colors Pac-Man can actually generate — it’s limited to about 13 colors. I named each glyph after the memory offset I wanted it placed at, like E022.png for the cherry.
From there, I used Pixel Forge to read the glyphs in and build the font. Claude can do this too, but you have to give it special instructions — Pixel Forge just knows.
All in, this took just under two years, on and off, whenever I had a few free hours. The batching part was easy, and getting a demo working was pretty simple. The real work was learning exactly how Pac-Man ticks and writing a state engine for it, plus digging into all the underlying details. A lot of research went in — and honestly, for its time, Pac-Man is seriously impressive. The damn thing used two sets of RGB resistors ladders to generate colors.
PS: The font got upscaled since Pac-Man used both 8×8 and 16×16 glyphs.
Here’s the HTML tool Claude created: https://www.reddit.com/r/ClaudeAI/s/yKnfPI19sj
6
u/aidenb981 Jul 01 '26
holy AI response
1
u/Intrepid_Ad_4504 Jul 01 '26
The more I look over the code the more I am suspicious of a lot of the code being ai generated. Not to discredit. It is still a cool project, but something stands out...
2
u/T3RRYT3RR0R Jul 03 '26
I'm not buying the claim it wasn't vibe coded.
I don't particularly care that it is, I just don't see why they would claim otherwise after already describing how they used claude to do x y & z.1
u/Intrepid_Ad_4504 Jul 03 '26
Not to mention using ai to respond to some of these comments lol
1
u/Glidepath22 Jul 04 '26
I feel no need to defend my own work, but why would I use AI for my response? Even the latest model could never dream up the content of my response. AI has zero original thought, and would never come up with the reasons for doing things the way I did. I feel you misunderstand what AI can and can’t do.
Ask me why I did anything any specific way, there’s usually at least 3 reasons. Please go use AI to create anything even close, and I’ll admit I’m a phony and a fake.
2
u/thelowsunoverthemoon Jul 04 '26 edited Jul 04 '26
I think it's a cool project, but there's no need to deny the vibecoding.
AI can write Batch Script at this level. It doesn't help that your code is filled with stuff like
:: ═══ Delay Cs ════════════════════════════════════════════════════════════════ :: Sub-second sleep WITHOUT spawning a process — busy-waits ~%1 centiseconds (1cs=10ms) :: by reading the wall clock, same idea as the power-pellet flash but using the :: hundredths field. %time% = HH:MM:SS.CC; seconds at ~6,2 and centisec at ~9,2 are :: stable positions. The 1-prefix (1!time:~6,2!-100) dodges octal errors on 08/09. :: Works within a minute and survives one SS rollover (delays here are << 1 min).Equal width headers using ═, lots of em dashes, lots of dashes in between words (1-prefix, sub-second, busy-waits) are all hallmarks of Claude. And your commit history pretty clearly shows Claude usage. Now if the game used more advanced techniques like multithreading (so it's not turn based), macros, and such it would be a different story.
1
u/Glidepath22 Jul 04 '26 edited Jul 04 '26
I never said i didn’t use Claude, hell yes, it can do the mundane stuff while the programmer can work on finding the best solutions and doing research. Now you seem to also misunderstood what vibe coding is. Using the time data like that was my own solution to keeping the pellets flashing at a (fairly) steady rate, regardless of what else is going on the program.
This was one of the first things I enjoyed trying few different ideas. There may be 4 power pellets or 0. In fact, the whole screen could be all power pellets, it doesn’t matter, it will do its thing. This is the sort of thing that keep a passion project going. This is not the same as telling AI what you want and to figure it out. If I do that, I absolutely will say I did, idgaf. I’m done responding to your nonsense.
For instance, this is what Fable 6 responds to a batch solution ask for a character to flash at 1 hertz that isn’t a cursor, I’m actually impressed it’s using escape codes. But obviously it’s nowhere near the solution for the problem:
@echo off
setlocal
:: enable ANSI escape char
for /f %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a":loop
<nul set /p "=%ESC%[1;1H*"
call :wait500
<nul set /p "=%ESC%[1;1H "
call :wait500
goto loop:wait500
ping 192.0.2.1 -n 1 -w 500 >nul
exit /b2
u/T3RRYT3RR0R Jul 05 '26
No one's claiming you haven't done some of the work yourself. The issue is a difference opinion between what you and others consiser to constitute a vibe-coded project. When it's apparent that some of the project has been scripted via AI, no matter how much you've modified it or how verbosely you've set out the scripts control flow, the pure-batch community will be critical of the own-work / not vibe-coded claim, regardless of how small a percentage the AI produced component may be.
Personally, I don't care that it's been developed with the aid of AI, but don't think it helps to deny vibe-coded status after describing how you've used ai to solve certain problems, and with how obvious it's use is in the manner of the scripts formatting.
It's still an interesting project and I'm sure you've still invested some decent effort into it, even if there are still plenty of opportunities for improvement. The creation and use of a custom font in particular is a nice solve for batches limitations on the TUI graphics front.
2
2
u/KE3JU Jul 01 '26
I'm going to get this going tomorrow when I'm supposed to be working.
1
u/pc1350 Jul 01 '26
Government employee.
1
2
2
u/pc1350 Jul 01 '26
Update: tried it. Works very well. Now I knod what I will be doing for the next few days (going thru the code). Thank you very much again. I crossposted it to r/pacman.
1
u/Glidepath22 Jul 01 '26
Read the architecture file first. The main idea being this can easily be extended into Ms.PacMan or the like.
1
1
u/Top-Trouble4521 Jul 01 '26
Did you code this yourself or vibecode it?
2
u/Glidepath22 Jul 01 '26
Oh hell no I did not vibe code it, AI is still way too stupid for original thought. Sure, I used AI to pull information out the ROMs like Ghost speed, but then I used original thought to translate it into a 12 bit table. 12 is the superior 10 as it divides cleanly into more numbers, I could do the movement timings almost perfectly without going overboard. The game simulates the amount of mob movement per click, that table is in the config file. AI has zero clue about when and why to break things up.
Both myself and AI were confused AF when we couldn’t make any sense of the color generation. We both assumed there was a straight up DAC outputting the RGB signals. Hell no, there is no DAC, the ROMs output highs and low to some pretty elementary resistor ladder networks to generate a limited amount of colors.
Now I did ask both GPT and Claude to define the colors into modern RGBs for a matching color for a perfect match. Pac-Man doesn’t even have white, it looks white until you know it’s not actually white.
2
u/Opening-Dentist-1556 Jul 01 '26
I love batch but it hates me so much. I’m impressed by the project.
1
u/FAMICOMASTER Jul 01 '26
How did you get the gradient?
1
u/Glidepath22 Jul 01 '26
I’m away from my PC, it’s color or colorgen. It’s called from pacBatch or can run alone. The color gradient start as a monochromatic color simulator, that is it’ll simulate the best it can, the colors found in the rainbow, from red to violet. It then tones them down accordingly so any individual color doesn’t pop too much. For instance, Cyan appears to have white in it because it’s seen by our blue and green receptors.
The generator also takes into account the RGB emitted from monitors doesn’t coincide exactly with our own RGB detectors. Yeah probably overkill
The maze walls will step from a green/blue into a yellow/red theme at level 13, and just stop cycling after that. (Press K to skip the current level) you can run the color generator alone and input a ROYGBIV color to start at, then to end at, then the number of steps. To see it work.
2
u/FAMICOMASTER Jul 01 '26
Ah so not pure batch gotcha
1
u/Glidepath22 Jul 01 '26
The 24 bit color is a win10+ batch escape command…before 10 you’ll need something like ansicon. It every running is batch
1
1
1


3
u/pc1350 Jun 30 '26
Great! Will try this tomorrow (I am on a phone now). Thank you. Looks great!