Jump to content

Recommended Posts

I need help coming up with a better combat system for my PHP RGP-MMO. Is anyone interested?

 

Right now it is basically offense vs. defense. Whichever is greater wins, but is honestly getting dull.

 

Total Offense = User Total Units + User Unit Upgrades + User Unit Bonuses.

 

Total Defense = Enemy Total Units + Enemy Unit Upgrades + Enemy Unit Bonuses.

Link to comment
https://forums.phpfreaks.com/topic/232502-php-battle-system-for-my-rgp-mmo/
Share on other sites

I think you mean RPG....

 

I was making my own a little while ago.  Single player, so it wasn't a MMO, but the combat engine was the heart of it.  Here's the gist of it:

 

Both PlayerCharacters (PCs) and Enemies derived from a base Character class.

 

PCs could be one of three classes - melee DPS, hybrid/status effect class, ranged DPS/mage.

 

Characters had a list of Attacks, which were objects.  Every class had access to the basic attack.  Specialized attacks were class-dependent.  New attacks were gained every 3 character levels.  Note that 'Attack' was a generic class... some of them weren't attacks in actuality, but buffs/debuffs.

 

Attacks could also have status effects tied to them.  These effects would attach themselves to the targeted Character (on a successful hit) via the Observer pattern, and each effect had a duration.  They would detach themselves from the Character when the duration reached 0.

 

All of this class/attack/status effect data was saved as XML files so I could add new classes, attacks, and effects without having to hard code much into the system.  It was as simple as simply dropping a new XML file into the correct directory.  Enemies had their own, simpler XML files.

 

Combat itself was turn-based.  50/50 chance of the Enemy attacking first.  All of the rest of the attacks happened in sequence.

 

I forgot what math I used, but I made sure there was a sliding miss percentage based on the Character's level.  That way, good equipment wouldn't totally make one's level useless.

 

I never got around to finishing it, but I had the basics of the combat system working.  I stopped during the status effect design phase due to real life things.

Never thought of creating a GIT(hub) repo for it, Nightslyr?

 

I might do that.  I don't know if I'll ever get around to finishing it, so someone else may as well take my half-baked ideas and see what they can do.  It's an ASP.NET project, but aside from the hoops I had to jump through to successfully hook into its Page object's lifecycle (which was a PITA), and some LINQ to read in the data from the XML file, the majority is straight OOP code.  Anyone should be able to lift most of it with minimal translation.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.