Wednesday, February 25, 2009

Multithreading, to be or not to be

We are in the age of multicore CPUs. Instead of more gigahertz we now have more cores, but most applications are still not ready to exploit them. The problem is that such processors requires multithreaded applications to get all the benefits to show their true power. And multithreading is a nasty bussiness.
A friend read my ideas about how to optimize my game for multicore by adding threads and recommended me this article, which in turn I recommend to you.

Tuesday, February 24, 2009

A look at Blender 2.5

The next Blender version looks cool, and I mean it, because it will have a new UI, but also its new features are really interesting. You can see here a briefing about 2.50, a major release that I have no words to describe. And that is literally too, because my english is not enough to properly express what will 2.5 mean in Blender's history.

Saturday, February 21, 2009

Howto: RPG dialog system

Well, Im going to explain now how the dialog system in my project is implemented.
But first, let me talk a bit about the project. The Ark is a very traditional RPG, although I use 3d features, the main view mode is isometric like. A 3rd person view is also provided for those used to more modern times. It is inspired in old classics like Fallout 2, Baldur's Gate and Diablo, looking to reach an adequate balance between action and quest solving. The secondary goal is to produce a game using only free software. Windows version is developed and compiled using Code Blocks+gcc, 3D models will be produced exclusively with Blender and all libs used must be free software. Once cleared this, lets go to the point.
One of the most important things in a CRPG is the dialog and the quest system. For example, the Oblivion is a great RPG, only degraded by its poor and stupid dialog system. Take the same game mechanics, but with a decent dialog system and you get Fallout 3, an even greater RPG.
So, how to implement such system? Without further ado, my solution.
The base of everything is the scripting system. Im going to suppose that you already have one, with access to game entities attributes. For the dialogs, I use a a container-like class, which holds the data of the current dialog phase. The dialog script receives a parameter Q, signaling where in the conversation are you and returns an NPC line, and several player reply/Id pairs. Initially I pass "root" as value. When the player chooses an answer, Q takes de value of the reply id code and the script is executed again. You can also make the script return a list of values instead of using a container.
This is how an script looks in a sort of pseudocode:

if q=root then
set npc_line *Starting line*
set player_reply_pair *Reply 1*,*question1*
set player_reply_pair *Reply 2*,*question2*
else if q=question1 ....

and so on. This is the simple version. Things get complicated when we mix attribute/skill dependent replies. Use your imagination...
Then comes the quest part. My solution is to have a list of flags, a sort of variables that hold values. A dialog script can consult this list to see if a flag exist, if not, it is added. another pseudocode example:

else if q=accept_quest then
set npc_line *Good, go to do what I said*
create flag Quest1,active
set player_reply_pair *Ok*,*ok*
else if q=questionX....


Seems easy, isnt it? The method works, but I would like to hear your opinions to improve it or a better way to do this.
And here you can see the system in action, four youtube videos:







Thursday, February 19, 2009

Shameless self promotion

I have mentioned before that I am working in a game project. Well, I have updated the official site (at last!) with a few details about game world. Im open to suggestions, just leave a comment in this post.

Wednesday, February 18, 2009

Ogre 1.6.1

A few, well, actually a lot of, days ago, was released Shoggoth 1.6.1. In some way I missed this one, but don't worry, the guilty of this failure have been adequately punished. Worth to mention in this version is the new memory allocator, which is supposed to be faster. I have heard that somewhere else, but can't remember exactly where.
So, it is time to officially consider Shoggoth as a mature branch. If you are still working with old 1.4, then you should think about porting. It is a mostly painless process.

Tuesday, February 17, 2009

New engine

Jdavis, a Gamedev.net forums regular, has released an early demo of his game engine. The screenshots looks nice and it aims to be quite easy to use, yet powerful. But it is not the choice if you target low specs hardware.
Also, I can't exactly figure out under which license it will be released.

Friday, February 13, 2009

Bye, Info 2009

Today Informatica 2009 ends. It has been a very intense week, meeting people (very few people) with similar interest, visiting the expo and even touching technology that I have just read about. One of the most important things of participating in an international event like Informatica 2009 is that you meet really brilliant people.
This guy in the PC is Farsthary, the man (some peplo insists that he is not a man, but 20) responsible for bringing volumetrics to Blender, and planning a lot of interesting stuff that you can see in his blog.

Thursday, February 12, 2009

Open source game design

Excuse my long absence. I have been busy and right now Im in the middle of the most important IT event in my country. I will post about this later, because now I'm writing this standing on my tired feet.
Today I discovered in Slashdot an interesting article which I haven't been able to carefully read: open source game design. An interesting concept that perhaps I will use in my project.