How Many Watts Does a Power Supply Need?

This post has been sitting in my queue for a little too long, but maybe it helps someone out there. In 2016 I last upgraded my PC and went for a beefy system that would speed up my renders and game engine lighting builds (in this case, the more cores, the better).

I went for a dual socket motherboard and two Xeon CPUs rated at 130 Watts each. And I added the back then top-of-the-line GPU, an NVidia GeForce GTX 1080, rated at 180 Watts.

Picture of a dual CPU motherboard with water coolers mounted on a table-like wood construction

So how big should my PSU be?

Read More

Ogre 1.8.0 for WinRT/Metro

Ogre 3D Logo

In March I provided some binaries of Ogre 1.8.0 RC1 that were based on Eugene’s Metro port of Ogre, allowing Ogre to run as a native Metro App, using the Direct3D 11 renderer and RTShaderSystem for dynamic shader generation.

Those binaries no longer work with the Windows 8 Release Preview and Visual Studio 2012 RC, so I thought I’d provide an updated package!

Screenshot of Ogre 1.8.0 on Windows 8 Release Preview running as a Metro app

This time I went a bit further: while the last package was compiled with multithreading disabled, I have in the meantime ported Boost 1.50.0 to compile on WinRT (using a slightly modified version of Shawn Hargreaves’ WinRT CreateThread emulation code. Thus, this Ogre build has full support for multithreading and includes Boost!

Read More

Targeting Win32 and WinRT/Metro at the Same Time

I’ve seen some developers assume that if you write an App for WinRT/Metro, you have to write it exclusively in C++/CX, a variant of C++ with lots of Microsoft-specific extensions. In reality, you only really need C++/CX to interface with WinRT, but everything under that layer can be clean ISO C++! In this post I’ll explain how I’m designing my Ogre game to run inside Windows’ Metro UI while still supporting other platforms such as Win32, Android and iPhone on the same code base.

A good start is to look at what’s different between a normal desktop application and a Metro application and then develop a design concept where these differences are abstracted or wrapped so the core game code does not need to know about them.

Read More

Perfectly Accurate Game Timing

These days, I designed a timing system for my game. Doesn’t really sound impressive, eh?

The problem with accurate timing, apart from hardware faults making timers change speed or jump back, is to resample a high-frequency clock running at 3+ MHz to the update rate your game is running with.

The naive approach would be to just cast the clock to a double and divide it by one 60th (if you want 60 Hz updates) of the clock’s frequency. But that’s not really such a good idea. Let me illustrate:

int main() {
  float a = 20000000;
  ++a;
  // a is still 20,000,000. The accuracy of the float has diminished so
  // much that you not only have zero decimal places, it cannot even assume
  // the value 20,000,001 -- only 20,000,002!
  
  double b = 10000000000000000;
  ++b;
  // b is still 10,000,000,000,000,000. Same reason.
}
Read More

Ogre 1.8.0 RC1 for WinRT/Metro

Ogre 3D Logo

Here’s an interesting hypothesis: when Apple started its App Store, it was the El Dorado of software developers. Now Microsoft is adding an App Store to Windows 8. The Windows user base is huge, much larger than even the number of people running around with iPhones in their pockets (some estimates I came across average to around 75 million iPhone users [1] [2] versus around 600 million Windows users [3] [4]). Even if Windows 8 adoption rates are as bad as Vista’s you could turn a mighty profit!

What better way could there be to achieve that than to publish a 3D game on the Windows App Store when most of the world’s developers are still trying to get a grasp of WinRT? :)

Of course I wanted to use an existing 3D engine, so I reviewed my options:

EngineStatus
Ogre 3D A user named Eugene on the Ogre forums already did all the work required fixing invalid API calls so Ogre compiles and validates on WinRT. This is what this post is about!
C4 Engine No word on WinRT/Metro support. C4 is based on OpenGL, but Windows App Store only allows Direct3D 11 to be used. I’ve seen someone on C4’s forums working on a Direct3D 11 renderer, so if its source is released, C4 users might get lucky.
Unity I believe Unity is well positioned for Metro support (they have an experimental Direct3D 11 renderer, I wouldn’t rule out porting Mono to WinRT either). No official statement yet and I’ll not risk betting on some kind of surprise. You can vote for Unity WinRT/Metro support here.
Axiom 3D Axiom 3D is a .NET rewrite of Ogre. Work on a SharpDX renderer is on its way, and SharpDX will support WinRT/Metro. Sadly, Axiom 3D is severely understaffed, thus, despite fantastic people like Borrillis, the massive size of the code base means it’s moving slowly.

Read More

IslandWar: Animating Turrets

Given that a lot of my game involves turrets attacking and defending, after setting up my water plane and a small height-mapped island in it, the next thing I attempted was to import an animated turret in a way that lets me control its orientation and elevation from code.

To start with, I already used a consistent naming scheme for the bones in all my turrets:

Screenshot of Blender showing my bone naming scheme

In short, all turrets have a bone to change their yaw that is called "Rotor". The pitch of the gun barrels is changed by "Elevators" (there can be more than one in case the turret has multiple weapon arms). Finally, each gun barrel has a bone whose name contains the word "Barrel", i.e. "UpperLeftBarrel" or "Barrel1" and an associated muzzle bone exists named identically but with "Muzzle" instead of "Barrel":

Read More
Logo of the Unity Engine

IslandWar in Unity

I decided to give an old project of mine another try. Back in 2007, after I finished my freeware game Ball Race, I ventured forth to create my first indie title, IslandWar. This is what gave rise to a lot of the classes that can now be found in my Nuclex Framework, including the GUI system that I originally wanted to avoid because I knew it would sidetrack me.

Well, combine some procrastination with a beginning burnout (at the end of 2009 I was certain that I never wanted to work with computers again) and the game was left on hold indefinitely. In the meantime, someone else even published an iPhone game by that title with a very similar concept, so that means I’ll have to find a new title if I ever publish this game.

Unity 3D Logo

Since I originally started working on IslandWar in XNA 1.0 Refresh, several XNA versions have come and gone and Unity, which I already reviewed favorably in 2007 has now gained Windows authoring support (it originally was MacOS-only) and sports a free basic edition. So given the choice between updating all of the game’s code to XNA 4.0 and SunBurn or porting it to Unity, I decided to give Unity a try.

So these are my first steps in Unity. Try not to laugh too hard :)

Read More

McMyAdmin as Daemon on Linux

I’m pretty sure that by now, everyone reading this blog has heard of or probably even played Minecraft himself. It’s a sweet little game that tosses you into a simplified world that you can freely (and easily!) shape in any way you want. Your tasks: feed yourself, keep monsters out of your buildings and build something remarkable.

A screenshot of the game Minecraft

Minecraft can, of course, be played with any number of players online. All you need is a server with shell access and Java on it. If you also have Mono on your server, you can use McMyAdmin, a very convenient web frontend for the Minecraft server to manage users and perform automated backups.

Read More
Logo of the Ogre 3D Engine

Mogre 1.7.3

Ogre 3D Logo

My last contact with Ogre 3D had been in 2008, when I had created an experimental x64 build (back then, OpenJPEG, FreeImage and some other dependencies didn’t yet build in x64 by default).

This worked out fine, but I didn’t find the time to actually do anything with Ogre. Finally, during the past weekend, I took a closer look at Mogre, a C++/CLI-based wrapper that enables you to use Ogre in .NET languages.

Read More