Need help with combat system for a new rts game

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
Klown
Posts: 89
Joined: Tue Feb 22, 2011 5:59 am

Need help with combat system for a new rts game

Post by Klown »

Hello:

Its been a while since ive posted. I am building a space rts game. I have 5 ships which have different atk, def, hp, range each. during an attack a player may choose any combination and quantity of the above ships to attack another players fleet with. that being said, im having a hard time coming up with a combat system for multiple units attacking and being attacked at the same time:

example:
attacker fleet is:
scout ship - 10
light fighter - 5
fighter - 0
frigate - 10
cruiser - 0

defenders fleet is:
scout ship - 0
light fighter - 0
fighter - 10
frigate - 10
cruiser - 10

figuring out how to pair the attacks or to resolve the battle as a whole and determine which ships take losses and which do not is mind numbing. if anyone has some very simple or basic formula i could use to pair the attack ships with the defending ships would be much appreciated. just to clarify, i have an idea of how i want to calculate the battle damage, im just having a hard time figuring out how to resolve which ship, fights which ship and how to determine the ships that take losses and how many losses.
if( $myGames != "Crap" ) {
  • please_donate( $money );
} else {
  • just_enjoy();
}
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Need help with combat system for a new rts game

Post by Jackolantern »

Can you tell us a bit more about your game? Is it real-time or turn-based? That will make a huge difference on how this would work out.
The indelible lord of tl;dr
Klown
Posts: 89
Joined: Tue Feb 22, 2011 5:59 am

Re: Need help with combat system for a new rts game

Post by Klown »

My game is a real time strategy. you can think of it as a space evony. there are 5 units to attack with, which are ships. you build these ships in quantity on your planet, then send them across the game map (galaxy) to attack other players planets where they can encounter the same ships in different quantities. i need a way to determine the battle result and how many losses each side takes, then apply the losses to each sides fleet in the database table to update the battle statistics on the battle report. i already have all systems in place except an actual combat system to determine winner/loser and calculate lost units and apply them. if more information is needed, please let me know im in the process of uploading the game to a free php host and doing very early alpha tests.

-thanks in advance for your advice
-klown
if( $myGames != "Crap" ) {
  • please_donate( $money );
} else {
  • just_enjoy();
}
casino
Posts: 22
Joined: Thu Feb 23, 2012 9:44 pm

Re: Need help with combat system for a new rts game

Post by casino »

Each unit would need to have some sort of value applied to it such as:

Attack
Defense
(Plasma Defense or maybe some sort of special defense?)


At the very least they would need an attack value and a defense value so that your code can do the math for the amount of units you defeat or lose.
User avatar
Ark
Posts: 427
Joined: Wed Jun 01, 2011 10:25 pm

Re: Need help with combat system for a new rts game

Post by Ark »

Jackolantern wrote:Can you tell us a bit more about your game? Is it real-time or turn-based? That will make a huge difference on how this would work out.
Uhmm I'm not sure if it will make a difference, I think he wants a combat system like ogame, the battle finishes inmedeately.
Orgullo Catracho
Post Reply

Return to “Advanced Help and Support”