Friday, December 15, 2006
Two days ago I attended I attended a cocktail function in order to hear a 'major announcement' from Interzone Games and the Western Australian Department of Industry & Resources (DOIR). The "Honorable Francis Logan MLA, Minister for Energy, Science and Innovation" was also coming along. Like the other attendees, I expected Interzone to announce they were setting up a studio in Perth, with assistance from the DOIR...
...but the Minister didn't even turn up! Hmmph. No explanation was given, other than "I'm sorry, we can't make the announcement we expected to" from Interzone CEO Robert J. Spencer. Weird.
This afternoon, I received a message in my inbox asking me to sign this online petition. It seems like someone inside DOIR changed their mind about the deal they were offering Interzone, which is really strange, as I believe that DOIR hosted and organized (read: financed) the function.
At least that explains the warm beer. :-).
Wednesday, December 13, 2006
It is a fast paced multiplayer strategy game, with very simple game mechanics which you can pick up in less than a minute. It's simplicity and enormous potential for complex strategy make it a very compelling game. I've been absorbed with it for too many hours over the last 2 days.
Nice work Phil.
Tuesday, December 05, 2006
GO3 is the sister event of the Tokyo Game Show. Apparently, _MTV Japan_ are covering GO3 and Nullabor. And did I mention Richard Garriott is coming?* Wow. My entry had better be good, the whole world is watching. And maybe even Richard Garriott. :-)
I've heard and read a lot of good things about a game development environment called Unity 3D. I'm seriously considering using it, but that means a costly dev license and a new mac. Perhaps I could find a local corporate sponsor... hmmm.
The alternative is either to grow my own engine again, or try an Open Source engine. Unfortunately, because so much brain time is involved in learning a new engine API, I really need to pick the right engine first... and I don't have much time, Nullabor is 4 months away.
* This is an unconfirmed rumour. There are however, many other famous names attending.
Tuesday, November 07, 2006
So, I've decided to take the plunge and work on a contract basis, leaving at least 1-2 work days available for other opportunities. I've already started networking, and have met several interesting characters who might be interested in working with me on game related projects. I have about 3 weeks left in my current permanent role, and after that will be seeking short term contract work to fill the gaps. I'm a bit nervous about the risks I'm taking, but I believe that no progress can occur without some measure of risk.
Monday, October 23, 2006
I caught up with some like-minded individuals, and some game producers who are looking to start up a dev shop in Perth or Melbourne. The interesting thing is... they are looking for Python programmers!
In fact, Python dominated a lot of the conversation. People are really waking up to the productivity gains a high level language like Python can provide. I've been asked to provide a demonstration of 2 or 3 games I've worked on (tommorow, at a local University), and the technology behind them. Should be fun!
Thursday, October 19, 2006
- It has no shadows.
- It has a slow culling algorithm.
- There is no animation support for 3D models.
I'm going to focus on a new idea I've had, which will let me create morphable, bouncy sprites. The inspiration comes from Gish, and the wobbly windows I've been throwing around the screen in Compiz/XGL.
If I map a texture onto a grid, instead of a single quad, I will be able to morph the texture by morphing the vertexes of the grid. Simple huh? I could morph the grid vertexes by interpolation between key frames, or by algorithm (think of a sine wave ripple effect).
I could even tie the vertexes together using verlet integration and a constraint solver, which would let me create bouncy, rubbery sprites which can morph in response to collisions. This requires getting my head around some new (to me) mathematics, which will take some time.
Monday, October 16, 2006
Everything worked as expected, except for the lighting tests. I suspect that my lighting code is at fault, as I've had intermittent problems with the lighting code on ATI cards. I ran the tests under Xgl which may have effected things which I don't know about...
Wednesday, October 04, 2006
I've been experimenting with the OpenGL shadow extension. It can produce very nice shadows, and it is quite easy to implement.
I want to make it usable from QGL, which presents a problem. Speed.
I have to make multiple passes through my scenegraph to render a depth map from the POV of each light in the scene. Each extra pass QGL makes over the scenegraph is going to consume frames per second.
I've previously written a render visitor in Pyrex, which only provided a minimal speed increase. I think this is because the double dispatch pattern I'm using requires a couple of python function calls for each node that is rendered.
It seems that the only way to get around this is to move the entire scenegraph data structure into a C extension, providing an API to allocate and modify C structures from my Python code. This effectively means ditching the current QGL and writing a C render engine, which is not something I intended to do.
Sunday, September 24, 2006
Current best practice revolves around using the stencil buffer and projecting a flattened model onto surrounding geometry, creating the illusion of a shadow. The technique often referred to as a shadow volume algorithm.
A different algorithm, with different tradeoffs, is the shadow mapping algorithm. There is even hardware support available for implementing this technique.
I'd like to implement shadow mapping in QGL, as it is likely to be much faster than a shadow volume technique. To do this, I need to get a hold of the ARB_shadow extension, which PyOpenGL doesn't (yet?) provide. I'll probably have to use ctypes, and talk to the libGL dll directly.
Thursday, September 21, 2006
* A ParticleEmitter lead node.
* All leaf nodes moved into qgl.scene.state namespace.
The particle emitter leaf node generates a bunch of particles within an arc and with a velocity range. You then call the .tick method of the ParticleEmitter, which animates the particles. It uses numpy, so it's reasonably fast. It could use a few more features, but I'll need to use it for a while to find out what they might be. :-)
Wednesday, September 20, 2006
I think it's time I stopped thinking about threads, and started thinking about concurrency.
One idea I'm considering is the use of a Linda style system which is designed to provide a tuple-space on a local machine only. For performance reasons, access to the tuple-space would need to be implemented via some kind of shared memory facility.
The tuple-space approach could be ideal for game development processes. For example, the main process could push scene information into the tuple-space, where it is read by a second process which performs culling operations on the scene, and pushes the viewable set of scene nodes back into the tuple space. Meanwhile, the main process could be running the physics simulation, processing sound etc. This approach would require writing a separate program which works cooperatively and concurrently with the main program. No forking, and no threading.
Friday, September 15, 2006
Something like this:
CORE_COUNT = 2 #This is how many CPUs or cores we have to play with.
def xmap(fn, seq):
Run a function over a sequence, and return the results.
The workload is split over multiple threads.
def __init__(self, fn, seq):
Thread.__init__(self, target=self.map, args=(fn,seq))
def map(self, fn, seq):
self.results = map(fn, seq)
newseq = 
n = len(seq) / CORE_COUNT
r = len(seq) % CORE_COUNT
b,e = 0, n + min(1, r)
for i in xrange(CORE_COUNT):
r = max(0, r-1)
b,e = e, e + n + min(1, r)
results = 
for thread in [Mapper(fn,s) for s in newseq]:
This function takes care of starting, joining and collecting results from threads. It lets the programmer map a function over a sequence, and have the work done in parallel. Of course, this won't work in CPython, but it might prove useful in PyPy, or IronPython. Parallel processing in this style would be very useful for applications that work with large data sets, ie Games!
A game could be written to take advantage of the xmap function whenever possible. It would only make sense to use it when iterating over large data sets or using long running functions.
Wednesday, September 13, 2006
The second core on my new notebook will not be available for my Python games. Python used to be my secret weapon, when it came to game development.
I don't want to get left behind in the coming multi-core revolution. Maybe it's time to move on.
Monday, September 11, 2006
I've just uploaded QGL-8 to the python cheeseshop. This version contains the new shader funtionality, plus a very useful Static Node, which compiles all it's children into a single display list. The attached screenshot shows the new Material leaf class being used in a neat particle demo (contributed).
Wednesday, September 06, 2006
Perhaps next time.
Wednesday, August 30, 2006
This is exciting stuff.
In the mid 90's, Ken Silverman wrote a bleeding edge 2.5D ray casting engine which was used to create Duke Nukem 3D. This was however, quickly eclipsed by Carmack's Quake engine, which was based on triangle rasterization. Ten years on, not a whole lot has changed. Things just got faster, and hotter, and bigger. Loking forward however, there is some exciting new graphics tech coming our way. With a quad core multi GHz CPU, real time ray tracing might soon become a reality.
This raises everyone's favorite Python whipping boy, the GIL, in another context.
The GIL prevents Python from scaling (using threads) across multiple processors. Hopefully someone will solve this problem soon. I want to use multiple threads on my multi-core chip in Python, but, at the moment, I cannot. Sure, I can fork a process and do something clever with that, but on Win32, this is rarely worth the effort, and generally not very useful for game programming. As more users get multi-core chips, Python won't scale as naturally as other threaded languages.
Will anyone step up and take on this challenge? I hope so.
Friday, August 25, 2006
I've spent the afternoon building a spacecraft fly-by demo for Entity Crisis. I've found that it is actually very hard to create a nice visual. Just because something is 3D doesn't magically make it a great looking scene. A lot of work has to go into getting the lighting right, and the material properties. The majority of effort goes into texturing. A boring model comes alive with the right texture. Fortunately I know a few good texture artists. :-)
I've also realized that a scenegraph needs nodes which can do things like enable and disable depth testing, blending etc. Not everything can be abstracted away into high level classes, the programmer often needs access to lower level functions.
The code and data is available in svn/qgl/trunk/demos/ec_intro.
Wednesday, August 23, 2006
I've just uploaded QGL 7B to the cheeseshop. This version fixes some critical issues with texturing Mesh leaf objects. Attached are two screenies of a textured space station with and without lighting.
The new shader functionality won't be available until after pyweek.
What better way to start than introducing the third return of our small band of game developers in the latest PyWeek competition. It's back! For those who aren't familiar with it we urge to check out the competition, view some previous years entries, and perhaps if you're feeling ballsy - enter yourself!
This will be our third effort after some pretty decent success in previous attempts. More news on the competition soon.
Game onward sir!
Monday, August 21, 2006
Thanks to some enlightenment from Alex Holkner (GLSLExample on the pygame cookbook), QGL now has shader support that actually works. The attached screen shot shows a Toon Shader in action.
A QGL shader has an update method, which passes named arguments to the shader program. Currently, the only supported data type for update operations is the humble float. Vector and matrix data types are coming soon.
Thursday, August 17, 2006
Every now and then, my lighting tests only show the ambient light value (usually (0.2,0.2,0.2,1.0) and ignore the diffuse and specular light parameters. The effect of this is that the entire scene is very dark, with no light effects at all. So, how do I fix this?
By tapping something on the keyboard.
Or clicking in the window.
This usually fixes the problem, until I click or tap again. I can do this a few times before the scene stays lit, or stays dark. I'm blaming the Linux video drivers, as this problem does not happen in windows.
My next notebook will use Nvidia.
Tuesday, August 15, 2006
I'm thinking of adding shader type leaves to QGL. Not everyone has shader capable hardware, so the leaves need to be optional, which means they can't exist in the qgl.scene namespace, they will need to be explicitly imported by the programmer.
If shaders are optional, then the render visitor shouldn't need to know about the OpenGL shader implementation. This presents a problem. How do I enable custom leaf execution in the Render and other visitor classes? In it's current state, it is not obvious, as the Render visitor uses a big if/elif block to dispatch leaf drawing operations.
So, you've created a car prefab using WheelCollider components, and now you can apply a motorTorque to make the whole thing move along. ...
Note, the GetHashCode() method will probably return a unique ID. There is a very remote chance you will get a clashing ID. Update: After...
This hard-to-see screenshot is a Generic Node Graph Editing framework I'm building. I'm hoping it can be used for any kind of node...
When you start working with threads in your Unity3D project, you will discover that many things need to be done in the main loop. For exampl...
I have built a Synthesizer for creating sound effects in Unity. It fills a similar niche to SFXR/BFXR, but aims to have more quality and ver...
I've just seen and used a brilliant ssh option. The command: sudo ssh -D localport user@externalhost will set up a local SOCKS proxy l...
Thank to Adrian Boeing I was inspired this morning to hack together a ripple shader for Unity3D. Thanks for the math Adrian. You can see t...
Available on GitHub: https://github.com/simonwittber/fizzle
Possibly slightly more correct lighting. The rim light is now only applied in the direction of the sun, rather than being purely based on v...
import csv open("output.tsv", "w").write("\n".join("\t".join(e.strip() for e in i) for i in csv.rea...