Hey guys, sorry for the absence this past week, as I said in the previous post, I've not been feeling too well.
However I'm all better now, so posting can resume as scheduled, that means the next AwesomeRPG post WILL be this Saturday (promise!)
For now, it's time for the second Pandaz! post.
Sadly due to me being ill over the past week, there isn't really any coding to speak of today, so it'll just be discussion, namely the combat system.
The combat system in Pandaz! is very simple, there are 5 types of Pandas, Spearmen, Cavalry, Archers, Monks and Ninjas.
Your Panda army can consist of any number and ratio of these types.
For example you could have a pure Spearmen army, or you could split evenly between all 5, its completely up to you.
There is no max army size, although there will be a system in place to avoid impossible battles (eg a pro with an army size of 3000 Pandas vs a newbie with 17).
Originally this system was going to be based on win:loss ratio, however I realized somebody could simply build up a vast army without ever actually fighting, and effectively have a rank of 0 (the same rank as a newbie with his 17 Pandas looking to fight for the first time)
So matches will probably be determined based on a ranking system using win:loss ratio, and based on army size.
Pandas can be upgraded at the cost of Bamboo. You upgrade the different types of Panda individually (so upgrading Spearmen to lvl 2 has no effect on your other Panda types), and level directly determines strength.
To keep it simple, the strength of a Panda is simply their level * 10 (A lvl 1 Panda of any type has 10 strength, a level 378 Panda of any type has 3780 strength).
As stated in the previous posts, each Panda type has a prey and a predator so to speak, one type which they excel against, and one type which excels against them.
This forms a wheel of sorts (graphic can be found in the previous post)
To recap: Spearman > Cavalry > Archer > Monk > Ninja > Spearman
For each "prey" type your opponent has to your "predator", one of your predators gains double strength. (For example, for every Archer your opponent has, one of your Cavalry gains a +100% buff to strength)
However, for every predator your opponent has to your prey, one of your prey loses half strength.
(For example, for every Spearman your opponent has, one of your Cavalry gains a -50% debuff to strength)
Buffs are ALWAYS applied before debuffs, therefore if you have 1 level 1 Cavalry, and your opponent has 1 Archer, your Cavalry has 20 strength instead of the usual 10, however if your opponent also has 1 Spearman, your Cavalry's strength returns to 10.
So for example: (all Pandas in the below examples are level 1 and have base strength of 10)
5 Spearmen vs 5 Cavalry:
50 Strength 50 Strength
100 Strength vs 25 Strength
6 Spearmen vs 3 Cavalry, 3 Ninjas
60 Strength 30 Str 30 Str
+100% -50% +100%
vs vs vs
Cavalry Spearmen Spearmen
90 Strength 15 Str 60 Str
60 Strength vs 75 Strength
This second example displays how diversity in an army can vastly improve chances of success, despite half of Player 2's army consisting of Pandas that are weak vs the Spearmen in Player 1's army.
The example also displays how debuffs are always applied AFTER buffs.
You may be wondering how 60 +100% somehow equals 90 in the second example.
This is because the +100% buff to the Spearmen is coming from the Cavalry, however there are only 3 Cavalry, and each can only give the buff to 1 Spearman, meaning that only 3 Spearmen go up to 20 Strength, the other 3 remaining at 10 Strength.
Of course, when it comes to 5 type vs 5 type battles (where each army consists of varying numbers of all 5 types of Pandas), it get's rather difficult to show using the above format.
Thankfully however, due to the magical wonders of programming and foreach loops, it's much simpler to implement in code.
I intend to simply loop through and (for example with Spearmen) double the strength of 1 Spearman for each Cavalry in the enemy army, then half the strength of 1 Spearmen (halving buffed Spearmen first) for each Ninja in the enemy army, then move on to Cavalry and apply buffs then debuffs, and so on.
I'm gunna talk to a few gamer and programmer friends about ideas in the hopes of spicing up this combat system and adding more variety and strategy, but for the time being this is pretty much it.
I hope this wasn't too complex/poorly explained for you guys to understand, and if it was, please let me know in the comments which parts confuse you, and I'll do my best to explain them to you.
Again apologies for not posting over the last week, I'll be doing some extensive coding on Pandaz! leading up to next Saturday, including removing the current internal launcher, and instead making an external launcher (see previous Pandaz! post for distinction), and something which I'm sure a LOT of you wanna see: Server-Client communication.
Or in laymens terms: Making a server program and having a client program connect to it and both send and receive data.