Geo Raycast - a three-dimensional graphics demo Based on the program "Labyrint" by Stefan Becker, published in c't 2/96 Adapted for Geos by Marcus Groeber 1996 Fido: 2:2448/7826.1 - email: 100712.270@compuserve.com This is my first program for Geos designed specifically with the OmniGo in mind. I wrote it to get an estimate of how feasible a game with Doom-like "first person" graphics would be on an 8086-based PDA like the OGo. This may sound crazy at first, but it isn't that far fetched, keeping in mind that the loss in cpu horsepower is partly compensated for by the reduction in screen size and colors. [This doesn't mean that Raycast won't run on the desktop version of Ensemble as well, it is just meant as an excuse for the unusual restrictions placed on the display of the graphics.] Nevertheless, a redraw rate of under 1 frame per second as achieved by this program on an OmniGo is probably not acceptable for a fast-paced action game. :-) Anyway, you can still use this program for a little walking exercise in a maze of texture-mapped walls and to show that your brand-new OmniGo can be used for other things than for storing appointments and phone numbers. To install the program, just copy raycast.geo to the WORLD directory of your Geos set-up (if you're using an OmniGo, you will have to employ some kind of file-transfer software to do this, of course). Usage is fairly straightforward: the menu bar items "Left/Right/Go" probably speak for themselves, while the "?" menu contains an option to toggle between a "view" and a "map" mode and a "Look" command to cause a 360-degree turn consisting of 32 individual pictures. This full turn can be used to compare the speed of the program on different machines - when compiled in EC mode, the program adds a status bar to the bottom of the window showing the average time required to calculate and draw one frame (making the window to big to fit onto a regular OmniGo screen). It should be noted that the drawing speed decreases somewhat when the player is looking at a wall that is very close. The "raycasting engine" in render.goc is an adapted and streamlined version of the code published in an article on that subject in the German "c't" magazine (issue 2/96) - I have mainly replaced all the Macintosh-specific parts, written an ESP-optimized texture-mapping routine and converted the entire algorithm to Geos 16/16 "WWFixed" fixed-point arithmetics, which alone yielded a factor 35 (!) improvement over the original floating-point based code on my 386/40 (no additional fpu). Most of the comments in the code are still in German because I have taken them from the original version with little modifications. If you would like to know about a particular detail, just drop me a mail... --- Dies ist mein erstes Geos-Programm, das speziell im Hinblick auf den OmniGo entwickelt worden ist. Sein Hauptzweck war, einen Eindrukc davon zu bekomme, wie realistisch ein Spiel mit Doom-hnlicher "subjektiver Kamera" auf einem 8086-PDA ist. Das ist nicht ganz so verrckt wie es auf den ersten Anschein klingen mag, wenn man bedenkt, da die mangelnde CPU-Leistung zumindest teilweise durch den kleineren Bildschirm und die fehlende Farbigkeit ausgeglichen wird. [Das bedeutet aber nicht, da Raycast nicht auch auf dem Desktop luft - allerdings sollte sich auch niemand beschweren, da es dort nicht bunter ist...] Es scheint jedoch so, als ob eine Rate von weniger als einem Bild pro Sekunde fr ein packendes Action-Spiel etwas zu niedrig ist... immerhin kann man mit dem Programm aber schon durch ein Labyrint mit gemusterten Wnden traben und auerdem auch noch beweisen, da ein OmniGo doch zu mehr zu gebrauchen ist als ein ledergebundener Terminplaner. Um das Programm zu installieren, mu die Datei raycast.geo einfach ins WORLD-Verzeichnis von Geos kopiert werden. (Auf einem OmniGo mu man dazu natrlich irgendeine Art von Dateitransfer-Programm verwenden.) Die Verwendung der Menpunkte "Left/Right/Go" mu wohl nicht besonders erklrt werden. Das "?"-Men enthlt eine Umschaltmglichkeit zwischen Sicht- und Kartenmodus und einen Menpunkt "Look", der den Spieler einmal um die eigene Achse dreht, wodurch insgesamt 32 Einzelbilder erzeugt werden. Diese Drehung kann zum Geschwindigkeitsvergleich des Programms auf verschiedenen Rechnern verwendet werden - wird das Programm als EC-Version bersetzt, enthlt das Fenster zustzlich eine Statuszeile am unteren Rand, in der die mittlere Zeit fr das Berechnen und Zeichnen eines Bildes angegeben wird (dadurch wird das Fenster zu gro fr den OmniGo-Bildschirm). Zu beachten ist, da Wnde, die sehr nahe vor den "Augen" der Spielfigur liegen, zu einer Verlangsamung des Programms fhren knnen. Der eigentliche Raycasting-Code in render.goc ist eine angepate und berarbeitete Version des Programms, das in der Ausgabe c't 2/96 verffentlich worden ist - fr nhere Informationen zum Algorithmus sei auf dieses Heft verwiesen. Ich habe fr diese Version vor allem die Macintosh-spezifischen Teile ersetzt, die Skalierung des Wandmusters in ESP-Assembler realisiert und den Algorithmus auf Geos-typische 16/16 "WWFixed" Festkomma-Arithmetik umgestellt. Allein der letzte Punkt ist fr eine Geschwindigkeitssteigerung um den Faktor 35 (!) auf meinem 386/40 (ohne Coprozessor) verantwortlich.