Five Hundred / January 17, 2019

Help me! Five Hundred AI

Since releasing the Paradice Five Hundred game all those years ago, one of the most consistent pieces of feedback I receive is that the AI partners and opponents don’t play optimally. This.. is very likely true. I’m limited in that I can only design a computer player that plays as well as I know how

Read More
Code / February 26, 2014

Boolean Function Parameters

Consider the following code, which might be part of a custom Font class to draw fancy text. Looks good, right? Parameters are clear, order makes sense, and it’s easy to understand what the code does when you find it invoked: No need to go searching for the function implementation, or hovering over using the IDE

Read More
Code / February 22, 2014

Puzzle: FPC’s TEventObject, in Windows

This post is kind of an open question. I’m hoping that I can get some comments, any comments, on it 🙂 Let’s set up a situation with a problem, and look at different solutions for addressing the problem. Which one do you think is best, and more importantly, why? The Setup There is a multithreaded

Read More
Code / February 16, 2014

Don’t use Suspend and Resume, but don’t poll either.

So, using thread Suspend and Resume functionality is deprecated in Delphi, Freepascal, and even Windows MSDN itself warns against using it for synchronization. There are good reasons for trying to kill this paradigm: suspending and resuming other threads from the one you’re currently on is a deadlock waiting to happen, and it’s typically not supported at all

Read More
Code / February 4, 2014

Playing video in FPC

A short and simple post for today. Playing a video file in Freepascal, without using Lazarus. I honestly couldn’t find any examples on the internet of how to do this, so I made one. The DirectX9SDK has examples of how to use DirectShow/ActiveMovie to play back video files in C++, however, the common version of

Read More
Code / February 1, 2014

Direct3D – Optimizing for different hardware

When your project is nearing completion, it’s time to look at optimization. For Direct3D, this typically means grouping and reordering of things to make the hardware work as efficiently as possible. For Direct3D 9, Microsoft have published a handy guide of things to look at optimizing here. But it’s interesting to look at the difference these

Read More
Good coding guidelines / January 25, 2014

Sometimes it’s the driver

Consider this pseudocode: Is there a memory leak in the above code? This is just pseudocode, so I’m not trying to be tricky with syntax and I haven’t omitted any key steps in init or shutdown. The answer I should get is “no”. And yet, in reality, the answer is “maybe”. All the code does

Read More
Code / June 6, 2013

Five Hundred redesign in development

Update: Version 1.00 now available – get it from this link! Wow, far, far too long between posts! Icefall development is currently on hold for a little while as… the problem is… I’m not finding it as fun to play as it should be. So I think I need to take a break and focus on

Read More