Tag: videogames programming

Trousers of Time… Again

It happened again. Last time was 2008, I received an interesting job offer and I had a really hard time in deciding what to do. Since the last days before Summer vacation I’ve been in touch with two friends that offered me a position for a leading a game programming team. For sure it was a once in a life time occasion, considering I live in Italy and considering the kind of workplace they were going to build and the name sponsoring the development.Since September I heartedly decided to join them in this adventure and I even start working for them in my spare time.
Sadly this morning I had to change my mind because we were unable to reach an agreement for the notice period my current employer required.
I feel sad and very dumb since programming videogames is my dream-job and I keep being nit-picking. The last time (and even the time before – not recorded here), hindsight proved me right, but I don’t think this is the case.
Somehow I also feel guilty, because I know I can make the difference, even though my videogame programming knowledge is a bit dated.
What to add more? Well, all the best to you, my friends, go and show the world Italians can make great games, too!

The ideal job

It is since long that Videogame Studios recruiters send occasional mail proposing jobs (for whose I am mostly unqualified, but it is always nice to be considered). This morning I received an opening in South France with the following benefit list

  • Christmas Bonus for all employees in November = about 1500€ for one full working year and on prorata for a shorter period
  • Salary increase each year for good performance (as an example in 2009, salaries increased of 7%, in 2010, salaries increased of 12%, in 2011, salaries increased of 8%)
  • Profit sharing system: Above a certain threshold, we give back to employees 50% of bonus gained on video game sales
  • Gift vouchers at the end of the year = 140 €
  • 19 luncheon vouchers per month of 8,80 € each (we cover 60 % = 5,28€ ), you pay only 40%.
  • 50 % of your public transport card will be reimbursed.
  • Retirement and health care – we take 100% in charge (for you and your family). And you perhaps know that the French state guarantee for a high level of health care insurance too.
  • We contribute to an agency that can helps you financially in buying or renting a flat
  • We will help you to find a flat to rent – we have a partnership with relocating company based locally (they help the candidate to find a flat, they welcome him at his arrival, help him with stuff like opening a bank account, discovering the city, finding schools for children, finding a good place to practice sport…..).
  • If you’re not speaking French, we would offer you French lessons to facilitate your integration
  • Media library : you can borrow consoles, videogames, DVD… for free (see with the ITguys
  • Free cakes and soft drinks dispenser.
  • As we are more than 50 employees, we work as a work council – Its goal is to propose you some discounted products such as theater tickets, trips, cinema…and another of its roles is to be the mediator between employees and employer if needed.
  • From our studio, you will be on the beach in 1 hour and you will be on ski slopes in 2,5 hours !

How couldn’t I be tempted? Especially by the 1 hour distance from seaside?!

101000

Tomorrow I’m going to turn 0x28. Undoubtedly it sounds better in hexadecimal than it does in decimal. And much more better than the “left-banana” if you happen to count in ASCII. Well, Xtè, right yesterday, let me note that nothing has changed in the Italian videogames industry in the last 10 years. There are still the same bunch of players. After Ubisoft no foreign company dared to set up a development studio in any part of our land. There are still two major players in Milan, still of the same size, and some minor players around the whole territory struggling to stay alive under the load of work and the inability to find skilled professionals at a price they can afford (or they are willing to pay).
I’m not sure if Xtè is completely right, maybe today we have some studio less than 10 years ago.
Those are sad considerations when talking about an industry that requires low setup costs, that shows no sign of crisis and is a well established part of the economy in most of the industrialized world. Investments in videogames industry are just risky. How much risky? Although young, this industry (as such) is only ten years younger than me. It has much road to go, but over the years “Things to Do” and “Things not to Do” have started emerging. As of today, I think that we learned to distinguish what is risky from what is not so risky. Porting is likely the safest activity in this field, followed by time to market titles. While the riskiest activity is the development of innovative and original IP. Most of the startups fail because they aim for the stars, trying to replicate the success of great games, developing new technologies, leaving free hands to the creative part of the studio.
You may wonder why I have this fixation with videogames. First I think it is part of my nature, maybe due to the fact that I met computer when I was 0xE i.e. an age very game-oriented. Maybe because to me programming is a sort of Lego-playing and therefore writing programs to play with is a natural consequence of this.
On the other side, it seems that I reached my top, from a professional point of view, when I worked in the videogame industry. The largest programs I designed, the largest team I led, the most entertaining problems I had to solve, many of the most skilled people I worked with… all happened back at the Ubi days.
Thinking about it, seems natural to me that a technologically advanced field, where many different disciplines are involved tends to attract the brightest offering them the most interesting problems.
I hate myself when I start complaining, so it is time to come out with a strategy for the future…. if I’m going to work on it in my spare time it’ll be ready and sound for my retirement (that, as I live in Italy, will never happen).

Finding the Right Path

After yesterday’s post, PaoloMan reminded me about how he and Piggi changed the CEngine pathfinding system simplifying the level design by at least an order of magnitude. In fact I had the intention of writing about their bread crumb pathfinding algorithm, but the good will got lost in some interruption of my editing. Anyway the matter is interesting and would be a pity to settle this matter with few lines embedded in another topic, so I am happy that my subattentive mind left out this yesterday.

In the beginning it was [http://www.maxpagani.org/CV-projectDesc-RS.html|Rainbow Six: Rogue Spear]. This was the first game of the studio on the then new GameBoy Advance platform with the quite ambitious goal of recreating the playing experience of the PC version of the game.
Pathfinding was needed for a number of actions of non-playing characters. Terrorists had to be able to find their way toward noises they heard, or to the last known position of their pals. Counter-terrorists had to manage to stay together following the player controller team leader.
A full A* algorithm would have been likely to be daunting on the poor ARM 7, so I devised a lighter system for all these pathfinding needs (well the idea was mine, but later I discovered it was already employed by other game engines). The idea was to define a routing network of nodes connected by straightly “walkable” rails. When a character needed to go from its actual position P to a remote position Q it queried the pathfinding system for the routing node closest to its position P. Then it asked the node for the next node in the network in order to get close to Q. In overly-simplified pseudo code it would turn out like this:

currentNode = findNodeClosestTo( P );
targetNode = findNodeClosestTo( Q );
walkTo( getNodePosition( currentNode ));
while( currentNode != targetNode )
{
    nextNode = getNextNode( currentNode, targetNode );
    walkTo( getNodePosition( nextNode ));
    currentNode = nextNode;
}
walkTo( Q );

Although the gameboy side of the algorithm was simple (even with extra code for a more realistic behaviour of characters) and fast (provided a way to quickly find the nearest node you can walk to) two non trivial problems had to be solved on the editor side.
First – networks had to be hand drawn on each map and – second – routing tables had to be computed for each node.
The reason for requiring manual work to draw networks was simply because we didn’t have enough programmer time to put the right amount of AI in the editors. One of the constraints of the project was the maximum reuse of GameBoy Color editors and tools we developed for [http://www.maxpagani.org/CV-projectDesc-RM.html|Rayman GBC] and minimally improved over the next two GBC platform games. This meant that editors didn’t understand the 3rd dimension.
So level designers had to hand draw the network taking care of connecting nodes with walkable line, trying to be very careful when more than one terrain level was involved. Also it wasn’t easy to test and debug the network. First you had to flash the game on a GBA and play it. A quick play throughout the level could not show any flaw even with a flawed network.
A properly designed routing network affected how realistic would be the movement of the characters, so networks were subject to several fine tunings.
Routing tables creation was not that hard, but the “easy way” my fellow programmers took first involved several hours of number crunching on the editor PCs. Level designers were quite mad at us for this daunting weight.
Lear produced a new and much more efficient construction algorithm, trimming down the network computation to a bunch of seconds.
But we were talking about Lara and the prophecy. Well it was clear that laying out routing networks was a big problem, luckily the AI needs for this game were quite modest. The pathfinding would have been employed for enemies to chase the playing character only after a walkable contact have been established.
PaoloMan and Piggi came out with a clever mechanism that allowed us to get rid of pathfinding networks and the related burden. The idea was to have the main character to drop virtual (and invisible on screen) breadcrumbs. When the chasing enemy loses direct sight of Lara (maybe she just turned around a corner), he can search the most recently dropped crumb for walkable way. If the most recent is not accessible, then he should go backward in time until he find a suitable one. It is like the main character defines a subset of a routing network just for the area where she is.
Talking about pseudocode, this approach would be something like:

// breadcrumb 0 is the current character position,
// 1 is the most recent and so on
breadcrumb = getBreadCrumb( Lara, 0 );
// find the most recent breadcrumb you can walk to
i=0;
while( !canWalkTo( breadcrumb ) && i < MAX_BREADCRUMB)
{
    ++i;
    breadcrumb = getBreadCrumb( Lara, i );
}
if( i==MAX_BREADCRUMB )
{
    // give up
}
// now just follows the trail
while( i >= 0 && ! canWalkTo( Lara ))
{
    walkTo( getBreadCrumb( Lara, i ));
    --i;
}
if( i > 0 )
{
    walkTo( Lara );
}

What I find notable is that, when working with games, standard solution to known problems (e.g. the A* for pathfinding) could be overwhelming or too daunting both to implement, to run and to manage. Having a clear vision of the needs of the game can point you to a proper, more efficient and simpler solution for the problem.

Game Development and Production

There are tons of books about writing every aspect of a videogame, about how designing the next great hit, about how to model and animate characters, but this is indeed the first book about how to make a videogame. In other words by reading this book you’ll get some insights at how to plan and manage a successful videogame project. Although project managers should be mainly concerned about the matter of this book, I think it is a must read for team leaders and a worth reading for everyone involved in a videogame project.
I recommend this book not only for those involved in professional videogame production but for anyone who has a project (even at hobbyist level) about videogame production.
The author presents his own experience as the owner of Taldren studio and producer of several games. The book focus mainly on Fixed Budget/Fixed Time kind of games, which are actually the most difficult to complete withing the constraints.
Topics range from how to use UML to sketch the project requirements to how to propose the project to a publisher for funding, to which parts of the project to outsource, to how to find a job in the industry.
The author is proposing his own experience presenting what worked and what not. Considering the maturity level of this industry I think that it is a very good approach, instead of ruling do’s and dont’s, he collects best practices with a critical approach.

Core Techniques and Algorithms in Game Programming

This book aims to be a comprehensive textbook for videogame programming courses. At least this is what it seemed to me. It doesn’t contain anything new or complex, but it is a good presentation, offering many references, for all the subjects in this vast field. To the experienced videogame programmer, the book hasn’t much to offer, nonetheless I found a couple of things I didn’t think of and/or I didn’t know about.
For example AI programming with rule system was something out of my experience, both because the consoles on which I programmed hadn’t much CPU power to spare and the games I coded didn’t require an advanced AI, with the notable exception of RogueSpear GBA.
Employing a rule system for RogueSpear GBA could have likely simplified our tasks.
Also the outdoor rendering algorithm is something that was relatively new to me.
To sum it up a good reference book, containing pointers to more detailed dissertations. I recommend it for junior programmers more than seniors.