Twitter

Pinboard Bookmarks

Blog Tags

Recommended Productions

Ball-B

Simple 3D game developed in Unity during Global Game Jam 2014.

Play Online

Date: 2014-01-26

Download:
Ball_B_Windows.zip (8.78 MB)
Ball_B_Source.zip (20.49 MB)

Octovirus

Simple 2D game developed during Global Game Jam 2013, for Windows.

Date: 2013-01-27

Download:
Octovirus.zip (6.1 MB)

FX Batch Compiler 1.1

This Windows application supports compilation of FX effect files and HLSL shader files using fxc command line compiler included in DirectX SDK. You can compile many files at time or one file with different settings.

Features:

  • Write compilation scripts in a simple language by specifying parameters for fxc.exe.
  • Compile multiple shaders at time.
  • Compile only shaders that need rebuild checked by file modification time.
  • Review success or failure, warning and error count and compiler output for every task.
  • Compile single HLSL source file with different parameters and preprocessor macros.

Date: 2011-02-09

Download:
FxBatchCompiler_1-1.exe
FxBatchCompiler-1.1-bin.zip
FxBatchCompiler-1.1-src.zip

Block Wizard

My first Flash game. Coded with FlashDevelop in ActionScript 3.

Date: 2010-04-06

CommonLib 9.0

Universal library for C++, created especially with game programmers in mind. Includes: math module (vectors, matrices, quaternions, planes, rich set of collision functions and more), string operations, conversions, smart pointers, configuration files handling, date and time module, exception class hierarchy for error handling, file system handling, stream class hierarchy, FreeList - free memory allocator, complex logger, profiler, library for threading and synchronization, tokenizer, wrappers for compression with zlib.

Language: C++. Platforms: Windows and Linux. License: GNU LGPL. Optional support for Unicode. Optional integration with D3DX. Documentation made with Doxygen.

Date: 2009-12-16

Download:
CommonLib_9_0.zip (4.92 MB)

Aqua Fish 2

Game for children - clone of PacMan. Player swims as a fish and collects points, as well as special items. Player also have to run away from enemies or destroy them. 60 maps in 6 different titlesets. Low hardware requirements. See also YouTube videos: [1], [2]. Game was published by Play Publishing company.

GameDev Calc

Calculator for game programmers. Basic data unit is a vector of 1-4 floating point numbers, which can be treated as (x,y,z,w) vector or (r,g,b,a) color. Next to basic calculations like addition, multiplication or sinus, vector operations are also available, e.g. vector normalization, conversion between degrees and radians, color conversion between RGB and HSB, finding linear an quadratic function coefficients and much more. Instead of entering single number, here you can see all the history of your calculations in form of stack and all operations are performed on that stack. Data can be entered and retrieved in different formats, like "D3DXVECTOR4(0.0f, 0.5f, 0.752f, 1.0f)" or "0xFF0080C0". Platform: Windows. Language: C#. License: GNU GPL.

Download:
GameDevCalc_1-0.zip (53.06 KB)
GameDevCalc_1-0_src.zip (50.73 KB)

Blog

23:57
Wed
14
Jan 2015

Review: Deleaker - A tool that finds resource leaks

Deleaker is a tool for programmers that finds resource leaks in C++ programs. It's commercial, with free trial and unconditional 30 day money back. Here is my review of this tool. I've tested version 3.0.27.0.

Deleaker is installed as a plugin for Visual Studio, any version from 2005 to 2013. It also works with Visual Studio Community 2013, as this new free version also supports plugins. There is also standalone Deleaker application (see below).

The purpose of this tool is to augment debugging of native C++ programs with the ability to list all resources that are allocated at the moment (heap memory, virtual memory, OLE memory, GDI objects, USER objects, handles) and so to detect resource leaks. Here is how it works:

The interface is very simple - it can be learned in just few minutes. You can build your program and start debugging it by hitting F5, Deleaker is enabled automatically. Now just open dedicated panel (menu Deleaker > Deleaker Window) and there press "Take snapshot" button. You don't even have to pause execution, but of course the button works as well when your program is paused at a breakpoint. After few seconds, the panel is populated with a list of currently allocated resources, with the place from which it was allocated shown in first column.

After selecting one, bottom panel displays full call stack. Clicking in this call stacks navigates to the place in the source code where the allocation is specified. Finally, after program exit, the list is filled with resources that were not freed - these are actual leaks!

You can filter the list by module (EXE or DLL file that made the call) and by resource type (memory, GDI objects etc.). There is also a column with size of the resource and "Hit Count" - number of resources that were allocated by that particular place in the code (e.g. inside a loop) and stay allocated at the moment.

"Show full stack" button is a nice feature. Clicking it displays full call stack, while by default, the stack is stripped from entries that don't come from your code, but from system libraries. For example, above my function with the actual allocation instruction, there is MSVCR120D.dll!operator new, then there is MSVCR120D.dll!malloc etc... until ntdll.dll!RtlAllocateHeap. It's good that the program can ignore such call stack entries. It also entirely ignores allocations made by system modules outside of your code.

Unfortunately it does this only by identifying module that the function comes from and not it's name, so it cannot ignore templates, like these from STL containers. Maybe ignoring functions by name specified as wildcard or regular expression would help, e.g. "std::*" or "std\:\:.+" - just like Visual Studio debugger can step over specified functions, as I described in How to Make Visual Studio Debugger not Step Into STL.

You can press "Take snapshot" multiple times and save the snapshots for later view. (They are just numbered, you cannot give them names.) By the way, Deleaker captures F5 key, so even when during debugging session, if the focus is in Deleaker panel, this button doesn't resume your program, but instead refreshes the list of allocations (takes new snapshot). You can also select two snapshots and compare them. Then you see only resources that were allocated in the right snapshot and not in the left, which can indicate a leak that happened during some time of the program execution.

Besides heap memory allocations, the tool can also detect other types of resources, like GDI objects. Unfortunately not all interesting types of resources are covered. For example, an opened file of type FILE* f = fopen(...) is shown as normal memory allocation and opened file of type HANDLE f = CreateFile(...) is not shown at all, but I guess it must be due to some system internals.

I didn't find a single leak in my main home project, so I created a dedicated, simple program to test if it can really find leaks. I also checked that it works with programs compiled in Release configuration as well.

Aside from being a Visual Studio plugin, Deleaker can also work as standalone Windows application.

Overall, I like the program. If its price is not a problem for you or your company, I think it can be very useful in improving quality of developed software. I especially like the fact that it's so easy to learn and use.

Comments (0) | Tags: c++ tools visual studio | Author: Adam Sawicki | Share

17:19
Tue
13
Jan 2015

Good Buy: ADATA DashDrive Elite UE700 128GB USB3.0

When I was browsing online shop, I was shocked to see that the market of USB flash memory sticks ("pendrives") changed so much recently. I have many pendrives that I was given or won as a prize somewhere, mostly 2-8 GB. My biggest pendrive was 32 GB that I bought several years ago for a very occasional price, as for that time period. Now I can see that the most reasonable choice (for money that I want to spend on a pendrive) is 128 GB!

So I started searching for a model to buy. Sure pendrive is not so complex as a laptop or a car - it's just a small accessory, but anyway I wanted to make a good choice, so I decided to look for following criteria:

  • Capacity = 128 GB
  • Possibly low price of course
  • USB 3.0 support
  • Fast transfers
  • Small size

Finally I found this one and I bought it for myself, as well as for my family as Christmas present: ADATA DashDrive Elite UE700 128GB USB3.0.

I'm quite happy with it. Transfers that I actually measured by writing and then reading one big file from/to SSD disk are: 110 MB/s write, 181 MB/s read, which is enough to write a 2 GB file in just 18 seconds and read it in 11 seconds.

(This article is not sponsored. It's just my personal recommendation.)

Comments (0) | Tags: shopping hardware | Author: Adam Sawicki | Share

23:14
Thu
08
Jan 2015

Lectures on ETI, Gdańsk University of Technology

Employees of Intel Technology Poland are visiting Gdańsk University of TechnologyFaculty of Electronics, Telecommunications and Informatics (known as ETI). On Thursday - 8, 15, 22 January 2015, there will be lectures as part of "Computer Graphics" course. Time: 11:15 - 13:00, place: new ETI building, room NE AUD1L. It's a lecture for students of computer science, but anyone who is interested can come and listen.

Together with Piotr Kozio³, I will be presenting on January 22nd. Our presentation has title "Shaders and their compilation" and will cover:

  • Review of rendering pipeline in modern graphics chips.
  • Presentation of HLSL shader language and shader assembler.
  • Topics related to shader compilation: SSA form, optimization types, register allocation.
  • Presentation of Intel GPU architecture.
  • Introduction to instruction set of our GPU.

During 2 hours we will cover lots of topics - basically all what happens to the shader after it's written in high level language and passed to graphics API - how it's processed by the driver and executed by the GPU.

Comments (0) | Tags: events teaching intel gpu | Author: Adam Sawicki | Share

00:07
Sat
20
Dec 2014

(Polish) Architektura wspó³czesnych gier video - Prezentacja

Zapraszam do obejrzenia slajdów z mojej prezentacji zatytu³owanej "Architektura wspó³czesnych gier video", któr± pokaza³em dzisiaj podczas targów Kariera IT w Gdańsku, 13 grudnia 2014.

Architektura wspó³czesnych gier video from Adam Sawicki

Comments (0) | Tags: productions events game industry | Author: Adam Sawicki | Share

17:45
Sun
30
Nov 2014

My Lecture on CareerCon

CareerCon is an event organized in various cities in Poland, dedicated to all kinds of jobs in IT, e.g. for programmers. You can find there many companies advertising their job offers. Entrance is free, but requires previous registration on their website. There are also some presentations every time.

13 December 2014 the event will take place in Gdańsk, where I will give a lecture "Architektura wspó³czesnych gier video" ("Architecture of modern video games"). If you are a professional programmer or a student interesting in career in IT, I'd like to invite you to come and listen.

Comments (0) | Tags: events teaching | Author: Adam Sawicki | Share

22:53
Sat
22
Nov 2014

PsyChill Evening - my first music visualizations

Yesterday I had an opportunity - for the first time - to show my visualizations as a VJ on a music party. The party was called PsyChill Evening, took place in Paszcza Lwa, Gdańsk, Poland and its musical style was described as "Psychill, Psybient, Downtempo, Psydub and Ambient".

Just like DJ is someone who plays music, a VJ is an auxilliary role of someone who makes visualizations in real-time, displayed using a beamer. There is some software dedicated for this, like Resolume or ArKaos, but what can be more fun for a graphics software enginner than coding my own software? So I made one. Honestly, I planned to write program like this for years, while now I had to do it in just one week, right before the party. It's written in C++ using DirectX 11. Here is how the result looks like:

As you can see, the rendering here is not very sophisticated, CPU- or GPU-intensive. There are just some 2D textures transformed and blended together (plus feedback from previous frame, plus symmetry) - all fading in and out smoothly, as it was for chillout music. But that's not the point here. There is some interesting code under the hood, like the way a "scene" is described in memory with all these changes that happen over time. Time is expressed inside the program not in seconds, but in beats, so after setting right BPM (Beats Per Minute), it synchronizes nicely with the music. The movement of these textures, as well as color transformations are all procedurally generated and random, so it's somewhat different every time. Of course, there is much more to be done here. But now all I need is some sleep :)

I love electronic dance music, so I'm very happy I could connect it wih my profession - graphics programming :D

Comments (0) | Tags: vj psytrance music | Author: Adam Sawicki | Share

23:47
Thu
13
Nov 2014

Microsoft Visual Studio Community 2013 !!!

Microsoft just released a new edition of Visual Studio that will replace Express. It's called Visual Studio Community 2013 and it's free, while it has all the features of the commercial edition, including support for plugins and many advanced tools. You can download it from Visual Studio Downloads, web installer or DVD ISO. It works with "old" Windows 7 as well. Good move Microsoft! For me it's probably the news of the month :) So far, I installed the IDE and tested on my home project CPU profiling:

...and Graphics Analyzer, which replaces good old PIX:

Comments (0) | Tags: visual studio | Author: Adam Sawicki | Share

22:05
Thu
06
Nov 2014

Experience with Game in Scheme

Last week I talked with a colleague about optimizing performance of his game project. It's written in Scheme (functional programming language, dialect of Lisp), using SDL and OpenGL. The bottleneck was GUI rendering.

When analyzing code, we found that the function for rendering text renders TTF font to a new surface with function TTF_RenderUTF8_*, then creates another SDL_Surface to convert format, then creates and fills OpenGL texture with glTexImage2D. The texture is then used just once for rendering... to another freshly allocated SDL_Surface, to perform clipping. All this happens for every GUI control, in every frame! Finally the objects are freed by Scheme garbage collector.

He then asked me whether we should find a way not to render the GUI part of the screen every frame, but only when something changes. He also cited the famous and often misused quote of Donald Knuth: "Premature optimization is the root of all evil".

I explained to him that modern GPU-s are able to render millions of triangles every frame and redrawing whole screen every frame is a standard practice. It's resource creation (allocation and filling of surfaces and textures) what should be avoided and not done every frame. If using SDL_ttf for text rendering, a final texture/surface should be prepared once and used to do just rendering in every frame, until the text changes. Additionally, calls like glViewport or glDisable(GL_DEPTH_TEST) also don't have to be made for every object in every frame.

When thinking about it now, the general rule of game optimization could be:

  • Don't calculate per pixel what you can calculate per vertex.
  • Don't calculate per vertex what you can calculate per object.
  • Don't calculate per object what you can calculate for a group of objects or once per frame.
  • Don't calculate per frame what you can calculate every X time, once per several frames, or only when it needs recalculation.
  • Don't calculate in real-time what you can calculate only once, when loading a game.
  • Don't calculate in game what you can precalculate offline in editor, build system or on your server farm and just store in files.

About functional programming and stuff like that, I think such high level concepts are good for software development as long as they are accompanied with understanding of what's under the hood. Some principles of functional programming, like avoiding side effects and just transforming one list of items to the other, are similar to the idea of DOD (Data-Oriented Design), used in game development for efficiency and scalability. But I don't agree that thinking about efficiency should be avoided until necessary or that optimization makes code complex and unreadable. Quite contrary - I believe simple code is both readable and efficient.

As I have little experience with functional programming, for me it was also fascinating to learn basics of Scheme. It's based on simple principles yet it is so powerful. I'm now thinking about how a language like this could be applied everywhere, from program configuration and as a description language, to game scripting and procedural media generation :)

Comments (2) | Tags: functional optimization | Author: Adam Sawicki | Share

Older entries >

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