ID:153168
 
I'm currently creating a space-based game and I'm now starting to program the battle system. So far the battle system is targeting based which means you must click on your enemy once and you will continue to attack them until they either die or manage to escape. Now here is the part I'm stuck on,Since it's a space based game how should the statistics be taken off for damage. Should it be totally random? Should it depend on every single statistic?

Example.

Player1 Hits Player2
Player1.Ammo-=5
Player2.Health-=Player1.Attack/Player1.Defense


I'd appreciate the community's input on this. Thanks a bunch!

~>Jiskuha
You should have more stats then that... like...
Accuracy
Evasion
etc.

But, if you had stats like that, go for the second choice.
I'd probably add a little random factor too it. Nothing to make it so everything comes down to dice rolls, but enough to make near equal combat interesting.
In response to DarkView
DarkView wrote:
I'd probably add a little random factor too it. Nothing to make it so everything comes down to dice rolls, but enough to make near equal combat interesting.

I was actually thinking of going with the dice rolls idea. Perhaps i shall make it random instead. I'll think it over tonight :).

~>Jiskuha
In response to Jiskuha
I'm making a space game, and in the combat, it will heavily rely on stats, but an += rand(1,20) will be involved.
In response to Kholint
Kholint wrote:
but an += rand(1,20) will be involved.


I don't like the set numbers for the random offsets. I like to add/subtract a random percentage instead. Think of it this way, when you're dealing out 10DMG (+rand(1,20)) the random fact really comes into play. However when you're dealing out 100DMG +rand(1,20) the random bonus is barely noticable.
Also I go for the random -20% to +20% to keep things interesting. That way it's possible to underpreform so even if they know the stats of both parties the battle isn't black and white.
In response to DarkView
Hm, good point.


I'm going to use lots of multiplication in my battle system, for the efficiency of onboard systems, power, etc.
In response to DarkView
so something like so?
                var/attack = rand(1,3)
if(attack==1)
M.health-=src.damage/3
M.sheilds-=src.damage
if(attack==2)
M.health-=src.damage
M.sheilds-=src.damage*2
if(attack==3)
M.health-=src.damage*2
M.sheilds-=src.damage/3


~>Jiskuha
One way of doing a space battle system is requiring the shields to be depleted before doing damage to the hull a la Star Trek, Buck Rogers, Earth and Beyond, etc. Nice thing with setups like this is you can have two "health" stats. The shield value being larger then the hull. Special exceptions to the rule can be added like a weapon that by-passes the shield, if it's still up, and takes off a set hull heath percentage. Make sure to give the weapon a long cool down time or high energy cost to keep it from being to ubur.

You could also add in targeting so player's who wish to rely on luck can chose to automatically attack a specific section of the enemy's ship. Hitting certain areas cause double damage but are double as difficult to hit. Or enough damage cause when targeting the engines disables the enemy's ability to flee. Weapons could be targeted to disable the enemy's offense.
I like the idea of ship defenses combining stealth and countermeasures as well as raw resilience. Shields can be physical or energy and basically act as ablative armor. Ideally weapons would also be optimized against certain targets. For example, energy shields are great at deflecting most laserlike and physical weapons, but are completely useless against EMP and ionic weaponry, which require hull shielding. That way you could have strategic importance to weapon and defense selection (Captain, our photon torpedoes are exceptionally lethal, but that ship appears to have cyclo-phasic shielding so maybe a plain kinetic weapon would be better.) Other measures such as thermal debris (chaff) to deflect heat sensing weapons or cloaking devices to fool visual sensors could also play a role.

Hull dammage is bad; it means the actual structural integrity of the ship is being compromised. Systems can also be damaged in the process (life support, energy, propulsion, sensors, weapons, habitation, etc.- some weapons, such as virus bombs, might even be designed to target or do additional damage to critical areas). Any major damage will probably require immediate docking for repair, although localized damage may be able to be contained (at least temporarily!).
In response to Jmurph
Wow! I never actually thought of that. Thank's for the idea i will infact make it so you must destroy the sheild to damage any part of the ship.

~>Jiskuha
One thing I think you definitely want to avoid is too much "bigger is better" syndrome; have very tight limits on how much equipment you can cram on one ship, so that players have to choose what they want their ship to be good at instead of just buying lots and lots of everything until they have an all-around super ship. If you buy more weapons, you have less room for cargo, engines, redundant computer systems, etc.; if you buy more shields, you have less power available to drive your ship.

On that note, I'm not all that great a sci-fi geek, but I think that no space combat engine is complete without the ability to shunt things. Y'know, "We're hit! Shunt all energy to the main deflector shields!", "Too late! Lower shields and shunt power to the engine, we're outta here!", etc. Basically, a limit on how much stuff the player can use simultaneously, so you can't be going full throttle and firing all your weapons constantly and keeping your shields at max strength; again, the player would have to choose what to focus on at any given moment.
In response to Grei
Grei wrote:
One way of doing a space battle system is requiring the shields to be depleted before doing damage to the hull a la Star Trek, Buck Rogers, Earth and Beyond, etc.

Being the next closest thing to a Trekkie, I thought I'd point out that Star Trek shields don't actually absorb all the damage before the hull is struck -- when shields are at a certain percentage, that reflects how much energy gets through them. Laser beams get reduced in effectiveness by a certain amount when they strike the shields (hence, why stuff still explodes all over the ship even when the shields are up -- though the cutscenes often just show the entire beam being eaten by the shields in modern Star Trek series and movies, the original Star Trek movies show varying amounts of hull damage from torpedos striking the shields (which are assumed to be form-fitting, unlike the more modern Star Treks which make them big bubbles)).

Physical objects, like torpedos and giant mutant space hamsters, are however generally ineffective when shields are up; they are easily halted even at relatively low shield power... though, of course, an explosion right on top of the shield causes a lot of disruption to the field and can still buffet the hull.

(Well, actually, they couldn't buffet the hull in real life without the shields being form-fitting. There's no atmosphere to convey a shockwave in space -- the only damage would be from the expansion of the explosion's own gas cloud as it buckles the hull. But without sound effects and shockwaves, space combat just wouldn't be as fun for us geeks to watch. I'm personally quite impressed by the modern Battlestar Galactica, which went for a compromise -- things still make sound in space, but sound muted and watery.)