Combat Detection Logic

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Working on a station at the moment, and just got done installing a rail based elevator. Got me wanting to have retractable turrets on the station like I plan on putting in my capitol ship, but there's a slight problem with that. Turrets on a station are for defending the station when I'm not around in a warship, so I wouldn't be there to press the button to deploy said turrets.

    Which got me thinking. The game apparently already is capable of determining when an entity is in combat, because shield recharge rates change based on it. So there must be an internal flag/toggle.

    Let us access the current state of that toggle with a logic block. That way we could build stations and ships that automatically respond to attack by deploying turrets via logic, and then goes back to a resting state when combat is over.

    I have to admit, half the reason I want this is for when some random idiot decides that my outpost is unprotected and decides to take a pot shot at it. Logic detects combat initiated, hostile in range, flashing red lights turn on, doors open, giant cannons rise up vertically out of the depths before rotating 90 degrees and locking into position, then all turning to great the attacker...
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I have to admit, half the reason I want this is for when some random idiot decides that my outpost is unprotected and decides to take a pot shot at it. Logic detects combat initiated, hostile in range, flashing red lights turn on, doors open, giant cannons rise up vertically out of the depths before rotating 90 degrees and locking into position, then all turning to great the attacker...
    I would be able to tell because of volume=mass or spying through build-mode (might get removed for v1.0)

    All the animations sound very time-consuming, given that rails can move entity only 2m/s currently (at 200% speed).

    I want my turrets to hides in a quantum-singularity using disabled clipping for 6+ turrets in the same spot :)
    Then you can't tell strength by size ^^
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    I would be able to tell because of volume=mass or spying through build-mode (might get removed for v1.0)
    Well anyone stopping to assess the target beforehand usually isn't the "Lulz, lets shoot it!" type to start with (usually).
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Well anyone stopping to assess the target beforehand usually isn't the "Lulz, lets shoot it!" type to start with (usually).
    You would be surprised what peoples do if they feel like archiving something.
    Script-Kiddies are a good example.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Either way is win win, far as I'm concerned.

    I'd get to keep my base pretty and not clearly bristling with weapons all the time, and either the random smegheads that take a pot shot get the surprise of their starmade lives when said base suddenly transforms into full death blossom mode, or they take a peak inside and decide that maybe attacking me isn't such a great idea after all and leave to find a softer target.
     

    lupoCani

    First Citizen
    Joined
    Jun 23, 2013
    Messages
    504
    Reaction score
    127
    • Purchased!
    • Legacy Citizen 10
    Firstly, the shield recharge isn't based on some abstract "in combat" flag, the rates are simply a product of how long since the ship was last hit by a shot.

    Secondly, you could try having an undocked mini-drone in a closed compartment with a 3d-checkerboard of are triggers. The ship would be stationary for the most time, but move when there are enemies around, setting off the triggers and activating the turrets.

    Thirdly, I support this suggestion.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Firstly, the shield recharge isn't based on some abstract "in combat" flag, the rates are simply a product of how long since the ship was last hit by a shot.
    Its still a binary flag that indicates "Hey, something is shooting at me!"
    Long as something is shooting at me, logic block is in the on state. When things stop shooting at me, it goes to off.

    That way, something shoots at me, my turrets deploy and return fire. When its destroyed or has jumped out of the sector and is hence no longer shooting at me, turrets retract and I go back into standby mode.
     

    lupoCani

    First Citizen
    Joined
    Jun 23, 2013
    Messages
    504
    Reaction score
    127
    • Purchased!
    • Legacy Citizen 10
    Its still a binary flag that indicates "Hey, something is shooting at me!"
    Long as something is shooting at me, logic block is in the on state. When things stop shooting at me, it goes to off.
    Firstly, it's not binary, it's some kind of non-linear function of shield percentage, time since last attack and possibly the strength of the attack.

    Secondly, I never meant to imply there would any technical problems with your suggestion. There's plenty of parameters that could easily determine the threat level, like "are we taking fire" or "are there enemy ships in range".
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Firstly, it's not binary, it's some kind of non-linear function of shield percentage, time since last attack and possibly the strength of the attack.
    You are being entirely too literal here.

    I don't mean that there is literally a boolean value that is being toggled via "oInCombat.SetValue True". I mean that there is some combination of factors, however they are determined, that has the net result of the game knowing if a ship is "in combat" or not, which could then be reduced to a literal binary state that could be accessed by logic.
     

    Rasor1911

    Abusing Stealth since the dawn of time
    Joined
    Jun 21, 2013
    Messages
    22
    Reaction score
    5
    • Purchased!
    • Legacy Citizen 4
    Great idea, the best way to do this might to have a 'combat' block with different mods, for example you can make it output a signal when damage is taken, enemy ships are in the area, or any array of options. And this will definitely be possible to implement.
     

    lupoCani

    First Citizen
    Joined
    Jun 23, 2013
    Messages
    504
    Reaction score
    127
    • Purchased!
    • Legacy Citizen 10
    You are being entirely too literal here.
    And you're not reading what I write. I quote-

    Secondly, I never meant to imply there would any technical problems with your suggestion. There's plenty of parameters that could easily determine the threat level, like "are we taking fire" or "are there enemy ships in range".
     

    Thalanor

    CEO Snataris Colonial Fleetyards
    Joined
    Sep 10, 2013
    Messages
    818
    Reaction score
    708
    • Master Builder Bronze
    • Thinking Positive
    • Legacy Citizen 3
    Yeah, just use a drone in an area trigger wireframe. Needs to be reset manually, but you get one free automated triggering with each manual reset (or - you make the system automatically reload itself and push the used undocked drones out).
     
    Joined
    Feb 8, 2014
    Messages
    20
    Reaction score
    9
    I don't think he's looking for an alternative way to do this with some logic/area trigger drone setup.. While that may work, as you pointed out, it is flawed and requires tedious manual resetting. If you have an array of turrets, as any station would, doing that for multiple turrets just becomes too much of a hassle. His idea is actually pretty cool in terms of a logic function that would do all this for you, as well as have other practical uses in the game. Other than just combat detection on hit, it would be more interesting if the logic block required usage of the scanner system to detect ships within a set range as well; otherwise it only uses the on-hit flag. A logic block like this would have some interesting possibilities..
     
    • Like
    Reactions: Edymnion

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Or we already have notifications of when ships enter our territory, including their status of friendly/neutral/hostile. A block that could read that status would be useful as well. Have it register a hostile intruder in your space and automatically activate your station defenses. Kind of a sector wide Yellow Alert.