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.

Sunday, 26 June 2016

Level class inheritance

The Level class in Teemu is probably the last class that doesn't use inheritance (from those that needs it), but it's about to change. I've already started to break it apart. Level class shares almost every feature between different level themes, but the obvious difference is the generation process.

I was thinking before that generation part wasn't "good enough" reason for inheritance, but I think I was wrong. If nothing else it's easier to maintain source code one theme at a time compared to huge combined Level class. But it's possible to start think about more advanced inheritance schemes with intermediate classes between the base class and actual themes. Longer inheritance chains are better, because they emphasize the benefits of inheritance, but as always you have to be careful not to create wrong kind of inheritance.

This is an important change, because Kaduria has also one large Level class and even from this brief experience I can tell inheriting is much better than one class. It took me a long time to realize this, but things sometimes are set a certain way and can stay that way, because it feels like a big task to change it.

Friday, 17 June 2016

Cleaning up Teemu

It's surprising that I'm now a better programmer than I was couple of years ago, because I was really great then. When I'm looking at the source code of Teemu I can now see some issues clearly. The main problem is the way classes have functions (and functionality) that belongs to somewhere else. This is often easy to fix and I've been doing some of that already.

Sometimes functions could use another class using two or more classes to modularize classes to do only what they are supposed to do. But in some cases it's probably not that bad, especially in smaller projects like Teemu. Some classes could be broken into smaller ones, but it's not worth the trouble, because often some functionality is used in limited number of places. I've learned to avoid refactoring when weighing the benefits of better source code vs. time spent to fix some minor issue. Everything can be fixed later.

It's also useful to arrange files into small logical groups in the IDE using virtual folders (or filters as Visual Studio is calling them). This is more important in large projects, but it also keeps files in control in small-ish projects like Teemu.

Tuesday, 14 June 2016

Teemu news for 2016

After changing Teemu from SDL1.2 to 2.0 I've kind of abandoned it. The main reason is Kaduria, but somehow I also managed to mess up the source code of Teemu too much so now it's in state of minor chaos.

The problem areas in Teemu are message system and Level class. For some reason those two are difficult to get right for me. It's possible to copy some code from Kaduria's message system, but it's much bigger than Teemu's system and not that easy to use. I think it is also a bit different so it's not even possible to use it without changing messages calls.

The least I can do is go through Teemu's source code again and check out the problem areas, then try to figure out what to do with them. In game design I was first planning to change Teemu to become more a sandbox game without "story", but now I'm not so sure about it. I kind of like the adventure game style where you need to find key items to solve other things.

I would hate to leave Teemu in the current release state, because the new stuff I've made (and planning to do) is quite cool.

Thursday, 19 May 2016

Windows 10 review

Windows 7 finally decided to force upgrade to 10. I could have stop the countdown to upgrade, but I thought what the hell, let's do it. Upgrade took about an hour to install and contrary to many experiences I did not have any problems.

The graphical look is more "blocky" and ascetic. Color settings are limited, there is no option to set user defined colors. I guess it will change some day. Another thing that has changed is the taskbar at the bottom of the screen. It's now black (always, I didn't find a way to change it) with white text. Active program has a dark grey tab with black text and non-active is even worse, it's completely black with only icon showing. I've been scratching my head for this, but I think it's simply a graphic design trick to "detach" the taskbar from everything else and not draw too much attention to it.

New features in task bar are notification/action center widget, search (which actually is quite nice) and task view (I don't know what it is). There is some kind of bug in notifications, because it's telling the same two things always when computer is started (Acer registration removed and MSE replaced with Windows Defender). People have had that same problem and for some it has disappeared after few days so I'm waiting rather than trying to do something about it.

The start menu is ok. I don't really care about tiles section, but as always you find actual programs from the list which is divided into alphabetical order. Settings (control panel) is also quite easy to use. Microsoft really went back from the horrible mistake of 8 tiles GUI to much more traditional OS.

Performace is kind of interesting in 10. It's eating memory way less than I expected, only 1,3Gb from 4Gb total. There are couple of more processes than what I had in 7, but the CPU use is quite conservative (seems to be 2% idle). New Task Manager and Resource Monitor are more advanced than they were in 7, showing all kinds of metrics of the system. Some programs are noticeably slower, especially Firefox for some reason. Other programs seem to be faster.

Windows 10 didn't remove any other programs than Acer registration and MSE (which is a part of the system now as Windows Defender). It's a mystery why Acer registration was removed, but luckily it wasn't anything important. Programs seem to work as always, even Visual Studio 2010 is working, and Kaduria of course. Maybe it's not a big surprise, because 10 seems to be built on 7 with some new GUI stuff and new programs.

People have had problems with 10 and updates of it, but at least this version in my computer is fine. I don't like the way it was forced, but I can understand it costs money to maintain several versions of an OS so Microsoft is using rather invasive ways to herd people to 10. I don't care really that much, I wasn't hurt when 7 was taken away from me. I don't miss that OS.

Thursday, 14 April 2016

Fix your shit Microsoft

The recent event with Windows update has made the update process fail and constantly spend 50% of cpu (in dual core, it's 25% I guess in quads) in Win7. I've tried couple of tricks, but it could have made things worse... In a way things like this are almost understandable because it's Microsoft, but...

If only I was a regular computer user, I would immediately switch to Linux. But I'm a game developer and I'm thinking in terms of availability of programs. It makes a lot of sense to develop for most common platform and then possibly release source code for hacker platforms like Linux, where compiling from source code is something you do all the time.

Microsoft has had problems with 10 as well. I believe it has been the most unreliable OS since Vista. People talk about several types of problems related to hardware, software or even 10 working at all. Clearly there has been changes in the way Microsoft handles programming since Bill Gates left the building. Gates is a real programmer, in fact I think he is actually good at programming. One can only wonder that goes in the mind of Gates now when he is watching these recent problems of Microsoft.

The situation in OS market has been difficult for many years, because we don't have a good option for Windows. If there was, a huge number of people and companies would gladly leave Windows. Both OSX and Linux have different kind of problems. OSX has very limited amount of software and I firmly believe the reason is the way Apple handles development. Linux and open source world is on the other hand too unreliable for any real life work. You need some kind of consistent support for regular programs used in real jobs and even we know Windows has serious problems in security etc. it's still a better option.

It's strange to realize that 10 years ago (Windows XP era) things were better. Even we know more today and have much better hardware something has happened that makes everything difficult and unreliable. Programs, operating systems and even web pages are getting worse, not better. What the fuck happened?

Thursday, 10 March 2016

7DRL day 5: Failure

I had no motivation to continue this project, even though the amount of work required was not that much. I'd rather put that energy to development of Kaduria.