But, this blog is supposed to be about my project. So a while ago, in august 2014, I decided I had done enough simple and medium programs, and it was time to move into something more difficult, like a RPG. So I worked in C# on that for a while, but I got stuck and had to start over. This happened several times until one day I was a bit sick, and I was randomly trying to code a level generator just to discover how they work, when I suddenly thought of why I couldn't just use procedurally generated levels in a RPG. I had been playing a lot of NetHack (I'm old fashioned, I don't care) and I could see a lot of RPG elements in there, like levels and stuff, so I thought I would just make my RPG more like a rogue like (whats the difference anyway). I continued to work on that one since then, and I am pretty confident I will be able to finish this eventually. The language I was playing around in was python, so I guess I am stuck with that now.
OK, enough for the dreaming, lets talk about what I have got. I got a nice picture that shows my class hierarchy:
So, main is in charge of getting a display window, and getting instances of all the other classes, passing events on to the world object, and telling windows when they should rerender themselves. The world object stores data about the current level and passes events from the main on to the player object, tells the AI of monsters when they are allowed to update based on there speed (I don't actually have a real AI implemented yet, they just choose a random direction to move in.
I have 3 window objects: One to show the screen, one to show the messages, and one to show the stats. The last one is just a class: pass block, right now, so that is why the top of the screen isn't cleared since the loading screen.
The grid object takes care of generating the level, and stores the base level (Not objects, like the player, only walls and floors)
The Player/Monster object stores stats of the object, and has AI code if its a monster. (Monsters inherit from player, they override the receive event function)
A body object is attached to a player/monster object, but changes if it would polymorph. It defines stuff like special combat attacks, tile visibility, stat ratio and what items would be worn. It hardly stores any data, this is all classlevel. Note that the way I handle XP earned while polymorhed is add it normally to your XP, but the monsters ratio will determine how much the monster can use.
The combat system is based on several targets on the monster, wich have different damage ratios, They have a posiiton and size, wich determines how likely you are to miss, and what other body parts you are likely to hit if you miss. Here is the map for human:
its upside down because I am measuring distance from the ground.
The idea is also that shorter monsters can't hit higher up body parts. This last part about combat isn't actually implemented yet, but I will probably finish that tomorrow, I will probably post again tomorrow.
Thanks for reading!
(I don't actually expect anyone to read this)