HCProfessionals Posted April 2, 2011 Share Posted April 2, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/232502-php-battle-system-for-my-rgp-mmo/ Share on other sites More sharing options...
KevinM1 Posted April 2, 2011 Share Posted April 2, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/232502-php-battle-system-for-my-rgp-mmo/#findComment-1195893 Share on other sites More sharing options...
ignace Posted April 2, 2011 Share Posted April 2, 2011 Never thought of creating a GIT(hub) repo for it, Nightslyr? Quote Link to comment https://forums.phpfreaks.com/topic/232502-php-battle-system-for-my-rgp-mmo/#findComment-1195905 Share on other sites More sharing options...
KevinM1 Posted April 2, 2011 Share Posted April 2, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/232502-php-battle-system-for-my-rgp-mmo/#findComment-1195913 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.