Non-optimal defenses sqrrt rounding?


Just a quick question thats important but not addressed.

Non-optimal defenses are counted at the square root of their value. Is this number then rounded down or rounded up ?? i.e. is a nonoptimal defense of 8 worth 2 or 3 defensive points ?

Thanks
22,777 views 20 replies
Reply #1 Top
I am pretty sure they said it always rounds down. It is non-optimal after all. So a defense of 2 armor against beam weapons gives you a real defense of 1 (1.414). And a defense of 3 gives you 1 (1.7321). So having non optimal defenses only helps you if you have 1, 4, 9, 16, etc. anything that is in between becomes the same as if you had the number lower.

At least I think I heard that
Reply #2 Top
There is a third possibility, rounded to the nearest. I have wondered this myself. I think rounded to the nearest makes the most sense. Do you really want non-optimal 8 to be the same as non-optimal 2?! With rounding to the nearest non-optimal 2-6 -> 2 and 7-9 -> 3.
Reply #3 Top
Knowing C++, and remembering how PQ bonuses worked in GalCiv1, I'd say rounding down is the most likely.
Reply #4 Top
It rounds it down.
Reply #5 Top
Rounding down isn’t very fair, especially if the number is .8 or .9. Such as in 8, the square root is 2.828, and ends up being rounded to 2 even thought its closer to 3. You may as well put 4 then.
Reply #6 Top
That is why they are "non-optimal" defenses. You will be severely punished for not keeping an eye on your enemies weapons systems, so as to research the appropiate defenses and build fleets that can deal with them properly.
Reply #7 Top
Ok.. as long as there is an answer Just because if my nonoptimal defense is a 8 (assuming I know the weapon system my enemy prefers) I will now be tempted to bump it that extra 1 to get an additional unit of defense as soon as possible. Thats good to know.
Reply #8 Top
Truncation is par for the course when converting a float into an integer.
Reply #9 Top
True, but there's no law that says you can't check if the fractional part is at least .5 and bump it up if so.
Reply #10 Top
There's not even a law that says you have to use integers. You can roll a number between 0 and 2.3719357 just as easily as you can roll a number between 0 and 2.
Reply #11 Top
At any rate, integer math in C++ will always yield an integer result unless you specifically type-cast it otherwise, from what I remember.
Reply #12 Top
Hey, why didn't you code it in Ruby in the first place?
Reply #13 Top
i really don't understand what square root calculate. can anyone answer the question. and why should i round up or round down during combat???
Reply #14 Top
A square is a number multiplied by itself. For example, 2 squared means 2*2, which results in 4. 3 squared is 3*3, making 9. And so on.

A square root is the reverse of that. You take a given number, and find out what number you have to multiply by itself to get that one. So the square root of 4 is 2, the square root of 9 is 3, and so on.

In this case not all the numbers have a whole number as the square root. For example if you tried to find the square root of 5, you would get 2.236 (with more decimals repeating after that).

Since you can't have factional defenses in GC2, you have to convert those non-whole-number results into whole numbers. In this case the easiest thing to do (and what the devs chose to do) is just drop anything after the decimal point. So for example 2.2, 2.5, 2.9, will all become just plain 2.
Reply #15 Top
i really don't understand what square root calculate. can anyone answer the question. and why should i round up or round down during combat???


Also just to add on to Kryo's post... all this is applicable when your ship has a defense rating of 0 / 9 / 0, and the attacker has an attack rating of 6 / 0 / 0.

Instead of you having ZERO defenses because they're using weapons that you are not prepared for, you instead have a defense of 3. (square root of 9 is 3) That is your "non-optimal" defense. If instead you had a defense rating of 9 / 0 / 0, your defense would be 9, because your defense of choice was meant for their weapon of choice... so you get the max use out of it.
Reply #16 Top
I think he is trying to ask what the square root calculates or why its used at all Not what a square root is, heh

"non optimal" defenses are counted only as square root of their value. As opposed to matched defenses.

Here is an example:
Fighter attacks another fighter
Fighter = beam attack of 4, beam defense of 4, missle defense of 4, massdriver defense of 1

The fighter's beam attack (rolled 1-4) is compared against the other fighters defense. The defense is calculated as:

Beam defense = 4 ('optimal or matched' defense)
Missle defense = square root of 4 ('non optimal' defense so it is only counted as square root) = 2
Massdriver defense = 1 square root of = 1

TOTAL defense = 4 + 2 + 1(above) = 7

So the attack of 1-4 is compared against the defense of 1-7.

Thats where the square root is used.

Seems like its beneficial to always have at least a 1 in each defense category since thats probably technologically cheaper than a 3 in any optimal category, no?
Reply #17 Top
so defenses are cumulative for example a 36 beam attack fighter , against a fighter with 12 beam defense 9 mass drivers defense and 16 missile defense will get a total defense of (12+3+4)=19.
another question is for every point attack suffered a ship will lose 1 hit point or there are other calculation to measure it?
Reply #18 Top
Yes, the difference of attack minus defense is directly removed from HP.
Reply #19 Top
Seems like its beneficial to always have at least a 1 in each defense category since thats probably technologically cheaper than a 3 in any optimal category, no?


That doesn't sound so bad, it's kind of realistic that a warship that primarily depends on its shields also is armored and incorporates basic countermeasures, after all it's meant to endure heavy combat. Kind of like how a fighter-interceptor jet mainly depends on countermeasures, but it's also made of strong materials and has redundancy systems; these things can't stand up to a solid missile strike on their own, but they might help.

I suppose it will depend on how major the size/cost effect is on having 'secondary' defenses. It might be really cheap to slap on low-tech weak defenses, and maybe you wouldn't have used those equipment spots anyway. Or maybe not.
Reply #20 Top
It's really not usually a great idea to try for multiple defenses (or multiple attacks for that matter)--taking 1 point in each, for example, will cost you piles of space on your ships, since you'll be using lower level versions of each defense. Whereas if you focus on one path, you'll get modules in pretty short order that add several points to one in the same or less space.

Keep in mind, as a general rule in GC2, higher tech = more efficient (more effect in the same space, or the same effect in less space).