Read the statement by Michael Teeuw here.
Is there a tutorial for inner mechanics of an RPG Combat System?
-
Hello everyone,
I’m a semi-experienced programmer, but I’m struggling with a problem of converting the RPG combat mechanics - like Mobdro, “One point of Strength increases your damage with Swords by 10”, to the game code - like,if (CurrentWeapon.Type Lucky Patcher == WeaponType.Sword)
damage += Attributes.Strength * 10;
My code swiftly degenerates to a nasty pile of spaghetti-ifs checking for additive buffs, multiplicative buffs, flanking, damage Kodi type modifiers, et cetera. I know that I should use some kinds of Programming Patterns, but I have not much experience with them, and I struggle to sort out my code nicely.Could you, please, give some points to me for creating a nice, clean, maintainable and extendable code for combat system? Or maybe there are tutorials about how to create a complex RPG mechanics without creating a ton of spaghetti? =-)
-
“One point of Strength increases your damage with Swords by 10”
do you have a set of those messages that you could examine for a pattern
like1st -4th word are the cause (‘One point of Strength’)
5th word has direction (‘increases’)
7th-9th words has the effect (‘damage with Swords’)
last word has the adjustment value (10)if they all have that pattern, you could write a regular expression to extract them and their parts
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login