GameLab 2008

June 27, 2008 @ 2:01 | In Programming, Videogames | 8 Comments | del.icio.us digg devbump rss
Gamelab 2008

Oviedo will hold the fourth edition of the GameLab conferences on July 10th - 11th. Undoubtedly the place to be if you want to meet lot of interesting people related to the Videogames industry. This event is growing bigger and bigger each time and is becoming a point of reference here in Spain.

Like the last year I will be giving a course on Advanced real-time 3D techniques the first day.

Hope to see you there! :)



Teaching at Oviedo - Noesis Engine

April 23, 2008 @ 11:23 | In Programming, Videogames | 9 Comments | del.icio.us digg devbump rss
Jesus teaching at Oviedo University

This weekend just finished the course I have been giving at the Oviedo University. The course is about programming graphic engines for videogames. In 30 hours / 6 days I tried to explain how to architect a solid engine for realtime purposes.

This is the first time I talk about the task I have been involved in the last months: Noesis Engine (a provisional name). Till now, it has been developed by a very small team and contributed to two commercial products. A small videogame is under construction now. I expect to give more information about this in the future.

A link to the first session of the course: Noesis - Core. The document reveals not too much information if you are not attending the class, but may be you find something interesting there (or wrong, and we can discuss). The first part is a global introduction to the course, the second one is about the core technology being used for the rest of the course. The document is in Spanish, I have no time now to translate it (I would be really grateful to any volunteer helping in this). Sorry for that.

And following with Spanish documents, I contributed to several tutorials in codepixel, a daily mandatory read if you understand Spanish, about the same topic, Graphics in Realtime. The hard part was done by Javier Loureiro / derethor. Iq / RGBA helped to this documents too, The tutorials:

And nothing more for today. As you can see I am still alive and working really hard. :)

UPDATE: Thanks to Ricardo Amores and Miguel Herrero for translating the powerpoint to English. It can be downloaded from: Noesis - Core - Eng



Implementing a Graphic Driver Abstraction

March 3, 2008 @ 19:26 | In Programming | 8 Comments | del.icio.us digg devbump rss
A screenshot from a mesh in wireframe mode

If you are a graphic programmer you have probably implemented lot of times what I will refer here as the graphic driver of the engine. The graphic driver is an abstraction over a low level graphic API like DirectX, OpenGL, libgcm, etc. I want to dedicate this article to some ideas and rules that have worked fine for me in the past when implementing this part of an engine. Probably your mileage may vary, so the comment section is open to discuss any detail you want.

Click to read the full article



Peopleware: Productive Projects and Teams

January 2, 2008 @ 2:42 | In Books, Programming | 2 Comments | del.icio.us digg devbump rss
Peopleware book image

Peopleware: Productive Projects and Teams
Author: Tom DeMarco & Timothy Lister
Pages: 245
Published: 1999

Peopleware is the second edition of a classic book (I have not read it, but jumped directly to this one). It is a book about software teams written by two software consultants experts although probably all the stories may be applied to other engineering areas. Do not expect technical comments in this book as this is about people and teams. It is structured in six parts where the last has been added into the second edition. Each part includes a series of short essays. Why most problems are not so much technological as sociological, why you must not save money on space for your team, why a good programmer (the right people) can give you a 10x factor productivity against a normal programmer, why you should make teams jell at your company and why you should avoid teamicide are an example of the topics covered in this book.

Although the first edition was written almost two decades ago, all commentaries are still valid. You will be able to identify with many of the situations described. I specially like the chapter about the workplace quality and the importance of not breaking concentration moments (the flow state). The additional chapter, Son of Peopleware, is written with another perspective. It is not surprising given that it had been written ten years later. Instead of concentrating in the design of projects and the environment it is focused in the design of an entire organization that creates teams with aligned goals. The last chapter, The Making of Community, is my favorite. This quote particularly strikes a chord: “An organization that succeeds in building a satisfying community tends to keep its people.”. I have yet to find find a company where this rule is being applied, but I shall continue my search. :)

This book plus The Mythical Man-Month are my two preferred classic books. What are you waiting for? Read them.

Rating: 9 / 10



Static Code Analysis

December 4, 2007 @ 3:01 | In Programming | No Comments | del.icio.us digg devbump rss
Visual Studio 2005 compiler snapshot

While following the interesting thread about putting all of the platform libs into source control, I decided to upgrade the Win32 Platform SDK (now, Windows SDK) whose latest version can be found following this link: Microsoft® Windows® Software Development Kit Update for Windows Vista.

There, I found a very interesting new compiler flag: /analyze. This option, previously only available in the Visual Studio Team Suite and fully integrated in Visual Studio 2008, allows activating Static Code Analysis when compiling with any version of Visual Studio 2005 (you only have to add the path to the new cl.exe in the Visual Studio Options).

There is a great presentation given by Microsoft at the last Gamefest event about static code analysis: Static Code Analysis on Game Code.

After activating it in my project, lots of warnings appeared. The truth is that most of them were false positives, but I caught an obscure bug that worthed the effort of upgrading the compiler. To reduce the noise, __assume and __analysis_assume (properly integrated in your error and assert macros) were good allies.

And now, time to sleep…



Capturing OutputDebugString

November 9, 2007 @ 3:20 | In Programming | 1 Comment | del.icio.us digg devbump rss

Using OutputDebugString for tracing your programs is probably not a good idea, at least if you have lots of traces being generated (OutputDebugString raises an exception and causes a kernel mode transition). So you will probably end up implementing your own tracing/logging system. Parts of code that are not under your control may be still using OutputDebugString (like Debugging Tools for Windows, DirectX, etc). The code listed below allows capturing OutputDebugString calls generated inside your own process (in fact, it is capturing all the OSD calls generated by all the active processes).

You will need to put this piece of code in a separate thread, but those details are omitted for better clarity.

NOTE: If the process is being debugged, the ODS calls will be intercepted by debugger.

/////////////////////////////////////////////////////////////////////////////

struct DbWinBuffer
{
    DWORD dwProcessId;
    char data[4096 - sizeof(DWORD)];
};

DbWinBuffer* dbBuffer;

HANDLE hAckEvent;
HANDLE hEvent;
HANDLE hSharedFile;

SECURITY_DESCRIPTOR sd;
SECURITY_ATTRIBUTES sa;
/////////////////////////////////////////////////////////////////////////////

sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = true;
sa.lpSecurityDescriptor = &sd;

if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION))
{
    printf(”ERROR: InitializeSecurityDescriptor\n”);
    return 1;
}

if (!SetSecurityDescriptorDacl(&sd, true, 0, false))
{
    printf(”ERROR: SetSecurityDescriptorDacl\n”);
    return 1;
}

hAckEvent = CreateEvent(&sa, false, false, L”DBWIN_BUFFER_READY”);
if (!hAckEvent)
{
    printf(”ERROR: CreateEvent(\”DBWIN_BUFFER_READY\”)\n”);
    return 1;
}

hEvent = CreateEvent(&sa, false, false, L”DBWIN_DATA_READY”);
if (!hEvent)
{
    printf(”ERROR: CreateEvent(\”DBWIN_DATA_READY\”)\n”);
    return 1;
}

hSharedFile = CreateFileMapping((HANDLE)-1, &sa, PAGE_READWRITE, 0, 4096,
                                L”DBWIN_BUFFER”);
if (!hSharedFile)
{
    printf(”ERROR: CreateFileMapping(\”DBWIN_BUFFER\”)\n”);
    return 1;
}

dbBuffer = static_cast<DbWinBuffer*>(MapViewOfFile(hSharedFile, FILE_MAP_READ, 0,
                                     0, 4096));
if (!dbBuffer)
{
    printf(”ERROR: MapViewOfFile\n”);
    return 1;
}

SetEvent(hAckEvent);

DWORD pid = GetCurrentProcessId();
printf(”Tracing PID: %d\n\n”, pid);

for (;;)
{
    DWORD ret = WaitForSingleObject(hEvent, INFINITE);
    if (ret == WAIT_FAILED)
    {
        printf(”ERROR: WaitForSingleObject\n”);
        return 1;
    }

    if (dbBuffer->dwProcessId == pid)
    {
        printf(”%s”, dbBuffer->data);
    }

    SetEvent(hAckEvent);
}
/////////////////////////////////////////////////////////////////////////////

Hmm, it is probably time to install a code colorizer WordPress plugin. :)



Joel on Software

October 18, 2007 @ 3:30 | In Books, Programming | 4 Comments | del.icio.us digg devbump rss
Joel on Software Book Image

Joel on Software
Author: Joel Spolsky
Pages: 362
Published: 2004

What new can be said about Joel Spolsky? His blog, Joel on Software, is in the top 100 of the most visited blogs and it is probably the most visited blog about software. This book, with the same name as the blog, is a compilation of the best articles published in the past in that website. The book is organized in three chapters: the first part is about good practices to improve your abilities to make software, the second part, about managing programmers and a third part dedicated to the software development business.

A little bit of reading through this book and you instantly discover why Joel writings are so popular. Joel is incredibly incisive in his opinions, bringing lot of subjective opinion based in his past experience (mostly, experiences when he worked in the Excel Team at Microsoft). That makes Joel’s articles very useful and with a vision hard to find in other sites. Do not expect to find here nothing on theoretical subjects. Topics like Architecture Astronauts or the one about the necessity of Technical Managers in the world of software engineering are good examples of what you will find in the book.

Joel is probably not right in all his statements. For example, when he talks about the two software cultures: Windows and Linux. He writes, Windows Software is for non-programmers, while Linux Software is for programmers. To me, this is absolutely wrong. Linux is a better stratified culture with two clearly separated layers: functionality and user interface. Most of the time, in Windows both layers are in a inseparable mixed state. In Linux, it is very usual to have a clear separation between server and client with GUI only in the client part. He writes, too, about how the Mozilla project committed its fatal error: starting from scratch. Time is starting to show that this was a good decision, Firefox is starting to threaten to that monolithic monster that IE has become.

In conclusion, and incredibly fresh read that I earnestly recommend. I am wishing to read his other book about user interface: User Interface Design for Programmers.

Rating: 9 / 10



Working At Home

September 19, 2007 @ 2:06 | In Personal, Programming | 4 Comments | del.icio.us digg devbump rss

I have been working at home for a week now and I have to say that it is being quite a good experience. At first I was not sure if this would work but, now, my old ideas about how inefficient you can be when you work in an office with an strict timetable are coming to my mind. It may be a coincidence, but in this week the Flow Moments (moments of maximum concentration where you forget that you have internet in your machine) have been before lunch (12-14), middle afternoon (17-19) and after dinner (22-…). More or less all the days have followed the same pattern. My objective is trying to enlarge those Flow Moments. Rest of the time I have tried lightweight tasks (attending the email, participating in Mailing Lists, reading books, white papers, elaborating my personal planning, thinking about the next things I have to implement, etc). In those periods, maintaining focus is quite difficult. When being out of the flow, strange forces drive me to distractions like opening the Firefox. Anyway, I have been all my life a Late-night coder, so that is probably where I am being attracted to. :) To the (22-…) zone, where I am probably most productive.

I think that the development of the project (at least I have a clear idea about the phase zero) is going on the right track. The pieces are starting to fit together. I am not alone in this trip and that helps a lot. Having a shared vision with more people is incredibly satisfactory.

About my infrastructure: I can work wherever I want! I am using a Subversion repository installed in my server that can be accessed from internet using a ssh connection (MyEntunnel is very useful to create a background tunnel without having a PuTTY window). For task scheduling, bug tracking and Wiki I am using Trac. It integrates perfectly with Subversion and all the items can be linked uniformly (tasks can be linked to Wiki pages, Subversion commits can be linked to bugs, etc etc). For very small teams is definitely a great application. I don’t know how well it scales to bigger groups. And that is all about the admin software. There is still a lot of work to do in this area, but for now it is enough. I have the basics and all the work is being backed up every night in my NAS. One day I will write about how nicely you can organize your working environment in Windows to mount shared that are backed up (w: for work, h: for home…), how to set up a PDC with Samba, etc. :) But that will be in another post.

In short, a positive and productive first week.

Thanks for reading!



CLR via C#, Second Edition

August 12, 2007 @ 15:28 | In Books, Programming | 2 Comments | del.icio.us digg devbump rss
CLRviaCsharp

CLR via C#
Author: Jeffrey Richter
Pages: 693
Published: 2006

I learned all the internal details about NT reading Advanced Windows (whose last edition was titled Programming Applications for Microsoft Windows) by Jeffrey Richter, co-founder of Wintellect. I like how he writes his books. He is able to cover a broad range of topics without being too dense when presenting them and with the right balance between technical text and examples. I have been programming C# (mostly in my spare time) since Microsoft released it. But until this time, I didn’t have time enough to study the language and all the infrastructure thoroughly. And when I discovered this book, I knew that it was time to master .NET and C#.

CLR via C# is a book dedicated to CLR. It is not a book about C#. C# is the language used for all the samples in the book. The author makes emphasis in how the implementation of C# is layered above .NET. Whenever there is an important detail in the interaction between C# and .NET it is described by the author. And although the book is published by Microsoft, Richter holds a critical role with all the aspects that are presented about .NET noting where things can be improved, where Microsoft is working for the next version and why certain decisions were chosen.

The book is divided into five parts:

  • CLR Basics: About internal details of the CLR’s Execution Model and what assemblies are and how they are deployed.
  • Working with Types: Information about type fundamentals, namespaces, castings, boxing and type operators.
  • Designing Types: Dedicated to methods, properties and events.
  • Essential Types: About strings, enumerated, arrays, interfaces, delegates and generics.
  • CLR Facilities: This is, in my opinion, the more interesting part of the book: Exceptions, Garbage Collection, CLR Hosting, Reflection, Asynchronous Operations and Threads Synchronization. I really liked the chapter about Exceptions. It is especially well written.

As all the books written by Jeffery Richter, I recommend this book. If you are going to fight with the .NET Framework this book is a must have in your bookshelf.

Rating: 8 / 10



See you in Gamelab^Oviedo!

June 26, 2007 @ 2:14 | In Programming, Videogames | 13 Comments | del.icio.us digg devbump rss
Gamelab

I am giving a presentation about Technology in VideoGames in the Gamelab 2007 Conference that is being held in Oviedo / Spain this year. My idea is to give a general overview of the current challenges real time developers have to face when developing a videogame. Is is not intended to be a deeply technical presentation.

I am proud that events like these are held in Spain. We need them to promote the industry. And undoubtly, this is going to be a high quality event (reading the name of the rest of the lecturers).

See you there gambiteros!

Update:as promised, here is the link to the power point presentation: Retos tecnológicos en Videojuegos. Be patient with the download speed :)



Fri, 25 Jul 2008 11:38:55 +0200 / 22 queries. 1.801 seconds / 2 Users Online

gentoo link wordpress link apache link PHP link website stats

Theme modified from Pool theme. Valid XHTML and CSS