This is a Pacman implementation using Postscript for 3D-Graphics, GForth for the gamelogic,
and FIFOs as communication channel between the gamelogic, the rendering engine, and an mplayer instance
to play music.
By Wolfgang (Blub\0) Bumiller
Peter Frühwirt
Martin Perner
The easiest way to describe the architecture is by viewing the play.sh file. Basically, the engine.eps file, and the ginput FIFO is cated into the GhostScript process. Therefore, the gforth code generates PS code which is written to the ginput FIFO and passed to GhostScript. At the same time it writes mplayer commands into the sfxInput FIFO to have mplayer produce sound.
This of course means that it works like a distributed system. You can for example run (cat engine.eps; cat ginput) |gs on one machine, while running groth pacman.fs on another machine, and use netcat to transfer the FIFO data from one machine to the other.
This kind of implementation also supports a funny way of recording demos. In the record.sh script
there's simply a tee demo.in command between the pipe and the GS process to also dump all the
commands into the file demo.in. So when you finished playing, you can review the demo in a very
simple way: cat demo.in | gs
Of course, its playback speed is always at maximum, and it gets faster the less work it is to render the
scene. So the more you eat, the faster it gets.
(This screenshot was created by simply typing: convert engine.eps screenshot.png ;) )
![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | architecture.png | 2010-01-15 21:19 | 38K | |
![]() | engine.eps | 2010-01-15 18:50 | 39K | |
![]() | initDataStructs.fs | 2010-01-15 16:06 | 1.2K | |
![]() | libc.fs | 2010-01-15 16:06 | 237 | |
![]() | movement.fs | 2010-01-15 16:06 | 3.3K | |
![]() | pacman.fs | 2010-01-15 16:06 | 4.4K | |
![]() | pipe.fs | 2010-01-15 16:06 | 2.1K | |
![]() | play.sh | 2010-01-15 16:06 | 357 | |
![]() | presentation1.pdf | 2010-01-15 21:16 | 1.4M | |
![]() | presentation2.pdf | 2010-01-15 21:16 | 1.4M | |
![]() | record.sh | 2010-01-15 16:06 | 351 | |
![]() | release-1.zip | 2010-01-15 18:48 | 14K | |
![]() | screenshot.png | 2010-01-15 18:50 | 28K | |
![]() | sounds/ | 2010-01-15 16:06 | - | |
![]() | world | 2010-01-15 16:06 | 199 | |