Friday, December 24, 2010

Covii Challenge part 2 update log: Friday

Day 5-Thursday:
Update 1(2:12):
  • The Final day! The Final Hour! The Final ... ok nvm
  • I finished the project about 15 minutes ago and sent it for review. I'm fairly confident they'll like it even though I personally would add some things like transition effects, DoF and Anti-Alias. I would probably rework my particle engine to allow particle area segmentation with which I could add some more realistic water effect to the second program (I ended up making two programs since I don't have much time and couldn't implement the transition effect).
    And Here are the screenies!
As you can see I fixed the low saturation problem!


Yeah, I know the trail doesn't look perfect, but believe me, it's not at all that noticeable  when it's running.

  • In retrospect I feel like I wasted far too much time resting, even though this project was a bit strenuous, as I must get used to working under such pressure if they are to keep me in the company for more than a few days. I also made a few rules that should help me survive and lead a healthier lifestlye when working:
  1. Sleep Early,Sleep a lot!
    8 hours of sleep a day is a must, even if it means not playing my games or watching movies before going to sleep. Sleep deprivation and lack of a standard sleep hours were one of my biggest mistakes I did during this challenge. An afternoon nap and a night's sleep is a must!
  2. Eat Healthy Food! (and longcat is long)
    As obvious as this sounds eating healthy things is actually a problem for me. Not because I don't like it, as I do enjoy a salad every once in a while, but because I don't find time to prepare proper food and resort to eating tuna or chocolate cream sandwiches all the time. I've noticed that in days I went out to eat in a restaurant I actually performed an incredible lot better than in the days I eat what basically is unhealthy garbage.
  3. A rest from programming is a rest from computerI've learned that if I work for a few long hours and then rest by playing games or watching movies, I don't actually rest as well as if I have taken a walk, it's also a lot more difficult to come back to . I still fall into the trap of playing games or browsing websites when I should leave the pc alone for an hour or two, so it's something I'll have to work on.
  4. Animation is Concentration! (but I'm programming!)Anyone who ever read Richard Williams "Animators Survival Kit" probably knows the quote "Animation is Concentration" inspired by Milt Khals' angry outburst  at Richard when he asked him if he listens to any music while working. This was Milt's response: "F-F-F-For Ch-CH-CHRIST'S S-S-S-SAKE, GG-G-GG-GODDamnit! WHAT A F-FF-F-FF SSSTUPID QUESSSTION!!! I'M NOT SMART ENOUGH TO THINK OF MORE THAN ONE THING AT A TIME!!".
    Yeah, Milt Kahl didn't listen to music while he was working and neither should you!
    Even though I'm a programmer this still holds. Music and any other sounds distract from work more than you realise and I've come to experience this first handed not only this week but along my life as well when I'm studying or working on my own projects.
    Turn off Messenger (or put it on busy and disable all notifications), close any youtube tabs you have open, close Winamp and listen to the silence.
  5. Get InspiredMy biggest problem when working is that I easily change focus, however this also comes with another trait of personality: I get inspired really easily. Every now and then I look for videos made by game "celebrities" like some of Chris Hecker's presentations where he talks about the tech they developed for Spore, or interviews with indie devs like the Wolfire team. Those videos always inspire me to work harder so one day I could achieve what those people have achieved. I also read a lot of tech presentations, especially those made by Valve. Those are also a good source of inspiration and you gain invaluable knowledge even if you can't replicate it at the moment.
  6. Keep things mixed up!
    There's one thing I'm prone to and that's fatigue. I can't work more than a few days on one thing. My solution to this problem was actually quite easy to come by: get a hobby in an area completely unrelated to programming. In my case I always liked to draw so this problem was solved by itself. Every now and then I grab Photoshop or Blender and just do something in it. Having activities spread in unrelated areas is really good for avoiding fatigue, and it even may bring advantages. I for example am more of an Game Engine fundamentals programmer, but being interested in modelling drawing and animation made me interested in graphical computing which in turn gave me this opportunity to work at CoVii!
  • I guess that's all of them. Those are the rules I set for the future. Some of them I've been following already, other will take a bit of time before I get used to them, but if I manage to follow them all I should perform my best at work and avoid procrastination while I'm home!
  • On Sunday I'll probably upload a video of the program in motion.
So, this series of updates is finally finished. I hope those of you that read it enjoyed it as well. From now on this blog is going to get a bit less active at least until Febuary which is when I'll move to a new apartement.
This was Mikolaj Kuta, AKA Spliter
Seeya!

Thursday, December 23, 2010

Covii Challenge part 2 update log: Thursday

Day 4-Thursday:
Update 1(2:49):
  • Almost  3 in the morning, I've been working for the last hour or so with brief rests to watch some youtube videos from my subscriptions. If I'm lucky Batman9502 will upload his LP videos for his Ocarina of Time and Megaman Legends 2 in less than half an hour, if not then it's off to bed  without a good-night cartoon :(
    Anyway, I digress. Here's what I've accomplished in the last hour and a half:
  1. Cubes that light up softly 
  2. When the mouse passes them not too fast and not too slow, they fly in the direction of the camera missing it by just enough not to notice any clipping.
  3. Trail effect on the cubes is finally noticeable.
  4. Added a very nice looking background that changes softly over time(only noticeable without cubes on the screen), I did this using a simple gradient background texture
  • So, not that much done but these are the new accomplishments. As usual I also fiddled with the framebuffer order and some colour and opacity, the colours look too desaturated for me in the current state; changed the bloom effect settings so it's a lot more subtle; changed the way the particles render so the final image looks softer, but at the same time allows me to illuminate the particles I need above their texture color. I also removed the specular highlight. It was far too strong even on the lowest settings, so I'll just stay with the very subtle sphere map.
  •  ANYWAY! Here's the product from few hours ago:
 Randomly Lit cubes with random rotations FTW!

  •  And here's the product from a few minutes before I started writing this entry:
 You see what I mean by too desaturated?

  • The background has a very nice color but the cubes, even though they have the same hue, are a lot more desaturated and I'm still trying to figure out why. I'll probably fiddle around with the light and the 2nd pass to add more red and blue
  • So! I'd say this part of the project is quite close to being done, all I have to add now is to make the cubes rotate when you pass over them with the mouse! Then it'll be off to the second part of the challenge where I'll have to add the same water-y effects to the particles as in the Yellow Submarine from the previous challenge and create another particle system that creates the particles near the mouse to give a similar effect to the one in the video they gave me. If I'm done in the early afternoon then I'll add some extra flavour like the screen shattering into a hundred of small cubes when changing from one effect to the other. This would be quite easy to do if I had the time since I render most of everything on Texture-bound FBOs.
  • I have one regret towards this challenge: I have to copy someone else's work. Not exactly, but since they gave me a reference I've been following it quite strongly so I don't sidetrack as I usually like to do. If I had more time I would've made some significant changes like adding Anti-Alias to the scene so it would look a lot more polished. I would've also added interesting physical effects to the particles, like visual effects like changing the hue of the scene or make the cubes actually behave "softer" using shaders (stretch them in the direction they're flying for example, and expand a bit when rotating really fast)
 Update 1(15:07):
  • I sent my (hopefully) future boss two of the screens I had here on my blog and he liked it! In fact he liked it so much that he said he wants to close the deal! I'm going there to work with them for one day and if they like me I'll be working!! I'll be part of a team that makes awesome projects and lets me get better and better at what I love to do! YEAH!
    Ekhem. Now we resume our scheduled programme:

  •  I added mouse speed dependent rotation to the cubes using cross product between the mouse current, and previous positions and the particle coordinates. Now the cubes rotate properly, if you pass the mouse over them slowly they'll rotate slowly in the direction the mouse is moving, if you pass your mouse a bit on the side it'll rotate on an angle perpendicular to the mouse movement in relation to the particle.
  • I also render the trail above the particles but with much more subtlety. This gives them the appearance of delicate semi-translucency especially when they move fast around the screen, it also helps softening the scene giving it a more...uh... ethereal(?) look?
    Here are the screenies:



  • There are still some thing I would like to try out like making a DoF effect using part of the blur shader but make the blur stronger the closer the particles get to screen, I'm not sure if I have time to do that since I still need to get working on the second part of this program which is making much smaller cubes that light up stronger the faster they go and behave like if they were in water. I would kinda prefer no to do that since I really need a good rest.
    Also I would follow my friends advice and add some anti-aliasing to the scene since it doesn't look that good on screenshots. Luckily this isn't such a problem when actually playing around with the program so most passers-by wouldn't notice any difference.
    One thing that popped up into my mind (even though unrelated to the challenge) is to make some effects using metaballs. I know it's made using the marching cubes algorithm but I'm curious how the actual mesh would be built from that.
  • I just noticed I wrote "Tuesday" instead of "Thursday" in the title.
    Whoops!

Wednesday, December 22, 2010

Covii Challenge part 2 update log: Wednesday

Day 3-Wednesday:
Update 1(2:10):
  •  Ok, I've spent three productive hours playing around with shaders, lighting, rearranging FBOs and generally playing around with everything. Here are the progress screenies:

Boring!


Basic textures, yay! Also, my eyes kinda hurt, red+blue=bad >:(


The beginnings of bloom. AUGH MY EYES!!!


MY EYES! MY EYES! MY EYES!!!


Ok, now it's not so bad, but still looks like crap.

  • As you can see I didn't do much. But only the last one is a true bloom effect. Even though it looks like crap, and isn't as strong/diluted as I would like it to be. I'm starting to get the hang of the shaders, since I've taken a nap I'll probably work another few hours before going to sleep, but I'll take a little rest now from the project.
  • Anyway, I updated my list of things to do. I also updated the list from the previous update here's the resume of what I did today:
  1. Finally Added real bloom (even though I'm not completely happy with it)
  2. 3D model particles
  3. Working quaternion rotation lib
  4. Added lighting
  5. Played around with various effects.
  • I can't say this is bad but I also would like to have made more both today and yesterday. Optimally I would have already achieved good looking bloom, added at least one of two physical particle effects and already added cube mapping. Still I'll probably achieve at least 5 out of 6 planned features by tomorrow noon so things aren't as hopeless as it seemed to me. However tomorrow is a big day since the basic functionality should be finished and I'll start making some more advanced stuff as well as fine-tunning.
 Mini-update: Disco Ball!! Well, sort of.

This calls for some awesome music:
http://www.youtube.com/watch?v=Awzrax7UcV8
Only link since youtube won't let me embed the vid :(
Watch it anyway :D

Update 2(11:44):
  • I fell asleep around 8:00, it's now 11:44. Damn cleaning ladies and their racket. Can't sleep now, I'll try to work, but probably I'll take a nap in the afternoon.
Update 3(14:55):
  • So, after some time feeling dizzy and with a minor headache from sleep deprivation I started blaying around with various effects. The current state of things looks pretty close to the video they gave me as reference. I noticed though that in the video the presentation also used DoF shader. I made some additions on my own of course, like subtle sphere mapping to give a more glossy appearance to the cubes, I also added an overlay texture which scrolls slowly enough not to be noticeable but still gives a faint effect of movement to the scene. Most probably my final work won't look as good as the original but hey! I'm competing against someone sponsored by Toyota, with quite a few years of experience in the field and I'm not that far behind!
The scrolling effect I mentioned earlier:

  • The sphere map is costing me some nasty bright seams on the chamfered edges I used to smooth the cubes, I'm not sure what to do, I'll either have to sacrifice smooth lighting or the sphere map... unless... hm... I might use the same model but with different normals for the sphere map pass, and a different one, with smoothed normals for the light pass!
  • Edit: No, I can't do that, stupid blender and its automatic normals!
  • Edit2: HAHA! being smart as I am I decided to export the cube model two times, first time with the chamfered edges but flat on the cube sides and another one with the rounded edges. Then I'll just copy the normals from the first one to the second one and voilĂ ! I have two types of cubes :]
  • Edit3: Once again: DAMN YOU BLENDER!!! I don't want any stupid optimizations! I want the normals and vertices exactly the same always!!! AGRH. Because of this I can't have fancy sphere map.
  • Edit4: The seams are caused by the light, now I'm mad >:(
  • Edit5: Ok! Finally got rid of the nasty seams, I removed some detail from the edges and it seems to work fine now and I didn't have to sacrifice neither the sphere map nor the smooth light!
  • Also: sorry for anyone stumbling upon this blog with a 56k connection. I really do feel sorry for you.
 Update 4(23:00):
  • I ended up taking a longer rest than I wanted, it's 23:00 now and I haven't touched the program :(
    I disappointed myself quite a lot with this, especially since I haven't even slept properly yet. I hope that I can at least have a productive night, or productive morning, anything as long as I can deliver the program by tomorrow afternoon!!

Monday, December 20, 2010

Covii Challenge part 2 update log

Long story short I'll be updating this post every now and then with the development info, thoughts and screenshots.
Edit: I moved the Wednesday updates to another post since the scrolling up and down to read anything is getting ridiculous.

Day 1-Monday:
Update 1(15:32):

  • Started working on the project yesterday but only had half an hour for it because of uni projects, I added support for FBOs, it's pretty sweet, also added some basic trail effects.
  • Today I woke up at 12, that's what I get for sleeping only 4 hours yesterday, I  started working on it almost immediately. Using a bit of tutorial help I made a blur shaders, works pretty sweet, today I should also be able to add true 3D objects to my particle system (so far it only supports 2D), this also means I'll have to rewrite the existing effectors.
  • Added the blur effect to my previous FBO rendering. My first post processing shader! It looks pretty sweet and it's quite close to the final look I'm going for in terms of trails.
Here's how it looks
  •  Damn, I noticed that if you look really close you can see a little crossing on the blur, it isn't noticeable in the movement through, but I'll once I finish the project I'll have to fix that.
  • Also wasted about one and a half hour trying to make the RECTANGLE textures to work... wasted because they still didn't work even though I used someone else's code. Either FBOs don't work with NPOT textures (which I think is odd since I've read somewhere they work fine) or my graphic card doesn't support them (which would also be odd since it's on the supported extension list) 
  • When starting to work on the new particle system I realized the particle rotation need to be quaternions to avoid gimbal lock. I don't have a quaternion lib compatible with my current math lib so I'm sad because I have to make one :(
Update 2(18:33):
  • Added the quaternion support and supposedly the particle system should work with 3D objects (it still supports all the existing features so I didn't had to rewrite the 2D effectors). I'm starting to get worried I won't make it for some reason even though it's not that difficult. I've been trying to relax and stop working for a bit but having to do this project all day and then work on uni stuff all night isn't good for me. I really need this job so I can't just rest for a day or two, I want this working Wednesday midday at the latest, after that it's fine tuning and Thursday I'll probably deliver it at least to see what they want me to change. They liked the first program I made for them but if I don't get this job I'll have to go back to Poland since I don't have any money left. Yeah, I'm kind of depressed right now, it'll pass after I take a rest.
Day 2-Tuesday:
Update 1(10:21):
  • I just woke up and I'm feeling a lot better now! Yesterdays depression most probably was only because I've been working on it a lot of hours straight without doing anything else. This is something I've learned to avoid in the past since it clouds your mind and you get into an Idea loop. Normally I rest every few hours for an hour or two to watch a movie, play a game or go for a walk to completely get away from my PC and get refresh my head. The reason I didn't stop yesterday is because this challenge is letting me a bit nervous since my life depends on this and all, but I should be able to avoid making the same mistake today.
  • I made  a small list of features I want implemented until tomorrow noon. Here they are:
  1. FBOs ready to write Post Processing shaders (done)
  2. Trail Effect (done)
  3. Particle System ready for 3D with quaternion rotations (done)
  4. Bloom (almost there)
  5. Requested particle effects (quarter way there, I could use my previous effects and add 3D support for them)
  6. actual 3D modelled particles (done)
  7. background movement highlight (I'm waiting for confirmation if it's necessary, I'll probably implement it anyway if I finish ahead of schedule)
 Update 2(14:24):
  • Finally added 3D, model loading, display, lights etc.
  • I discovered there's a problem with my quaternion lib and I'll have to redo most of it (on any rotation the entire scene disappears). I'm starting to wonder if I really need quaternions or would axis-angle be enough. Still I shouldn't have that much trouble since I know I had somewhere a working quaternion lib, I just don't know where. I'll have to go into my backup folder and spend some time looking....
  • Made a screenie so you can see how it looks now:
I know the cubes don't look like much so far but at least it's something! 

Also I still have the grids I used to orient myself
  • Can you believe me I spend over an hour before I could see anything? The beginning is always the hardest part for me when I don't know where I am and my references aren't drawn, since the problem could be anywhere from badly configured viewport with farclip too close, to camera orientation, to (in this case) drawing in a FBO instead of drawing to the screen!
  • I'm gonna take a break now. I need to eat and rest, luckily I don't have any uni projects today night so I'll have a bit more time to work later. I really hope I can finish this for tomorrow noon, otherwise I would be really disappointed with myself.
  Update 3(19:39):
  • I feel sick. Headache high temp and nausea... ugh... I don't think I'll be able to finish things until tomorrow. I'll take a nap and if I feel better when I wake up then I'll continue making the program, if not I'll wait until tomorrow.
  Update 4(21:56):
  • just woke up, I feel a lot better now even though still a bit drowsy. Time to work!
  Update 5(23:17):
  • GOD. DAMN. PRECISION. ERRORS!
  • also stupid c=sin(aangle.angle*0.5); It's supposed to be cos @_@. Bot h of those have cost me over one hour of work that could have been spent making shaders or particle physics or anything at all other than rewriting my quaternion library!!

Covii Challenge part 1 and other updates

Hello!
Another blog update (yeah, I've been doing that a lot lately haven't I?).
If you've seen the video on my last post to the end you'd know I'm desperately looking for a job right now.
With extreme amount of luck I've found a job offer for the C++/OpenGL programmer!!!
The company name is CoVii from Computer Vision Interaction.
Basically they develop applications that allow interactive surfaces like an interactive wall or floor where the content responds when a person walks by.
I went to an interview there on Tuesday and apparently they liked me (either that or they pretended to like me),  but they wanted to test my skills out since my portfolio isn't that impressive as I've let the university and lack of money consume my will and time to work on my projects little by little (if I didn't have any financial trouble I would probably have made by now a graphical equivalent of Crysis).

They gave me two projects and so far I've completed one of them, it took me about 2 days. Considering I had classes during both of them and uni projects to do, I'd say I've done it pretty quickly. Maybe barely over 8 hours of coding.
Anyway, I'm rambling. Here's the video of the project in motion:
 


 


As you can see it went quite well and I'm happy with the results (and luckily so are they) but they want me to do another one. Now the next one is a bit harder not only because I have a ton of uni projects to do, as well as being chrsistmass time for which I'll go spend a day or two with my friend and his familly (with whom I've spent last years' Christmas and it was awesome), but also the seconds project covers more advanced OpenGL topics such as post processing and shader effects.
Now I've done some simple vertex and fragment shaders before, unfortunately what I've learned from them is not as much as I would need for this project (I really hope the boss isn't reading this blog right now, even though he said he's read it when he interviewed me...at least I think he's the boss, I forgot to ask him...).

What will happen in the next few days is that I'll have a couple of day long working sessions during which I'll be furiously studying the advanced OpenGL aspects. Today I've learned how to use framebuffer objects (finally! I've been meaning to learn about them for weeks but the damn uni has me doing chat programs and encryptions and stuff). FBOs are damn useful, I've managed to create trail effects without even changing any existing code nor touching shaders!
So far I've planned using cube mapping for very subtle reflections, shaders on models for stronger light effect, I'll also use shaders combined with FBOs to create post processing effects like depth of field, blur for the trails and bloom.

That's a lot of things to learn in such a full week, but considering I've done kind of similar things before, and understanding how all of this works, I'd say I have a pretty good chance of making them want me in their team!

oh... btw, I know this blog is displayed on the LudumDare through RSS, so sorry for the fellow LudumDarians that I don't make any actual game updates! I hope you're ok with life ramblings and mild programming stuff!.

I'm off!
~Mikolaj Kuta AKA Spliter

Sunday, December 5, 2010

Urban Stroll

Hello!
Just a quick blog update to show I'm not procrastinating as much as it would seem.
This time it's actually a VIDEO blog update!
sooo... yeah
Enjoy


As I mentioned I'm looking for a job so until I get hired, or at least until someone will give me a job interview I won't be able to make a tutorial. I'm also extremely busy with university projects, If I want to do anything of my own it means to stay up till 4am.

That's all for this blog post.
I'll see you next time!

Sunday, November 21, 2010

Desert Bus for Hope



Visit Desert Bus For Hope Here
Desert bus is a charity event created by LoadingReadyRun in which they play the most boring game ever created: Desert Bus.
You can see them play it live on their feed at the desertbus site by clicking on the big Live Feed Drivercam button. I really suggest you do it.
All of the donations are gonna go to the Child's Play foundation.

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, November 2, 2010

Read this article

Eurogamer hosted the following article:
http://www.eurogamer.net/articles/2010-11-01-the-fall-of-realtime-worlds-article?page=1
I think you should read it.

It shows well that in the gaming world not everything is fun and games (no pun intended).
APB wasn't on my hype list, and after seeing some gameplay I immediately recognized it wouldn't be as fun as it first sounded, but still it was made by people who love games and wanted to make a great game, which saddens me because it turned to be their demise. Even though I wasn't impressed in the game it's still hard to believe it destroyed a company and put over a hundred people on the street without jobs.


Good luck to everyone that used to work at RTW, I hope you won't give up.

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.

Friday, May 7, 2010

Learning GUIs and stuffs

So yeah, I decided to finally take learning a GUI seriously so I grabbed Win32 and started learning it:





Huh? What's That you say? That's got the wxWidgets logo on it? Yeah, you're right. Win32 is shite to program in by my standards so I grabbed Qt!

And so I started learning Qt. Unfortunately after one day trying to install it properly it still gave me errors about bad entry points for DLLs and shit like that so I decided to grab wxWidgets and the prebuild libs that you just instal and run (LIKE IT SHOULD ALWAYS BE WITH EVERY SDK!). But maybe it's just me that don't find the pleasure in compiling an SDK for half an hour then realizing it still won't run, and then comiling it again and again only for it to give you more and more elaborate error messages when you try to run your program.

Anyway. The point is: I'm learning to work with wxWidgets which means Soon I'll start working on Litterbox SDK per se (Level editors, animation editors, exporters, importers and converters, all with a GUI!).

There is a bad side to all of this: I'm gonna lose my scholarship for next year because of a new law that's been passed in detriment for immigrants like myself. So unless a miracle happens I'll have to quit University for at least one year and get a job, or two jobs.

If anyone has any experience with job hunting as an experienced but not yet professional programmer I would gladly hear it.

See you once I do something worth posting here like some progress on the editor.
~Spliter

Thursday, March 11, 2010

Chiustream tomorrow friday at 22:00 GMT

Hello!
I know I said I wouldn't update this blog until I have something of my editor to show for it but I forgot about one thing:
Tomorrow, Friday 12, at 22:00 GMT or 5:00pm EST will be held a Chiustream.
"What is a Chiustream?" you may ask.
Chiustream is a live 1 hour contest held by Bobby Chiu from Imaginism Studios (the ones that designed the characters for Tim Burton's Alice in the Wonderland).
The contest is about art. Drawing, painting, digital, traditional, anything! The theme of the contest is given at the start of each Chiustream, after that you have one hour to paint and to submit your artwork to Sketchoholic.com and then you have about 10 minutes to vote for your favourite work (apart from your own).

"Why is it called ChiuSTREAM?" Well, that's because it's a live stream, that's right, Bobby Chiu will be painting alongside with us, and if this chiustream is gonna be like the other ones the prize will be the paining he's drawn.
The themes are mainly asking to draw a character or a creature so it's always interesting to participate. Even if you don't want to participate you can still lurk on the ustream, listening to his sexy and overly cheery voice, since he's an extremely charismatic person and often says things that stay with you for a long time.

If you're interested then visit the following site:
http://www.sketchoholic.com/Talent/member/my_contest_items.php?ContestID=292

I hope to see you there and even participate! (I won't be joining the IRC chat since it doesn't work for me on ustream and ustream channel blocks mibbit IRC client)
I'm out!
~Spliter

Monday, March 8, 2010

If you fail: fail, and then fail again.

Programming without planing everything through has finally taken its toll. I have to scrap most of the editor code, leave the PC, grab a bunch of paper sheets a pencil and thing everything through.
This time the problem was that I didn't differentiate the edit mode from the game mode, which lead to serious complications (the code worked fine but the logic behind it didn't).
In this version you could change the entities on the fly without having to worry about it making any sense later but on the other hand you could also edit entities that shouldn't be editable and once a game run it preserved its state and didn't reset.
What I'm gonna do now is use the game engine as it is, take out the editor related stuff and rebuild it so that while editing will take place inside the engine, it won't be held at game runtime. I think it'll be easier to manage editor logic like this. All the previously existent features should still be possible right now, but running the game during the edit mode won't be possible that easily, it'll have to save the level, reset the world and load game from the saved map, and then do the same when entering edit mode. It'll still be faster than closing the program and loading the map again since all the textures used in the map will be kept.
This is also another thing my engine has: preserving resources between levels. After a level finishes loading it'll just delete the resources noone asked to load and thus shortening the loading time.
That's all for today. I doubt I'll update this blog until I make significant progress.
See ya in a week or two!
~Spliter

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

Tuesday, February 23, 2010

No net no updates

Yeah, pretty much what the title says. I've been without net for the last few days at my condo and no one apparently is doing anything to fix this.
I have some nice things going on right now when it comes to my game. First I finally thought of a map saving and loading format that is easy to read by eye and modify (it's a xml looking type thingy, with objects and arrays and whatnots).
I've been also experimenting a bit with the art style for my game, it's actually pretty difficult to come up with something that isn't a complete ripoff either of World of Goo deliciousness or Patapon simplicity. I don't really have my style that I'm happy with so I'm reduced to using other peoples styles and experimenting with them. Unfortunately I don't have the artistic skill and training in making backgrounds/level art to actually make something that looks good and this means I'm gonna have to make a lot of drawings/paintings in photoshop or inkscape before I'll do some actual in-game art.
I'm gonna post some of the experimental art here and check the reactions it gets. This means this blog's gonna be updated with random blurts of art and only occasionally with actual new game mechanics, at least until I figure a good art style.

...ok, I'm gonna stop rambling now
SO LONG!
~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!

Sunday, January 31, 2010

Back to game devving

Yes! I am back! I haven't been away for long, 3 days is not much but if you consider the entire week before announcing the break in which I wrote less than 100 lines of code then I have rested considerably.

Taking time off and looking at things from another point of view (the point of view of a person that's not doing anything constructive or work related except for a small job-thing) I finally found a way to do what I like doing (making games) without losing sight of what I want to do (make games). This might sound obvious for many but it wasn't for me. You see, every time I wanted to make a game I started making an engine practically from scratch, an engine I wanted to be reusable robust etc. I was dumber than the dumbest guy in Dumbville, the capital of Dumbland. Every single little thing had to be implemented by me (on top of wanting too much things I didn't really need) which led me through many failed attempts of reinventing the wheel and making unfinished libs I didn't really need. Whenever I asked myself "Is it worth it to do everything by yourself?" I always answered promptly "Yes! I can learn tons from it!", and even though I indeed learned many things ultimately it kept me behind. If I had first made the games and only while making them I tried to implement the missing functions not only I would learn more but I would have actually made something worth showing to people!

So what I've come to create a few commandments for myself:
-Thou shall not program what is not needed.
-Thou shall try to use freely available libraries for thy needs before writing your own.
-Thou shall not reinvent the wheel if it's irrelevant to thy progress!

I think that's all of them.
Another good thing that came from the pause in programming my engine is that now I want to work on it so I can finally start making a game I planned! This is mostly because I realized how tedious it is to write GUI applications without a purpose! Passing those few tutorials made me really want to make something useful again, so I already finished my collision detection engine (I call it finished but I'll be adding more functionality later) and now I'll just write the display layers and the game manager code and this will be it for this engine iteration(I already lost the count).

Thursday, January 28, 2010

Taking a break from Game Dev

Yeah... Like the title says I decided to finally take a break. The reason behind this is that mind have become saturated from thinking about how to integrate new parts, about what to do with my engine etc. I won't, however, take a break from programming in general. Two days ago I became interested in simple web development and started reading some tutorials on HTML as well as CSS. I might also learn PHP later on, as I believe this might help me out to create a site for my little one man studio, but that's reserved for future at least a year ahead. I won't need a site until I actually make a game I want to show instead of the little crappy ones I make to test my engine functions that provide no more than 10 seconds of entertainment....which is mostly because of the graphics, not the playability of it.
Today I found a download I made in summer when I desperately wanted a GUI library despite not needing it. It's called JUCE, so far it looks pretty great and I can definitely see the possibilities for it's use as it's cross platform, free and is open source! My plans for it involve learning how to use it and make some programs so my mind won't become saturated with working on my engine. Unfortunately I won't be able to use it if I go commercial since I'd have to buy a license for 400$ which isn't something I would be willing to spend right off the bad on one license until it proves to be valuable enough and if the game sells enough to let me use it.
If any of you know of a good GUI library that doesn't require me to be open source I would highly appreciate if you told be about it (especially if it looks just as sweet as JUCE does)

Here's an old post from Scientific Ninja
Make Games not Engines
It made a little discussion going on in my head and although it didn't made me stop making my engine and start making games, it cleared my head a little and I decided to write the functional version of Litterbox as fast as I could and add more features while I'm working on a game (which I'll either chose from my list of unfinished games or invent new one after I return to game deving).


That's all for today! I'll see you next time!
~Spliter

Tuesday, January 26, 2010

What actually is Litterbox?



Yes, another gargantuan post, and as always I have way to much to say about way too few things.

A most of the times when I talk about my pet game engine I mention really vague stuff like I'm working on the entity system, or collision system or whatever. This works great during conversations as a quick way to say "I'm actually doing something that doesn't involve scratching my butt", however if you're reading this blog then you're either minimally interested in what actually my engine is about or you have too much spare time and are wasting it reading random blogs from the LudumDare feed(in which case you've probably already read more interesting blogs like Hamumu's or Bleck's and are just too lazy to do anything else than read the less interesting ones) and being this the case you'll probably won't mind if I describe how my pet engine works. If I'm lucky it won't derail as my last post did (yeah, originally I was just going to talk about my engine a bit, but then I got distracted and ended up doing a rant/tutorial about the ever so useful macros).

Sunday, January 24, 2010

My Little Litterbox and Advanced C++ Macro Tutorial

Right...
I decided to let the "El Poho" name belong to my past, since I already have a name for my one manned so called studio which is "Catbox Beta" I actually came up with a more suiting name for the engine:
Litterbox
The editor will be probably named after another cat related thing (catnip? nah... it sounds more like scripting language to me).
Litterbox inherited a lot from El Poho but it allows me to go a step farther. With every iteration of my engine I learn new tricks, I find new traps I must avoid and learn to plan more and more ahead. The results of 20 or so iterations of my engine, since the day it could barely run a pong game are quite notable. Everything is so beautifully modular I can add and remove components without much hassle. The two months I played with the Valve's Source engine didn't go to waste either! I learned the power and infinite usefulness of macros, this knowledge makes me cringe every time I hear those naysayers say that Macros are bad, and that they only replace consts and inline functions! WRONG! Macros are a nifty little way of putting text in places making creation of new classes a cinch! Get ready for some learning because here comes a class about advanced use of C Macros!