Our Scripts Vault contains many game scripts that you can use to create your own game!
How should I divide up the damage taken by each group of units?
How should the database look like?
How should I store differen units in the tower?
What should the flow of battle look like?
QuoteHow should I store differen units in the tower?Yup, sounds about right. If you are just adding a sum of a field or fields instead of looping you could execute a GROUP BY query to perform the sums via the database.. As an exampleSELECT SUM(amount) FROM player_units WHERE playerid = $playerid GROUP BY units
QuoteWhat should the flow of battle look like?Looks good.. Might not be correct from a player stand point but nonetheless at this point its a solid battle flow. Once you release it to real players though they may have some better ideas they would like to see The last few questions have to deal with outcomes of a battle and how to calculate them.. This is something I've personally struggled with since I started writing online games back in the old BBS days You name a battle system give it the old D&D formula, advance D&D, d20, fudge dice system, you name it I've tried it. Finding that perfect formula for a battle outcome is not easy. Personally I like a little random, without a random what you'll get is the king of the hill scenario.. Where the first one out of the gate, that gets the most powerful will stay the most powerful though out the game. Adding a little random allows for a fudge factor so maybe a person can battle a person a little more powerful and win. On the flip side player's don't like a lot of random either so this is the tight rope to walk when designing a battle system.. Lately I've been using a simple odds engine that seems to be working pretty well.Attacker is 100% more powerful then defender: 95% chance attacker winsAttacker is 50% more powerful then defender: 75% chance attacker winsAttacker is more powerful then defender: 65% chance attacker winsAttacker is equal to defender: 50% chance winAttacker is less powerful then defender: 35% chance attacker winsAttacker is 50% less powerful then defender: 25% chance attacker winsAttacker is 100% less powerful then defender: 5% chance attacker wins
Hope this helps ya out a bit...