Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBaneTrapper

Posted 19 February 2013 - 12:54 AM

Didn't really understand how a battle starts, this seems a bit of Ogre Battle (The March of the Black Queen), but the world is not divided on squares and the battle occours in a separated stage.

 

Anyway, for the buffs management, you shoud create two values for each stat in you characters, for instance:

 

float spellPower, currentSpellPower;

 

Then you should create a buff structure/class with at least the following values:

duration, roundsSinceUsed;

 

You should probably add some kind of ID to know which stat the buff improves (you can also create one list for each stat) and the improvement amount. The duration variable should hold the amount of rounds the buff last, and roundsSinceUsed is set to 0 and increased at the end of each round.

Save the buffs on a list for each character.

 

At the end of each turn you should check each character in the game and increase the roundsSinceUsed of each buff by 1.

At the beginning of each round you should check if duration is equals to the roundsSinceUsed, if it is you remove the buff.

 

The buffs should change the current version of the stat, after removing a buff you can either remove the improved stat value (if all the buffs can stack) or just recalculate the current value.

Hopefully this will give you a vision how to engage battles.

(EDIT::: Units move 1 squad i meant 1 square at keypress)

http://postimage.org/image/mvvdmbgmn/

Also i am thinking if making it a round base system or timed (Round based i mean until all units acted once, by that all spells that last like 5 turn buff(Defend) will never be the same length and it will highly depend on units in battle. Therefore i am going to make it timed.

 

I like the idea, buff has duration and id. when buff is used its push_back() intro units std::vector<Buff> and for each buff, check its type, and call corresponding function.

 

*system

Thanks on noting that, If you take a closer look you would notice i did not make the same typo in code...

 

 

In
warcraft 3, most of the buffs actually "did" nothing. They just
triggered animation effects on the target they were attached to. In
general, the buff would have all sorts of properties to change the look of the character they were affecting, but had no gameplay effect at all.

 

The
actual damage dealing / stunning / whatever was controlled by scripts
that would fire periodically and look for that buff. If that buff was
present, they would influence the character in some way or another.

 

There
were some exceptions to this norm, but, in general, it was the
abilities and the scripts that did all the hard work. Buffs were just
for show.

 

As for items, I'm not sure how other games
did it, but bastion(by supergiant games) stores all it's data in an XML
file (you can see it too), including enemies, items and upgrades.
anyway, the item and upgrade tags usually look something like this:

 

<item name = "damageBuff" target = "DAMAGE" type = "ADD" value = "15 /> <- adds 15 damage

or

<item name = "damagMultiplier" target = "DAMAGE" type = "MULTIPLY" value = "1.8 /> <- multiplies current damage by 1.8

or

<item name= "healthUpgrade target = "HP" type = "ADD" value = "50" /> <- adds 50 bonus 

 

 

the
awesome thing is, if you can just add and multiply variables, you can
subtract and divide them too! this system is crazy flexible and I'm
using something similar to it. 

Hope this helps!

For bastion system.

Its probably required to store multiple instances of stats(hp...) because in case of

<item name = "damagMultiplier" target = "DAMAGE" type = "MULTIPLY" value = "1.8 /> <- multiplies current damage by 1.8

But what would you do if you got another buff that modifies your DAMAGE, then this buff ends. The buff would have to hold witch attribute to modify and value as well as duration and maybe type.

 

Regarding the warcraft3 buff system.

That's what i am currently aiming for, tho art effects are still not implemented.

Also i am thinking not working with % values for this project for sake of finishing it, because there are much things need to be done.

 

Thanks on tips, i got some vision on what i should be aiming for now.

 


#1BaneTrapper

Posted 19 February 2013 - 12:52 AM

Didn't really understand how a battle starts, this seems a bit of Ogre Battle (The March of the Black Queen), but the world is not divided on squares and the battle occours in a separated stage.

 

Anyway, for the buffs management, you shoud create two values for each stat in you characters, for instance:

 

float spellPower, currentSpellPower;

 

Then you should create a buff structure/class with at least the following values:

duration, roundsSinceUsed;

 

You should probably add some kind of ID to know which stat the buff improves (you can also create one list for each stat) and the improvement amount. The duration variable should hold the amount of rounds the buff last, and roundsSinceUsed is set to 0 and increased at the end of each round.

Save the buffs on a list for each character.

 

At the end of each turn you should check each character in the game and increase the roundsSinceUsed of each buff by 1.

At the beginning of each round you should check if duration is equals to the roundsSinceUsed, if it is you remove the buff.

 

The buffs should change the current version of the stat, after removing a buff you can either remove the improved stat value (if all the buffs can stack) or just recalculate the current value.

Hopefully this will give you a vision how to engage battles.

http://postimage.org/image/mvvdmbgmn/

Also i am thinking if making it a round base system or timed (Round based i mean until all units acted once, by that all spells that last like 5 turn buff(Defend) will never be the same length and it will highly depend on units in battle. Therefore i am going to make it timed.

 

I like the idea, buff has duration and id. when buff is used its push_back() intro units std::vector<Buff> and for each buff, check its type, and call corresponding function.

 

*system

Thanks on noting that, If you take a closer look you would notice i did not make the same typo in code...

 

 

In
warcraft 3, most of the buffs actually "did" nothing. They just
triggered animation effects on the target they were attached to. In
general, the buff would have all sorts of properties to change the look of the character they were affecting, but had no gameplay effect at all.

 

The
actual damage dealing / stunning / whatever was controlled by scripts
that would fire periodically and look for that buff. If that buff was
present, they would influence the character in some way or another.

 

There
were some exceptions to this norm, but, in general, it was the
abilities and the scripts that did all the hard work. Buffs were just
for show.

 

As for items, I'm not sure how other games
did it, but bastion(by supergiant games) stores all it's data in an XML
file (you can see it too), including enemies, items and upgrades.
anyway, the item and upgrade tags usually look something like this:

 

<item name = "damageBuff" target = "DAMAGE" type = "ADD" value = "15 /> <- adds 15 damage

or

<item name = "damagMultiplier" target = "DAMAGE" type = "MULTIPLY" value = "1.8 /> <- multiplies current damage by 1.8

or

<item name= "healthUpgrade target = "HP" type = "ADD" value = "50" /> <- adds 50 bonus 

 

 

the
awesome thing is, if you can just add and multiply variables, you can
subtract and divide them too! this system is crazy flexible and I'm
using something similar to it. 

Hope this helps!

For bastion system.

Its probably required to store multiple instances of stats(hp...) because in case of

<item name = "damagMultiplier" target = "DAMAGE" type = "MULTIPLY" value = "1.8 /> <- multiplies current damage by 1.8

But what would you do if you got another buff that modifies your DAMAGE, then this buff ends. The buff would have to hold witch attribute to modify and value as well as duration and maybe type.

 

Regarding the warcraft3 buff system.

That's what i am currently aiming for, tho art effects are still not implemented.

Also i am thinking not working with % values for this project for sake of finishing it, because there are much things need to be done.

 

Thanks on tips, i got some vision on what i should be aiming for now.

 


PARTNERS