Combat enhancements: Difference between revisions

From PSwiki
Jump to navigation Jump to search
Landson (talk | contribs)
Landson (talk | contribs)
 
(50 intermediate revisions by the same user not shown)
Line 1: Line 1:
(Go back to the main [[GSoC_2011|GSoC 2011]] page)
<small>'''[[GSoC_2011|GSoC 2011]] > Combat Enhancement'''</small>
 
<div style="float:left; margin-right:20px; margin-bottom:15px">__TOC__</div>
 


== Design Information ==
=== Abstract Description ===
The idea here is to give combat a little more flavor and variety than what is currently available. I feel combat should have multiple types and varieties of attacks. The most important part of combat in PlaneShift though is the roleplay. PlaneShift is unlike other MMORPG's in the fact that it is not a grind power fest, it is about immersing yourself in the game and being your character. So instead of the typical twitch style combat, I feel it is important to make the combat a roleplay experience in and of itself.
The idea here is to give combat a little more flavor and variety than what is currently available. I feel combat should have multiple types and varieties of attacks. The most important part of combat in PlaneShift though is the roleplay. PlaneShift is unlike other MMORPG's in the fact that it is not a grind power fest, it is about immersing yourself in the game and being your character. So instead of the typical twitch style combat, I feel it is important to make the combat a roleplay experience in and of itself.


=== Features Wanted ===
== Combat Design ==


These are features I am currently thinking about, more may be added while some may be removed over the next couple weeks of planning.
=== Current Design ===
PlaneShift today allows the players to engage combat with magic, with melee (like swords, axes, .. ) and with range combat (like bows).
Players have the possibility to choose stances: full defense, defense, normal, attack, berserk, to tell the engine how much of their skills they want to use for defense or for attack. The monsters today always use normal mode.
There is a table which determines the effects of each type of weapon vs. each type of armor. For example a knife will make more damage against a leather armor (which can be cut) than against a chain mail.
All stats, equipment, skills, item stats and quality are considered in the combat sequence. The actual formulas are pretty complex, and give some realism to combat.
Player can use 2 weapons, or a weapon and a shield. Players can use items to boost their stats/skills and fight better.
 
NPCs/Monsters can be:
* invulnerable (in this case you cannot even attack them)
* peaceful but able to fight back. They will not attack by themselves unless provoked.
* attack on sight. They will attack as soon as you approach them.
 
When you attack a monster you enter in his hate list, and he will chase you and attack you.
Combat is executed automatically by the server, the player can switch equipment, cast spells and move/run. If the player stands still in front of the monster, combat proceeds automatically until one of the two dies.
Progression is done through increasing your skills, stats and gaining new equipment. This allows you to fight better and face harder monsters.
 
=== Goals ===
 
As I was going through the code I noticed a few things about the current combat system and the planeshift server system as a whole.
1) the current spell system has almost every feature that I want the actual combat system to have.
2) progression scripts handles a lot of the special features I want to be implemented, and it would be easier to add to this system rather than create something entirely new. This would also help the spell system which would father also help combat.


==== An Attack Style System ====
==== An Attack Style System ====
Line 35: Line 56:


==== Misc. ====
==== Misc. ====
*make single wielding and dual wielding matter, for isntance a dual wielding attack may do half the damage per hit, or maybe even less but give a better chance at a special effect?
*make single wielding and dual wielding matter, for instance a dual wielding attack may do half the damage per hit, or maybe even less but give a better chance at a special effect?
 
== Technical Details ==
 
=== Goals and Deadlines ===
 
* edited 7/16/2011
==== Stage 1 ====
 
Starts:May 11th
 
Deadline: June 25th


=== Detailed Implementation Plan ===
Status: DONE (except progression script enhancements, it hasn't made my priority list yet, and probably won't until testing starts on what I have already)
The most important part of this system, because it is the base is the queuing system used. As well as the psAttack class(to be implemented) that allows for attacks to be read out of the database and held in the cache until called by the queue.


note: this is still in development, will become more detailed over the next couple weeks.
* Create the attack database and include a few example elements.
* Design and implement a new combat manager.(this now depends on a few things whether it will be this stage or next)
* Implement the queueing system
* Include the queue in the psCharacter, so that each character has it's own queue, required as part of combatManager.
* Make CacheManager Load Attacks up from the database at startup
* Create psAttack to as a data structure to hold the attacks in cache as well as in the queue, and to be used in combatManager.
* Implement the current list of special effects through progression scripts
By The End of Stage 1, I expect combat to be useable much as it is today, it will be more of a base system without any real new features. But it is meant to be extendable to make rest of development easier.
 
==== Stage 2 ====
Starts: June 25th
 
Deadline: August 1st
 
Status: DONE
*Implement Area of Effect Done
*Create a UI element that shows all available attacks, looking similar to the spellbook now. DONE
*Make sure attacks can be used through the current action bar. DONE
*Create a player command system to allow users to choose attacks, this will allow the new attack system to be used in some way until the UI elements are complete. DONE
*Create the range/melee differentiation, possibly the distance factor as mentioned above. This could done through the power expression. may be done in stage 1. DONE
*Work on testing different possibilities of how decay could be changed to work with the new dual wielding system. DONE
*add some different attacks to the database, for testing over the next couple weeks after this part. DONE
 
By the end of this Stage 2 I would like to have a fully functional background combat system, not yet any UI elements, but working through commands.
 
==== Stage 3 ====
Starts: August 1st
 
Deadline: August 10th


==== Fields in Attack Database ====
*'''ID'''
*'''Name''': name of attack that should be shown in game.
*'''Multiplier''': some attacks may do more or less damage than the base attack this multiplier should will be factored in with the final damage to get the attack's final damage, base attack would obviously be 1.
*'''Animation name''': may not be useful right away, but I plan to implement a way for each attack to have it's own animation associated with it.
*'''Prerequisites''' : anything that the attack requires, could be a certain number of progression points, could be specific training,wielding a certain weapon, or even a certain completed quest. This will likely be an xml script to allow for easier extensibility.
*'''Special effects''': Defines the attacks special effects as discussed above, also likely to be an xml script to allow for extensibility in the future.
*'''Area of Effect''': Another XML Script, It would define if the attack is aoe or single target, if it is in fact aoe it would define directions effected, likely only the main four to start(front, left, right, back, or all around), and it would determine the size of the are effect.


==== psAttack ====
*Would like to be done with UI Elements. DONE
*will function very similar technically to psQuest, it is able to hold attacks in the cache; and run prereq scripts
*this will be a time to clean up code, optimize everything
*would require a script schema and engine to work, may not be fully neccecary at first, but the idea is for it to be easily extensible, maybe now you may get the attack through progession, but maybe some attacks added later can be bought through a trainer, or earned ina  quest...possibilities should be endless...
*it will also be a buffer period for anything that didnt get done in stage 1 or stage 2.
* maybe a script should also be added for special effects? still thinking about how this will be implemented....
==== Queueing System ====
[[File:attackqueue.jpg]]
* As a queuing system should be, attacks may only be added in the end of the queue.
* this makes changing the order of your attacks difficult and penalizing, so it's something that should be thought about
* nodes should be removable at any point except the "Next Node", maybe add some sort of penalty though?
* The First Node(Next in Line) should only be changeable 3 ways: 1) out of combat it should be able to be changed at will to be ready for the next fight 2)By being executed and replaced by second node and 3) if in combat it is empty(base attack is being used) then it should be filled.
* Nodes 2-end should be dumped after battle while allowing 1 to stay for the next fight. 2-end should only be able to be added when combat is flagged. outside of combat, choosing an attack while an attack is already queued would replace the currently queued attack.
* Size of the queue should be limited. This would prevent queuing too many attacks and not doing anything else
* Should check the prereqs when attack is being added to the queue, if they are not met it should not be queued.


==== Combat Sequence ====
==== Stage 4 ====
Details still being added and considered


Trigger->pull attack from queue -> check prereqs in case circumstances has changed since it was put in the queue -> calculate attack -> apply attack
Starts : August 10th
=== Current Goals ===
This is a list of what I want to achieve next, this list will be broken up and extended upon as I finish one part of the feature. It is a big job and it will help a lot to have it broken into achievable pieces.


==== Part 1 ====
Deadline: August 20th


=== Task and Progress List ===
*This stage will be used soley for testing purposes, there will be no new features added.
*This is where values will be adjusted to make sure everything stays balanced, as well as trying out as many attack types as possible to find possibly bugs and fix them.


== GSoC 2011 idea information ==
=== Skills needed ===


Our server and client are all coded in C++ and the database is MySql. For this project C++ knowledge is needed with little knowledge of mysql.
*Currently I am updating the code to fit into the current trunk code and be ready to merge.


=== How combat works today ===
=== Technical Designs ===


PlaneShift today allows the players to engage combat with magic, with melee (like swords, axes, .. ) and with range combat (like bows).
'''Currently Designing Stage: 2'''


Players have the possibility to choose stances: full defense, defense, normal, attack, berserk, to tell the engine how much of their skills they want to use for defense or for attack. The monsters today always use normal mode.
==== Combat Flow ====
[[File:cmbtflow1.jpg]]


There is a table which determines the effects of each type of weapon vs. each type of armor. For example a knife will make more damage against a leather armor (which can be cut) than against a chain mail.
Some Notes on Planned Changes :
* I am wanting to make dual wielding more of a specialist mechanic, I want it to have a place in role play as well as make combat more fun. At the moment I really feel like it simply is the most efficient way of fighting. See above on how I want to do this, but in this stage I will make changes to set up dual wielding.
* As stated in the chart, in this stage energy calculations and it's role will remain the same, completely untouched. This may change later down the road, I'm still trying to decide how to make more powerful attacks cost more while maintaining the roleplay atmosphere. Making energy an integral part of the new attack system could be an answer.
*I really want to separate range and melee logic in this stage.
*I will be adding a virtual psAttack class which will be inherited by more specialized forms of attacks such as melee, range, and magic.
*Combat manager will manage the psAttacks with as little work actually done within it as possible, most all calculations and work will be done within psAttack classes.


All stats, equipment, skills, item stats and quality are considered in the combat sequence. The actual formulas are pretty complex, and give some realism to combat.
==== Fields in Attack Database ====
*'''ID'''
*'''Name''': name of attack that should be shown in game.
*'''image_name''': The name of the image to use for the attack icon in the gui
*'''attack anim''': may not be useful right away, but I plan to implement a way for each attack to have it's own animation associated with it.
*'''attack_description''': a description of the attack
*'''attack type''': the attack type, this is defined in another database which defines things such as weapon requirements
*'''range''': this is a formula field to be used with mathscript, it defines the range of the attack, can also be a solid number.
*'''aoe radius''': similar to range, but defines the radius an aoe attack would be.
*'''attack angle''': also like range, it is a formula or a single number that defines the angle of the aoe attack, for instance it may be 45 degrees if you want to attack everything thing within a 90 degree angle in from of you, the angle is defined with you as the vertice and the line between you and your target as the line of symmetry.
*'''outcome''':this is the name of a progression script that is attached to this class, this is where any special effects would be defined.
*'''power''': a formula for the power of the attack, based on your weapon and skills
*'''requirements''' : anything that the attack requires, could be a certain number of progression points, could be specific training,wielding a certain weapon, or even a certain completed quest. This will likely be an xml script to allow for easier extensability.


Player can use 2 weapons, or a weapon and a shield. Players can use items to boost their stats/skills and fight better.
==== The Attack Queuing System ====
changed slightly in technical design but functions the same as planned, new technical design will be posted soon.


NPCs/Monsters can be:
*The Queuing system will not technically be a queue by definition a queue, it'll work a lot more like a linked list with limited functionality
* invulnerable (in this case you cannot even attack them)
*Functionality will include, adding to the end, deleting any position except the head, deleting all attacks with the same specified name within the queue, limiting the size of the queue to a specified number, popping from the front, and it will pull Attack data from the cache based on attack name or ID number.
* peaceful but able to fight back. They will not attack by themselves unless provoked.
*Will require 2 classes, as any linked list would: the linked list class and the node class.
* attack on sight. They will attack as soon as you approach them.
*The players queue will be held in the pscharacter class.


When you attack a monster you enter in his hate list, and he will chase you and attack you.
==== psAttack ====
*this is where all the magic happens in the combat system
*it is a purely virtual function
*it will have several implementations, 4 to start(melee, range, magic, default), with more easily added if needed in the future.
*Will require attack and affect be implemented.


Combat is executed automatically by the server, the player can switch equipment, cast spells and move/run. If the player stands still in front of the monster, combat proceeds automatically until one of the two dies.
==== Class level Design ====
[[File:AttackClassDesign.jpg]]


Progression is done through increasing your skills, stats and gaining new equipment. This allows you to fight better and face harder monsters.
== Current Progress ==


=== Ideas for improvement ===
===Log===
* 5/10/2011 - Design of stage 1 is solid enough that I feel I can start coding.
* 5/15/2011 - I now have a basic attack structure made, as well as a database to hold the attacks, now adding a basic structure for requirement scripts.
*5/31/2011 - Prerequisites now fully work as intended. Attacks Can now be added to the queue from the client. Hmmmm that took a lot more work to do than explain.
* 6/3/2011 - I've discovered a few things that could cause a few internal design changes.
* 6/14/2011 - Finally got around to updating my implementation plan, as well as started much of the implementation.
* 7/7/2011 - The Attack system is currently functional.
* 7/12/2011 - first gui widget made and functional. updated the status of my timeline above.


* Progression just by increasing your stats is not fun after some time. We need to add new abilities which can be gained at certain ranks. Each ability should be special, and also have an associated animation. Examples can be: charge, blade dance, whirlwind of axes, ... Those may do a damage on multiple opponents, or ignore armor, or do extra damage to certain creatures, or multiply some of your skills, or change the way you use combat stances. Overall will be pretty good to have a way to script those effects, so can be more easily managed and don't have to be hardcoded.
===Still Undone===
* Today if you stand in front of a monster, combat runs automatically, which may be pretty boring. Sure you can move, but you cannot really use different attacks or strategies. In general PlaneShift wants to be a roleplaying game where your character traits are well represented in game. For this reason we don't want to have the skills of the player influence too much the result of combat. As an example a combat UI where you swing all the time the sword, and you hit only when you are perfectly in synch with the monster is not something we want, because this will not represent the strength of your character. What we are seeking is a middle ground between player controlled and character controlled. We would like to be able to add different attacks and parry to a queue of events which is used during combat. So for example you could queue: special actions, spells, parries, swings, special attacks, dodging, ...
* <s>A Gui Piece for the Queue</s>
* Today the chasing of monsters when in combat is pretty raw. In many cases they move on top of the attacker, and rotate wrongly, so they do not face the attacker properly. This has to be fixed.
* <s>Testing of AOE</s>
* ...
* <s>Implement weapon decay in special attacks</s>
* <s>test various attacks and tweak where neccesary</s> < not done but well in(never done =P)
* <s>search for possible optimization</s>
* <s>Farther improve the attack list gui</s>

Latest revision as of 04:56, 15 August 2011

GSoC 2011 > Combat Enhancement


The idea here is to give combat a little more flavor and variety than what is currently available. I feel combat should have multiple types and varieties of attacks. The most important part of combat in PlaneShift though is the roleplay. PlaneShift is unlike other MMORPG's in the fact that it is not a grind power fest, it is about immersing yourself in the game and being your character. So instead of the typical twitch style combat, I feel it is important to make the combat a roleplay experience in and of itself.

Combat Design

Current Design

PlaneShift today allows the players to engage combat with magic, with melee (like swords, axes, .. ) and with range combat (like bows). Players have the possibility to choose stances: full defense, defense, normal, attack, berserk, to tell the engine how much of their skills they want to use for defense or for attack. The monsters today always use normal mode. There is a table which determines the effects of each type of weapon vs. each type of armor. For example a knife will make more damage against a leather armor (which can be cut) than against a chain mail. All stats, equipment, skills, item stats and quality are considered in the combat sequence. The actual formulas are pretty complex, and give some realism to combat. Player can use 2 weapons, or a weapon and a shield. Players can use items to boost their stats/skills and fight better.

NPCs/Monsters can be:

  • invulnerable (in this case you cannot even attack them)
  • peaceful but able to fight back. They will not attack by themselves unless provoked.
  • attack on sight. They will attack as soon as you approach them.

When you attack a monster you enter in his hate list, and he will chase you and attack you. Combat is executed automatically by the server, the player can switch equipment, cast spells and move/run. If the player stands still in front of the monster, combat proceeds automatically until one of the two dies. Progression is done through increasing your skills, stats and gaining new equipment. This allows you to fight better and face harder monsters.

Goals

As I was going through the code I noticed a few things about the current combat system and the planeshift server system as a whole. 1) the current spell system has almost every feature that I want the actual combat system to have. 2) progression scripts handles a lot of the special features I want to be implemented, and it would be easier to add to this system rather than create something entirely new. This would also help the spell system which would father also help combat.

An Attack Style System

  • Attacks can only be executed in certain stances
  • Attacks that can only be executed by holding certain weapons
  • Certain armors maybe hindering power of certain attacks?

Queuing System

  • Attacks can be added to a queue through a hotbar
  • The attack queue would be shown in a UI element
  • if nothing is in the queue then the "normal" attack is used

Differentiate between range and melee

  • add a quiver equipment slot
  • Maybe the closer you are to the monster, the more damage the hit does; this gives range a unique mechanic in that your using it to be farther away and be safe, but getting closer will allow more damage, so you have to find the sweet point where you are far enough away to be safe, but close enough to do enough damage.

Special Effects

  • the idea here is to make some attacks have less power but have a chance at a special effect that will affect the outcome of a battle
  • one potential idea is poisoning....if your character is more of a villain, or a rogue type of character, they may prefer attacks that poison
  • temporary paralysis?
  • extra damage to certain creatures
  • ignore a percentage of armor
  • Boost current stats
  • always attack a certain target location
  • Do extra decay to an enemy weapon
  • This list would be a good start, as I said it would be easily extensible so more can easily be added.

Misc.

  • make single wielding and dual wielding matter, for instance a dual wielding attack may do half the damage per hit, or maybe even less but give a better chance at a special effect?

Technical Details

Goals and Deadlines

  • edited 7/16/2011

Stage 1

Starts:May 11th

Deadline: June 25th

Status: DONE (except progression script enhancements, it hasn't made my priority list yet, and probably won't until testing starts on what I have already)

  • Create the attack database and include a few example elements.
  • Design and implement a new combat manager.(this now depends on a few things whether it will be this stage or next)
  • Implement the queueing system
  • Include the queue in the psCharacter, so that each character has it's own queue, required as part of combatManager.
  • Make CacheManager Load Attacks up from the database at startup
  • Create psAttack to as a data structure to hold the attacks in cache as well as in the queue, and to be used in combatManager.
  • Implement the current list of special effects through progression scripts

By The End of Stage 1, I expect combat to be useable much as it is today, it will be more of a base system without any real new features. But it is meant to be extendable to make rest of development easier.

Stage 2

Starts: June 25th

Deadline: August 1st

Status: DONE

  • Implement Area of Effect Done
  • Create a UI element that shows all available attacks, looking similar to the spellbook now. DONE
  • Make sure attacks can be used through the current action bar. DONE
  • Create a player command system to allow users to choose attacks, this will allow the new attack system to be used in some way until the UI elements are complete. DONE
  • Create the range/melee differentiation, possibly the distance factor as mentioned above. This could done through the power expression. may be done in stage 1. DONE
  • Work on testing different possibilities of how decay could be changed to work with the new dual wielding system. DONE
  • add some different attacks to the database, for testing over the next couple weeks after this part. DONE

By the end of this Stage 2 I would like to have a fully functional background combat system, not yet any UI elements, but working through commands.

Stage 3

Starts: August 1st

Deadline: August 10th


  • Would like to be done with UI Elements. DONE
  • this will be a time to clean up code, optimize everything
  • it will also be a buffer period for anything that didnt get done in stage 1 or stage 2.

Stage 4

Starts : August 10th

Deadline: August 20th

  • This stage will be used soley for testing purposes, there will be no new features added.
  • This is where values will be adjusted to make sure everything stays balanced, as well as trying out as many attack types as possible to find possibly bugs and fix them.


  • Currently I am updating the code to fit into the current trunk code and be ready to merge.

Technical Designs

Currently Designing Stage: 2

Combat Flow

Some Notes on Planned Changes :

  • I am wanting to make dual wielding more of a specialist mechanic, I want it to have a place in role play as well as make combat more fun. At the moment I really feel like it simply is the most efficient way of fighting. See above on how I want to do this, but in this stage I will make changes to set up dual wielding.
  • As stated in the chart, in this stage energy calculations and it's role will remain the same, completely untouched. This may change later down the road, I'm still trying to decide how to make more powerful attacks cost more while maintaining the roleplay atmosphere. Making energy an integral part of the new attack system could be an answer.
  • I really want to separate range and melee logic in this stage.
  • I will be adding a virtual psAttack class which will be inherited by more specialized forms of attacks such as melee, range, and magic.
  • Combat manager will manage the psAttacks with as little work actually done within it as possible, most all calculations and work will be done within psAttack classes.

Fields in Attack Database

  • ID
  • Name: name of attack that should be shown in game.
  • image_name: The name of the image to use for the attack icon in the gui
  • attack anim: may not be useful right away, but I plan to implement a way for each attack to have it's own animation associated with it.
  • attack_description: a description of the attack
  • attack type: the attack type, this is defined in another database which defines things such as weapon requirements
  • range: this is a formula field to be used with mathscript, it defines the range of the attack, can also be a solid number.
  • aoe radius: similar to range, but defines the radius an aoe attack would be.
  • attack angle: also like range, it is a formula or a single number that defines the angle of the aoe attack, for instance it may be 45 degrees if you want to attack everything thing within a 90 degree angle in from of you, the angle is defined with you as the vertice and the line between you and your target as the line of symmetry.
  • outcome:this is the name of a progression script that is attached to this class, this is where any special effects would be defined.
  • power: a formula for the power of the attack, based on your weapon and skills
  • requirements : anything that the attack requires, could be a certain number of progression points, could be specific training,wielding a certain weapon, or even a certain completed quest. This will likely be an xml script to allow for easier extensability.

The Attack Queuing System

changed slightly in technical design but functions the same as planned, new technical design will be posted soon.

  • The Queuing system will not technically be a queue by definition a queue, it'll work a lot more like a linked list with limited functionality
  • Functionality will include, adding to the end, deleting any position except the head, deleting all attacks with the same specified name within the queue, limiting the size of the queue to a specified number, popping from the front, and it will pull Attack data from the cache based on attack name or ID number.
  • Will require 2 classes, as any linked list would: the linked list class and the node class.
  • The players queue will be held in the pscharacter class.

psAttack

  • this is where all the magic happens in the combat system
  • it is a purely virtual function
  • it will have several implementations, 4 to start(melee, range, magic, default), with more easily added if needed in the future.
  • Will require attack and affect be implemented.

Class level Design

Current Progress

Log

  • 5/10/2011 - Design of stage 1 is solid enough that I feel I can start coding.
  • 5/15/2011 - I now have a basic attack structure made, as well as a database to hold the attacks, now adding a basic structure for requirement scripts.
  • 5/31/2011 - Prerequisites now fully work as intended. Attacks Can now be added to the queue from the client. Hmmmm that took a lot more work to do than explain.
  • 6/3/2011 - I've discovered a few things that could cause a few internal design changes.
  • 6/14/2011 - Finally got around to updating my implementation plan, as well as started much of the implementation.
  • 7/7/2011 - The Attack system is currently functional.
  • 7/12/2011 - first gui widget made and functional. updated the status of my timeline above.

Still Undone

  • A Gui Piece for the Queue
  • Testing of AOE
  • Implement weapon decay in special attacks
  • test various attacks and tweak where neccesary < not done but well in(never done =P)
  • search for possible optimization
  • Farther improve the attack list gui