Jump to content
  • Advertisement
  • entries
    18
  • comments
    12
  • views
    17295

Working on combat system

Sign in to follow this  
mousetail

928 views

So, I was feeling a bit less motivated, so I decided to keep a blog again! Unfortunately, this meant I had to delete my old blog, but luckily I could keep the points I got from there.
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:
2.png
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:
human.png
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)
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!