Hi List,
I have been working on a rendering engine for a 1st person maze game,
like the kind that powered the old Wolfenstein 3D, and I thought I'd
share my experience.
In the BitBlt Renderer image, I've done all the rendering by hand, in
Squeak. It's being rendered in Standard Definition PAL. In standard it
was hard to see where to go, so I changed it to widescreen, but that
cost a couple frames per second. There are rough edges on the texture
coming from cosine for fisheye correction, as well as a curve.
I ran out of wall time to do anything else with the renderer... it ran
at 4 frames per second after scaling by the UI scale... and to make it
not look like it runs like molasses I didn't tween walking and turning.
And then I tried to texture the floor and ceiling and my wall time went
from 4 frames per second to 4 seconds per frame because I had to paint a
pixel at a time. I'm sure it could have been done faster with WarpBlt,
but I had only been able to optimize drawing trapezoids for 0, 90, 180,
and 270 degrees and didn't want to lose turning animations.
In the GPU Renderer image, I've offloaded rendering onto the graphics
card. It was certainly an adventure, because when I started I knew
absolutely nothing about hardware rendering except it involves telling
the GPU how to paint triangles. While I am upset that it is rendering
at a high resolution instead of the chunky, 1990s look I was hoping for,
I'll take the gained performance over it.
Actually, it runs so fast I can both convert the entire stage to a mesh
and upload it every frame and still have wall time left over to do
movement animations at 12 frames per second. I'm going to optimize
stage loading next using the raycaster, but it performs well enough to
use for debugging and as a demo for people at home.
So, yes, you can make a 3D game in Squeak. If it runs on my 10 year old
laptop where only the onboard graphics card works, I'd say it can be
done. Which is great, because I've really been excited about learning
Smalltalk and using it to make graphical programs, and what better than
writing a game?