Mixing Worlds - Pacman

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

Architecture

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.

Graphic displaying the architecture

Recording Demos

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.

Screenshot

(This screenshot was created by simply typing: convert engine.eps screenshot.png ;) )
Screenshot

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -  
[IMG]architecture.png15-Jan-2010 21:19 38K 
[   ]engine.eps15-Jan-2010 18:50 39K 
[   ]initDataStructs.fs15-Jan-2010 16:06 1.2K 
[   ]libc.fs15-Jan-2010 16:06 237  
[   ]movement.fs15-Jan-2010 16:06 3.3K 
[   ]pacman.fs15-Jan-2010 16:06 4.4K 
[   ]pipe.fs15-Jan-2010 16:06 2.1K 
[TXT]play.sh15-Jan-2010 16:06 357  
[   ]presentation1.pdf15-Jan-2010 21:16 1.4M 
[   ]presentation2.pdf15-Jan-2010 21:16 1.4M 
[TXT]record.sh15-Jan-2010 16:06 351  
[   ]release-1.zip15-Jan-2010 18:48 14K 
[IMG]screenshot.png15-Jan-2010 18:50 28K 
[DIR]sounds/15-Jan-2010 16:06 -  
[   ]world15-Jan-2010 16:06 199  

Apache/2.2.22 (Debian) DAV/2 mod_fcgid/2.3.6 PHP/5.4.36-0+deb7u3 mod_python/3.3.1 Python/2.7.3 mod_ssl/2.2.22 OpenSSL/1.0.1e mod_perl/2.0.7 Perl/v5.14.2 Server at www.complang.tuwien.ac.at Port 80