my C++ console 3D fps Game on Windows from scratch

Started by
11 comments, last by Khatharr 7 years, 11 months ago

Now translate it into ANSI escape sequences and provide it on a port you can telnet to.

3D ASCII rendering at a stunning 5 frames per second...

The future is here. Time to put on my V-stripe jumpsuit.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.
Advertisement

Now translate it into ANSI escape sequences and provide it on a port you can telnet to.


So, the worst case to represent a single cell would be 15 bytes:

"\x1B[7;31;41;1m\xE2\x96\x93" 

2  "\x1B["             // Opening escape sequence
1  "7"                 // Reverse video
3  ";31"               // Red foreground
3  ";41"               // Red background
2  ";1"                // Bold foreground (to bright red)
1  "m"                 // Closing escape sequence
3  "\xE2\x96\x93"      // UTF-8 sequence for 75% fill (?)
And for a terminal with 60 rows and 80 columns, and assuming 15 bytes per cell, that would be 72.0 KB/frame (not including cursor positioning), and 2.16 MB/s for a modest 30 fps. We would need to analyze a few sample “images” of course, because state can be shared across neighboring cells.

In any case, it’d give my 2400-baud modem a run for its money, that’s for sure. Definitely worth it for full-frame animated GIFs for terminals!

Obligatory blinkenlights link:

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

This topic is closed to new replies.

Advertisement