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

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 - fast 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

11:33
Thu
29
Sep 2016

How to Boost Your RAM to Declared 3000 MHz?

I recently upgraded some components of my desktop PC. I was suprised to discover that RAM doesn't work with declared speed of 3000 MHz. Here is the solution I've found to this problem.

Back in the days of DOS I can remember having to set up everything manually, like selecting IRQ number and DMA channel to make sound working in games. But today, in the era of Plug&Play, assembling a computer is easy and everything works automatically. Almost everything...

Although I found that both my new motherboard (Gigabyte GA-Z170-HD3P) and RAM modules (Corsair Vengeance LPX DDR4, 32GB(2x16GB), 3000MHz, CL15 (CMK32GX4M2B3000C15)) support 3000 MHz frequency, it worked on 2133 MHz. Motherboard specification says: "Support for DDR4 3466(O.C.) /3400(O.C.) /3333(O.C.) /3300(O.C.) /3200(O.C.) /3000(O.C.) /2800(O.C.) /2666(O.C.) /2400(O.C.) /2133 MHz memory modules", while specification of the memory has "3000MHz" even in its title. What happened? Motherboard spec calling all the frequencies higher than 2133 "OC" (like in "overclocking") gave me some clue that it is not standard.

After few minutes of searching on Google, I've learn about a thing called XMP (Extreme Memory Profile). It's an extension to SPD (Serial Presence Detect) - a protocol used by RAM modules to report to the motherboard what parameters do they support. I then checked in the specs that my motherboard, as well as my memory support XMP 2.0.

So what I finally did was:

  1. I restarted my PC.
  2. I entered BIOS/UEFI during boot with [Del] key.
  3. I located a setting related to XMP. It is called "Extreme Memory Profile(X.M.P.)".
  4. I changed it from "Disabled" to "Profile1" - the only other option available.
  5. I exited BIOS with saving changes.

That's all! Fortunately I didn't need to manually set any frequency, timings or voltage of my Skylake processor, memory or any other components, like overclockers do. With all the other settings left to default "Auto", the computer still works stable and RAM now runs with 3000 MHz frequency.

By the way: Please don't be worried when you see only half of this frequency in HWiNFO64 tool as "Memory - Current Memory Clock". All in all we are talking about DDR here, which means "Double Data Rate", so the real frequency is just that, but data is transferred on both rising and falling edge of the clock signal.

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

18:19
Tue
27
Sep 2016

Internet in Poland - My History

This article at forbes.pl says that yesterday there was a 26-th anniversary of first Internet connection in Poland. On 26 September 1990 scientists made a first connection between Warsaw and Geneva to transfer some data. I thought it might be a good opportunity to write down some memories of my personal beginnings with the Internet. I think it can be interesting to some younger readers that know only the modern Internet as it looks today, as well as to some foreigners, because history of the Internet it other countries may be a little bit different than in Poland.

I know there were things before, like people dialing specific numbers and connecting to so called BBS-es, but my first experiences were already dealing with "this" global Internet. I was in high school back then. At first I started to go to Internet cafes - venues throughout the city where you paid per hours you could spend working on a computer connected to the global network, and possibly downloading some files to your floppy disks. Going there after (or instead of :) school, I first learned how to use IRC and of course WWW. IRC was a protocol that required a client app (mIRC was the most popular one for Windows) and allowed to chat with people, privately or on numerous topic channels, so it was possible e.g. to meet local girls in my city :)

Of course the Web existed already too, with many pages about programming that I've been reading to learn Delphi and download some new components for it. There was no all-knowing Google then, not to mention StackOverflow. Instead there were multiple competing search engines (e.g. Yahoo, AltaVista, Infoseek, Lycos, HotBot) and their algorithms were not so good yet. Page directories were also popular, with manually managed lists of websites grouped into categories and subcategories. Many people created websites about the topics of their interest, like "John's website about programming", or about fishing, or whatever. Pages looked different than today. Their style was to be later called "Web 1.0", with the use of HTML frames, textured backgrounds and animated GIF-s.

Read full entry > | Comments (0) | Tags: history web | Author: Adam Sawicki | Share

19:41
Sat
24
Sep 2016

Pitfalls of Floating-Point Numbers - Slides

Just as I announced in my previous blog post, today I gave a lecture on a "Kariera IT" event - organized by CareerCon, dedicated to IT jobs.

Here you can find slides from my presentation, in Polish. It's called "Pu³apki liczb zmiennoprzecinkowych" ("Pitfalls of floating-point numbers").

Here are links to the Floating-Point Formats Cheatsheet (in English) that I mentioned in my presentation:

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

14:28
Fri
19
Aug 2016

Pitfalls of Floating-Point Numbers - My Lecture on CareerCon

CareerCon is an event organized in various cities in Poland, dedicated to IT jobs, 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.

24 September 2016 the event will take place in Sopot, where I will give a lecture "Pu³apki liczb zmiennoprzecinkowych" ("Pitfalls of floating-point numbers"). I will talk about properties of floating-point data types, which are the same regardless of the programming language you use. I will show their limitations, common mistakes to avoid and some good practices. If you are a professional programmer or a student interested in career in IT, I'd like to invite you to come and listen.

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

16:43
Thu
28
Jul 2016

How to disable C++ exception handling using macros?

Some time ago my colleague showed me a clever way to disable exception handling in C++ using a set of preprocessor macros:

#define throw
#define try          if(true)
#define catch(...)   if(false)

Please note that:

  • throw is a macro without arguments that resolves to just nothing, so the expression following it will become a standalone expression with its result discarded.
  • try is a macro without arguments that resolves to an "if" statement, that will smoothly merge with the following { } braces.
  • catch is also a macro that resolves to "if" statement, but it takes variable number or arguments and doesn't use them in its definition.

So following code that uses exception:

try
{
    // Do something
    if(somethingFailed)
        throw std::exception("Message.");
}
catch(const std::exception& e)
{
    // Handle the exception.
}

Will resolve after defining these three macros to following:

if(true)
{
    // Do something
    if(somethingFailed)
        std::exception("Message.");
}
if(false)
{
    // Handle the exception.
}

Of course it's not a solution to any real problem, unless you just want your try...catch blocks to stop working. Disabling exception handling for real (and associated performance penalty, as well as binary code size overhead) is the matter of compiler options. And of course this trick makes errors not handled properly, so when an exception would be thrown, the program will just continue and something bad will happen instead.

But I think the trick is interesting anyway, because it shows how powerful C++ is (it empowers you to do stupid things :)

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

14:32
Wed
20
Jul 2016

Upgrade to Windows 10 - My Story

I upgraded my system to Windows 10. Free upgrade is avaiable until July 28th for all genuine users of Windows 7, 8 and 8.1, so now it's high time to do it if you don't want to pay for it later. My upgrade went well, but not without problems. Here is my story:

First some basic information:

  • There are two ways to upgrade Windows. First is to use the "Get Windows 10" app that pops up for several months on everyone's desktop, also known as GWX. Second is to go to Get Windows 10 website and download a small tool "MediaCreationTool.exe". This tool can also be used to download and create a bootable DVD ISO image or USB flash drive with offline Windows installer.
  • To get your free license of Windows 10, you need to perform an upgrade. After the upgrade you will have a product key for your new Windows, which you could use to reinstall the system from scratch if you want to. Product key of the current system, whether it's Windows 7, 8, or 10, can be retrieved using a small tool called ProduKey.

On my old Toshiba laptop with Windows 7, bought in 2011, the upgrade failed. The system is not broken though - Windows 7 still works. After the failure I checked manufacturer's website and found that there are no drivers for this model for any operating system newer than Windows 7, so it's good to stay this way.

On my new Lenovo laptop with Windows 8.1, bought in 2015, I was able to successfully perform the upgrade suggested by the system. All the devices work correctly. All installed programs and settings are also preserved.

On my PC, with most components bought in 2013, upgrade to Windows 10 also failed. I can remember fighting with this annoying upgrade window and deleting some system files few months ago, so that might be the reason. I was ready to format my system disk and install everything from scratch anyway, so here is what I did:

  1. I made all necessary backups - an obvious step :)
  2. I launched "MediaCreationTool.exe", selected "Create installation media for another PC" and created a DVD ISO file with offline installer.
  3. I burned the file to a DVD disk.
  4. I booted my PC from Windows 7 installation DVD, formatted my system disk and installed fresh Windows 7 on it, with proper product key.
  5. I launched "MediaCreationTool.exe" and performed upgrade to Windows 10. It succeeded this time.
  6. I launched ProduKey and written down the new product key of my upgraded Windows 10.
  7. I booted my PC from Windows 10 installation DVD, formatted my system disk again and installed fresh Windows 10, with the new product key.
  8. Finally I could install all the needed apps, apply my preferred settings, set some nice wallpaper etc. (I especially recommend Mandelbulb Maniaces Facebook group as a source of wallpapers :)

I could find drivers for Windows 10 for all my components and peripherals and they all work correctly (except only an old, little webcam - ModeCom MC-1.3M, but I don't use it anyway). I could also install all the programs that I need and they seem to work.

I recommend you to also get your free upgrade to Windows 10. I had an opportunity to work with this system a lot and I could say it's not that bad :) I know there are some arguments against the new Windows version, so let's look at them:

  1. Privacy concerns. They say that Microsoft introduced telemetry code that is spying on its users and sending everything to Microsoft. That might be true, but:
    • There are ways to disable or at least minimize it - just search for "windows 10 disable telemetry".
    • Microsoft introduced telemetry to Windows 7 and 8 as well, and even to programs compiled using Visual Studio 2015.
    • Whether we like it or not (and I don't like it either), technology world evolves in the direction where our data is moved to the cloud and so corporations and governments are spying on us. It's impossible to avoid, unless you want to be an outsider using only free software and give up on all the goodness that is available to us, like smartphones.
  2. New user interface is flat and ugly. I agree with that. There are even leaks from Microsoft that explain why it looks this way. But only the new part of the system (like Settings window) are made in this new style. All other windows and apps have similar looks as they had before.
  3. People commonly believe that new version of the system always works slower. I can see this is not the case. Since Windows 7, 8 and now 10 developers put a lot of effort to make it work fast, especially in terms of startup time. I think that Windows 10 boots and works as fast as previous versions.

There are some advantages of the new Windows as well, especially compared to Windows 8.x. There is no Charms Bar and Hot Corners when you but your mouse cursor in the corner of the screen. Start Menu is back with just few tiles you can configure and the old good list of installed applications. (You can always get even more old-fashioned Start Menu by installing free app: Classic Shell).

But the most important is what's not visible to the naked eye. As a developer I know that a new operating system is not about new looks of buttons and menus or new Calc application, but mostly about new technologies under the hood. Some of them (like Direct3D 12 and WDDM 2.0, to name just these related to graphics) are available in Windows 10 only. Some applications and games will require them to work sooner or later. That's the reason I believe it's worth upgrading to Windows 10 as long as it's free.

I plan to update my blog more often now, so I invite you to come back here from time to time or subscribe to my RSS channel.

Comments (0) | Tags: microsoft windows | Author: Adam Sawicki | Share

00:51
Thu
09
Jun 2016

Pixel Heaven and Bajtek Special Issue

Do you remember "Bajtek" magazine? I don't, because I was a little kid back then, but older colleagues told me that in 80's and 90's it was a popular Polish magazine about computers (like Atari, Commodore or Amiga - platforms that were in use at that time). Archival issues can be downloaded for free from atarionline.pl.

Now, 20 years after last one, a new issue has been released. It's a single, special issue - Wydanie specjalne: Bajtek. There is my article inside - "Programowanie grafiki dzi¶" ("Graphics Programming Today"). The article describes briefly a history of graphics cards (from first 3D games, through 3Dfx Voodoo and S3 ViRGE, cards from NVIDIA and ATI/AMD, appearance of OpenGL and DirectX, to invention of shaders), shows graphics pipeline of modern GPU-s and mentions the new generation of graphics API-s (Direct3D 12 and Vulkan).

Many people who were interested in graphics programming, games or demoscene at the time of Bajtek magazine, now have a more "serious" job, whether in software development or something completely different, and they no longer have time for this hobby, so they are not up-to-date with advancements in this technology. So I thought they may like a short update on this subject.

The new issue of Bajtek was first shown on Pixel Heaven - a party that took place 3-5 June 2016 in Warsaw. I've been there and I had a great time. There were many different activities, like indie games exhibition, retro gaming zone, lectures and discussion panels.

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

16:10
Sat
21
May 2016

What software engineering has to do with history, politics or law?

When at school, I always prefered scientific classes (like mathematics) over humanities. Among my most hated classes were: history, geography and language/literature. That's why I chose to become a programmer. But despite computer science is a scientific discipline, I can see that on a higher level, software engineering involves some humanities like, for example, history, politics or law.

History, because in software - just like in real life - you need to know what happened in the past to be able to understand the state of things we have right now. For example, in the field of graphics API-s, someone asked a question on Programmers Stack Exchange: Why do game developers prefer Windows? The best answer is the one that extensively explains how two main API-s - DirectX and OpenGL - evolved over years.

Politics, because top-level decisions are not always made based on purely technical arguments. Going back to graphics API-s, Microsoft decided to push its next-generation low-level Direct3D 12 into Windows 10 only, while Khronos Group defined Vulkan as an open, multiplatform standard. Google was rumored to design its own graphics API, was even asked by John Carmack not to do so, and it finally returned to the negotiation table with Khronos, so Android N will support Vulkan as well. Apple chose different path and did design its own graphics API - Metal. Similarly, in the GPGPU field, OpenCL is a widely supported standard, but NVIDIA succeeded in promoting its own, vendor-specific API: CUDA. HSA is yet another such initiative, led by a foundation. Among its members are: AMD, ARM, Imagination, Qualcomm, Samsung and many others, but the list lacks some big players, like Intel or NVIDIA. So developing software technology is a little bit like doing politics - "Am I strong enough to go against the others or do I need to seek allies?"

And finally, the law. Specifications of programming languages and API-s are somewhat like acts passed by the government. They are written in natual language, but should be as unambiguous as possible, precisely defining each term, specifying what is allowed and what is not. Doing something against the specification is like breaking the law - it may go unnoticed, it may even give you an advantage (like programmers notoriously relying on signed integer overlow in C++, despite formally it's an undefined behavior), but you may also "get caught" (and get a compilation error or invalid results from your program). On the other hand, a compiler or API implementor not complying to the specification is more serious problem - it's like a state official breaking the law against you. You may just accept your fate and go away (equivalent of not using broken feature and looking for some workaround) or you may report it (so the bug will be fixed in new compiler/driver/library version).

So although software engineering is a scientific/technical discipline, I think that on a higher level it can be compared to some degree to humanities like history, politics or law.

Comments (0) | Tags: philosophy | Author: Adam Sawicki | Share

Older entries >

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