May 23, 2020 - Still alive

Very long time; no post.

So; what has happened since last?

I was quite busy at Fatshark. Vermintide was a big hit. Making a game that is mostly coded in Lua run fast enough on consoles was a challenge ^__^

2016 - October
Then even more busy at DICE; fixing post launch bugs Battlefield 1, .. then developing Battlefield V. Doing what I usually do; low level stuff. Optimizing. Fixing weird bugs. Handling Console specific things. .. and working for DICE/EA meant no coding on own projects and such. I guess that is one reason I haven’t updated this website in forever. The other main reason is me being lazy :p

2019 - August
And from this, you will probably understand that I do not work at DICE any longer. I moved on to Avalanche as the Lead Programmer for theHunter: Call Of The... more.

Aug 15, 2016 - Floats

I have quite recently learnt things about floating point math, or, to be clear, about IEEE 754.

So, I thought I knew most things about them. And then sadly I read way too many bad sources and got quite confused (some good as well!). To get to the bottom of it, I did what I always do; try it out myself. Debug it!!

This is in the specific context of game development. So, fast, and perhaps not extremly precise? Also x86/x64 specific. And I only know the options name/existance in VS2015.


Read more.

Jul 17, 2016 - Update

Haven’t updated in a long time. Mostly busy with work. ( Vermintide PC version released in October 2015. Console versions being worked on. )

I’m really liking Visual Studio 2015. Even if it made one of my previous post on using clang in Visual Studio superfluous.
And now with that, all the C++ features are available! Normal Microsoft compiler has come a long way, but there are still a few things missing. Not that I use a lot myself. The newest feature I use is variadic templates. My logging class doesn’t have macros anymore, and it is typesafe!

I plan to actually do some proper coding very soon.
Not just tiny examples to help relieve my curiosity for new features and such. :)

Jul 30, 2015 - Timing: Only use QueryPerformanceCounter if needed? (UPDATED 2016.03.28)

Short story: I did some profiling (I do a lot of profiling) and QueryPerformanceCounter showed up a lot more than..I felt it should. So, some reading up and testing later, I am now using rdtsc/rdtscp.

Longer story: A long time ago, before computers had more than one core, and if the CPU supported it, the fastest way to time things where by using the rdtsc instruction. The granularity you got was a lot higher than any other kind of timing instruction available at the time. Partly because it wasn’t really a timing instruction; it returned instructions executed since boot-up.

The problems:

  • If a CPU changes speed, the rate of instructions per second was not constant; hard to use for timing.

  • Multi-core. One cores rdtsc instruction might give a whole different value than another. Our thread might switch core, a lot. The cure for... more.