[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introduction!



Hi,

On Monday 25 February 2002 17:24, katie@fysh.org wrote:
> To kick off a debate - anyone use Design Patterns in their games
> programming?

Patterns do automagically appear if projects grow, this is what I've 
experienced. For a small 2-3k game one doesn't think that much about the data 
structures, objects (if OOP at all), and related matters - only the UI and 
the main algorithms determine the code.
But beyond that, if it comes to extend a game and viewing it as a more 
flexible engine, one will hardly move one without at least some patterns.
On the other hand, games try to avoid patterns in some situations. Imagine the 
class of units in a game - instead of inheriting from such a class to create 
a unique set of creatures, it is more likely to try to use one single class 
(as long as it's possible, excluding maybe special units or heroes), and 
assigning attributes to them which are not compiled in.
(OK - I talk about free/open games where cheating the one way or the other 
couldn't be prevented anyway.)

Now what I've found to be an interesting challenge with regards to the 
mentioned windows-influenced gamedev scene is the following:
http://www.gotdotnet.com/terrarium/whatis/

I asked myself how that would be possible on the Linux as it is now, or will 
be in a few months from now, without .NET (mono) and what its VM has to offer 
in regards of security/capabilities (see below).

To write the main framework for this game, any normal methods could be used, 
however I'd prefer a scripting language for 2 reasons:
a) speed is not an issue for this game
b) MS claims the game can auto-update itself. There is actually a weak point 
in their implementation, because the auto-update does only happen after a 
restart (yeah, we know they love restarts) of the game. A better alternative 
would be to have most of the game (including all the logic) inside a tree of 
objects which can be dumped and restored, so using Ruby for example would 
allow in-game updates if my theory isn't wrong here.
Maybe it's even possible to write a generic framework for this, but it seems 
that if this worked, it had to be written in the very same language as the 
game itself - so the word 'generic' is probably misplaced here.

The next point is the transmission of the creatures to the server. Note that 
they claim to be distributed, but rely on a master server, so a superior 
alternative should provide true peer-to-peer operations. I didn't fully 
understand the part with the client groups and the teleporter though.

The most complex issue (in my view) is to execute the scripts on the server 
while guaranteeing that they don't harm the environment and don't cheat. The 
former would have to be guaranteed by the script interpreter (both Python and 
Ruby have security levels), but for a true sandboxing on system level 
something like the Linux Capability system should be used (see 
/usr/include/linux/capability.h), personally I still dislike the fact that as 
a normal user you're not allowed to drop privileges whereas root can do that.

All the other points seem to be equal among Windows and Linux, but of course 
this is all theory, in practice one might encounter more oddities, like how 
to implement an alternative to what they praise "XML Web service" for various 
tasks.
And of course, forcing the authors name and email addresses into a creature C# 
class which becomes a "Carnivore" is something only MS would do...

Josef

-- 
The MindX Open Source Project: Fighting proprietary games
GGZ now! - The GGZ Gaming Zone: http://ggz.sourceforge.net
ggz.morat.net | ggz.snafu.de | jzaun.com | mindx.sourceforge.net/europeone