posted 26-04-2003 21:09 BST
Ok, since I'm fairly sure I'm one of the few who have made a combat system I'll give a few tips.For single player games you have status variables which you've probably used for your stats. I'm assuming from the demo the basic combat stats you are using are 'attackpower' and 'defensepower'. There are a few different ways to determine if the attack is successfull, the most common in muds and rpgs is dicerolls.
In my combat system demo, I used a sum of 100 as a basis for a successful and a random 100-sided dice roll to determine the success rate of the attack. The formula was like this...
ATTACKPOWER - DEFENSEPOWER + Dice(1-100) = SUCCESSRATE
This means ANYTHING over 100 was a successfull attack, anything under it was a miss.
Examples of how it played out clipped straight from my demo are as follows...
> attack I think I'm Back
You stab at I think I'm Back with an engraved mithril falchion!
AS: 115 vs DS: 50 + d100 roll: 85 = 150
Skillfull strike to the leg... That should slow 'em down! 47 damage!
I think I'm Back slumps to the ground and ceases living!
Roundtime: 8 seconds
> attack stinky
You swing at Stinky with a bare fist!
AS: 2 vs DS: 35 + d100 roll: 92 = 59
A clean miss!
Roundtime: 7 seconds
> attack stinky
You swing at Stinky with a heavy iron club!
AS: 25 vs DS: 7 + d100 roll: 97 = 115
Off-balance swing taps the shin. That might bruise! 8 damage!
Roundtime: 9 seconds
I felt the random 1-100 left enough room so that a weak player could still get lucky and hit a player stronger than them, but also it provided for weak hits as well as very strong hits in like strength players and also it was a system that had a look and feel I was familiar with, as some of you may be as well.
A more classic rpg way of doing things would be to simply be able to hit anything with a lower 'defensepower' than your 'attackpower'. The damage dealt to the target could be figured out by dividing the 'attackpower' by the 'defensepower'. This would make situations like 'attackpower=6' vs 'defensepower=5' result in very little damage dealt to the target, but as your attack grew, fighting weaker opponents would be easier and easier untill only requiring one blow. This does cause a problem though when dealing with opponents with a higher 'defensepower'.
I don't know what all this meant or if it was helpful, but realistically, a combat system can be anything you want, just as your game can be anything you want.
If you want your player to have a 25% chance of hitting the target, then just...
SET NUMERIC <chance; $rand(1;4)$>
if ( %chance% = 1 ) then do <attack>
However you want it. If you want them to have a 75% chance then just do...
SET NUMERIC <chance; $rand(1;4)$>
if ( %chance% <> 1 ) then do <attack>
I don't know. I'm retarded, have fun.