Latest Posts

VS2005 Enhancements

Microsoft has released a Power Toys package for VS2005.

Visual Studio 2005 IDE Enhancements are a set of Visual Studio extensions that are designed to make you more productive. These enhancements are directly integrated into the Visual Studio IDE. This set of enhancements includes Source Code Outliner, Visual C++ Code Snippets, Indexed Find, Super Diff and Event Toaster tools. All these tools except the IDE Event Toaster can be invoked from Visual Studio’s View.OtherWindows menu group. The Event Toaster tool can be configured from the Tools Options dialog under the PowerToys node. The Visual C++ Code Snippets can be invoked on any C++ source file. Previously, these enhancements were only available via the Visual Studio 2005 SDK. This installation does not require Visual Studio 2005 SDK.

  • Source Code Outliner: The Source Outliner tool is a Visual Studio extension that provides a tree view of your source code’s types and members and lets you quickly navigate to them inside the editor.
  • Visual C++ Code Snippets: The Visual C++ Code Snippets tool lets you insert snippets in your code by using a pop-up menu that contains programming keywords. VB.NET and C# languages have this functionality in Visual Studio 2005.
  • Indexed Find: The Indexed Find tool is a Visual Studio extension that uses the Microsoft Indexing Service to provide improved Search capabilities to the integrated development environment (IDE). It sends the results of a search to the Output Window.
  • Super Diff Utility: The Super Diff Find tool is a Visual Studio extension that compares text files. It uses color coding and graphics to show the difference between the files in deleted text (red), changed text (blue), inserted text (green).
  • Event Toaster Utility: The Event Toaster tool is a Visual Studio extension that notifies users about specific events within the Visual Studio IDE.

Taken from here.

Visual Studio 2005 geschenkt

Auf developia.de habe ich gelesen, dass Microsoft 5000 Visual Studio Standard Lizenzen verschenkt. Voraussetzung ist, dass man sich anmeldet und sich dann mindestens fünf CodeClips zu Gemüte führt. Interessenhalber habe ich mir ein paar der Clips angeschaut. Die gute Nachricht für diejenigen, die nur auf VS aus sind, ist, dass der liebe Christian Wenz in seinen Beiträgen die Codes jeweils am Ende auch vorliest, das heißt, man muss nichtmal hinschauen. Aber es lohnt trotzdem, auch wegen der gelegentlichen freiwilligen und unfreiwilligen Komik: Christian Wenz bspw. öffnet lieber Mozilla Firefox anstatt den hauseigenen Internet Explorer, weil sich JavaScript “in anderern Browsern durchaus schneller abschalten lässt”. Jörg Jooss wiederum erklärt, “und wie man sieht…”, und ich habe nichts gesehen. Ob das jetzt schlichtweg ein Aktualisierungsproblem durch Bandbreitenengpässe war, oder tatsächlich jedes mal so zu sehen – oder eben auch nicht zu sehen – ist, kann ich nicht sagen, denn ein zweites Mal wollte ich mir seine Redekunst dann doch nicht antun. Die Sprechpausen waren stellenweise so lang, dass ich die Verbindung durch Blick auf das Netzwerksymbol / einen schnellen Blick ins IRC / ein Refresh meiner geöffneten Browser-Seiten kontrollieren musste. Leider bietet MS auch beim zweiten Anschauen keine Navigationsleiste an, um in einem Vortrag springen zu können, so dass die Beiträge für diejenigen, die wirklich des intellektuellen Nährwerts wegen auf die CodeClips schauen, eher als umständlich empfunden werden mögen. Obwohl die Aktion bereits am 8. August gestartet ist, haben auch heute noch Mitmacher ein Paket abgesahnt, ein Blick auf die Seite mag sich also lohnen. Meine Codes poste ich jetzt hier der Fairness halber nicht (wenn ich das richtig beobachtet habe, muss man ohnehin mindestens einen Film einmal an-gesehen haben), aber Google liefert hier sicher ein paar Ergebnisse für die ganz faulen.
Apropos Google, wer auf diese Art von e-Learning steht, dem seien auch die mit “Google engEDU” getaggten Videos bei Google empfohlen. Dabei handelt es sich um Mitschnitte Googles hauseigener Techtalks, größtenteils zu Themen aus der Informatik.

Template Parameter Types

I just had a case where I wanted to make sure that a C++ template parameter was of a certain type. The template should be used for pointers to instances of class “Base” and its derivates so that I could call a method of Base on the object provided to the template class.

template< class T >
class MyTemplate
{
public:
    MyTemplate( T object )
    {
        object->baseClassMethod();
    }
};

First, I thought there would be no way to achieve this, but then I tried a static_cast which turned out to be the solution: using the static_cast ensures that the type casted to is used at compile-time. Isn’t that beautiful? If you don’t need to access the object but constrain the template to a certain type, you could use the d’tor to implement some dummy code.

template< class T >
class MyTemplate
{
public:
    MyTemplate( T someObject )
    {
    }
    virtual ~MyTemplate()
    {
        // constrain parameter type to "Base"
        // and derivates
        static_cast< Base* >( static_cast< T >( 0 ) );
    }
};

Using this template with a type which is neither “Base” nor inherited from “Base” leads to a compiler error like “can’t convert ‘bad type’ to ‘Base’.

Tool Enhanced Again

Tonight, I added the batch processing. On the left image, you can see a set of six input images on the left, and three output images on the right (all images at 50% zoom, another feature I added).
Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us
The packing is not optimal in a mathematical sense, but it’s effective anyway, as the shot on the right shows. These (100% zoom) images were randomly picked from a set of output images which were created when I reorganized all of the plants we have in DVW to test my tool.

Tool Enhanced

Tonight, I enhanced the tool (codenamed TexTorture, hehe) with a little rectangle packing algorithm. Taking an unsorted list of sprites (i.e. rectangles), the outcome is already quite lovely. Next, I will try how presorting of the rectangles by width, heigth or area will affect the result. Finally, I want to be able to merge n input textures into m output textures, where m<<n, hopefully.
Rectangle Packing applied

Exe Packers

Yesterday I searched for PE EXE packers. UPX is certainly the best known candidate, but it has a quite restrictive license when it comes to changing the loader code or preventing unpacking of the compressed EXE somehow. After digging through some commercial tools like Armadillo (which features were impressing!) and shady tools like morphine which are usually used to hide trojan horses, worms and the like, I found PackMan – a nice packer with source and dedicated to the public domain.

Q'n'D Java Tool

I just wrote a quick and dirty Java/Swing tool. It loads and autodetects DVW sprites from a texture file and allows to reorganize them. This is useful for stupid programmers like me who don’t want to mess around with mspaint.exe or The GIMP but feel the urge to move sprites around for whatever reason. I am planning some improvements like a textual export of the rectangle coordinates and a cool algorithm to align the sprites automatically including batch processing, but for now, manual moving of the sprites is exactly what I wanted.
The autodetection is done using a simple floodfill approach which proved to be sufficient for my test texture. I might find other textures where this approach isn’t enough, therefore I will provide means to apply a dilatation operation on an image and to merge detected rectangles.
A little tool I wrote
While I wrote this tool, I recognized a little problem in the AWT drag and drop framework, java.awt.dnd.DropTargetListener in particular. I used DropTargetListener#dragOver(DropTargetDragEvent) to listen for dragging but found that there was no (direct) way to find out which object was actually dragged (those objects implement java.awt.datatransfer.Transferable).
I was not the first one who stumbled over this, like the entries in Suns bug database showed, and fortunately one suggestion from this page worked for me:

DropTargetDropEvent tempDTDropEvent = new DropTargetDropEvent( dtde.getDropTargetContext(), dtde.getLocation(), 0, 0 );
Transferable dragData = tempDTDropEvent.getTransferable();
MyTransferable trans = (MyTransferable) dragData.getTransferData( MyTransferable.DATA_FLAVOR );

This issue was fixed in Tiger where an appropriate getter for Transferable was added.

Game Objects

I just read something in AI Game Programming Wisdom 3 which sounded sooo familiar to me. Sergio Garces of Pyro Studios writes about game architecture regarding the game objects,

“… we often see examples of inheritance abuse, making the fundamental mistake of confusing behaviour (what objects do) with identity (what objects are)”

This is exactly one of the many mistakes I did in DVW, where the inheritance hierarchy is like Entity<-Unit<-Vehicle<-Constructor<-KPBConstructor or Entity<-Unit<-Building<-UnitFactory<-BunkerBarracks. It works, but this really is not the way I would do again.
Next time, I would use a part-based approach like sheijk|6S is doing in Velox3D, i.e. the game designer (not necessarily the programmer!) creates units out of several abilities, just like plugging and playing: plug in a motor, and the entity could move; plug in a weapon, and the entity could attack or fight back; plug in a brain (i.e. some AI) and it knows how to use its parts.
DVW
But we’re making good progress anyway.

Coming and going

Many of us are enthusiastic about getting into the game industry. And the more enthusiastic we are, the more we might wonder why people are happy to leave the business again. At the end of 2004, a blog entry widely known by the authors nickname, ea-spouse, rocked the boat. I remember that many professionals joined in complaining about the working conditions. Recently, I read two similar articles again: Jurie Horneman of ex Rockstar Vienna wrote that he was glad when the studio was shut down. He refered to another article entitled The joyful life of a lapsed game developer whose author was glad to have left the industry for good.
How can it be that so many want to get in, and at least some are happy to get out again?
Let’s face it. The trouble is that the game industry still is an industry. Like in every other business, be it software or whatever, there are customers, deadlines, and consequently there are crunch times. And I’d expect my employees to commit themselves to the project to some level. This does not mean that overtime should be the custom, nor this means that a company has a right to exploit its employees. But for me, the willingness to do extra hours was part of my employment contract. On Sundays or holidays, if required. Also, I had to agree to relocate to another site of my company if necessary (which could be Cologne<->Calgary in my company, for example). Working in a fast moving industry requires some flexibility.
The second thing is how people got laid off recently at Rockstar. Apart from the many creative and technologically skilled people and those people who feel that making games is their profession, there are business people who don’t care about your great story, your cutting edge technology, whatever. Those people just see these little numbers at the end of the fiscal year. Those people might make mistakes just like we (the creative idealists on the other side of the table) might do, but in the end they’re just doing their job. I believe – well, I hope, at least – that they had a good reason for their decision, and I’m confident that those who are skilled and flexible enough will find a new job soon – be it game development or not, there are a lot of related fields. If not… Darwins natural selection comes into mind.
While this is my very rational point of view, the emotional one is that I feel deepest sympathy for those who got laid off in such a bad manner. And I never want this happen to me. But it will, and I will have to face it, too, I guess. My employer handed out a little book called “30 minutes for sovereign dealing with changes” to all employees several months ago. The actual intention is still unknown to me, but you might guess what many of us feared…