Tuesday, 5 July 2016

Messages and events

The small event system that I had started is now removed. It was kind of funny thing, because I didn't realize that when you have an event system it has to cover everything in the game. Otherwise you have two "flows" of program happening at the same time, resulting to random outcome.

The event message type was not removed, because changing that would have been hard. In fact it works just fine, because "event" type messages simply use another type of id in specific situations. These are things like opening a door. With events you can make the door opening abstract, detached from who is actually opening the door, so later it's possible to make other creatures than the player open the door without changing anything in the door opening routine.

I've been combing the source code for messages, because some of them are not working as expected. When messages are ok then it's easier to concentrate on rest of the unfinished stuff. It's mostly gameplay content (story) and some level themes which need more complex stuff. I really want to release the new version even without the new RPG system, as soon as it starts to look like a playable game.

The current version of Teemu has 98 source files so it has been growing since last release. The quality of source code has also increased a lot I think. One of the reasons I'm releasing the source code is that I want to show in practice why C++ (OOP) is such a good option in programming (compared to C). It's hard to convince anyone just by telling that C++ is better, this way it's obvious.

No comments: