April 2013

Warning! Some information on this page is older than 3 years now. I keep it for reference, but it probably doesn't reflect my current knowledge and beliefs.

19:25
Sat
27
Apr 2013

Writing Efficient C++ Code - my Article in ProgramistaMag

I started cooperation with Programista - Polish magazine for programmers and other IT professionals. You can find my first article in the latest issue 4/2013 (11).

My article - "Writing Efficient C++ Code" - is about achieving best possible efficiency of native C++ code. It describes data-oriented design as an alternative to pure object-oriented philosophy and shows its advantages, mostly related to consciously designed layout of data in memory, which makes good use of CPU cache. It also mentions operations that should be avoided if code is to be efficient, shows some language tricks and Visual C++ project options that help with generating efficient code and mentions parallelization.

Besides, in each issue of the magazine you can find interesting articles about different programming languages, libraries and technologies, as well as interviews, book reviews and other articles related to software development. The magazine is available for subscription in electronic and paper form.

Comments (33) | Tags: c++ optimization productions | Author: Adam Sawicki | Share

19:14
Tue
23
Apr 2013

Type Visualization in Visual Studio 2012 Debugger

When you code in C++ and you have your own library of data types, especially containers, it would be nice to be able to see it in the debugger formatted in some readable way. In Visual C++/Visual Studio, there used to be a special file autoexp.dat designed for this purpose, as described in "Writing custom visualizers for Visual Studio 2005". But it had weird syntax and poor error reporting.

Now in Visual Studio 2012 there is a new way of defining debugger visualizations for native data types, called Native Type Visualization Framework (natvis). All you need to do is to create an XML file with ".natvis" extension following special format and place it in directory: %USERPROFILE%\Documents\Visual Studio 2012\Visualizers. Full documentation of this format is on this single MSDN page: "Creating custom views of native objects in the debugger". See also "Expressions in Native C++" and "Format Specifiers in C++".

For example, if you have a singly linked list:

template<typename T>
class CLinkedList {
   // ...
    struct CNode {
       T Value;
       CNode* Next;
    };
    size_t Count;
    CNode* Head;
};

Default visualization of a 3-element object in the debugger would look like this:

But if you create following natvis file:

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
   <Type Name="CLinkedList&lt;*&gt;">
       <DisplayString>{{Count = {Count}}}</DisplayString>
       <Expand>
           <Item Name="[Count]">Count</Item>
           <LinkedListItems>
               <Size>Count</Size>
               <HeadPointer>Head</HeadPointer>
               <NextPointer>Next</NextPointer>
               <ValueNode>Value</ValueNode>
           </LinkedListItems>
       </Expand>
   </Type>
</AutoVisualizer>

Next time you start debugging (restarting Visual Studio is not required), same object will be shown as:

Besides extracting single fields from objects, evaluating whole C++ expressions and formatting values into a string for summary of whole object, this framework is able to visualize following data structures:

Comments (1) | Tags: visual studio debugger c++ | Author: Adam Sawicki | Share

00:08
Tue
16
Apr 2013

IGK 2013 Quiz

During IGK 2013 gamedev conference, just like in previous years, we organized a contest with 75 questions in 15 categories, from gaming to programming. We had 8 participants this year and the winner was Artur Poznański "artpoz" - congratulations! See full results.

You can now download new version of the application with source code in C# and this year's questions to test your gamedev knowledge by yourself or with your friends:

IGK_Quiz_2013.zip (2.76 MB)

Comments (1) | Tags: warsztat igk competitions productions events | Author: Adam Sawicki | Share

20:03
Sat
13
Apr 2013

Here be Dragons - Our Game from IGK 2013 Compo

During IGK 2013 gamedev conference there was traditional game development compo, where teams of up to 4 people have to make a game in about 8 hours. Of course we participated in it. This time we called our team "Mass Deffect" (just some random name). There were four of us, all programmers: Kamil Szatkowski "Netrix", Karol Kuczmarski "Xion", Krzysztof Kluczek "Krzysiek K.", and me.

The theme this year, with all the requested features of the game, was: "Artiller game - multiple ways of destroying map, hp & mp - at least 2 kinds of energies - achievements - multiplayer" That fitted into my plan to use two mice on one computer, which I researched recently and described in: Handling Multiple Mice with Raw Input. We designed our game in the Saturday evening, after considering multiple ideas. Finally we chose Krzysiek's idea inspired by Rampart - an old Atari game (see this video).

Our game has title "Here be Dragons". In works on PC, Windows. It is written in Visual C++ 2010 Express, based on a Direct3D 9 framework developed by Krzysiek K. We decided to use 3D graphics (which becomes more and more rare on this kind of game development compos). But game logic is 2D and map entirely fits the screen. Two players build castles on the opposite sides of the map (with left mouse button). On the large enough castle, towers with maidens appear which are resource needed by dragons :) When player has dragons, he can shoot fireballs at the enemy (with right mouse button).

We took 4th place out of 12. Our game lacks many planned features. It doesn't even have sound or music. Anyway, it was fun as always :) Here you can download the game with full source code:

HereBeDragons.7z (3.17 MB)

Comments (0) | Tags: events productions competitions igk warsztat | Author: Adam Sawicki | Share

00:01
Thu
11
Apr 2013

IGK 2013 - My Photos

IGK 2013 @ Google+ - here is the gallery of my photos from the IGK 2013 conference.

Comments (1) | Tags: igk events warsztat gallery | Author: Adam Sawicki | Share

22:15
Mon
08
Apr 2013

After IGK 2013

Today I came back from 10th Polish Game Engineering Conference - X jubileuszowa Ogólnopolska Konferencja Inżynierii Gier Komputerowych IGK2013, which took place at Uniwersytet Przyrodniczo-Humanistyczny in Siedlce, Poland. See also Facebook page and topic on forum.warsztat.gd.

It was fun :) Maybe papers were not the highest possible quality in scientific terms. I also noticed complete lack of presentations from any companies producing "big" PC or console games. There were only talks about mobile and web-based games, as well as serious games - simulation and training for military.

The presentation I liked the most was "Desert Tycoon - Gra stworzona na piasku" by Konrad Rodzik and Jarek Potiuk from Polidea. They talked about their first iPhone game - Desert Tycoon. It's a game like Farmville, but taking place on Arabian desert. I was amazed by the openess they present when talking about what went good or wrong and all the technical details of their work. It was very interesting to hear about e.g. the quirks of rendering text in Arabic language.

My second favorite talk was "Testowanie rozproszonych aplikacji mobilnych opartych na Unity3D" by Marcin Korniluk and Piotr Duda. It's not the most interesting subject for me, but I liked the structure of this talk. They showed what they are talking about and what problem they want to address and then they presented the solution they are working on.

The big name of this conference was probably Sos Sosowski with his talk "It's not a bug, it's a feature". This indie game developer, author of McPixel, has great talent for speaking in funny and engaging way.

I'm glad we managed to organize the quiz. Congratulations artpoz for winning! I will publish the application we used along with all the questions we asked in the following days and link it from here. Meanwhile please leave your comments about any ideas, what you liked or not liked about this game, how we could improve the rules, the app and what kinds of questions would you prefer to see next year.

Of course on Sunday there was also game development competition. 12 teams participated this year. The theme was: "Artiller game - multiple ways of destroying map, hp & mp - at least 2 kinds of energies - achievements - multiplayer". We took 4th place. I will publish our entry soon. I think the level this year was quite high. Almost all compo entries looked like nice games. My favourite game was the one from team "Kryzys". They made a game for two players with top-down view about tanks shooting each other with different kinds of weapons and destroying the map. Tanks were controlled by... smartphones with Windows, using touchscreen and accelerometer.

There were around 70 participants this year. The possibly biggest groups were people from Polygon (game programming interest group at Warsaw University of Technology), Warsztat community, Vexillium group, Ganymede (game development company, one of the sponsors). Here is a group photo.

Some additional links:

Comments (0) | Tags: competitions warsztat igk events | Author: Adam Sawicki | Share

STAT NO AD [Stat] [Admin] [STAT NO AD] [pub] [Mirror] Copyright © 2004-2017 Adam Sawicki
Copyright © 2004-2017 Adam Sawicki