News for hackers. Stuff that matters.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by Jach on Wednesday December 05, 2012 @03:51PM (#4878498)
Not quite--this is more a recreation of the Flash Portal clone. i.e. it's all 2D graphics and 2D physics.

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...

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by zephjc on Thursday December 06, 2012 @02:57AM (#4880787)
Technically, that's a raycasting engine (a la Doom and Wolf3D). The first implementation that I know of that was made into a game was Daedalus for the TI-85, back in 1997 http://www.ticalc.org/archives/files/fileinfo/11/1147.html
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by lloeki on Thursday December 06, 2012 @06:22AM (#4881324)
You ain't done nothing till you coded a 3d engine on a HP48 GX: 131x64 pixels and a 4-bit Saturn CPU. The timing tricks to extort four shades of gray from the monochrome screen were awesome.

http://en.wikipedia.org/wiki/Saturn_(microprocessor)

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by Tractor4973 on Monday December 10, 2012 @09:12PM (#4902728)
This reminds me of this game for HP48. It had some pretty graphics for the time, using 4-grey colors with LCD timing tricks.

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....

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by tertet on Wednesday December 05, 2012 @04:42PM (#4878759)
It would not be that hard to write a 3D physics engine for a TI-89 calculator (Assuming you already know how to write a 3D physics engine, which I do). Problem is, it would be useless since it will probably take tens of seconds (if not more) to calculate each frame.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by jlgreco on Wednesday December 05, 2012 @04:59PM (#4878831)
I would not be so sure. It really all depends on how much physics you want your "physics engine" to have. Rag-dolls? Not likely. Quake 1? Sure, you could do physics to that extent on an 89. The 89's are more powerful than you may suspect, unlike the 84 (seen in the article), they have Motorola 68k's.

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.)

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by gipsies on Wednesday December 05, 2012 @06:02PM (#4879144)
I remember playing a lot with my old TI-83. One of the most impressive games was DOOM: http://www.ticalc.org/archives/files/fileinfo/238/23843.html Best video I can find: https://www.youtube.com/watch?v=TuupoxmeQ6U

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

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by jlgreco on Wednesday December 05, 2012 @06:36PM (#4879287)
Ah yeah, good stuff. I was always partial to Gemini and Wolf on the 83+ (http://www.ticalc.org/archives/files/fileinfo/247/24742.html, http://www.ticalc.org/archives/files/fileinfo/277/27767.html). Wolf even had an on-calculator level editor!
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by ANTSANTS on Thursday December 06, 2012 @11:55AM (#4882479)
Gemini blew the socks off of all my middle school friends, but I'm embarrassed by the amount of time I spent on Galaxian in math class. Maybe one of these days, I'll dig out my 83+ and complete the no laser, no death run that I was always aiming for, just for old time's sake.

In hindsight, I wish I had spent that time learning Z80 instead...

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by andrewmunsell on Wednesday December 05, 2012 @09:45PM (#4880004)
I always find it funny that someone actually ported Fruit Ninja. http://tiwizard.com/downloads/fruit-ninja/

The controls are pretty clever too.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by tertet on Wednesday December 05, 2012 @05:28PM (#4878978)
>>http://benryves.com/images/nostromo/bsp/2010.11.28/Walkthrou....

Not bad but it is not a 3D Physics engine. Just a renderer. Not the same thing. Still pretty impressive.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by jlgreco on Wednesday December 05, 2012 @05:39PM (#4879026)
Certainly, I didn't mean to imply it is, just use it as a benchmark against which you can get an idea about what the 84 is actually capable of (the Portal thing isn't really a great demonstration of that).

(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...

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by Jach on Wednesday December 05, 2012 @06:47PM (#4879338)
That's the thing, though. I'd be awestruck to see a Portal 3D physics-like thing on the 89 and be playable, because I'd have no idea how the person pulled it off and as I said above it'd be mindblowing. If you're familiar with physics engines, perhaps you're familiar with how the GBA works at the hardware level and how a game for it is typically made? Super Monkey Ball Jr. is an example of a game that blew me away and I'm still not really sure how they pulled it off.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by geori on Wednesday December 05, 2012 @07:54PM (#4879613)
The memory limitations are a bitch. It isn't that difficult to build your engine in that amount of space, but storing any decent graphics or level maps are nigh impossible. I had to quit working on a Zelda clone and JRPG because of memory issues. To this day, I've only seen one long game actually worth a crap and that's Joltima - http://www.ticalc.org/archives/files/fileinfo/34/3456.html Karneges had to use every trick in the book (huffman compression on 4 bit tilemaps) to fit it into 32K of RAM.

Still, it's impressive to do anything like Portal on the calculator. Glad that someone picked it up, even if the headlines are sensational.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by loeg on Wednesday December 05, 2012 @10:50PM (#4880183)
You can absolutely page in data from Flash memory as needed, it's just non-trivial (and not handled by the "OS"). On devices with flash memory as an extension of RAM (TI 83+, 89, and 89 titanium), this could help for read-only level data that isn't needed all of the time.

Edit: Of course, Joltima targets the TI-83 (different from the 83+), which doesn't have any flash memory. Bravo, Justin Karneges.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by jlgreco on Thursday December 06, 2012 @01:10AM (#4880510)
You can also go the "App" route and make the whole thing an application that runs straight from flash.

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...

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by geori on Thursday December 06, 2012 @10:32AM (#4882107)
Paging really, really sucks to manage on a TI calculator.

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"

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by fatjokes on Wednesday December 05, 2012 @07:57PM (#4879622)
> While programming for graphing calculators admittedly doesn’t give Marcolina’s work a wide reach

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.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by Evbn on Thursday December 06, 2012 @02:48AM (#4880775)
How is the TI-83 still a thing? iPod is superior in every way: CPU display size and color, flexibility, cost (well, if they produced a last-gen version for the down market, it would be)
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by bcoates on Thursday December 06, 2012 @05:34AM (#4881213)
Battery life. Durability.

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.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by Scaevolus on Thursday December 06, 2012 @03:00AM (#4880792)
You can't lock down an iPod or wipe its memory before a test.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by ionforce on Wednesday December 05, 2012 @05:33PM (#4879002)
That is an excessively sensationalist headline. Portal, physics and graphics-wise, does way more than that graphing calculator.

To imply that they are equivalent is shameful and ignorant.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by vacri on Wednesday December 05, 2012 @06:19PM (#4879221)
I don't see any claims of recreating Portal's graphics. I think yours is an excessively sensationalist criticism.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by peterhajas on Wednesday December 05, 2012 @06:24PM (#4879241)
Claiming to recreate the physics engine implies that somebody remade the Source engine on a calculator. This is a massive exaggeration.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by vacri on Wednesday December 05, 2012 @11:37PM (#4880305)
The title says 'in 25kb on a graphing calculator'. The only way it's "amazing" is if you know what a graphing calculator is, and if you know that, then it's pretty obvious that the title is a mild form of poetic license rather than a sensationalist attempt to mislead. And really, when people think of "Portal physics", for the most part they think of 'a hole between two non-adjacent surfaces you can travel through', not 'a realistic 3D world where objects behave according to newtonian physics', because the latter is a dime a dozen.

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?

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by Evbn on Thursday December 06, 2012 @02:44AM (#4880766)
The technically fascinating aspect of implementing narbuncular/portal physics is the optics of looking into a portal, not the trivial translation/rotation of passing through a portal in a platformer sideview.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by vacri on Wednesday December 05, 2012 @06:56PM (#4879388)
You don't think that ionforce is over-egging the criticism pudding by throwing in inferred claims about graphics, too?

I find it ironic that such a tactic should be used in a criticism that strongly applies the 'shameful' label.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by ionforce on Wednesday December 05, 2012 @07:36PM (#4879548)
You're right that it is ironic. It's ironic the same way bigots say that liberals are being intolerant of their beliefs.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by ionforce on Wednesday December 05, 2012 @07:34PM (#4879538)
You're right in a way. Portal could be thought of as two parts, the raw physics and the raw graphics. But when a lay person makes claims of recreating Portal's secret sauce, they're really implying the portal mechanism which is one part physical and one part graphical.

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).

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by oellegaard on Wednesday December 05, 2012 @04:58PM (#4878828)
Awesome! Too bad I gave my TI84 to some girl, after leaving college :(
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by meaty on Thursday December 06, 2012 @03:10AM (#4880817)
I have doom on my TI Nspire CAS :) Unfortunately the crappy screen is no good for playing it.

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.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by TommyDANGerous on Wednesday December 05, 2012 @10:21PM (#4880108)
Watching that demo on the calculator makes me want to play Portal.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by NanoWar on Wednesday December 05, 2012 @07:35PM (#4879546)
Wow that is so awesome. It's running on 6Mhz after all!
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by hnruss on Thursday December 06, 2012 @03:22AM (#4880855)
TI-83+ was my only hand-held programming system. In high school, I wrote Blackjack, Trapshoot, and a Whac-a-mole clone on it, along with a few originals. I hope that touchdevelop takes off-- it might be the only reason I'd get a tablet.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by stickdick on Wednesday December 05, 2012 @04:12PM (#4878617)
Not quite...
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by rheide on Wednesday December 05, 2012 @07:53PM (#4879606)
It's an awesome achievement, worthy of geek praise. But even if I'm being very generous I wouldn't call this a physics engine.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by NanoWar on Thursday December 06, 2012 @04:44PM (#4883978)
There is however another approach by the same guy. Called Zedd Physics Library: http://www.ticalc.org/archives/files/fileinfo/441/44185.html
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by jiggy2011 on Wednesday December 05, 2012 @03:54PM (#4878516)
This looks more like a standard 2d platformer.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by senorcastro on Wednesday December 05, 2012 @04:38PM (#4878737)
The graphics are terrible.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by jlgreco on Wednesday December 05, 2012 @04:50PM (#4878788)
It's a 96x64 B/W screen.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by JackWebbHeller on Wednesday December 05, 2012 @06:02PM (#4879147)
I think that's the joke...
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by jlgreco on Wednesday December 05, 2012 @06:31PM (#4879272)
Ah. People here are being rather negative so I took it as a sincere criticism.
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by Evbn on Thursday December 06, 2012 @02:56AM (#4880786)
More like Portal: Flash Version 2D

http://portal.wecreatestuff.com/

Weird that this portal-dedicated person and Are Technica hadn't heard of Portal 2D.

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by yozmsn on Wednesday December 05, 2012 @11:55PM (#4880350)
Oh how I wish I still had a usb-TI83 cable, still have the calculator just not the cord to plug it into my computer...
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by ygra on Thursday December 06, 2012 @04:58AM (#4881116)
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by andrewcooke on Thursday December 06, 2012 @07:02AM (#4881417)
ok, i have to ask - how do you get smiley-face amazon urls?

[update: huh, so it can be arbitrary text. what's it for?]

Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by ygra on Thursday December 06, 2012 @08:40AM (#4881641)
I didn't want the original (very long) URL which included the product name at that place (the technical term might be SEO-friendly URLs). So I first replaced it by an underscore to keep it short and then tried whether I can put something nicer in there. This wasn't generated by Amazon ☺
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by yozmsn on Thursday December 06, 2012 @07:05AM (#4881428)
☺
Re:Portal’s physics engine rebuilt in 25KB—on a graphing cal... by yozmsn on Thursday December 06, 2012 @07:03AM (#4881424)
Yes, only I'm not spending $20 to play portal on a calculator...