• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 833 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 Apr 19, 2019, 7:07 PM Apr 18, 2019, 6:59 AM

    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 Apr 18, 2019, 12:15 PM

      “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
      • 1 / 1
      1 / 1
      • First post
        2/2
        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