Aug 312010
Balance
by Hannes Rahm
balanceScreenShot

Hey, no time to waste, we already missed the deadline!

This is our entry for the August edition of the Experimental Gameplay Project.
The theme was No Buttons.
It's called Balance and it's a physics-puzzle-game controlled entirely with mouse movement.

Balance is a Flash game using Box2D for physics.

The idea is to push the blue block to the green block to get to the next stage.

playBalance
Hope you like it!
/Hannes and Alfred
archived as: game,flash,flash game,experimental gameplay project,prototype
 
Jul 302010
Undercurrent
by Hannes Rahm
Oh, it's that time of the month again. Experimental gameplay time!
For June and July the theme was Addiction.
Our entry is called Undercurrent and it's part fl0w, part geometrywars and part roleplaying game.
Guide your microorganism downwards, kill, level up, avoid spikes, repeat.
When you level up you get points to spend on enhancing your creature. More spikes, Longer Spikes, More health.

We found that one of the most addictive things in games are competing for highscores, so we built in 5 different ways to compete: Score, Most kills, Largest Kill, Deepest Death and Fastest down to 300.

It can get a bit laggy at times, and I'm sure there are a few bugs. But hope you enjoy it anyway!

playundercurrent

Indiehugs!
/Hannes & Alfred
archived as: game,flash,experimental gameplay project,undercurrent
 
Jun 222010
Zink - Illusions
by Hannes Rahm
Yay! Our first Wild/Animation-compo entry is released!
It's called Illusions and ended up 2nd at Dreamhack Summer 2010. Not bad for a first try!

Please watch in Fullscreen 720p. The effects looks a lot better that way.

Oh, and congratz to Raddox, who won, as usual :)



Art Direction and Filming:

Hanes (me) + Louie

Music:
Hanes

Huggies
/Hannes and Louie
archived as: demoscene,Animation,Klegg,Wild,Illusions,Cream in water
 
May 242010
Lightspeed
by Hannes Rahm
Lightspeed

We are back with another Experimental Gameplay Project-entry.
The theme for May was "High Velocity" and our game is called Lightspeed.

Fly through hoops to gain points and speed. You get 20 seconds.
Black and white hoops accelerate you and gives you points. The faster you go, the more points you get.
If you fly through a blue hoop you get an extra second.

You build combo points by flying through several black or white rings in succession. If you have combo points you can Boost for additional speed.

When the time runs out you enter your name, and your score is posted to our online leaderboards.

We couldn't fit learning OpenAL into our schedule so the game is painfully silent. Maybe if you ask us nicely we'll crank something out ;)

Controls:
Steer with mouse.
Boost with left-mouse-button.
If the game is running slowly, use C to turn off clouds or reduce your desktop resolution.

Prerequisites:
Windows: .net Framework 2.0.
OSX and Linux: Download and install the latest version of mono from: http://www.mono-project.com/.

DownloadLightspeed-button

To run on Windows: Lightspeed.exe, Linux: Lightspeed-Linux.sh, OSX: Lightspeed-OSX.command. (Or just run mono Lightspeed.exe in a console)

Tech
I (Hannes) recently bought a macbook, and since I don't really want to run windows on it we decided to try some cross-platform development. We settled on C# + OpenTK. Through the seemingly miraculous power of Mono the same binaries seems to work on both Windows, OSX and Linux.

I code in MonoDevelop on the mac and Alfred code using Visual C# Express. MonoDevelop can use the vs-solution files natively so no problems there really. We have our own subversion server to help with the collaboration.

This is a very simple game, but I am very impressed with Mono and OpenTK!

There have been only a few problems with the cross-platform setup.
1) Loading transparent png's work differently on the different platforms. On Mono we have to convert from premultiplied-alpha manually. If you see black halos around your transparent images when running your games on Mono. Try doing this to the textures on load:

int id = GL.GenTexture();
GL.BindTexture(TextureTarget.Texture2D, id);

Bitmap bmp = new Bitmap(filename);
BitmapData bmp_data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
int PixelSize=4;

// Fix premultiplied Alpha in mono
int p = (int) Environment.OSVersion.Platform;
if ((p == 4) || (p == 6) || (p == 128))
{
unsafe
{
for(int y=0; y<bmp_data.Height; y++)
{
byte* row=(byte *)bmp_data.Scan0+(y*bmp_data.Stride);

for(int x=0; x<bmp_data.Width; x++)
{
float a = (float)(row[x*PixelSize+3])/255.0f;
float r = (float)(row[x*PixelSize+2])/255.0f;
float g = (float)(row[x*PixelSize+1])/255.0f;
float b = (float)(row[x*PixelSize+0])/255.0f;

r = r/a;
g = g/a;
b = b/a;

row[x*PixelSize+2] = (byte)(r*255.0f);
row[x*PixelSize+1] = (byte)(g*255.0f);
row[x*PixelSize+0] = (byte)(b*255.0f);
}
}
}
}

GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, bmp_data.Width, bmp_data.Height, 0,
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bmp_data.Scan0);

bmp.UnlockBits(bmp_data);

GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);

2) Setting mouse position on mono (osx atleast). To be able to use delta mouse movement to steer we wanted to center the mousepointer between every frame. It seems that Cursor.Position = new Point2(..) locks the mouse position for a couple of hundred milliseconds. This makes the center-on-every-frame-technique unusable. We don't have a good solution to this atm. We had to settle for just checking the delta of the mouseposition each frame, which works but only until you hit the screen edge. You can press Space to recenter the mouse if things go bad. For this game you go pretty much straight ahead, so it's not that big of a problem.

Anyway, we hope you enjoy our little game!

Huggies
/Hannes and Alfred
archived as: experimental gameplay project,opentk,mono,linux,osx,premultiplied alpha
 
Apr 012010
Word Hunt
by Hannes Rahm
WordHunt

So... End of the month, and once again we are late with our Experimental Gameplay Project entry.
Lots of last minute engine troubles, so this is quite rough.

The actual game code is written in a only few hours.
The admittedly crappy meshes were modelled in around 3 hours total.

Is it fun? Well if you're into hectic, memory-intensive, click'n'spell games, possibly :)

Anyway, here is our entry for the 10 seconds challenge:

Word Hunt

Instructions

You are in a cluttered room.
Spell the announced words by clicking on things. You get ten seconds per word.
If you fail to spell a word in time, you start over from the beginning.
The object you are hovering over is shown in the top left corner. It's first letter is used to spell.
You start with 3-letter-words, but every five words you spell correctly another letter is added.

>> Download here <<

Prerequisites
You will need
  • DirectX 9
  • Microsoft .net framework 3.5

This is built on our little unfinished game engine + editor called znCore.
It's not really up to even this small task yet, but it looks like it the game runs reasonably well.
The game is written and the scene is composed entirely within our editor.
Check "Game/Scenes/__temp.scene" for the anatomy and scripting of this game.
We plan to make znCore a nice platform to build 3d games on.
Right now it's usable but not enjoyable :)

Huggies!

/Hannes and Alfred
archived as: experimental gameplay project,ZnCore,word hunt
 
Mar 182010
ZnCore Update 2
by Hannes Rahm
So what is going on in ZnCore-Game engine land? A ton actually.
First and foremost we have expanded into the third dimension. Complete with cameras, lights and 3d models.
The rendering is really rudimentary at the moment. No eyecandy yet :(

The engine still employs a component based entitysystem that is easily scripted through IronPython. We have added a simple xml based scene format that is used to load up sets of entities. This is based on our Template format, an xml file that describes what components and properties an entity should have. The scene lists all the entities in a scene, what templates they should be based on and any modified component parameters. Scenes can be both saved and loaded easily, and (it seems ;) ) reliably.

The third big thing we have added is a simple game editor!
The editor features:
  • A Solution Browser that by doubleclicking enables loading of scenes and spawning of entities from templates.
  • An Entity Browser that lists all the entities in the current scene.
  • An Entity Inspector that lists all the components in an entity. You can add components and edit their properties in a simple Property Grid
  • A realtime view that shows the scene. Entities are selectable with right click and moveable with left mouse drag.
  • A Script Console that can be used to directly speak python with the engine
  • A Floating editor for entity scripts (through the ScriptComponent)
  • Modular "Visual Studio Like" dockable panel system through DockPanelSuite.
So how does it look?

ZnCoreScreenShot1
This shows most of the functionality of the engine. Including some examples of how scripts can be written.

archived as: C#,ZnCore,Game Development
 
Mar 012010
Rejection
by Hannes Rahm
Rejection

[UPDATED!] Game now has sound and a helpful helpscreen

Ok, so... we are a bit late, even in our own timezone. :)
But here it is, our entry in the February Experimental Gameplay Project.

The theme was Rejection. Wikipedia has this to say about that:
"The word 'rejection' was first used in 1415. The original meaning was 'to throw' or 'to throw back'."

Instructions
In our game you should protect the rabbits on the bottom from the evil, bomb throwing, badgers on the ledges above. Click and drag the bombs to throw them back to the badgers. The game is over when you have no rabbits left.

We have worked on the engine throughout February and practically hacked the game together over a few hours this weekend. As our engine is just in it's infancy, things are neither stable nor working perfectly. Fingers crossed that other people than ourselves can even run this :)

Prerequisites
You will need
  • DirectX 9
  • Microsoft .net framework 3.5

Download the game here

(old version here if problems occur)

Hope you enjoy it!
/Hannes and Alfred

archived as: game,experimental gameplay project,C#,IronPython,ZnCore,rejection,c++
 
Feb 092010
ZnCore Update 1
by Hannes Rahm
So, while we might be the laziest people on the northern hemisphere we have actually made some progress on our engine. Alfred have been working on the c++ and wrapping side to expose more stuff. My efforts have been put into the other side of the engine, the stuff in C# and IronPython.
I have added a SpatialComponent that handles an objects position and rotation in the world. Coupled with this there is now a SpatialComponentManager that registers all SpatialComponents and enables us to do things like GetObjectsWithinRadius(x,y,z,r).

One fundamental problem is when some data in one component is needed in another component.
Like for example, our SpriteComponent needs a position (which i stored in the SpatialComponent)
The way we have "solved" it at this point is simply storing a reference to the SpatialComponent in the SpriteComponent and each frame reading the data from there. This is quite messy, but works, for now.

I have also thought a bit about how an actual game could be structured so a future editor could be built easily.

Game Folder Structure

-- Templates (Contains Xml files with "templates" for entities. That is, the entities components and parameters)
-- Assets (Containing Models/Textures/Sounds/Music etc)
-- Components (Containing pure python components referenceable in Templates. Not finished)
-- Scenes (Xml files describing the different levels or stages in a game. With lists of templates and scripts, Not finished)
-- boot.py (A python script that boots the game)

boot.py
(reduces the amount of recompiles when we only change script files)
engine.CreateEntity("Templates/TestEntity.xml", "TestEntity")
engine.CreateEntity("Templates/TriggerEntity.xml", "TriggerEntity")

The CreateEntity function parses the entity-template-xml-file passed and creates an Entity with the appropriate components. For now it's just an ugly switch clause that handles all component types separately. This needs to be streamlined. With a bit of Reflection magic it'll be a breeze.

An Entity Template: TriggerEntity.xml
(When instanced in the game this entity changes the background color when other entities are near)
<?xml version="1.0" encoding="utf-8" ?>
<template name="TriggerEntity">
<components>
<component type="SpatialComponent" />
<component type="SpriteComponent" Texture="Assets/Textures/Kid1.png" Size="64,64,0" />
<component type="ScriptComponent">
<![CDATA[
class TriggerClass:
"""TriggerClass"""

def EveryFrame(self, sender, args):                                            
objects = engine.SpatialManager.GetObjectsWithinRadius(self.spatial, 300)
if (objects.Count > 0):
engine.Core.GraphicsEngineSetClearColor(255, 0, 0)
else:
engine.Core.GraphicsEngineSetClearColor(0, 128, 0)

def __init__(self):    
self.spatial = entity.GetComponent("SpatialComponent")
self.spatial.X = 512
self.spatial.Y = 512
self.spatial.RotationZ = 90
engine.TestEveryFrame += self.EveryFrame                        

def __del__(self):
engine.TestEveryFrame -= self.EveryFrame

TriggerClass()
]]>
</component>
</components>
</template>
archived as: XML,C#,IronPython,Component Based Design,ZnCore
 
Feb 042010
ZnCore
by Hannes Rahm
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 state
While 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
archived as: ,C#,IronPython,Component Based Design
 
Nov 292009
Sweet Tooth
by Hannes Rahm
Zink - Sweet Tooth

We are proud to announce that we won the Combined Demo competition at Dreamhack Winter 2009!
Wow, three times in a row. A real demoscene hattrick!
We won by a tight margin over Lusius with his Demo lu-01. I would almost call it a tie :)

Our demo is called Sweet Tooth and is coded in C# using SlimDX.

We have had a series of problems running the demo in fullscreen, it seems for some reason to only work on Windows Vista. Had no time to fix it before the deadline. When we wake up from the sleep-drepravation induced coma we are in, we hope to be able to fix this.

We want to say a big THANK YOU to the Dreamhack Kreativ Crew, who did an awesome job putting the event together!
The other big thanks is ofcourse to all the people who voted for us!

Check back in a while for a little post-mortem on the production.

Download demo
(Needs SlimDX, get it here)

Huggies to all
/Hannes

Update: Captured and uploaded to Youtube: (Quality should be better as soon as youtube is done processing!)
archived as: demo,demoscene,sweet tooth