Showing posts with label Game Dev. Show all posts
Showing posts with label Game Dev. Show all posts

Tuesday, July 2, 2013

Dragon game update: additive blending, contorted transformer and slender dragon

Hello again!

This has been a pretty big week for my game.
I've refactored the rendering engine simplifying some stuff and improving performance a lot. I've also added smooth shading to my dragon model and had a fight with blender over exporting models (I had to change roll of some bones which turns out isn't as simple as I though because all animations get screwed up).

As for additions to the animation system:
  • Additive and Subtractive blending. Allows me to create an animation I can lay on top of other animations (eg: small variations when running)
  • Skeleton masking: Allows me to select which bones get affected by a node
  • Triangular mesh node blending resulting in Head rotation: Ok, this isn't completely new but I did remove it for some time when I did the animation tree refactor
I also did another small anim tree refactor meaning it is no longer a tree and more of a graph with a root node and leaf nodes. This means I can now have one source animation node being used in several other places which is really useful.


Anyway, here's the latest update video:




And here you can see what happens if you don't subtract animation from a reference pose:  
 
 


Also my dragon is apparently a transformer, here he is as a spaceship:


That's all for this week. Next week I'll be working on leg IK, adding flying animations and I'll also work a bit on the texture. I'd love to do an IK tutorial eventually since it's a topic I already got myself quite familiar with, and there are a couple of techniques that are easy to implement that you don't need to know too much math to add to your own game.
Either way if you have any questions about animation blending/trees or IK feel free to contact me either by commenting or through twitter @SpliterCbb

Cheers!

Saturday, June 22, 2013

Working on a new game

Hey!
I've been neglecting this blog for quite some time since I was thinking of moving to wordpress but without ever actually committing.

So I decided that for the time being I'll keep updating this blog with the news of the game I;m currently developing.

The end result I want is a game where the player is a dragon from the start of its life in the egg up to the end of the life. I want it to have a certain storyline but It'll be free-roaming/open world for the most part with story taking place in specific areas, one of the key focuses of the game will be the animation as I want to combine keyframed animation, IK, physics and procedural animation to have a dragon that controls great but still responds naturally to the world.

I'm developing it on my own engine since I want this to not only be a great game but I also want to learn the hard technical parts as I'm making it.

So far I have a basic resource management, a rendering system and the beginnings of a robust animation system.

Here are the video updates so far:
Update 1

Update 2
A funny bug related to my direction setting resulting in wobbling.
Update 3

Sunday, August 21, 2011

Progress snippet

Hello!
Ludum Dare 21 has started yesterday. Unfortunately I'm not participating but that doesn't mean I won't be doing anything this weekend!

For the last month or two I've been working on my game engine. My little baby Litterbox has it's third rewrite from scratch ever since I've started making it. This time the key word is "Components"!

Now, components are a very, very good thing, but the classical component-based engine design has it's flaws like component communication overhead, the lack of centralized control, and many more than would normally keep me away from it. However I couldn't just go back to using the traditional deep hierarchy design as it constraints the flexibility of the engine, and many times you have to use a super-complex base-object that I really don't want to have.

So.. What's the sollution?
Hybrid

My engine architecture is a hybrid one, having always a centralized  game entity to which the components are linked. In most cases this means that I have a command center for my objects, but I can also add and new components easily. So if I have a 2D game engine where I suddenly would want one of my bosses to be fully 3D there wouldn't be a problem! I just add a lb3DModelComponent to my boss object, and handle all the special 3D code in the entity.

So far I've moved from 2D animated sprites to 3D models (with Horde3D) without any problems, and if I want a 2D game on top of my 3D game then there's absolutely no problem!

So, here's my progress so far:
-I have a fully functional Entity system with attachable components.
-2D box-based collision system (with various iterations per frame)
-2D graphic system, leftover from earlier engine testing, with support for animated sprites loaded from a sprite sheet.

My Game
I also started thinking about the game I want to make. In my earlier days as a wannabe game dev I created a small demo in gamemaker, where you controlled a fiery guy, you had a selection of fire-based weapons and you were left in a small town full of squishy pink dudes and buildings to use your abilities on.
Recently I showed it to a couple of guys at LudumDare IRC channel and the feedback they gave me really pumped me up so I decided to give that game another try.

The basic idea of the game was that you were a Poyo, a little pink dude kinda resembling a Poring from Ragnarok Online. You would then acquire special powers that would let you transform into a version wielding 1 of 3 natural elements, namely: Fire, Water and Flora.

The game setting was mostly based in a fantasy land with traces of advanced tech.

Now I'm reworking the Idea. I'm planning for keeping the feature of 3 elemental transformations, and as planned before the game would be an Action-Adventure, though I might throw in some RPG elements in there too since it seems to be a good blend considering the fantasy setting.
Anyway, here's the screenshot of how things are so far:



This also was a good excuse to go back to modelling in Blender.
Importing these models to Horde3D was a real pain in the ass as the colladaConverter crashed when converting them, but the people on Horde3D forum had a nice workaround which works good so far.

For comparison here's how the old PoyoAdventure demo looked:


That's quite a sight there in all its 2D glory, however 2D constraints when it comes to depth and having object on top of one another really threw me away from it, that's why I decided to remake this game with 3D graphics (though with the same 3/4 view). I still plan on using 2D collisions though, just to work faster and have something done in less time.

I won't finish this game but I want to have a fun to play prototype. If it's fun enough then I'll work on it more adding fully 3D collisions, proper story, and I'll invest more time into it. (Basically this version will be the proof that I can make a game, as well as a proof of concept for my engine).

I'll be working on this most of the weekend, in a few hours I should have the little pink dude walking around with a basic animation and colliding with stuff. No idea what I'll do tomorrow but lately I've found out that striding back and forth around my house, brainstorming, gave me lots of good ideas as well as will/inspirations to implement them.

Edit: For those interested, no I didn't get the animations playing. I have no idea how I export animations from blender to use in Horde. I'll ask on Horde forums but that place is pretty much a ghost town. I'm kind of starting to regret using Horde instead of Ogre3D. If I don't find anything reasonable soon I'll try making my own converter with the help of AssImp.

That's all for now!

Later!
Spliter


Wednesday, June 1, 2011

The joints are turning

Hello!
Luck is not always on our side and so the animation tutorial will be delayed a little. I do have it completely planned out though so pretty soon you'll see the first chapter. The complete tutorial will have 9 chapters ranging from vector transformations, through skinning, blending animations IK and saving.

It's the biggest such project I have got myself into so wish me luck!

The first chapter will just talk about vectors and vector transformation so those that already know this stuff can skip it without much thought.

In this chapter I will assume you've at least heard of vectors and I'll just speed through a few useful things like dot and cross products, and matrix transformations and some interesting applications, so even if you already understand vectors it'll be worth skimming though it.


Later!
Mikolaj (Spliter) Kuta

Monday, November 8, 2010

Small engine update

Hello!
Sorry for the complete lack of updates (in case anyone reads this blog) but I've been dead busy with real life, most notably with my university and finding money to live. But never mind that.
I have made a little upgrade in my engine, namely: it now supports polygon casting.
What is poly casting you say?
Poly casting works just like ray casting except with a poly. Basically it smears a (convex) poly along a line and looking for collisions along it, giving you the time each of them (if any) happened.
In simple terms:
Let's say you have a large 16px ball that's travelling at 200 px/frame. any wall that's in between the balls' current

position and the next one is probably gonna be missed, and so the ball will glitch through them.
frame 1:





frame 2:




Using polygon casting we can prevent that as it will detect all the walls the ball went through and also record the time at which the ball entered and exit each one of them, making this perfect for fast moving objects for which a simple ray cast wouldn't be enough for.

Frame 1:




Frame 2:




Note how in the second frame the ball didn't get past the walls since it detected the collision beforehand.

Here's a video in which I show the latest updates:
1-Webs
2-Lazer
3-little demo of a triangle being cast from the player to the mouse position
4-some bullets





When I get some free time I'll make a tutorial on ray and polygon casting, in the meantime I'll also update my engine to support an entity IO system which will allow the communication between various entities. It'll prove to be mighty useful when I want for example a door triggered by a button, or to make explosions at specific events.

Till next time!
~Spliter

Tuesday, July 20, 2010

Results of MiniLD20: A little introspection

Warning: This blog post has a lot of introspection and very little technical things, you can skip it if you're just interested in how games are made by other people.

As strange as it sounds I actually made a game.
Well.. it can barely be called a game and I'm not proud of it in the slightest.
I have to admit the theme kind of screwed me over since I'm no good with abstract themes, but still I probably could've done better.
The "game" was a small non animated tank with a drill on it going through a series of letters that spelled "GREED" and they disappeared when it touched them. I didn't even add particle effects. After destroying all of them a big "you win" creen appeared and that's it.
It was complete and utter piece of shit that would probably make this world better if it never existed.
So... why I am blogging about it?
Well... Once I made and submitted it it occured to me that it actually works as a poof of concept for my engine. I didn't have any problems making it. The coding party took only a few minutes and while I did it in an hour, most of that time was spent chatting on Ludumdare IRC channel and watching youtube videos.
So... what does "proof of concept" mean to me? Well, I realized how easy is to add new mechanics in my engine, and I saw how all those time made my engine better and better!
Then why didn't I made more games on it?
The problem is with me getting caught in the details, and not being able to complete a project on my own. I have lots of Ideas for new gameplay mechanics and I can apply them quickly but that's about it for me. I love developing new stuff more than I like polishing it and working with it for longer periods of time. I also invent new mechanics without thinking of how they can be used in the actual game, rather than just a toy to play around with.
For example: after spending some hours programming after I've released my miniLD20 piece of crap (AKA "game" ) I made a small prototype where you controlled a kind of protozoar with to tails.
Here's a screenie:

And that was about it.
I really can't think of any interesting gameplay for it, I'm only good in adding new feature/mechanic and then letting it go without using it again.

Another new mechanic I added was kind of a gravity field, it's kind of a coming back to roots thing as I've done that already before on my old version of the engine (while it was still called El_Poho). But then I've lost my will to use it.

So... why can't I continue working on something and then eventually turn it into a game?
I have a few theories.
The main one is that I need leadership. I've noticed that when I work in teams during classes I make a very bad leader, and a very bad follower, however being the right hand mand of the leader is the perfect spot for me: I get my share of power so I can expand my creativity,but the leader is always directing my actions so I don't get sidetracked so easily. Any other position for me ends up badly. I love to be where the action is and I love challenges but it's hard for me to know what to do next.

Second reason is that I want to do new innovative stuff. But as soon as I implement the hardest part of it it stops looking so innovative for me and I get bored with it. And since I work alone on my project there's noone telling me "you need to finish doing this game/project". Although I shouldn't, I rely heavily on outside influence when I see other people stop caring about what I do I stop as well, and fall into procrastination.

There's probably a few other reaasons to my lack of finished projects but This post is already long as it is.
Sorry for making you read about myself but sometimes I need to vent my anxieties somewhere.

Later!
~Spliter

Thursday, July 15, 2010

MiniLD Commitement

Here's the log of the chat I had with the awesome people of Ludumdare IRC channel:

02:03 Spliter        ok, I'm gonna try to do something this time
02:04 Spliter        if I don't have anything at the end of miniLD I'll ....uh... what's a good compromise that's   harsh but isn't oo harsh like quitting game deving?
02:06 thedaian    hmmmm
02:06 thedaian    hard to say, really
02:06 mrfun         you have to watch the hannah montana the movie
02:06 Spliter        D:
02:07 thedaian     or any of the twilight movies
02:07 Spliter        I said something that's less harsh than quitting game dev, not something worse than going to hell!
02:07 Spliter        ok
02:07 thedaian     and then write a blog post about it with a detailed review
02:08 Spliter        It's decided, if I don't have nothing to show for after the end of miniLD I'll have to watch Hannah Montana the movie and then watch all of the released twilight movies!
02:08 TenjouUtena     You have to make your next game in Brainfuck or something.
02:08 Spliter        and then write a blog post about it
02:08 Spliter        and you're all my witnesses!
02:08 iFire            I spent like 20 minutes on circles and arrows >.<
02:08 Spliter         If I don't do none of those things you'll call me weiner-butt for the rest of my life
02:09 iFire            some people don't work under pressure
02:09 thedaian     banned from channel until the full LD!
02:09 Spliter        D:
02:09 Spliter        when is it again?
02:10 mrfun         but will you video blog about each movie dressed as a lead character?
02:10 Spliter        mrfun: no camera, and no money for corsdressing
02:10 Spliter        oh wait
02:10 Spliter        I have a camera
02:10 thedaian     mid or late august i think
02:10 Spliter        it's shitty as shit but it works
02:11 thedaian     no need to dress as a character from the movie, and no need to video blog, but some pictures of you with the movies would be good
02:11 Spliter        ok
02:11 Spliter        I'm commited then!
02:12 thedaian     make a blog post documenting this would be good
02:12 Spliter        ok!
02:12 thedaian     so there's some more proof


tldr version:
I decided to do something in this miniLD and watch Hannah Montana and all Twilight movies if I don't, I'll also have to blog about the experience and post pictures.


So yeah, I'm commited for this miniLD or I shall suffer the consequences. This blog post is the proof, the participants of the chat are the witnesses.
Wish me luck!
~Spliter

Sunday, July 11, 2010

The joy of prototyping

One of the biggest problems I face when doing tools for my game is the sheer size of it all and my general lack of experience doing usefull things (as oposed to screwing around).
The biggest challenge I'm facing right now is making a level editor that be called a 2D version of Valve Hammer Editor.

Yes. I'm that stupid to try making a huge editor on my own with barely any prior experience. How did it go? Well... I failed miserably before I even begun. The sheer number of features I want in my editor is daunting. Implementing them on their own is already quite a task, not to mention integrating them all into one big editor where every piece has to cooperate with the rest.

Friday, June 18, 2010

Not only procrastinating

Hello!
It's been quite some time since my last update and as crazy as it seems I didn't spend all this time sitting on my butt and farting. Only mostly.
Yeah, college life is difficult, when you're not studying for finals you're looking for a job, or a place to live, or gathering documents or doing assignments.
Still I've got some time free and I've been spending it mostly watching youtube videos making a small model viewer on wxWidgets and last two days I've spent making a nifty little 2D animation system for my game. All it does for now is draw a mesh on an animated skeleton.

Anyway here's a screen:

Unfortunately it isn't animated here.

So far it only animates a test skeleton with a test mesh using two merged test animations.
Oh, that's right, one little feature is that there are two "blending" modes, a simple aditive, which is helpfull when you want use two independent animations (eg, legs running, and arms flailing around) and use them together, and a real blend between two animations with a certain ratio. Of course the stored skeleton pose can be blended again and again, so I can have a 50 tentacled monster with each of his arms having a diferent animation of its own, while the monster itself has its own animations.
In future I plan to add IK and simple physics which will be blendable with the existing animations giving them a little more realism/naturality.
Apart from the animation system I'm also gonna create an animation and mesh editor, and when I'm done I'll have pretty looking graphics in my game.

That's all for now, I'll update this once I've finished some of the planned things.
~Spliter

Friday, May 28, 2010

No more shenanigans

Just a quick post to say that I'm putting my engine and GUI on hold. I'm getting really frustrated with the fact that I've been working to make games for 3 years already and I haven't made a single release. Therefore I'm now looking for an engine that will come with a nice collection of tools to use instead of making everything by myself practically from scratch. Right now I'm downloading Unity but if I find another engine that I'll like more I might go with that. So if you, who is reading this, has any Ideas It's time to post them! I'm out. ~Spliter

Sunday, May 9, 2010

More GUI Shenanigans

Ok, so following Blecki's suggestion I decided to try out the C# with VStudio 2010 and .Net:



Wait... That isn't C# with VStudio 2010!
Oh.. right, So the installation of VStudio turned out to be quite harmful to my PC, harmful as in: Windows used to load in 20 seconds, and after the installation it took it's sweet 3 minutes every time. Neither uninstalling nor Restoring system could help, as a side effect Drag n drop also stopped working, so I decided to install windows xp again. Luckily I have 6 partitions 3 of them having the apropriate size of 20 Gigs for a windows instal. So now I'm dual booting winXP, the version I'm onright now is Service Pack 2, which I like more than my previous (SP3) which I'll reserve just for gaming.

However one good side effect came from reinstalling windows from scratch: wxWidgets wxGLCanvas works! (as you can see on the screenshot)
This is really great news, (though I kinda wish I worked with C# right now) I'll be able to finally get back on track to work with that editor!

So yeah, See you soon with another Editor update!
~Spliter

Saturday, May 8, 2010

Editor GUI Shenanigans

So as promissed another small update on my editor:



Slowly but surely it's taking shapAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAAAAAAaa... ok, I'm sorry I really can't say that with a straight face, wxWidgets turned to be complete shite for me. I can't seem to add the most basic setup either for openGL or for SDL.
First I've spend the entire yesterday's morning trying to get the thing compiling, it kept giving me a crapload of linker errors and whatnots, fast forward for today and I've got the application compiling and linking without any problem. The problem appears when I try to run it. It just crashes! FFS I've spent 5 days learning on how to work with this thing only to discover it's all for nothing????

Anyway, if anyone has any Idea of why it would crash I'll highly appreciate it. I would post a screenshot but it's just that standard dialog asking if I want to send the info to microsoft (Does anyone even do that???).

It wouldn't be a problem if it was just my app that crashed. Every single tutorial source I put up and running up to the point of launching it Simply Dies at start (No window even appears, just the stupid microsoft dialog), even the one given as an compilable example!.
I'm using Code::Blocks which might be part of the problem but I say that the application should at least try to compile if I try to call the "mingw32-make -f makefile.gcc" in that directory. All it does is create an empty subdir and die.


TLDR version: wxWidgets is shite for me, I need to learn Qt, maybe at least it'll allow me to use openGL UNLIKE wxWIDGETS!
I'm out
~Spliter
EDIT: Qt is shite for me as well as FLTK, fox Toolkit, GTK would've been awesome if it wasn't in c
EDIT2:Blecki, from LudumDare Chat convinced me to try C# with .Net framework... I hope I won't regret it.

Monday, March 8, 2010

Edit Mode slowly but taking shape

Pretty much like the title says. Although I haven't planed anything beforehand, the editor mode is slowly taking shape, most of the work is done under the hood but here are some more notable features I implemented so far:
-Selecting/deselecting entities (so far only the player can be moved but it's only because I haven't integrated the other entities into the system).
-moving them around
-Displaying their info.
-select different layers and being able to select ents only on that layer

The editor is embedded into the engine so you can enter it at any time in the game. So far I still didn't implement saving and loading but that isn't far behind. In fact the editor saving will work exactly like the game loading and saving. Later I'm gonna work on this system a bit more to differentiate loading and saving a map and loading and saving a gamestate, which shouldn't be that difficult.

My hopes for the next editor update should be the following:
-Integrating all existing entities into the editor
-creating and destroying entities.
-Changing the layer an entity is on, and changing the order on the layer (bring forward, bring backward, etc).

Later yet I'll add the saving and loading of the maps.

There's still one major feature I want to add to my editor:
Entity Edit Mode

This mode will be specialized for every new type of entity. Normally you can move, rotate and scale the entities. But what about those that need a custom texture, or those that have a model or animation you want to edit?
In those cases you enter the entity edit mode and you'll be able to edit everything as you see fit, with your own custom GUI and everything.
So it'll work kinda like a program inside the editor.

Here you can see how everything looks now:

Not very inspiring, is it? Oh well, the GUI will come later when the most important features will already be implemented.

Later!
~Spliter

Thursday, March 4, 2010

I'm doing it again.

WARNING: wall of text coming without pictures and with too much philosophical crap.
   Damn, I thought I knew better than doing an editor system without planning everything beforehand. Every session I have programming it get's to be a bigger clusterfuck than before. However I do wonder if I'm actually doing the right thing. Last time I started jamming code without planning it through,on the December LD,everything got FUBAR, and I had to scrap lots of it in order to be able to make anything, but I have also learned tons of little tricks that helped me out before. Programming without having a concrete plan, with just having a vague Idea in mind, actually6 is lots of fun since you make things up as you go.
When I studied animation (by myself) I learned there are two kinds of animation. One of them is drawing as you go and the other is by doing keyframes and interpolating between them. The second one gives good results by being pre-thought, however it gives boring results, the first one however when you're animating as you go it's a lot more entertaining to animate and gives interesting results and livelier characters but tends to miss the marks and is in general unorganized. A good animator uses both of those styles to get the best results, and I'm thinking if it isn't the case with programmers too.
   Maybe programming stuff without pre-planning everything and then scraping most of the code but keeping the interesting stuff can become my way of doing things? Sure it wastes a lot of time but it also gives good results! When the entity system was in such a stage and scrapped everything I did learn a lot more than I expected, and you learn the most when you fail, so it might be possible I'll learn something even if I know beforehand something is gonna eventually fail.
That's all for today. Cya!
~Spliter

Sunday, February 28, 2010

Progress on the Cricket game [post nr 3]

Hello! Long time no see, eh?
In the last few days I've been concentrating more on the artsy side of me, this was fortified with Chiustream. "What is chiustream?" You may ask. Well, chiustream is a video stream every friday at 22:00 GMT created by the awesome artist Bobby Chiu.
For those that don't know who he is: he was one of the three character designers on Alice in the Wonderland directed by Tim Burton, along with Kei Acedera and Michael Kusche. The stream is basically a 1 hour contest at the beginning of which Bobby Chiu gives a theme and you must draw it.

But enough about art, you're here for my game updates right?.... right?

So in the last post I wrote that I've already finished all the three things planned for this update: Camera scrolling, Particle effects when you sing and allowing walls that won't let you grip them, From that time I didn't do much more as I've been busy with art practice.
Anyway, here's a screen of the latest build:


As usual here's the update of my game:
benhem.com/catboxbeta/Litterbox_update_10_02_28.rar
Of course you must have all the previous updates downloaded which you can download here:
http://benhem.com/catboxbeta/Litterbox_update_10_02_18.rar
and here:
http://benhem.com/catboxbeta/Litterbox_redistributable.rar
Yes, you do have to download them all and extract to the same folder, remember to extract them in the reverse order of appearance. Sorry for this inconvenience but I don't want to waste too much Benhem's space.

That's all for today, I hope you liked this update, I'm off!
~Spliter

Thursday, February 25, 2010

Artsy fartsy

Hello! As promised This post will be about my experiments with the art style for my game. Even though I did already draw and paint my main character and I do plan to keep him a bit cartoonish, that drawing isn't his final design. My main concern right now isn't about the design of the character but the art style in general. My Achilles Heel are the backgrounds and level art so before I do anything about the characters I'll try to find a fitting style for the levels themselves.
Here are some of my most recent takes on the level pieces:

My first try:

This one in practically the same style but added a bit of soft shadows:

In this one I tried a bit different way of doing the dirt on top, I also decided to not add the soft shadows made by blurring near the edges. This one is one of my favourite styles so far.

This one started interesting but the turned kinda crap. I wanted to elaborate on the previous one by making the dirt look like some kind of dense liquid, but later I wrecked it with badly placed blur shadows and adding an unnecessary texture.


The following two are in completely distinct style I tried just to see how it would work.
In fact these are my favorites.
The problem lies withe the fact that I don't know if they fit the general game theme. As these simple styles are good to show an ambient devoid of humans meanwhile I'll have to make quite a few levels dealing with machinery,human houses and rockets and shit.


In the last one I especially like how the layering worked out, I think it's gonna be quite easy to add this to my engine but still I'll have to elaborate on them and see if I can fit in the machinery and human made products into that style. Still The kind of gameplay the first one shows is calm and friendly, meanwhile I'm hoping for a bit of action mixed with puzzles and platforming.

I would like to hear input from all of you who are reading this blog. Anyone can comment, no signup or capcha needed.

Hope you liked this post, the next one will be a progress update as I completed all the stuff I promissed in the last update post (camera scrolling, walls you can't latch onto and particle notes when you sing).

I'll see you tomorrow!
~Spliter

Thursday, February 18, 2010

Progress on the Cricket game [post nr 2]

So things are going quite faster than I expected them to do. It's a shame I'll have to put the my cricket game aside for the miniLD this weekend.

Anyway, here's what's new:
I finally added jumping, proper jumping with raytracing to make sure you don't fly off the map no matter how fast you go (although you can still get pushed outside with the normal collision tests I make after the movement has been done. I'm still indecisive whether I should add walking/scurrying into my game for the player since if I did that for normal ground walking I would also have to do it for wallwalking/ceilwalking and it would be a hassle. So far you can still move a little, but if you want to travel it's mostly by jumping.

Here's a new screen:
Those blue things at the edges are walls I have added so you wouldn't fall off if you miss a jump.
I also finally disabled the rotating background! It was giving me headaches when testing.

Having made a lineart concept from the "I'm probably not meant to be a game designer" post I decided to color it. It might sound simple but being Deuteranope (I have shifted green spectrum a bit) I usually use weird looking color combinations when dealing with green, so I decided to try something crafty:
Paint the little guy in blue, setting appropriate hues and saturations and all that jazz,and then change the hue to green. It definitely looks a lot better than if I did it with green right away (at least to me), so here's a little tip for all you deuteranopes out there: Paint in the color you're comfortable first and only then change the hue to the color you have shifted! (however unless I get a confirmation from a person without shifted spectrums I can't put my money where my mouth is).

Anyway! Here's the final version of the main character:


Of course this wouldn't be much of a progress post if I didn't give you an updated version of my game to try out the new jumping feature so here it is:
http://benhem.com/catboxbeta/Litterbox_update_10_02_18.rar
It's only the exe without the DLL's but to save on Benhem's storage space I decided it would be best to only give updates instead of the full thing every time.
You can get the previous working version here:
http://benhem.com/catboxbeta/Litterbox_redistributable.rar
And then just put the exe inside there

The controls:
Space- to show the sing menu/GUI and mouse over the circles to sing.
WSAD- for additional control in flight
AD-to walk on the floor (or on the ceiling in this version)
RMB- hold longer to jump faster release to jump

My plans for the next update:
-add a little particle effect of notes when singing
-add camera scrolling to follow the player and thus make the world bigger
-add walls/solids you can't latch yourself onto

So this is it! I hope I didn't bore you,and see you next time!
~Spliter

Wednesday, February 17, 2010

Progress on the Cricket game [post nr 1]

An average programmer can write an entire program in a week. Unfortunately I'm not an average programmer and I take incredibly long amounts of time to write the simplest things. Main reason for the slow progress is not having much motivation therefore I decided to get more graphic.
From now on every few days I'm gonna update this blog with the progress of my game and I'll post when there is something new you can actually see. I'll try to do it as often as I can. Hopefully having something to show for will motivate me to work more and procrastinate less, having said that here's my first progress update:

I finally added one of the key gameplay features: Singing.
Practically I've spent today's entire day adding Fmod support to my game and I'm happy to announce I now can have sounds! Of course having ability to play sounds would be nothing without the sounds themselves so I added the singing feature, mentioned in the "I'm probably not meant to be a game designer" post, suggested by Thedaian.
The singing works just like it did in Aquaria, you mouse over the notes arranged in a circle and compose short melody with them, if it matches any melody known to you will give you certain power or do something interesting. So far you can only play a fixed-size melody of 6 notes and all it does is toggle between red and purple song layout.

Before Singing: After Singing:
Note that everything here is placeholder, and the background still rotates continuously because I'm just too lazy to change a certain variable to false.

Here's my work in progress if you want to see it in action:
My game's current build with necessary DLLs:
http://benhem.com/catboxbeta/Litterbox_redistributable.rar
Just the game exe and the assets:
benhem.com/catboxbeta/Litterbox_nodlls.rar

WSAD-moves you (the little blue square).
LMB-places one of the walls on the mouse position.
Space-press and hold to play the music you like.
Q-hints at the only music available.


So this is all for today, I hope I didn't bore you too much, see you next time!
~Spliter

Monday, February 15, 2010

Entity based C++ Game Save Tutorial with complete code

Ok, so maybe I'm not meant to be a game designer but I want definitely to be a game programmer. I like doing all that low level code and I've got an enormous help from tutorials all over the internet and from the "Game Programming Gems Vol 3" book. I hope you find this tutorial useful, and if not then at least I hope you like the save system I wrote for you. If you've been following my blog you are now aware that I have been developing a game engine for quite some time. I bet heavily on automation and allowing the programmer know as little of internal workings as he wishes. My current iteration of my engine has been influenced heavily by the Source engine structure. But enough about this, if you're here it means you got interested in the a tutorial on how to save entities.
Now, before we begin I'll be mostly talking theory, if you want you can download the entire source code as well as a sample program showing it works in a link I'll provide at the end of this page. This tutorial won't explain on how to implement the saving system I'm describing, but it will tell you a lot of theory to build your own based on Shells or use the code I wrote. If you don't find this tutorial that much helpful since you would like to know the implementation then look at the code in the linked file at the bottom of this post, not only it has everything setup so you can use my code in your project right away, but it has a very good readme file that explains everything from how it works to what every separate thing does, to how to integrate it with existing systems.

Part 1: the start
So you've just created a good entity system or are about to and you think to yourself "gee, if I only had implemented the ability to save entities to a file or a buffer!". Many times beginner programmers let the saving system to the end. Although it's not a bad thing since it's one of the last thing you need you have to prepare a fertile ground for saving. One of the mistakes people do is keeping references to other entities in game as pointers in your object. This practice leads to many problems when you start to make the saving system so here's a word of advice: Don't do it. If you want having references to other entities like to an owner or the nearest enemy keep them as handles. A Handle is a combination of an ID and a index, most probably you'll either keep your entities on a static sized array so you don't have to reallocate the entire collection every time you add or remove an entity. A handle is basically an ID, it works great if it's just the index of the object on the entity array since you're gonna need that anyway. By passing the handle/ID to the entityManager he should be able to give you a pointer to the entity you want or NULL if no such entity exist (the best thing about handles is that you don't have to worry that if you erase your entity if it leaves dangling pointers on other entities). Having all entities inheriting from one common ancestor is also usually a requirement of loading systems.


Part2: the Theory
In an ideal saving system you would be able to just call LoadEntities(char* buf) and the entire system would just do everything you expect it to do. Luckily it is possible, unfortunately you have to implement all that code yourself, or use someone else's code.
Let's start at where we began: we have a collection of objects that don't have any saving implemented and you want to save them. What a bummer! you have to write so much code for every single variable just to save it! You're lucky you've got me, and I'll teach you how to reduce your workload using Shells and Macros (yes, remember my last rant about them? well you'll see them in full action this time!). I'll just quickly state that by using macros instead of rewriting/copying and replacing about a hundred lines of code for every class you'll only write two short lines, and then one very short line of code for every variable you want to save.


What is a shell?
The theory behind shells is the following: you create a small object specialized for every entity you want to save in your game that holds which variables will be saved and loaded. It'll work as our intermediary between the entity to save and the buffer: [entity]<--->[shell]<--->[buffer] The Ideal would be to be able to write something like this:
FooShell {
    SaveVars
  • x[float]
  • y[float]
  • name[string]
}
...and then just call the shell's saveObject(object,buffer) and loadObject(object,Buffer). To achieve this we must create a system that:
  • allows passing of a variable as a parameter
  • allows passing the type of the variable
The difficulty lies that Shell and the entity we want to save are separate classes. By joining them into one we would lose the abstraction we have right now. So what do we do? We use a nasty little trick and instead of getting the variables themselves we get their offsets and sizes in bytes. What do I mean by that? Let's say we have an object with three float variables x,y,z and we want to save two of them, let's say y and z. This is how our object would look in memory:
  v-object start
[x][x][x][x][y][y][y][y][z][z][z][z]
where each [ ] represents a byte. to save y we need to get it's offset from the start of the object. for that we must handle some nasty pointer calculations. in theory you grab the address of y and then subtract from it the address of the object which is also the object start. In our case the offset of y would be 4 and it's size would be sizeof(float) which is also 4. Would you look at that! We already have a format for our variable storage entry in c++ it would look like this:
struct varEntry
{
 unsigned int size;
 unsigned int offset
};
our Shell class would look like the following
struct Shell
{
  virtual void fillEntityFromBuffer(baseClass* ent,char* buffer);
  virtual void fillBufferFromEntity(baseClass* ent,char* buffer);
  virtual unsigned int getMinBufferSize();
  static varEntry* variableList();
};
The member function variableList should return an array of statically allocated varEntry-s holding information about the offset and size of every variable to be saved/loaded for the specific entity that Shell was made for, to add simplicity that array should end with a special entry, you could chose an varEntry with size0 and offset 0 or size=0xffffffff and offset=0xffffffff (you can get this by casting a -1 to unsigned integer).

3. How the system works
In a Shell based saving system to save all the entities you'd do either one of these things: every instance of every class would need to have a member function that gives us the shell assigned to it. This works great for saving but problems appear when you are loading entities, and don't know which constructor to use. My favorite mode of overcoming this problem would be to write a singleton factory class for every entity that could not only spawn the entity instance we want, but that could also give us a singleton shell object specific to that entity. On the save system side you'd have one shell for every entity in game and one base shell corresponding to the one entity/class that is the common ancestor from which every other are descendant. An advantage of such system is that if combined with Macros you'll end up writing a little bit more code on the implementation but it'll save you literally thousands of lines of code throughout the project.
The workflow of this method is separated into two phases:
-Implementation
-Use
The Implementation phase is the most difficult and takes the longest to complete as you have to write a generic loading code for variables, however thanks to this initial stretch the Use phase, which is when you're actually assigning saving capabilities to every entity you want/need will take a lot less time and a lot less code.
    So the things you'll need are:
  • One common ancestor to all entities in game
  • A Shell class, that's gonna be rewritten a lot (or not at all with macros), built for saving and loading the variables from a buffer.
  • A variable storage entry with a specific format.

if done right with macros you'll end up with having something like this after every entity you want to save:
START_STORAGE_DESC(FooEnt,FooParentEnt,BaseEnt)
  STORE_VAR(x,TYPE_FLOAT)
  STORE_VAR(y,TYPE_FLOAT)
  STORE_VAR(name,TYPE_CSTRING)
END_STORAGE_DESC()
So that would be all! I hope you liked this tutorial/article/whatever and found it useful, even if not, you can still download my code here: [Shell Based Entity Save System]

Wednesday, February 3, 2010

I'm probably not meant to be a game designer (will update this post with your Ideas)

Full of enthusiasm I have reached a point in which my engine is good enough to make a simple game. Collisions work, rendering works, it's easily scalable, you can add new objects into the game without any hassle and everything is just peachy.
It also means that at this points I lose all the Ideas for a game since I don't want to make a clone nor an uninspired game. A miniLD competition would work out great since right at this moment I have just finished the engine to such a state that I don't have any "illegal" code and it's still easy to make a game in it.
Yesterday when I was talking on IRC complaining about this to people who were there (and couldn't escape my complaints if they wanted to talk to other people on that channel) I had a wonderful Idea (yes, the I is capital for purpose):
You play as a cricket.
What an extraordinary Idea it is! It only lacks something minor to complete it but the foundations are already there! One of the participants in the conversation (whose name I won't mention for his own safety and not because I forgot it) told me: "what if he played musics to get magical powers or change the terrain?". Now that's what I call inspiration! The game idea still lacks something though but so far we got this:

Main character:
  -The Cricket
What he does:
  -he can jump (oh yeah, this Idea was all mine, I'm that clever)
  -plays music to get magic powers (that guy's Idea)


yeah... just a few minuscule thing are missing but I guess I can make a game out of this. Still, small details can destroy huge buildings! So I'm asking help from You, the reader, to fill in those little things like the story, setting, enemies, and the rest of the gameplay that you would want to see in this marvelous masterpiece.

I'm gonna update this space with your awesome Ideas (yes, this I is also capitalized for purpose)

To those that would want to help me here's a concept drawing of the main characters. Those that don't want to help me please don't look at it.

The Cricket:
I know he may look innocent but he's a deadly killing death machine.(I'll probably make him look more deadly in future revisions)

The Ki-Dan-Shoo:
His wrath at humankind was so powerful it opened a third eye with his hate-chakra. Also he has a scar on his eye which hints that he is evil.


What we've got so far:
Game Name:
Main character:
  -The cricket - Loyal servant of the Ki-Dan-Shoo, also he needs a name.
Secondary Characters:
  -The Ki-Dan-Shoo - a sentient blade of grass with three eyes, the third one being his chakra-eye(PsySal's Idea)
What he does:
  -he can jump (oh yeah, this Idea was all mine, I'm that clever)
  -plays music to get magic powers (Thedaian's Idea (aka That guy))
Story:(contributors: PsySal, Demize, Anonymous)
  -His master, the Ki-Dan-Shoo, who seeks revenge on humankind has ordered our main character to kill all humans. His wrath goes all the way back to his early days when he kept the crickets as pets. He raised them from eggs taking care of them every day. As he lived on he had too many crickets, so he he gave many away hoping that they would find a better place, for his horror he discovered that those unfortunate souls were used as food for Human pets. His blood boiled inside him wanting vengance! Through incredible stunts, plot twists and awesome action the fate of the humankind will be decided In Space!