Apr 28, 2012

Working with Subversion from Mercurial

My favourite VCS is Mercurial. Before that I used SVN, and I have no regrets about it. But it's still popular, and from time to time I have to use SVN. Here is solution how you can work with SVN from Mercurial. I didn't tried it myself yet, but will certanly try it then time comes.

Updated 02.05.2012. So, the need has come early, and I tested it. It works! I'm almost sure it's buggy to work flawlessly with advanced reps, but if you need to just grab some repo it's definetely enough.

Apr 25, 2012

Game development podcasts, videos, etc.

This article data (and much more) can now be found here. I find that blogger platform was not suited well for managing of this kind of list.

Apr 24, 2012

Minecraft: The Story of Mojang

Nice video about Minecraft creator Marcus Persson and his new Mojang company. Fairly recent which is good. I'm impressed how 'Notch' is open about success of Minecraft. "It's almost impossible to repeat such success" he says, "it was sort of luck and right time" so modest. I'm just bumped first time to this site BTW, but it sertanly deserves some digging around, looks like an interesting place.

Apr 21, 2012

XNA articles beginner should not miss

This article data (and much more) can now be found here. I find that blogger platform was not suited well for managing of this kind of list.

You may also find useful:
- XNA tutorinals beginner shouldn't miss
- XNA tools 2D game developer should not miss

Apr 19, 2012

If your hard drives are identified as removable

I've noticed that in my Windows 7 installation all my hard drives are shown as a removable drives. This is not only looks incorrect, but it also permanently occupies your system tray with Safely remove hardware icon.

After some investigation I've found that this indicates that not all required drivers are installed on an operation system. On my Intel chipset you were need to install Rapid Storage Technology driver. After that, and a two reboots (duh!) hard drives are identified correctly as not removable. You also got some RAID caps via Intel app, but I wasn't really interested in that for now.

Be aware however that this driver installation procedure can trigger activation for some protected software applications!

Apr 16, 2012

Street of Rage Remake v5

Holy sh*t! Have you seen this? Never believed this will ever will be possible, but it's true! The project page will say it all:

It has been 8 years of work, but the final version is here, this is complete and ready for download, Surprised? :-)

Eight years! That's a truly dedication to one of the best action games ever. I don't know why SEGA or someone else didn't already do the same thing, create a sequel using all power that is available now. Being an extreme fan of original SOR series I don't know how I missed such a huge thing, looks like it was around from about 2009 already. Yet it better to play that game then it's finished and polished.

The remake is absolutely wonderful! It doesn't seem like a amateur fun-project at all, on the contrary all assets looks like a professional quality, better than many commercial games. Music remastering is of wonderful quality. You should absolutely give it a try, it's free! The only sad thing it's not opensource in any way. But who knows, maybe in better future it will be?

Apr 15, 2012

Digger.NET in development, part 5

Well, I extremely satysfied right now, since I've done complete main screen of my XNA port of a Digger Remastered. The currently main page looks like:

I'm impressed how easy it's for a complete gamedev noob (like me) to do things in XNA. So, original internal framerate for Digger is something like 15 frames per second. Question: how much it takes to set it in XNA game? Answer: one line, just add this to your main Game class:
// original frame rate is 15 fps (67 ms per frame)
this.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 67);
So-o-o nice! So nice I will count the XNA one of the best frameworks which comed from Microsoft (I'm hoping Microsoft will not slow down or stall the thing with it's new Metro-Shmetro and all the native stuff which it puhing quite intensively lately, IMHO).

This is especially evident if you look at the original C code, it's so complex. The graphics and drawing code is incredibly complex. I'm not going to blame the author, seems like he did much more complex job than I but this:
bool sprrdrwf[SPRITES+1];
bool sprrecf[SPRITES+1];
bool sprenf[SPRITES];
Sint4 sprch[SPRITES+1];
Uint3 *sprmov[SPRITES];
Sint4 sprx[SPRITES+1];
Sint4 spry[SPRITES+1];
Sint4 sprwid[SPRITES+1];
Sint4 sprhei[SPRITES+1];
Sint4 sprbwid[SPRITES];
Sint4 sprbhei[SPRITES];
Sint4 sprnch[SPRITES];
Sint4 sprnwid[SPRITES];
Sint4 sprnhei[SPRITES];
Sint4 sprnbwid[SPRITES];
Sint4 sprnbhei[SPRITES];
is just nonsence. At least you can pack each x, y, wid, hei etc. coordinate like data in a structure with two fields. And this is just a tip of an iceberg. Consider this young fella from sprite.c:
void drawspr(Sint4 n,Sint4 x,Sint4 y)
{
  Sint4 t1,t2,t3,t4;
  x&=-4;
  clearrdrwf();
  setrdrwflgs(n);
  t1=sprx[n];
  t2=spry[n];
  t3=sprwid[n];
  t4=sprhei[n];
  sprx[n]=x;
  spry[n]=y;
  sprwid[n]=sprnwid[n];
  sprhei[n]=sprnhei[n];
  clearrecf();
  setrdrwflgs(n);
  sprhei[n]=t4;
  sprwid[n]=t3;
  spry[n]=t2;
  sprx[n]=t1;
  sprrdrwf[n]=TRUE;
  putis();
  sprenf[n]=TRUE;
  sprx[n]=x;
  spry[n]=y;
  sprch[n]=sprnch[n];
  sprwid[n]=sprnwid[n];
  sprhei[n]=sprnhei[n];
  sprbwid[n]=sprnbwid[n];
  sprbhei[n]=sprnbhei[n];
  ggeti(sprx[n],spry[n],sprmov[n],sprwid[n],sprhei[n]);
  putims();
  bcollides(n);
}
no comment (pun here!). How many global variables you can count here? Maybe you want to know that ggeti is? Actually it's a function pointer, to another function (which is actually quite an elegant solution to switch CGA and VGA graphics mode):
void vgageti(Sint4 x,Sint4 y,Uint3 *p,Sint4 w,Sint4 h)
{
  Uint5 i;
  for (i=0;i<h*2;i++)
    if (i+y*2 < 400)
      farmemcpy( (char far*) (p + (Uint5) i*w*8l), back_bitmap_bits+ (Uint5) ((y*2l+i)*640l + x*2l) , w*8);
}
how many magic numbers you can count here? Developer suggests contacting him in case of any questions. But last modification date for source is year 2004. I feel it's little rude to notify person on his completely forgotten project. This is so sad he didn't leave enough comments then he could.

Apr 14, 2012

Digger.NET in development, part 4

This post could also be named: "Why is it a good habit to search for and read the docs" or "Why is it a good habit to comment your code".

The base source code of a Digger Remastered is a C Windows application which uses DirectX for graphics output. Due to the source evolution nature of this game (at least I think so), which was a DOS application before, variables naming is somewhat... short. No camel case also. And almost no comments in source code. I've downloaded latest source code for Windows as my starting point. I thought it will not be very hard to understand the code of this, rather simple, game. I've deciphered some part of a high level game code, but then I've approached a graphics code. This is the place there I have stuck a big time. Can you guess what this code does?

void putis(void)
{
  int i;
  for (i=0;i<SPRITES;i++)
    if (sprrdrwf[i])
      gputi(sprx[i],spry[i],sprmov[i],sprwid[i],sprhei[i]);
}

As you can see, all variables here, except for i are global. Also complicates things, you know. This was also frustrating because I didn't actually need most of the graphics code, which uses pixel-by-pixel drawing since I use real bitmap sprites for drawing. But because this code also tightly coupled (related) with other game logiс (collision detection for example) I need to understand it too.

Not so long ago, I've decided to look for another sources on the site, Java in particular, in hope it will help to understand the graphics code. However, the Java sources were useless, but I've also downloaded (for some unknown reason) old windows sources and voila, I've found some text files inside the zip! The description I found inside was invaluable:

void putis(void)
 Redraw background images


quite unexpected from a name though, hmm. Considering there are tens of different obscure functions and global variables, and deciphering one of them can take hours, this file gonna save me big time (pun here!).

Strange thing though is, why not add this single line as a comment in source code file, just there it belongs, not in a big separate text file. Why? Why?! Why?!!

Apr 12, 2012

Big PHP rant

Oh my, this one deserves to be remembered.

I must admin, I use PHP in my little personal business site, but in a manner of advanced SSI, with little amount of logic. I've always wondered, why even so, I'm uncomfortable with PHP. Why even very simple scripts usually ended up me being in documentation, with finally "oh, that's how it is done". But I never imagined things are so bad there.

PHP language requres major cleanup. Remove all duplicate syntax. Remove php.ini with all to defaults, most of options should not be configurable at all! Create a stable platform that is consistent to every system and installation. Go with unicode as default. This will break all I know. So be it. Call it PHP 6, it will be new, but still known to many language.

But instead PHP group is doing almost exact opposite.

Installing Windows Phone SDK on Windows Server 2008 R2

If you try to install a Windows Phone 7.1 SDK on Windows Server, 2008 R2 x64 in my particular example, I will be surprised that it's officially supported in Windows Vista and Windows 7, as for now.

There is an existing solution for web installer. But what if you internet connection is slow, you need to install SDK on 10 computers, and you have a nice ISO lying on your file server HDD? Actually you only need a good hex editor. HxD is a good one, and absolutely free. What we need, is to modify same lines, but directly in iso file. Open image in editor and search for a unicode string [gencomp7788]. After you found it's location, look down for the same unicode InstallOnLHS=1 and InstallOnWin7Server=1 strings (you can copy baseline.dat from image beforehand and open in notepad for reference, it's located in root directory of the image). Select value 31 after '=' which is '1' and replace it (Edit -> Fill selection...) with 30 which is '0', you will see changes immediately in editor. Now, save the image. You're done. Open the image and verify that changes in baseline.dat are the same as you expected, and you are ready to go!

P. S. I suppose (didn't actually tried that) you can copy files from image into some directory and modify baseline.dat there, but it's not that fun!

XNA tools 2D game developer should not miss

This article data (and much more) can now be found here. I find that blogger platform was not suited well for managing of this kind of list.


You may also find useful:
- XNA tutorinals beginner shouldn't miss
- XNA articles beginner should not miss

Why you should reinvent the wheel

Below, I will talk about game development specifically, but I think this can be applied to any type of development.

The main theme I want to concentrate on is: if you personally experienced problems which some "wheel" solves, then you will use it better and with more satisfaction.

Consider arrays for example. Do you remember very first time you really understand concept of arrays? Usually this is very close to the beginning of language study. But despite that, usefulness of arrays is immediately obvious. You dont need tens of variables to store multiple values, and of course cycle processing of this values is much easier, to say the least.

Now remember user defined functions. They also come early, but not so early as arrays. Functions benefits is not so obvious until your programs go beyond some 100 lines.

And then, pointers. Double linked-lists. Queue. Stack. All of that strange useless magic. Then classes arrived and OOP with that strange inheritance thing. Why do you need to block access to a structure field? Some of us were forced to all this stuff at university or college. But as time goes you begin to understand why all this exist.

There is, however, a different side of this. Many starting game developers, as I can see, for example, at gamedev.stackexchange.com tend to use heavily some rather complex frameworks for games. The problem is that unless you will create game without usage of some frameworks, unless you didn't try to solve problems which arise with you own hands, you can't quite understand even basic logic that stands behind framework, and can't use it effectively.

You don't use classes from the start. You don't use pointers and complex data structures from the start. Not even functions. You use variables and arrays. Then your code grows, you understand concept of a function. And so on, you use more advanced features, then you face problem and understand how that feature helps to solve it. Before that time, your usage of it would be wrong and unefficient. Similarly enough you don't start game development by creating WoW clone, you are making Tetris clone.

Of course there are exceptions. You don't write XNA youself. You don't write standard C library. But this are well built, long time tested, basic functionality tools from a major brand. They can be considered a part of a language. You don't write image manipulation library, it's not the core kwnoledge that drives your game. But you write your game editor, your game core and physics engine. Even if you fail, your experience will be invaluable.

Apr 5, 2012

A set of XNA tutorinals beginner shouldn't miss

This article data (and much more) can now be found here. I find that blogger platform was not suited well for managing of this kind of list.

You may also find useful:
- XNA tools 2D game developer should not miss
- XNA articles beginner should not miss

Apr 2, 2012

Conjurer: Reloaded

The Conjurer project which was my little playground for something related to game development, but which ultimately become a failure, will now hold something quite more useful. It will be my personal XNA Framework utilities library. For now it contains a KeyboardManager class which helps to manage keyboard input handling.

As you can expect, main user of this project will be (and is) Digger.NET project.

Brian Fargo interviews

Brian Fargo interviews concerning mostly Wasteland 2 funding, development and much more. Very interesting read for any game developer and gamer.