October 20, 2018

Unknown type name 'u_int'

I ran across the error message (Unknown type name 'u_int', 'u_long', 'u_char' etc.) when trying to incorporate some old C code into a more modern project. It shows up in system headers, like sys/attr.h, and I was confused. After quite some time I figured out what the problem was, so I thought I’d share. Simplified example The source code, when simplified, looked something like this: $ cat test.c #define _XOPEN_SOURCE 500 #include <sys/attr. Read more

October 6, 2018

AddressSanitizer (ASAN) examples

AddressSanitizer is a great tool for finding bugs in C or C++ projects. It consists of some instrumentation added to code at compile time, as well as a dynamically linked runtime. Good test coverage is required, as it detects problems at runtime, while running your test-suite. To use it, supply -fsanitize=address to both the compiler and linker when building for tests (works in newer versions of clang and gcc). There are great resources for understanding how it works, but when I started, I was missing a few simple examples. Read more

July 27, 2018

Using Systemd to ensure unit(s) run on one CPU core

This post is based on an excellent article from Red Hat: https://access.redhat.com/solutions/1445073 I’m a CFEngine developer, so this is a more work related post. CFEngine and Systemd In some performance critical situations, it makes sense to limit management software to a single CPU (core). We can do this using systemd and cgroups. CFEngine already provides systemd units on relevant platforms, we just need to tweak them. Tested using CFEngine 3. Read more

June 6, 2018

The DayKnight 30-day project - Week 4 / Final update

DK30 has been over for quite some time. I wanted to post a final update about my progress, for my “fake week 4”. Work and other things have kept me busy, so I’m not done with everything I wanted to do, but still enjoy working on the game. Enemies I’ve added a few enemies, with skills and the basics needed for AI. Currently the AI is completely random. Ogre - Only knows how to attack Slime - Uses a few basic physical moves, like Attack and Slash Wizard - Can use both healing and damaging magic skills. Read more

May 18, 2018

The DayKnight 30-day project - Week 3

DK30 has officially ended. As I’ve been busy with work, progress has been slow. I’ve done some changes to pave the way for better GUI, but nothing to show there. This post is mainly about the new skills. Skills I’ve added 8 active skills, I think this is enough for the demo, and shows the potential of the combat system. For simplicity, all the explanations below assume that you have equal stats as your opponent. Read more

© Ole Herman Schumacher Elgesem 2018

Powered by Hugo & Kiss.