MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Is there a tutorial for inner mechanics of an RPG Combat System?

    Scheduled Pinned Locked Moved Tutorials
    2 Posts 2 Posters 1.0k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      Pyaar Banned
      last edited by Pyaar

      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? =-)

      1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil
        last edited by

        “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
        like

        1st -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

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0

        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
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy