Adventures in Game Development

on thread pools and wait-free structures

by mordekai on Apr.12, 2009, under Artificial Intelligence

Well, I wrote my own threadpool and leveraged that to get a much speedier result out of my TicTacToe AI… but the multi-threaded version is still slower than single-threaded.  After quite a bit of research I’m convinced that I’m spending far too much time waiting & blocking… which is eliminating all the speed-ups I was hoping to gain with multiple threads.

I also read about lock-free queues (and other methods) to help eliminate the slow waiting/blocking.  I’ll have to come back to this in the future and take it further.  For now, I think I’ll either move on to a more complicated game like Chess… or learn how to do 3D animations.

Leave a Comment :, , more...

multiple threads for extra thinking

by mordekai on Mar.25, 2009, under Artificial Intelligence

Before moving onto something more difficult (like a Chess AI) I thought I’d try something; threading the TicTacToe AI so that each potential move (branch of the decision tree) is handled concurrently… and in theory, the AI could analyze more unique game states in the same amount of time.  So far, my code is having the exact opposite effect… that is, the Single-threaded version is actually faster than the multi-threaded version.  Quite a bit faster. =[ Sad.

Some combination of the following things could be true: 1) My code sucks, 2) I’m useless, 3) This is not an appropriate usage of threads.

Since I like to believe I’m useful, I’ll just rule out number 2 now.

I’m pretty convinced that number 3 is not true… that is, each potential move (branch in the decision tree) can be separately analyzed without any sort of inter-thread communication.  And there is quite a bit of work for any given worker thread to do, so they should be able to happily crunch some numbers in relative isolation and come back with the best move for that branch of the decision tree.  This works… but is much slower than just running everything in one thread.

I must be doing something wrong (ie., my code sucks…).

I need to do more research… I’m going to run a timer on the single-threaded and multi-threaded versions… crank up the amount-of-thinking to way-more-than-neccessary.  We should (in theory) reach a point where the single-threaded version is slower than the multi-threaded version.  If not, then I’m doing something very wrong and I will be sad.

Leave a Comment :, , more...

AI & Angel SDK

by mordekai on Mar.17, 2009, under Artificial Intelligence

I’ve been playing around with the Angel SDK and really like it.  I’m currently working on a couple games with this SDK, (1) a puzzle type game about Life and Life’s choices with a few of my group members from Game Jam Vancouver, and (2) I’m diving into AI.  I’ve always been interested in AI and have experimented with it before… but never really took it very far.

What I’ve done so far is a tic-tac-toe variation (19×19 grid, get 5 in a row).  you can download the distribution here. Just unzip the contents into some folder… and it should work. (If it doesn’t please let me know… there may be intricacies to the way the Angel SDK distributes files that I am unaware of). The Computer seems to make some weird decisions… it plays more defensively…

I’m considering trying out a chess AI next.

Leave a Comment :, , more...

Game Jam Vancouver

by mordekai on Feb.10, 2009, under Uncategorized

Last weekend (Jan 30 - Feb 1) I was at the Vancouver Game Jam.  I had made plans to drive up there for the weekend and participate (since there was no Game Jam for Seattle!) and I am very glad i did.  A couple days before I started my drive North I started getting sick… “Crap…”, I thought.  I couldn’t pass up the opportunity though, so I made the journey figuring that I would be a little more tired than everybody else.. but I would suck it up… be a man… etc.

On day 1, I register with the Jam (there was a little mix up when i tried to pay in US cash… but they were forgiving) & sat down next to some really great, talented and *driven* people.  I introduced myself as the American I am (queue mild teasings about the weakness of the American dollar & former president :) ) and we all proceeded to wait for the rest of the jammers to arrive.

At roughly 5:00 pm we were given our game design constraints as follows:

Theme: “As long as we have each other, we will never run out of problems”

Additional restrictions:

1) A play through of the game should be no longer than 5 minutes.

2) Adjectives (one of): Thin, Rotating, Evolved

Within 30 minutes, many people had pitched ideas, but one in particular sounded promising and very doable.  I joined team “One Tonne Punch”.  We were 8 strong, and within an hour had a pretty strong & fleshed out game play idea.

Since we had two experienced c++ programmers (myself included), we decided to prototype the game in c++ rather than pick up Flash/ActionScript programming on the spot.  In the end, this proved to be a mistake.  As my illness set in I found it very difficult to think and maintain focus and I was just unable to keep up.  We eventually threw out our c++ work and the game was coded up last minute in Flash.

I learned a lot of valuable experience that weekend.  It was very stressful but still extremely rewarding.  I met a lot of solid people who I wouldn’t mind working with again.  Most importantly, I proved to myself that this is what I need to be doing.

I will definitely go again next year.

The game (& source) can be downloaded here:

ForShame

ForShame

Leave a Comment :, , more...

Looking more and more like a real game!

by mordekai on Jan.14, 2009, under Scribble Wars

I’ve added some gravitational forces and platforms for the enemies and the main character to walk on. I’ve also made the objects in the game scroll at the same rate as the background. It’s looking like some semblance of a game now. You can walk around, jump and shoot stuff — what more does one need? :)

Next up, i think I’ll cobble together a system to track all the objects that will appear on a given level, and then display them as necessary as the game scrolls. Sounds like a plan.


scribble game 8 from Chris Haukap on Vimeo.

Leave a Comment :, more...

What I’m doing now: Scribble Wars

by mordekai on Jan.08, 2009, under Scribble Wars

I’m taking a break from Crypt Keeper to work on a 2D platformer/side-scroller with a small team at Kloonigame’s forums: long thread
We’re tentatively calling it Scribble Wars. You play as an as-of-yet unnamed cartoon hero who has been drawn in the margins of some kids lab notebook. In fact the entire world of scribbles and doodles in this kid’s lab notebook have sort of come to life. The creatures you will face are the lesser scribbles & doodles of the antagonist bully. His cartoon renderings will get better and more detailed with each level in the game.

I just got some collision detection working:

Leave a Comment :, , more...

a quick Crypt Keeper movie

by mordekai on Jan.04, 2009, under Crypt Keeper

I’ve been busy with the holidays and now i’m working on a new game project with some actual artists (as in, not my crappy art).  I thought to myself “I have to jump on this”… so my own Crypt Keeper game will have to wait a bit.  The good news is that i’ll be writing stuff for this game that i’ve been meaning to get to with CryptKeeper :).

I thought i’d post a quick movie of what the game currently looks like (that way, no downloads are required to see it in action — it’s short!)

2 Comments :, , more...

CryptKeeper update - 3D limbs and some animations

by mordekai on Dec.08, 2008, under Crypt Keeper

Much time has passed and new things can be seen in my demo. The tree limbs are now being rendered with 3d cylinders and textured. I had to take the branches off the limbs to reduce the number of calculations I’m doing. It’s currently being very wasteful with math and will need to change so i can calculate & render branches too… which will make the limbs look much prettier.

Here is a screen shot of the game in it’s present state.
Crypt Keeper Screen Shot
each person has little animations now, and so does the evil tree flinging the people. It’s coming along :)

Leave a Comment :, , , more...

Crypt Keeper Backdrop

by mordekai on Nov.04, 2008, under Crypt Keeper

Here is a sketch of the backdrop that I will be using in the game. Just some town/local village for now… I’m still experimenting with my digital tablet. I sort have a direction of where i want to go with the look/feel & game play of Crypt Keeper, but there’s also a giant amorphous blob of unknown there too. Lights will be pouring out of the building windows, and from the lamp.


And here is what i have so far of the face for one of the evil trees. again, still experimenting!



Leave a Comment :, , more...

Texture Mapping is worth 100 xp

by mordekai on Oct.31, 2008, under Crypt Keeper

Here is a screen shot from the current version of my game-in-progress.

Please note the hand-drawn (with my new digital tablet) people roaming around on the ground. my own art, of which i am proud :)

Also note the non-textured mono-colored tree (it’s much more visible in game). It has a number of animated limbs that seek out, grab and fling the people on the ground. It was dead simple getting this working in 2 dimensions… but moving to 3 dimensions was much less trivial than i was hoping it would be. After running that gauntlet, i have a profound respect for 3D graphics programmers. Wow.

Unfortunately, I couldn’t get the tree textured for this post. It would have certainly looked better on my debut post to have a textured tree moving around in 3D, but i (a) didn’t have a texture actually drawn for the tree yet, and (b) I’m currently rendering the tree with lines (not polygons) in OpenGL… which cannot be textured. This is OK though… since I have no readers yet, I’m confident I can have textures on the tree before anyone sees it :)

Leave a Comment :, , , , more...