Developing Possessed was a ton of fun, havn't had that much fun coding anything in ages.
I have been thinking a lot about why I had a so much better time doing that than other things.
A lot of the fun came from having a really short way between idea and prototype. Both for the whole game and for the smaller parts. I think Flash is a good platform for quickly developing prototypes.
The big thing i lack in Flash is obviously 3D. Sure you can do PaperVision3d, but that is not really enough for my needs.
I have tried a couple of game engines (Unity3D and UDK for example) but none really feels right. Unity looks cool, but the free license lacks fundamental things like shadows, UDK feels like a beast.
Also, here at Zink we have an unhealthy will to do things ourselves.
So that's where we are at, planning to make our own game-engine, that allows for rapid (and FUN) game development in 3d.
We have put together a small code "sketch" of how our engine might function:GraphicsEngine (c++)
DirectX with c++. Takes care of everything graphics.
A managed c++ wrapper sits on top for easy use in c#
Very basic at the moment. The only thing exposed to c# is SetClearColor :)
GameEngine (c#)Instantiates GraphicsEngine and all other subsystems.
Contains a Component based gameobject/entity-system.
Read more about Component Based Game Design on CowboyProgramming.com
Scripting (IronPython)Most entities and components needs to be accessable through scripting.
Our current solution employs IronPython scripts that live inside our ScriptingComponents.
The scripting is where all future gamelogic will go.
Current stateWhile nothing is set in stone yet, I feel this combination is both simple, powerful and flexible.
C++ for the things that need to be fast. C# is a good choice for building tools later on. IronPython is stupidly simple to host on top of c#, and no need for strange template programming for exposing classes.
In the future I plan to be able to build pure-python-components.
We already have this crap up and running. A red and green brightly flashing screen through the power of Script
Code snippets:Booting IronPython 2.6:ScriptEngine scriptEngine = Python.CreateEngine(); // Creates the engine
scriptEngine.Runtime.LoadAssembly(Assembly.GetAssembly(typeof(AnyType))); // Loading extra assemblies
ScriptScope scope = Python.CreateEngine(); // Creates a scope
scope.SetVariable("name", anyObject); // Sets a variable in the scope
ScriptSource scriptSource = scriptEngine.CreateScriptSourceFromString(source); // Compiles source string
object result = scriptSource.Execute(scope); // Executes the python code in scope and puts it's output into result.
Our flashing testscript in python: (engine is set by the ScriptingComponent)
class Test:
def EveryFrame(self, sender, args): # Define the EveryFrame Callback Function
self.frame = self.frame + 1
if (self.frame == self.frameInterval): # Only update on every frameInterval frames (very high framerate)
if (self.r == 255): # Make things pulse
self.d = -1
if (self.r == 0):
self.d = 1
self.r = self.r + self.d # Update r
engine.GraphicsManager.SetClearColor(self.r, 255-self.r, 0) # SetClearColor
self.frame = 0
def __init__(self):
self.r = 0
self.d = 1
self.frameInterval = 2500
self.frame = 0
engine.TestEveryFrame += self.EveryFrame # Hook up EveryFrame() to the engine.TestEveryFrame
Test() # This creates an instance of the Test-class and returns it to c#
Maybe these will come in handy for someone!
Huggies!
/Hannes