Sunday, 20 November 2016

Gameview scrolling styles

The gameview of Kaduria is based on a technical limitation from ancient past. With tiles you had a limited space for the gameview and games like Ultima solved the visibility problem by placing the player character at the center of the view and then scrolling the gameview after each step.

When I watch gameplay videos of DCSS (Dungeon Crawl) I've noticed that scrolling at each step is kind of irritating. It's not that obvious when you play yourself rather than just watch however. What I find interesting is that ADOM is also scrolling per move, but only if there is more level to be displayed. At the ends of the level ADOM's gameview is not scrolling which is soothing to eyes. Another trick that helps is smooth scrolling. In fact it may be a bigger factor to make scrolling easier to follow (especially when watching gameplay videos).

The other option to scroll is known as "push-scrolling" which means more level is displayed when a limit is reached. The problem with push-scrolling is that you have to handle visibility somehow, because it's not always the same distance you or enemies can see, unless you limit the vision in the currently displayed gameview also.

I'm planning to move from centered gameview to push-scrolling style in Kaduria. Yes, after more than 20 years of development. Yet now when there are less limits on resolution it's possible to use a large gameview with 32x32 pixel tiles (or even bigger) if the resolution requirement is the current full HD. Who knows when Kaduria is released the now full HD is a small resolution.

Sunday, 30 October 2016

New tiles for automap

The tile size of automap is one of the special problems I have seen before during this project which is tiles getting too small for modern resolutions. The size of automap tile is 12 x 12 pixels and it's just slightly too small. Resizing to something like 16 x 16 could make a difference.

The automap routine is quite good at handling the change of size I think. It doesn't yet have any special features I'm planning, it's simply displaying the explored map. The automap could have some kind of world structure where you would select visited places and view the map of them. Writing comments on maps could also be a useful feature.

Thursday, 13 October 2016

Flow

I've entered into a nice mood or flow in programming. I think it's the result of leaving Rogue Temple forums. Or it might be the vitamin D I've started to take. Currently I'm going through game object classes and checking out virtual functions. There is a kind of problem when letting virtual functions "to do" later. When designing a virtual function logic you should write all versions for derived classes as soon as possible to find out problems with function parameters etc. For example it looks like I have to add 'actor' parameter for Break function for game objects, but we'll see it when testing that functionality.

One of the funny things I've noticed when programming a large project like this is just calm down and work for couple of hours at a time to get into that flow. Also, I have started to write more comments rather than less. It's such an important part of programming, but often neglected as it seems when looking at some source codes of roguelike games. Writing good comments is a skill, because it usually has to be in a form of summary rather than explaining line-by-line what is happening when you should be able to read the source code itself to find it out.

Sunday, 25 September 2016

Project update

After trying Visual Studio 2015 with Teemu and Brick Atelier it was a preferable solution to move Kaduria to it. I don't know why but it's somehow satisfying to compile the project with W4 warning level and pick up errors that were not catch by 2010 (or probably just using W3).

One of the warnings is unused parameters in base class functions which may sound like annoying warning, but it's actually useful. You should use base class parameters/function either to inform that base class routine was called (rather than leaving it empty) or improve the class hierarchy. In fact I have a hierarchy problem with containers which are a component part of game object classes while it probably should be a class to inherit from. The solution is either fill base class routines with some kind of detection if they are called or try to create a class hierarchy without pyramid inheritance problem.

It's odd how these technical details seem to be more interesting that trying to create the game itself, but I guess it doesn't matter a lot in this case.

Tuesday, 13 September 2016

Keyboard command design

I've tried to follow a plan in keyboard command design where keyboard commands have some kind of logic in them. Lower case letters are for commonly used commands and upper case letters for less used, but also some letters have similar kind of action with lower and upper case forms. This is done in some roguelike games, but I think it could be extended as much as possible.

For example I had 'q' to quaff as usual, but previously I also had it search for water sources from the environment first and if they were skipped then drink something from the inventory. However I started to think it was confusing and added a new command to drink from environmental sources with 'Q'. Even that command is often 'quit' in roguelike games it doesn't take a long time to adjust to that. There are also some other keyboard combinations in the same key with lower case for items and upper case for environmental sources. It's a nice, logical arrangement and easy to remember.

It's not particularly useful trying to cut down the amount of keyboard commands, because you still need some kind of way to activate commands. Menus can be ok in some situations, but worse in others. The design of keyboard commands actually takes some consideration that I believe developers of older roguelikes never did. That was the case with many other areas of design as well.

Wednesday, 24 August 2016

Avoiding work

I've tried to pick up development again, but it feels hard. When looking at a particular piece of source code all there is left is work... especially in game design. Not so much in technical implementation, but some of that is also needed. It may sound funny when I'm referring game design as work, but that's how I feel when I'm comparing it to "pure" programming (without creating game content).

Working is kind of boring when you don't get anything out of it, at least not money as in this case. I'm often wondering why I'm even doing this, because I don't like playing as I used to like when I was younger. Maybe the explanation is that it's became a strange kind of habit. I bet if I tried to quit it would feel like there is something missing.

Today I was checking out item code. It showcases the problem of getter/setters in class based programming, but it's just how it is. Sometimes you could in theory create methods that sit well inside a simpler datatype class, but most often you need to get pieces of atomic data and make determinations outside that class. Either way the stuff gets done and no one is giving you points from better OOP style.

Problems in item code are mostly related to classification of items and using item type to check out some properties. It's not a good idea, because you could add some new item that has the same properties, but would not get recognized by the game as that kind of item. In large systems you need to classify everything to a larger group of items, whatever it may be. Then use the group's data to detect item types in more abstract level.

Tuesday, 26 July 2016

Inheriting levels

Seeing how easy it was to inherit levels from Level class in Teemu I'm doing the same in Kaduria. The funny thing is that in Kaduria it's easier than it was in Teemu, because the level generation in Kaduria is more data-driven and relying less to specialized generation code. Splitting the gigantic Level class is useful also for a simple reason that you can concentrate on each level theme without having to worry about breaking up something elsewhere.

Other than that I've cleaned up messages. They are still giving me a lot of trouble, but it's starting to look like I'm able to remove last pieces of the old message code rather soon.