Wednesday, 5 June 2013

Rethinking artificial intelligence

A while back I removed AI system I had been developing for some time and merged it to a command structure. Maybe I was looking for a simpler solution, but after some thinking it's obvious that there must be a separate AI logic with the original primary/secondary task idea.

How tasks will be organized is not yet clear, but each of the creature has to keep something in mind, a goal to which it is reaching. A number of things can change the goal, but not secondary tasks which involve things like swimming or some other circumstance as a temporary block between the creature and its target or goal.

I'm too dumb to use any sophisticated AI algorithms, but I think you don't need any of that to make creatures do what you want. Also, algorithms tend to produce predictable patterns that can be exploited. I intend to create an unpredictable AI that can sometimes make huge mistakes or forget something important. If I can make it so that the player will see those mistakes then it's going to be cool.

Sunday, 5 May 2013

Mountains of snow

I find myself again at the snow top. This level theme requires some new routines, but if I keep myself calm I can possibly create a brief sketch for each level theme per week or two. Anything new made in a theme can be used later and most of the time consuming stuff is creating things that don't yet exist.

When most level themes of Kaduria are quite static with some random structures it has made me think what I'm actually trying to do. It's like Teemu, I can't call it a roguelike. It's too static and more like adventure game. Still it has permadeath which even I find annoying. The interesting thing is that some people like the challenge permadeath is creating. Even when the game design is poor and often your character dies in a random situation which could not be avoided. This has made possible to create games that have quite poor game design, but some people still like them. ADOM is a great example. It never was really good as a game, but its difficulty became a feature some hard core players like anyway.

I know it's funny when you remember my strict opinion about what a roguelike should be, but I have to think about removing permadeath from Kaduria. I want to create a large game world and more static content. It's not good combined with permadeath. I think pure roguelikes should have relatively small game world and almost completely random level generation. However Kaduria will most likely be a fusion of "static" RPG and a roguelike. Maybe it could be a good idea to include an iron man mode with permadeath for hard core players.

Wednesday, 1 May 2013

Caverns of doom

In the next phase caverns or more like passages connecting them went through everything else as was expected. Passages wider than 1 tile were removed temporarily, since there is no routine to check rooms with the ellipse routine drawing passages. It's a minor problem to be fixed later.

Caverns itself were too small for some reason. Fixed that with proper data for the level theme. That way I can control the size on each level theme if needed.

Both actual rooms and caverns are separate "layers" so it's possible that sometimes those two don't have a connection between them. It's rare, but possible. I'm going to check that with flood fill and then searching a place where a corridor can be made without breaking anything else.

When looking at cavern interior generation I started to think too much again. There are 11 different interiors now and some of them are unfinished, but I realized that I can and should leave some of them to do later, namely those I don't need right now in this level theme. It may be even possible that caverns can't do something I need later and I have to create another more specific routine for that task.

Next I'm going to add small rooms which is the last feature for this level theme. After that I'm going to move on next level theme. The idea of the new plan is first create the physical structure of each level theme and only then add details.

Saturday, 27 April 2013

Plan B, part 2, phase 2

Connections between "rogue" rooms work now, in the simple form without any complex routes for corridors. Some room types prefer to have a centered doorway and it also works, but with the assumption that rooms always start from the edge of the room space. Also, there is a need for a new type of space searching routines which understands different room shapes (the current one checks a rectangular area).

Now I can move to the next phase which is generating other stuff in the level beside the important theme rooms. I have not tried it yet, but I think it's going to be interesting. The manual generation process will hopefully make it easier to control the generation, but I have a feeling that I need to change something. The good thing is that I have sanded the parts of the generation to such a perfection that there is hardly anything left to do but connect the dots.

I also realized that I can change the way small "auxiliary" rooms are connected to other parts of the dungeon. There can be different rules to produce complex houses with room types logically connected to each other. Let's say a shop can have a small storeroom and also a bedroom where the shopkeeper is staying. The storeroom can be connected to the bedroom as well so if you sneak into the storeroom you need to go past the sleeping shopkeeper.

Friday, 19 April 2013

Room refactoring

Yesterday was a bit depressed, because I have to refactor rooms - again. How long it's going to take to get this right? The plan requires a new kind of connection scheme for rooms which are generated "rogue" without corridor nodes. Of course I started to think all sorts of ways to connect rooms - with other rooms, caverns or whatever. I'm thinking too much.

Today it seems to be easier to start with simple tasks. First, rooms need more detailed connection data which means they know exactly where they are connected and how. The second task is creating manual connection routine between rooms and checking out existing connections. After that it starts to get complicated, but I can only test it to see how everything else works with rooms.

It may be not that difficult as it seems, because I have created a lot of routines and most of the refactoring is using those routines slightly different way.

Thursday, 11 April 2013

Planning on paper

Planning on paper works really well. Yes, even when you plan random generated levels. It's easier to think what types of rooms or other features you need in that level theme.

Of course I ran into problems when a new shape for specific type of room was needed. The way walls are created works only for rectangle shapes and it's possibly difficult to fix so I'm doing it the easy way with blueprint tech developed for Teemu.

I also came to a conclusion that it's simply impossible to create all level themes with a single routine and data input. It's not that bad, I just need to write routines for each level theme using tools that already exist. That way I can do all types of funny stuff to create special themes. The order of creation plays an important role here, because changing the order makes funny level themes possible.

Another big thing is also the amount of randomness in some level themes. I was thinking that a long time and wondering how I could make level themes random enough. It's not the issue really. I could make endless number of variations or then I could start to finish level themes and make them less random. If it's creating too static themes I'm changing the game from a roguelike to RPG with save/load game and removing permadeath.

Thursday, 21 March 2013

Weapon research

The RPG system of Kaduria is more physically based. It means there is more research to do with weapons and armours. I like doing research, but I don't want to dig too deep into that stuff. However it's interesting to realize how little we modern people know about medieval type weapons. Why they were like that and how they were used. In fact I think even actual scientists don't know everything yet, because the practical knowledge was lost when firearms were invented.

The techniques that were used had been developed during thousands of years. Imagine all that fighting and the history of weapon development to become better at killing. It's so revealing and tells a lot about us humans.

When I read about medieval weapons there is always something I didn't know or realize. Let's take an example of arrows. I knew they have a pointy end, but I didn't realize there were so many types of heads. Each of them had specific use. What I'm going to do is take essential head types and model them in Kaduria. It's something else compared to just having a regular arrow.