Portal’s physics engine rebuilt in 25KB—on a graphing calculator
arstechnica.com
arstechnica.com
I got my hopes up for a moment, preparing to be awestruck. Since I have a TI-89, that's what I think of when I hear "graphing calculator". My TI-89 can do 3D stuff (for instance this fun maze generator game http://www.ticalc.org/pub/89/asm/games/amaz89.zip), it would blow my mind to have anything close to a Portal 3D engine on it.
It's still awesome but not as mindblowing as the title suggests...
Here is an idea of what you can do with a 84's Zilog z80 (warning: long animated gif): http://benryves.com/images/nostromo/bsp/2010.11.28/Walkthrou...
(corresponding blog entry: http://benryves.com/journal/3739423)
You can get a lot more out of an M68k. (Actually, to be fair, the M68k calculators' larger screen size works against them, but if you are willing to sacrifice graphics you can easily surpass that demo.)
Not bad but it is not a 3D Physics engine. Just a renderer. Not the same thing. Still pretty impressive.
(It is not in fact even a 3d engine, but rather a vector BSP 2.5D one that is technically similar to Doom. To the extent with Doom has physics (pretty much only momentum (seen prominently in how explosion knock back effects entities) and gravity, so not really) that demo kind of has physics. Actually I don't think he actually does momentum, and his gravity is primitive. He's pushing the calculator pretty hard, I'm not sure how much more you could add, but the 89 can do much better.)
Basically I think you could get something close to this on an 89 (with dramatically worse graphics/graphical abilities): https://github.com/id-Software/Quake/blob/master/QW/client/p...
Unfortunately I never had a TI-89. Would've been awesome if I had one back in the day, and then test these games: http://www.ticalc.org/archives/files/fileinfo/405/40593.html and http://www.ticalc.org/archives/files/fileinfo/323/32318.html
In hindsight, I wish I had spent that time learning Z80 instead...
The controls are pretty clever too.
Unfortunately, it also meant the game was heavy (40KB!). And even more unfortunately, some HP48 emulators (most importantly the Android ones) do not support 4-grey graphics, making the game unusable... :(
Note : could find some screenshots here : http://www.hpcalc.org/hp48/games/adventure/sshots/phantasie.... http://i45.servimg.com/u/f45/12/35/12/06/bourg_10.png http://i45.servimg.com/u/f45/12/35/12/06/shop10.png http://img21.xooimage.com/files/5/9/8/hp48sx-city-150-5320fd... http://img24.xooimage.com/files/1/c/a/hp49-50-73x160-40469d....
Still, it's impressive to do anything like Portal on the calculator. Glad that someone picked it up, even if the headlines are sensational.
Edit: Of course, Joltima targets the TI-83 (different from the 83+), which doesn't have any flash memory. Bravo, Justin Karneges.
Advantages are you can use many flash pages so your application can be massive, and your program will be easier to launch/distribute. We have the App signing keys so these days this route is pretty simple.
On the other hand you have to "allocate" ram to write to or scrounge for ram in predetermined areas in the address space. With regular assembly programs you can have "static" allocations that you can write to. Also programs don't take up a minimum of a single page, so they are generally preferred by people who are more comfortable with their calculator.
Damn, now I really want to revisit that z80 scheme implementation I was working on a few years ago...
That being said, I loved working with the 32KB limit and optimizing every single byte out of my code. You got to learn all of the tricks like "XOR A" = 1 byte vs "LD A,0" = 2 bytes. However, some things sucked, like having to frequently write new sprite routines or tilemap scroller routines. I even ended up writing a logo style scripting language to handle animations in a RPG just to save a few KB.
Yes, this is clearly the 3% case for Knuth's quote, "... 97% of the time: premature optimization is the root of all evil"
Are they joking? Those TI 83's will be used by high school students in the US/Canada as long as TI has this chokehold on schools. They've outlasted god-knows how many versions of Mac's, PC's, Nintendos, Xboxes, PS's.
Also, don't underestimate the value of a UI and hardware keyboard centered around a specific workflow. Calculators are almost the opposite of a tablet/phone, computers specialized to programming and user input, with communication and content consumption as an afterthought at most.
To imply that they are equivalent is shameful and ignorant.
I find it ironic that such a tactic should be used in a criticism that strongly applies the 'shameful' label.
Honestly, how many people who know what a graphic calculator was would seriously think that they "remade the Source engine", misled by the 'sensationalist' title?
Literally recreating only the physics portion of Portal would be silly.
And yes I was intentionally trying to be sensationalist back because it's a waste of time being victim to submitter's sensationalist headlines, especially on a technical site such as as this (one would hope).
I've seen all sorts of hacks like this over the years but to be honest, I've fallen in love with the HP50g for hackability. The thing is awesome.
Not sure if its just me but I seem to accumulate calculators.
http://portal.wecreatestuff.com/
Weird that this portal-dedicated person and Are Technica hadn't heard of Portal 2D.
[update: huh, so it can be arbitrary text. what's it for?]