Live data from Hacker News

Video Chess disassembled and commented

nanochess.org

41–50 of 72 posts

Re: Video Chess disassembled and commented

#42
post #29

Many years back (so details are fuzzy), a friend who worked at Atari in the early 80's told that the programmer who did the game part of the work had the basic chess algorithm working in a few months, spent the next year getting it to run in less than 128 bytes of RAM, and was then burnt out and left tech. IIRC, the game devs used a PDP-11 for much of their work, so that had a bit more RAM to work with to get started…

The 128 bytes of RAM seems quite easy (game state is 32 bytes for chessboard + 1 byte for side-to-move+castling+en-passant plus 2/3 bytes per move in the search stack + 1 byte to record the depth at which castling was disrupted = 54/64 bytes with depth 10, leaving a luxurious 64/74 bytes for call stack and local variables).

The problem seems to be more the 4KB of ROM, but only if one is trying to make it actually somewhat good, and also perhaps using 1979 tech for programming.

Re: Video Chess disassembled and commented

#43
post #18

Earlier quoted context omitted.

That's perpetually true. "You're trying to do machine learning on a desktop PC?" "Hmmm, I wonder if we could use the GPU as a math engine?" But holy cow, that chess game really pushed the limits! (A side note I like to bring up occasionally: my first "computer" was "Atari BASIC" on my 2600. It had 63 bytes of RAM, I think. That didn't last long until my parents brought home a TS1000 with a luxurious 1KB of RAM.)

> But holy how, that chess game really pushed the limits! Having 4 kilobytes of ROM made it relatively easy, I think. If one ignores draws by repeated positions (which I think all small chess programs do), board state can easily be stored in 67 bytes or so (64 for the board proper plus four bits for whether various castlings are allowed, plus a byte indicating the square for en passant opportunity, plus a byte for co…

1K ZX chess actually used the screen data as the game state.

As a neat side effect, this means the user can see all the moves that the engine is considering.

Re: Video Chess disassembled and commented

#44
post #33

What's its ELO score? Edit: Really? Downvotes? Certainly it must have one. You could play someone on chess.com and find out?

This seems to have an estimate: https://chess.stackexchange.com/questions/24952/how-strong-i...

I was wondering the same thing. It is interesting to see the exact feature in past engines with limited resources that overcomes the threshold and moves an engine from the bottom to the higher ranks, and how historically what ideas were in place and which were culled that moved the engines in that direction.

Re: Video Chess disassembled and commented

#45
post #40

Earlier quoted context omitted.

By the way: right now I'm working on a chess training project(1), and I'm thinking that a marketing cofounder could really help. If anybody is interested, my contact info is in my profile. (1) https://chess.braimax.com

I tried it out, was enjoyable to play a few puzzles. My feedback is a) that the ring sound (when you win a puzzle) was too loud, so I ended up muting the tab, and b) that the logo looks like "BraiMax", and doesn't stylistically fit with the rest of the site theme.

Thank you for your feedback! By the way, you can disable sound from the little cog icon just above the chessboard.

Re: Video Chess disassembled and commented

#46

Earlier quoted context omitted.

Keep in mind is these kind of things have a flat memory space between RAM and ROM. It's not like today where disk is some thing way over there that you need to buffer in RAM. All of your code and resources are in ROM which means they're just an address away. Your RAM is scratch space for dynamic values but you can pull everything else from ROM. For instance your bitmaps for pieces/spaces are stored in ROM, the code c…

Keep in mind is these kind of things have a flat memory space between RAM and ROM This is true and is very central to how these miracles were pulled off. While you know this, for the benefit of those reading: you could also use ROM for time/space tradeoff purposes -- for example instead of doing a bunch of trig calculations in real time for character movement purposes you could just have lookup tables in ROM. the cod…

Addendum:

    Contemporary systems like the Neo-Geo did not have that 
    restriction and could render ROM data directly
...which was obviously advantageous for typical use cases! However, it came at a cost in flexibility. The NeoGeo could draw from ROM, but could not draw from video RAM.

Games on the Genesis and SNES could therefore use video RAM as sort of a makeshift kludgy framebuffer for polygonal games or for fancier raster effects. The Neo-Geo could do no such thing.

The Neo-Geo might have been able to given some custom hardware on the cartridge itself, with a cartridge-based CPU rendering data to RAM on the cart that was seamlessly mapped into the cartridge's address space. I have seen some wacky emulator projects that work this way, like DOOM on NES: https://hackaday.com/2019/06/06/doom-on-the-nes/

Re: Video Chess disassembled and commented

#47
post #5

I started developing software as a kid on a Commodore 64, and I thought we were pretty clever if we were able to accomplish interesting things using only 32KB of RAM. But the idea that somebody was able to develop a full chess engine using only 128 Bytes of RAM boggles my mind.

I wonder if it "looks ahead" anything at all, or if it's just evaluating the current turn's piece trade potential. If it does look ahead, I wonder how many bytes per turn of lookahead is needed.

Re: Video Chess disassembled and commented

#48
post #29

Many years back (so details are fuzzy), a friend who worked at Atari in the early 80's told that the programmer who did the game part of the work had the basic chess algorithm working in a few months, spent the next year getting it to run in less than 128 bytes of RAM, and was then burnt out and left tech. IIRC, the game devs used a PDP-11 for much of their work, so that had a bit more RAM to work with to get started…

I'd love to see a dev setup for using the PDP-11 and the Atari 2600 for doing gamedev. I did a quick search on youtube and the search engines and couldn't find anything.

Re: Video Chess disassembled and commented

#49
post #48
post #29

Many years back (so details are fuzzy), a friend who worked at Atari in the early 80's told that the programmer who did the game part of the work had the basic chess algorithm working in a few months, spent the next year getting it to run in less than 128 bytes of RAM, and was then burnt out and left tech. IIRC, the game devs used a PDP-11 for much of their work, so that had a bit more RAM to work with to get started…

I'd love to see a dev setup for using the PDP-11 and the Atari 2600 for doing gamedev. I did a quick search on youtube and the search engines and couldn't find anything.

I'd love to see a dev setup for using the PDP-11 and the Atari 2600 for doing gamedev. I did a quick search on youtube and the search engines and couldn't find anything.

The photographs I've seen aren't all that interesting.

A VT-52 terminal and a hand-built cart wired into an RS-232 port, all on a long desk.

Hopefully there are more exciting photographs out there that I haven't seen.

Re: Video Chess disassembled and commented

#50
post #48

Earlier quoted context omitted.

I'd love to see a dev setup for using the PDP-11 and the Atari 2600 for doing gamedev. I did a quick search on youtube and the search engines and couldn't find anything.

I'd love to see a dev setup for using the PDP-11 and the Atari 2600 for doing gamedev. I did a quick search on youtube and the search engines and couldn't find anything. The photographs I've seen aren't all that interesting. A VT-52 terminal and a hand-built cart wired into an RS-232 port, all on a long desk. Hopefully there are more exciting photographs out there that I haven't seen.

Have a look at the PDF document here: https://forums.atariage.com/topic/259003-intellivision-devel...

Also check out the links provided at the end of the document.

Besides the PDP-11, I'm glad to see the beloved PDP-10 was also used by game developers back in the days.

Post reply on HN