Preliminary Armour System

A common area for the CC and AA for downtime and other things.
Droid
Vice Admiral
Vice Admiral
Posts: 1173
Joined: Mon Jan 07, 2008 2:07 pm
Location: Canada

Re: Preliminary Armour System

Post by Droid »

Ablative armor isn't that good anymore anyway, it'll get shredded by vulcan fire.
User avatar
Arcalane
Pseudofeline Overlord
Posts: 4034
Joined: Thu Sep 13, 2007 10:37 am
Location: UK

Re: Preliminary Armour System

Post by Arcalane »

Yeah no.

~~
Silverware wrote:im not sure, if i were trusted with the code i could probibly turn out one with the change needed to the armour to show the idea off...
but meh
Alright Einstein, here's the part where bullets hit armour;

Code: Select all

if round(other.id.l_hp / 100) <= l_damage then
    if other.id.l_hp <= l_damage then 
        {
        with (other.id)
            {
            instance_destroy()
            if object_get_parent(object_index) != ctr_EShip then
                {
                l_owner.l_syshp -= l_hp
                }
            }
       }
    else
        {
       with (other.id)
           {
           l_hp -= other.l_damage
           if object_get_parent(object_index) != ctr_EShip then
               {
               l_owner.l_syshp -= other.l_damage
               }
           }
       }
instance_destroy()
That first line is the current armour system.

Go crazy. For the enemy-bullets-hitting-Ally/Player armour, replace ctr_EShip with ctr_Ship.

Everyone else is welcome to try their hand at this too, if you know how to work with GML.
  /l、
゙(゚、 。 7
 l、゙ ~ヽ
 じしf_, )ノ
Water_and_Wind
Captain
Captain
Posts: 497
Joined: Wed Sep 12, 2007 3:29 am

Re: Preliminary Armour System

Post by Water_and_Wind »

I guess you could do something like this: (never used GML before, but seems easy enough)

Code: Select all

if round(other.id.l_hp / 100) <= l_damage then
    var l_threshold = 0.1 // I'm guessing that the "l_" represents local variable?  A weapon must deal at least threshold * section HP to deal full damage
    var l_exponent = 1 // determines how much scaling down of attack damage should be done, higher equals more severe scaling
    var l_reduceddamage = l_damage * min(1, power(l_damage / (other.id.l_hp * threshold), exponent))
    if other.id.l_hp <= l_reduceddamage then 
        {
        with (other.id)
            {
            instance_destroy()
            if object_get_parent(object_index) != ctr_EShip then
                {
                l_owner.l_syshp -= l_hp
                }
            }
       }
    else
        {
       with (other.id)
           {
           l_hp -= l_reduceddamage 
           if object_get_parent(object_index) != ctr_EShip then
               {
               l_owner.l_syshp -= l_reduceddamage 
               }
           }
       }
instance_destroy()
In this example, for a section with 100 HP, any attack doing damage equal or over 10% of the section's HP (i.e. 10 damage) will deal full damage, and any attack that deals less than 10% damage will have its damage reduced linearly. For example, a Vulcan, dealing 4 damage would only deal 40% of its normal damage (i.e. 1.6 damage), and a Heavy Vulcan will deal 80% of normal damage. I don't know if weapon damage will be rounded, but if not then as long as the damage is over 1% of section HP, all weapons can do very minimal damage at least.

For non-linear scaling, you can change the exponent to something other than 1. If the exponent is 2, then Vulcans will only deal 16% of their normal damage on a 100 HP section, while a heavy Vulcan would do 64% of its normal damage.
Last edited by Water_and_Wind on Sun Nov 14, 2010 1:48 pm, edited 1 time in total.
Metagame 2.0 calculator: [url]http://bsf_meta2_calculator.byethost17.com/index.php[/url]
Curvy Alien Fleet: viewtopic.php?t=4959
Thrusallanian Naval Database: Patrol Craft to Behemoth, support ships, stations, warp gates, everything.
http://www.wyrdysm.com/phpBB2/viewtopic ... sc&start=0
Fleets of the Five States, get it here: http://www.wyrdysm.com/phpBB2/viewtopic.php?t=1929
Silverware
Commodore
Commodore
Posts: 626
Joined: Fri Apr 17, 2009 11:50 am

Re: Preliminary Armour System

Post by Silverware »

Code: Select all

tmp_ratio = l_damage/other.id.l_hp
if (tmp_ratio)>0.75
// If damage is at least 75% of the section hp then it will give 100% damage in
{
  with (other.id)
  {
    l_hp -= other.l_damage

    if object_get_parent(object_index) != ctr_EShip then
    //Not sure about this section on either side.
    //Have little idea what this actually does
    {
      l_owner.l_syshp -= other.l_damage
    }
  }
}
else
//If the damage is less than 75% of the section hp then if will be reduced in a sort of S shape
//at about 30 - 40% the damage is reduced to about half
{
  with (other.id)
  {
    l_hp -= -cos((other.tmp_ratio)*pi*(4/3))/2+0.5

    if object_get_parent(object_index) != ctr_EShip then
    //This may have to be edited Im not sure what its supposed to do,
    //I think its supposed to reduce a portion of the SYS Hp whatever SYS is.
    //if so then instead of l_hp use ((-cos((other.tmp_ratio)*pi*(4/3))/2+0.5))
    {
      l_owner.l_syshp -= l_hp
    }
  }
}
instance_destroy()
This "should" provide some defence against medium damage even to smaller ships. while no gun will do 0 damage to the armour, because even a pee shooter will "eventually" break through armour.
User avatar
Arcalane
Pseudofeline Overlord
Posts: 4034
Joined: Thu Sep 13, 2007 10:37 am
Location: UK

Re: Preliminary Armour System

Post by Arcalane »

Well this certainly seemed to do something for a test ship's survivability, but it also made said test ship report a Total HP value of -4774%, which may be because I didn't change that last syshp thing. Making the suggested adjustment seems to have fixed it.

Download: http://www.wyrdysm.com/██████████████/bsf_meta2_silarmbranch.exe
  /l、
゙(゚、 。 7
 l、゙ ~ヽ
 じしf_, )ノ
Silverware
Commodore
Commodore
Posts: 626
Joined: Fri Apr 17, 2009 11:50 am

Re: Preliminary Armour System

Post by Silverware »

I think i made an error...
will recheck my code in the morning and reassess the situation.
I saw a section with 50 hp drop to 0 hp then not die. So i will recheck my code when my brain gets back to 100% awake.
User avatar
Arcalane
Pseudofeline Overlord
Posts: 4034
Joined: Thu Sep 13, 2007 10:37 am
Location: UK

Re: Preliminary Armour System

Post by Arcalane »

In my own tests (using some of the AA's designs) I've had no problems with invincible sections. This may have been because of the use of artillery and vulcans.

Artillery shells explode and ignore armour rating entirely, and vulcans are still using the old armour system it looks like.

In both cases, they have this part, following on from a check whether or not the section's HP is less than the damage, namely, this part;

Code: Select all

if other.id.l_hp <= l_damage then 
        {
        with (other.id)
            {
            instance_destroy()
You left that part out, which is part of the problem.

Ed:

I fixed the 0hp=invincibility thing, but anything that doesn't do enough damage to instantly kill or is not armour penetrating or explosive is basically useless against armour (read: everything besides artillery and weapon types that we aren't even using yet), the Del display shows them doing only tiny amounts of damage. This is on cap-to-cap guns, namely powerful weapons that aren't available to you yet. I think you need to doublecheck your math.
  /l、
゙(゚、 。 7
 l、゙ ~ヽ
 じしf_, )ノ
Silverware
Commodore
Commodore
Posts: 626
Joined: Fri Apr 17, 2009 11:50 am

Re: Preliminary Armour System

Post by Silverware »

yeah... I think I may have put the values around the wrong way...
Nope... Im a dip-shit for forgetting this.

Code: Select all

tmp_ratio = l_damage/other.id.l_hp
if (tmp_ratio)>0.75
// If damage is at least 75% of the section hp then it will give 100% damage in
{
  with (other.id)
  {
    l_hp -= other.l_damage

    if object_get_parent(object_index) != ctr_EShip then
    {
      l_owner.l_syshp -= other.l_damage
    }
  }
}
else
//If the damage is less than 75% of the section hp then if will be reduced in a sort of S shape
//at about 30 - 40% the damage is reduced to about half
{
  with (other.id)
  {
    l_hp -= other.l_dmg*(-cos((other.tmp_ratio)*pi*(4/3))/2+0.5)

    if object_get_parent(object_index) != ctr_EShip then
    {
      l_owner.l_syshp -= other.l_dmg*(-cos((other.tmp_ratio)*pi*(4/3))/2+0.5)
    }
  }
}
instance_destroy()
I forgot to multiply the ratio of damage by the actual damage itself...
so if the damage/hp was less than 75% you would only get the ratio of damage...
Combat should be much faster than the older SilArm but slower than without it
Kal Adama
Lieutenant Commander
Lieutenant Commander
Posts: 53
Joined: Sat Oct 24, 2009 12:55 pm

Re: Preliminary Armour System

Post by Kal Adama »

Love the idea, Arc. Wish I could've posted earlier. I'm gonna test this thing out now.
User avatar
Arcalane
Pseudofeline Overlord
Posts: 4034
Joined: Thu Sep 13, 2007 10:37 am
Location: UK

Re: Preliminary Armour System

Post by Arcalane »

That fixed it, yes. Incidentally, this has made a test/experimental Old Empire Destroyer completely immune to autocannon fire.

Ed: It seems that the damage can be reduced past half. I'm afraid I can't release a testing version until you actually make this shit work.
  /l、
゙(゚、 。 7
 l、゙ ~ヽ
 じしf_, )ノ
Silverware
Commodore
Commodore
Posts: 626
Joined: Fri Apr 17, 2009 11:50 am

Re: Preliminary Armour System

Post by Silverware »

Yes i was looking at theoretical stuff for and it seems that the hp regen or the armour needs to be toned down
User avatar
Arcalane
Pseudofeline Overlord
Posts: 4034
Joined: Thu Sep 13, 2007 10:37 am
Location: UK

Re: Preliminary Armour System

Post by Arcalane »

It's not even that. I just edited my last post.
  /l、
゙(゚、 。 7
 l、゙ ~ヽ
 じしf_, )ノ
User avatar
Arcalane
Pseudofeline Overlord
Posts: 4034
Joined: Thu Sep 13, 2007 10:37 am
Location: UK

Re: Preliminary Armour System

Post by Arcalane »

A little ugly, but it seems to have done the trick;

Code: Select all

tmp_ratio = l_damage/other.id.l_hp

if other.id.l_hp <= l_damage then 
    {
    with (other.id)
        {
        instance_destroy()
        if object_get_parent(object_index) != ctr_EShip then
            {
            l_owner.l_syshp -= l_hp
            }
        }
    }
else if (tmp_ratio)>0.75
// If damage is at least 75% of the section hp then it will give 100% damage in
    {
    with (other.id)
        {
        l_hp -= other.l_damage
        if object_get_parent(object_index) != ctr_EShip then
            {
            l_owner.l_syshp -= other.l_damage
            }
        }
    }
else
//If the damage is less than 75% of the section hp then if will be reduced in a sort of S shape
//at about 30 - 40% the damage is reduced to about half
    {
    with (other.id)
        {
        if other.l_damage*(-cos((other.tmp_ratio)*pi*(4/3))/2+0.5) < other.l_damage/2 then other.l_damageactual = other.l_damage/2 else other.l_damageactual = other.l_damage*(-cos((other.tmp_ratio)*pi*(4/3))/2+0.5)
        l_hp -= other.l_damageactual
        if object_get_parent(object_index) != ctr_EShip then
            {
            l_owner.l_syshp -= other.l_damageactual
            }
        }
    }
instance_destroy()
  /l、
゙(゚、 。 7
 l、゙ ~ヽ
 じしf_, )ノ
User avatar
Arcalane
Pseudofeline Overlord
Posts: 4034
Joined: Thu Sep 13, 2007 10:37 am
Location: UK

Re: Preliminary Armour System

Post by Arcalane »

Here's the non-derp version: http://www.wyrdysm.com/arcalane/meta2/b ... hfixed.exe

~~
Orelius wrote:Example: have different classes of armor, ablative, light, medium, heavy. Each piece of armor has a specific durability and size constraint. ex, ablative pieces can be no larger than X by Y pixels, etc. This would make it so larger ships would have to have larger pieces of armor. In addition, it would make ablative armor less of a problem since it'll take up less space.
I feel I should clarify my "yeah no" from earlier.

Armour: It will be possible (in the full game) to improve the effectiveness of your armour in a roundabout fashion; upgrading armour increases the hp you get for each point of mass spent. For example, the current system is 1:1 hp:mass, but later on you might be able to increase that significantly.

Weapons: Of course, that's not a huge benefit; there are plenty of counters, both instantly available (beams, arty) and researchable (torpedoes, armour-piercing ammo will be an option) during the course of the game.
  /l、
゙(゚、 。 7
 l、゙ ~ヽ
 じしf_, )ノ
Water_and_Wind
Captain
Captain
Posts: 497
Joined: Wed Sep 12, 2007 3:29 am

Re: Preliminary Armour System

Post by Water_and_Wind »

With improved damage control, powerful PD, and damage scaling to armour, larger ships take forever to kill. The changes will also benefit ships with few sections but high HP spread between them; i.e. the opposite of ablative armour.
Metagame 2.0 calculator: [url]http://bsf_meta2_calculator.byethost17.com/index.php[/url]
Curvy Alien Fleet: viewtopic.php?t=4959
Thrusallanian Naval Database: Patrol Craft to Behemoth, support ships, stations, warp gates, everything.
http://www.wyrdysm.com/phpBB2/viewtopic ... sc&start=0
Fleets of the Five States, get it here: http://www.wyrdysm.com/phpBB2/viewtopic.php?t=1929
Locked