Game Programming in Squeak
ted at eiles.com
Tue Oct 30 18:14:14 UTC 2001
An example of a high-level game language is UnrealScript used in Unreal
Tournament. http://unreal.epicgames.com/UnrealScript.htm .
This interpreted language looks like Java/C++. The byte-code based
interpreter has garbage collection and has special features used for
real-time 3d games.
The "inner loops" are written in C++, the majority of the game logic is in
UnrealScript (x20 lower than C++), and the 3D rendering is in C++, C, and
assembler. Most of the physics processing is in C++.
In UnrealScript each actor get a chance to performance some logic for each
frame. The key to performance is to have a high frame rate each actor needs
to finish it's processing quickly (e.g. 100 actors, 0.25 msec/actor = 25msec
of script processing per frame would be 40 frames/second at best. Then add
per frame processing for 3D rendering and audio, the frame rate will go down
according to complexity of the processingdown). Even TCP/IP connections are
actors and must perform their connection setup, data transfer, and teardown
in a piecemeal fashion on subsequent ticks, so that per-frame processing is
kept to a minimum.
I've been investigating on integrating squeak into the Unreal Game Engine.
To integrate Squeak I need to be a better Squeaker and get some help on
making Squeak re-entrant.
From: squeak-dev-admin at lists.squeakfoundation.org
[mailto:squeak-dev-admin at lists.squeakfoundation.org]On Behalf Of Peter
Sent: Tuesday, October 30, 2001 11:39 AM
To: 'squeak-dev at lists.squeakfoundation.org'
Subject: RE: Game Programming in Squeak
> From: Jon Hylands [mailto:jon at huv.com]
> Yes, I've thought about that perspective. I'm a big advocate of
> writing games in Smalltalk, but in my opinion you can't write a "state
> of the art" (which is what I really meant instead of "modern") first
> person shooter in Squeak. I have my doubts you could do it in any of
> the currently available Smalltalks.
> The problem is that the target is constantly moving. Yes, you could
> probably do Doom or maybe even Quake using Smalltalk MT on todays
> hardware, but that is hardly state of the art...
I'm not a "modern" 3D games programmer, but know plenty of folks who are.
Although some of the inner loops are still hand-optimised, 99.9% of the code
is written in some (moderately) appropriate high-level language these days.
If you gave Squeak the appropriate 3D plug-in, which would probably have to
be hand-optimised, I think you could have a pretty good go at something that
was perhaps a year behind the art (i.e. needed a CPU about twice as fast as
the equivalent hand-crafted equivalent). However, portability would likely
be a *big* problem as you'd almost certainly have tied yourself to one
architecture in the process.
If you're using a software blt to to any of this, however, forget it!
More information about the Squeak-dev