Dienstag, 12. Juli 2016
Epsilon Eridani
Ich greife mal wieder nach den Sternen, aber diesmal nicht als Computerspiel, sondern als Novelle. Der Protagonist des Buches wacht völlig verkatert zehn Lichtjahre von der Erde entfernt auf, und versucht, das Beste draus zu machen.

Buch 1:
01 - Viel Glück!
02 - Der Große Filter
03 - Wiios Gesetz
04 - Planung mit Unbekannten
05 - Futarchy in the U.N.
wird fortgesetzt...

Inspiration war (neben den Romanen von Stanislaw Lem, die mich für Science Fiction begeistert haben) eine Serie von Essays, die Eliezer Yudkowsky auf lesswrong.com veröffentlicht hat (jetzt auch als E-Book: "Rationality: From AI to Zombies"). Viele Leute mit denen ich darüber geredet habe empfinden es jedoch als Zumutung, einige tausend Seiten Wissenschaftsphilosophie auf englisch lesen zu müssen (obwohl Eliezer auch komplizierte Themen gut erklärt).
Er hat das Problem anscheinend auch erkannt, und "Harry Potter and the Methods of Rationality" geschrieben, eine Fanfiction in der Harry Potter nicht bei den Dursleys, sondern bei Oxford-Professor Michael Verres-Evans aufwächst und, mit der wissenschaftlichen Methode und einer gehörigen Portion Hacker-Mentalität bewaffnet, Hogwarts unsicher macht. Ebenfalls sehr lesenswert, und zu finden auf hpmor.com (es gibt auch eine ausgezeichnete Hörbuchversion, gelesen von Eneasz Brodski, auf hpmorpodcast.com).
Um diese Ideen auch deutschen Lesern näher zu bringen habe ich kurz mit dem Gedanken gespielt, seine Geschichte zu übersetzen. Aber mir erschien es dann doch interessanter, etwas Eigenes zu schreiben...

[Sorry, an English version of this post would be kind of pointless, considering that it is about a novel I am writing in German. But you might want to take a look at my inspirations referenced above. If you are anything like me, they will provide you with an incredible amount of insight as well as plenty of good entertainment.]

... link (0 Kommentare)   ... comment


Dienstag, 23. Dezember 2014
Projekt Eden
[Projekt ist auf unbestimmte Zeit eingestellt]
Im Moment bastle Vor kurzem bastelte ich an einem Computerspiel, bei dem es um die Besiedlung von fremden Planeten geht. Langfristig versuche ich, den selben Detailgrad und Realismus wie Dwarf Fortress zu erreichen (bei ansprechenderer Grafik und einfacherer Bedienung) - im Moment bin ich aber schon froh, wenn es überhaupt spielbar wird.
Das hier ist die erste Alpha-Version, bei der überhaupt etwas zu sehen ist - aber es ist mehr eine Tech-Demo als ein Spiel. Man kann bisher zufällige Planeten erzeugen lassen (der selbe Name erzeugt dabei immer den selben Planeten) und die Grafik bewundern.

Why not spend a nice holiday on Iota Piscium a this year? See the lovely lakes, the wonderful telephone system, ...
Windows-Binaries: https://www.dropbox.com/s/qiftgp4290nnij5/Eden-Alpha1-win32.zip?dl=0
Source*: https://www.dropbox.com/s/tom7yl9riuw8aoz/Eden-Alpha1-source.zip?dl=0

[Project currently on hold]
I'm currently I was recently working on a video game about the colonization of alien planets. In the long term, I'm aiming for the same crazy level of detail and realism as Dwarf Fortress (while keeping graphics and UI more pleasant) - but right now I'll be happy when it is playable at all.
This is the first Alpha version that gives an impression of what it will look like - but it is more of a tech demo than a game. You can generate random planets and admire the graphics. The same name will always generate the same planet.

*And Code::Blocks project. Will compile under Windows and Linux (I haven't tried it on a Mac - but there's no reason why it shouldn't work).
There is currently a Heisenbug hiding somewhere. It disappears once you compile it with at least one debugger stopmark anywhere in the code (making it rather annoying to hunt down, which is why I can't be bothered to right now).

... link (2 Kommentare)   ... comment


Sonntag, 14. Dezember 2014
Update für SDW & QDW
In der Zwischenzeit habe ich in SDW und QDW einige Bugs gefunden und behoben. Die wichtigsten Änderungen sind:

- OpenGL-Texturen lassen sich jetzt auch aus einer SDW::Surface erzeugen, wenn ihr Alignment ungleich null ist. Außerdem kommt die Funktion jetzt ohne temporäre Kopie aus, weil sie direkt aus dem SDL-Format in den Grafikspeicher lädt.
- Die Widget::addX()-Methoden geben jetzt eine Referenz auf das erzeugte Element zurück. Das erspart die Suche nach dem neuen Element, wenn Eigenschaften verändert werden sollen.

sdw-qdw-alpha2.zip (zip, 26 KB)

---

Update for SDW & QDW

In the meantime, I've found and fixed a few bugs in SDW and QDW. The most important changes are:

- Generating OpenGL Textures from a SDW::Surface will now work even if its alignment is nonzero. It will also upload the data directly from the internal SDL format, eschewing the need for a temp copy.
- Widget::addX() will now return a reference to the created widget. This removes the need to search for the new widget to adjust its properties.

sdw-qdw-alpha2.zip (zip, 26 KB)

... link (0 Kommentare)   ... comment


Samstag, 20. September 2014
Variants in C++ (ohne RTTI)
Manchmal ist es nötig, Variablen von verschiedenen Typen im gleichen Container zu speichern. Für diesen Zweck gibt es in vielen Programmiersprachen einen Variant-Typ - jedoch nicht in der C++ Standardbibliothek. Es gibt andere Implementierungen, aber die meisten haben den Fehler dass sie RTTI benötigen (und damit auch dort Kosten verursachen, wo sie gar nicht gebraucht werden). Viele haben obendrein eine umständliche Syntax, benutzen manchmal hässliche Makros und/oder sind vom Konzept her schwer verständlich. Dabei ist das völlig unnötig. Nach einigen eigenen mittelmäßig erfolgreichen Experimenten mit void*, CRTP und Lambdas bin ich schließlich bei einer fast schon lächerlich simplen Implementierung angekommen. Die Daten liegen auf dem Stack, der einzige Overhead ist der type_index, und lesen/schreiben ist komplett typensicher. Ein winziges Problem ist noch, dass manche Debugger den Datenzugriff bei Referenzen manchmal für einen Segfault halten (was er nicht ist; der Debugger kann das aber nicht wissen) - wenn man stattdessen (Smart-)Pointer benutzt, klappt alles wunderbar...

variant.hpp (hpp, 1 KB)

---

Variants in C++ (without RTTI)

Sometimes, you need to store variables of different types in the same container. That's what Variant types are for. But the C++ Standard Library doesn't have one. There are other implementations, of course - but most use RTTI, which creates overhead in places where the Variants aren't used or needed. Many also have a convoluted syntax, use ugly macros and/or are hard to grasp conceptually.
But it turns out that this is completely unnecessary. After some experiments using void*, CRTP and lambdas (with mixed results), I found an almost ridiculously simple way to do it. Everything is stored on the stack now, the only overhead is carrying the type_index around, and reading/writing is completely type safe.
There's still a minor problem though: Some debuggers may occasionally believe that accessing data on a Variant& is a segfault (which it is not, but there's no way for the debugger to know or check this). But if you're using (smart) pointers instead, there's no problem...

variant.hpp (hpp, 1 KB)

... link (0 Kommentare)   ... comment


Samstag, 13. September 2014
GL Object Wrapper
Modernes OpenGL ist effizient, schnell, leistungsfähig und vielseitig, aber die Syntax ist noch wesentlich umständlicher und verwirrender als sie es ohnehin schon war. Um die Verwendung etwas weniger schmerzhaft zu gestalten, habe ich also eine Mini-Bibliothek geschrieben, die einem die gängigen Funktionen wie das Kompilieren von Shadern, das Binden von Uniforms und das erstellen, befüllen und hochladen von Vertex Buffer Objects abnimmt:
Der GL Object Wrapper "GLOW".
Für Leute die noch auf alten Systemen ohne Shader arbeiten kann die Bibliothek auch die Fixed Pipeline mit Vertex Arrays benutzen - die Syntax ist für beides (so weit wie möglich) gleich.
Mit dabei ist auch ein Loader für Wavefront Objects (.obj), ein gängiges und gut dokumentiertes Format für 3D-Modelle.
Das Beispielprogramm verwendet SDL, SDW und QDW zum Laden von Texturen und für I/O, aber GLOW selbst benötigt nur OpenGL und GLM.
glow-alpha1 (zip, 947 KB)

GL Object Wrapper Demo

While modern OpenGL is efficient, fast, powerful and versatile, its syntax became even more arcane and convoluted than before. To make using it a little less painful, I wrote a small library to handle common tasks like compiling shaders, binding uniforms and creating, filling and uploading Vertex Buffer Objects:
The GL Object Wrapper "GLOW".
For old machines, the library can also use the Fixed Pipeline with Vertex Arrays, while keeping the Syntax as close to identical as possible.
The library also contains a loader for Wavefront Objects (.obj), a common and well-documented type of 3D-Models.
The example uses SDL, SDW and QDW to load textures and handle I/O, but GLOW itself only requires OpenGL and GLM.
glow-alpha1 (zip, 947 KB)

... link (0 Kommentare)   ... comment


Sonntag, 24. August 2014
Simple Directmedia Wrapper
Bei Grafikprogrammierung habe ich mich bislang immer auf Allegro (https://www.allegro.cc) verlassen; die Bibliothek kann ich immer noch empfehlen, gerade für Einsteiger, aber an vielen Ecken könnte sie schneller, portabler oder ausgereifter sein. In dieser Hinsicht ist Simple Directmedia Layer oft deutlich überlegen, weshalb ich jetzt zu SDL2 wechsle. Beide sind jedoch reine C-Bibliotheken, was bei Programmierern die C++ und RAII* gewohnt sind regelmäßig für Kopfschmerzen sorgt. Also mussten ein paar Wrapper-Klassen her, um die Arbeit zu erleichtern und Ressorcenmanagement zu übernehmen.
Das Ergebnis ist der Simple Directmedia Wrapper, eine header-only-Bibliothek die dem Anwender die ganze nervige Buchhalterarbeit abnimmt.
Ein anderer beklagenswerter Mangel sind schnelle, vielseitige und einfache Widget-Bibliotheken die reibungslos mit SDL zusammenarbeiten. Die meisten Programmierer scheinen CEGUI zu benutzen, aber in der Praxis ist es oft unnötig groß und komplex. GWEN und KiWi sehen auch vielversprechend aus, aber beide neigen zu Abstürzen und scheinen nicht mehr weiterentwickelt zu werden. Mein Ansatz hierfür sind die Quick&Dirty Widgets, eine weitere header-only-Bibliothek die zusammen mit SDW benutzt werden sollte. Sie können mit SDL's Software- oder Hardware-Renderer benutzt werden; man kann das GUI aber auch als OpenGL-Textur binden, irgendwo auf den Bildschirm projizieren und mit shaderbasiertem OpenGL oder Immediate Mode mischen. Der Skin wird aus einer Bilddatei geladen und kann angepasst werden; Ein Win98-artiges Design ist standardmäßig dabei.
Beide Bibliotheken verwenden C++11 (insbesondere shared_ptr und Lambdas) und erfordern daher einen modernen Compiler; ich habe sie auf Ubuntu 12.04 mit GCC und Windows 7 mit MinGW getestet. Außerdem benötigen sie SDL2 mit Image- und TTF-Plugins und (wenn OpenGL benutzt werden soll) GLEW**.
Die erste Alphaversion gibt's hier, mit einem Beispielprogramm das die verschiedenen Anwendungen zeigt:
sdw-qdw-alpha1 (zip, 590 KB)

QDW Screenshot

Until recently, I mostly used Allegro (https://www.allegro.cc) for graphics. I can still reccomend it, especially to beginners, but I often found it not fast, portable or mature enough. I find Simple Directmedia Layer superior in this regard, which caused me to switch to SDL2. Both, however, are pure C libraries, which causes frequent headaches for programmers used to C++ and RAII*. What I needed was a bunch of Wrapper Classes to simplify my work and take care of the resources. This resulted in the Simple Directmedia Wrapper, a header-only-library that handles all the bookkeeping for you.
Another thing I missed was a fast, versatile and simple Widget library that plays well with SDL. Most people seem to use CEGUI, which I find too large and compex for most uses. GWEN and KiWi also look promising, but both are prone to crashes and development seems to have ceased. My solution are the Quick&Dirty Widgets, another header-only-library for use with SDW. They can be drawn using SDL's Software- or Hardware-Renderer, but you can also bind the GUI to an OpenGL-texture, project it somewhere to the screen and mix it with shader-based or immediate-mode OpenGL. The skin is loaded from an image file and can be modified freely; a Win98-like look is included.
Both libraries use C++11 (especially shared_ptr and lambdas) and thus require a modern compiler; I tested them on Ubuntu 12.04 with GCC and Windows 7 with MinGW. They also require SDL2 with the Image- and TTF-Plugin and, if they are to be used with OpenGL, GLEW**.
This is the first alpha version, compete with an example program to show how it can be used:
sdw-qdw-alpha1 (zip, 590 KB)

---
* http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

** The example also uses GLM, but the libraries themselves don't.

... link (0 Kommentare)   ... comment


Noch ein generisches Rollenspielsystem
Jeder Rollenspieler der etwas auf sich hält scheint früher oder später sein eigenes Regelsystem zu schreiben (oder zumindest eine Sammlung an Hausregeln, die leicht als neues System durchgehen könnten). Meine Motivation dafür war, dass meine Gruppe regelmäßig sehr unterschiedliche Szenarien spielt und nicht andauernd neue Regeln lernen will. Also brauchten wir ein generisches System. Bislang hat man da im Wesentlichen die Wahl zwischen sehr freien Systemen wie Wushu und FATE (die mir nicht genug Anhaltspunkte geben um konsistent zu leiten, und der Gruppe nicht genug um ihre Handlungen zu planen), und GURPS - mehrere tausend Seiten voll mit Regeln und Tabellen, die sich kaum jemand merken kann oder will und die umfassender sind als ein halbes Dutzend spezialisierter Systeme (ich mag es trotzdem irgendwie...).

Damit war Selberbauen angesagt. Meine Anforderungen:

- Es darf nicht größer sein als unbedingt nötig, und muss auch für Anfänger verständlich sein.
- Es muss ohne spezialisierte Materialien auskommen (nur sechsseitige Würfel!)
- Die Regeln müssen genau genug sein, dass die Spieler vorher ungefähr wissen können wie die Situation behandelt wird, und planen können.
- Es muss möglich sein, nicht benötigte Teile der Regeln zu ignorieren ohne anderswo in Schwierigkeiten zu kommen.

Das Ergebnis ist eine Sammlung von Modulen (jedes nur ein paar Seiten lang), die nach Belieben kombiniert werden können, und alles von Fantasy bis SciFi abdecken: Das Generische Modulare System.

Runterladen kann man die aktuelle Version bei scribd:
http://de.scribd.com/collections/4321900/GMS-1-01DE

---

Yet another generic role playing game system

Sooner or later, every GM worth his salt seems to design his own system (or at least a collection of house rules that could easily pass for one). My motivation for this was a group that likes to play lots of different settings, but can't be bothered to learn a new set of rules for each. Thus, we needed a generic system. Currently, there's the choice between freeform systems like Wushu and FATE (that make consistent GMing and planning harder than it should be), and GURPS - a few thousand pages worth of rules and tables few people would want to learn, which are larger than half a dozen specialized systems taken together (I still have a soft spot for it, though...).

In short, we needed a new system. My requirements were:

- It should be as small as possible, and quickly explained to beginners.
- It should not require specialized material (so, only D6s)
- The rules should still be specific enought that the players can know beforehand how a situation will be handled (and plan accordingly)
- You should be able to safely ignore any part of the rules you don't want to use

The result is a collection of modules, a few pages each, that can be mixed and matched freely and covers everything from Fantasy to SciFi: The Generic Modular System.

You can get the current version at scribd:
http://de.scribd.com/collections/4319550/GMS-1-01EN

... link (0 Kommentare)   ... comment


Die Bithalde
Dieses Blog ist eine Sammlung verschiedener Ideen, Konzepte und Projekte, an denen ich gerade arbeite, und die ich mit der Welt teilen möchte (und vielleicht die eine oder andere Schimpftirade über aktuelle Themen). Nichts auf dieser Seite erhebt irgend einen Anspruch auf Vollständigkeit, Nützlichkeit oder Korrektheit - aber es steht jedem frei es runterzuladen und zu benutzen.
Wenn nichts anderes angegeben ist, ist alles auf dieser Seite unter der CC-BY-NC-SA Lizenz verfügbar. Ich bitte darum, Nutzungen die davon nicht abgedeckt sind vorher mit mir aushandeln.

---

The Bit Dump

This blog is a collection of various ideas, concepts and projects I want to share (and maybe the occasional rant about current topics). Nothing here has any claim on being complete, useful or correct; it is provided as is, and you're free to download and use it.
Unless explicitly written otherwise, all content is licensed under CC-BY-NC-SA. Any other use needs to be negotiated with me first.

... link