Block Driven Ship/Turret AI

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Idea has come up before (I know, I brought it up), but the game has changed since then in ways that invalidated some of the stuff, so I'd like to bring it up again refined for how the game is now.

    In the game Final Fantasy 12, they had an AI driven system for combat where you had to build the AI yourself. It was a kind of a mini game crossed with item collection to find/buy the commands you needed to then build the perfect AI, but I think the general way it worked would lend itself to Starmade block logic quite well.

    In FFXII, the system was set up as a two part list.
    On the left hand side of any given entry was the conditional. On the right hand side was the action. Items higher on the list took priority to the items lower on the list.

    So a basic setup would look like:

    "Health < 25%" "Use Healing Magic: Self"
    "Ally Health < 10%" "Use Healing Magic: Ally"
    "Enemy Health > 0%" "Attack: Enemy"

    So "Attack Enemy" being at the bottom would make it the lowest priority, its the "If there's nothing more important to do, attack something" command. Above that in priority is the "Your buddy is critically injured, heal him" command, so that the AI considers healing someone about to die on your side to be more important than just making another attack. Highest priority is healing yourself to keep yourself alive, which takes precedence over everything else.

    We could very easily turn that into a block based setup in order to build fire priorities for the Bobby AI's to follow.

    We could have a number of target blocks (Target: Ship, Target: Missile, Target: Astronaut), a number of conditional type blocks (shields, distance, armor hp, system hp, mass), and then use activators to set thresholds the way we do on the current sensor blocks.

    Here's a quick visual for a primary DPS Cannon/Cannon turret:
    Image1.jpg

    Bobby AI is the main master.

    Slaved to it is a Target:Ship block. Slaved to the Target:Ship is a Shield block, and slaved to the Shield block is an Activator set to off. This would equate to "Target a ship who's shields are at 0%".

    Slaved to that first Target:Ship is also a Target: Missile, which then has slaves for Distance and the activators for 1/3rd, meaning "Fire at any missile that is within 1/3rd of your maximum range".

    Then comes a simple "Fire at Astronauts".

    Then "Fire at Ships within 1/3rd of maximum range".

    And finally "Fire at Ships".

    So we now have a priority fire list. If there's a target with no shields, shoot at that. If there's a missile at close range, shoot at it as long as there's no shieldless ships around. If there are no shieldless ships and no missiles to shoot at, shoot at any astronauts you see. If none of the above, shoot at any ships within 1/3rd of your range (aka, prioritize anything in your face). And finally if you've got nothing else to do, just shoot at any enemy ship you can see.

    If you wanted, you could do something like move the Missile row down below the "Ships within 1/3rd range" since its a primary DPS turret, or leave it where it is for a "Oh crap, that one made it through the dedicated PDT!"

    Could even have a Target:Ship -> Mass -> 100% to tell it to give priority to the largest ship it can see, or Target:Ship -> Mass -> 25% to tell it to give priority to anything in the bottom 25% of mass ships it can see (aka, aim for drones and fighters over the carrier).

    This would increase the size of turrets and attack drones, but the amount of increase would depend on how complex you wanted their logic to be. At a minimum, you could completely replicate the current AI with at most a single block. Instead of going into the Bobby and telling to "Aim at Ships", you slave a single Target:Ship block to it. "Aim at Missiles" would add a single Target:Missile block. And "Target Any" would be simply not slaving anything at all.

    The AI would simply run down the list of priorities each time it fired. That way our hypothetical chaingun here could be wailing on a target, switch to fire a few shots off at a missile that broke through the dedicated PDT, and then switch back to it's original unshielded target without any input from you (other than having build the AI that way).

    Would give us a lot more in-depth build options, and would take a lot of the AI programming weight off the dev's shoulders. If you want a dumb as a box of rocks AI, then don't do any extra work. If you want a precision scalpel to go in and do exactly what you want, better be prepared to suss out that logic!
     

    Sachys

    Hermit.
    Joined
    Nov 30, 2015
    Messages
    647
    Reaction score
    316
    I remember that system in the game actually (and one of the better things about it as far as my interest went).

    I'm not sure how well it would work in starmade on the whole - but - i DO like the idea of the priority firing list. That alone should be something implemented - to my tastes at least.

    The rest I'll have to mull over some more.

    Edit: theres no "interesting" rating... bah.
     
    Joined
    Dec 3, 2016
    Messages
    93
    Reaction score
    7
    AI configuration is needed in Starmade. But you suggest to build a lot of blocks. It will make small turrets useless. Also, then more blocks you have, then more it require server's resources. So a lot of blocks will create a lot of lags.

    Here is another suggestion to configure AI.

    It will allow a lot of options and target priority (and conditions like you want) too, but with less blocks and lags.

    It's actually a good idea, but some AI configurations will require at least 50 blocks. And small turrets will be useless. That's why manual configuration of bobby AI is better.

    Also, AI in Starmade is too poor and buggy at the moment. I think they need to move AI priority up in their development plan. We can to promote the improvement of the AI configuration.
     
    Joined
    Nov 30, 2015
    Messages
    855
    Reaction score
    75
    AI configuration is needed in Starmade. But you suggest to build a lot of blocks. It will make small turrets useless. Also, then more blocks you have, then more it require server's resources. So a lot of blocks will create a lot of lags.

    Here is another suggestion to configure AI.

    It will allow a lot of options and target priority (and conditions like you want) too, but with less blocks and lags.

    It's actually a good idea, but some AI configurations will require at least 50 blocks. And small turrets will be useless. That's why manual configuration of bobby AI is better.

    Also, AI in Starmade is too poor and buggy at the moment. I think they need to move AI priority up in their development plan. We can to promote the improvement of the AI configuration.
    This would increase the size of turrets and attack drones, but the amount of increase would depend on how complex you wanted their logic to be. At a minimum, you could completely replicate the current AI with at most a single block. Instead of going into the Bobby and telling to "Aim at Ships", you slave a single Target:Ship block to it. "Aim at Missiles" would add a single Target:Missile block. And "Target Any" would be simply not slaving anything at all.

    If you want a dumb as a box of rocks AI, then don't do any extra work. If you want a precision scalpel to go in and do exactly what you want, better be prepared to suss out that logic!
    Also, thread hijack alert.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Also, thread hijack alert.
    Yeah, he basically just stated what I already said, and used it as an excuse to promote his own thread. Real classy that.

    Difference between the two being that his is a hard coded "this is the way it is, choose between the pre-made options" that requires more work on the part of the devs to create the AI, and mine is less work for the devs and more flexibility to have exactly what you do or do not want for yourself.

    But hey, a bump is a bump.
     
    Joined
    Dec 3, 2016
    Messages
    93
    Reaction score
    7
    Also, thread hijack alert.
    Yeah, he basically just stated what I already said, and used it as an excuse to promote his own thread. Real classy that.

    Difference between the two being that his is a hard coded "this is the way it is, choose between the pre-made options" that requires more work on the part of the devs to create the AI, and mine is less work for the devs and more flexibility to have exactly what you do or do not want for yourself.

    But hey, a bump is a bump.
    I repeat that your suggestion with logic block will increase server load and just make small ships useless. In real life, about 1x1x1 sm circuit is able to do stuff like 1 000 000 logic blocks or more! And you want us to make a lot of blocks? So if I want to make good logic enought I have to put 50+ (or 500+) logic blocks for AI?! Do you think about light ships with mass < 100? Do you understand that logic blocks needs more CPU load than their code analogs?

    About development. Developing of manual AI configuring is not hard. I made it for another game just for 3 days alone. Alone! But main code took only about 4 hours! Another 2.8 days I just used to test it. So you still think that Schine will spend a lot of time for coding? Are you sure that block control code is easier to develop?

    About flexibility. I want players to be able to code AI by themselves. It will have more flexability then any amount of blocks.

    And dude, don't blame me because I pasted link with the purpose don't to copy all the stuff here. It would be bad if promoted another thread with another theme, but I didn't.

    We should help to create stuff for AI configuration. It's important. And your suggestion is better then current ability to choose between missiles and astranauts. But you should think about best way to create AI configuration. I am not telling that my suggestion is best. We have to brainstorm to get best idea.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    And dude, don't blame me because I pasted link with the purpose don't to copy all the stuff here. It would be bad if promoted another thread with another theme, but I didn't.
    It is generally considered bad form at the very least to go onto someone's suggestion and basically go "No, I like my way better" and then promote your own thread.

    Also, please stop and consider the game as a whole.

    We have logic gate blocks. The game has an established leaning towards giving players block based components and letting them figure out creative ways to use them.

    For example, despite a simple clock being one of the most common logic circuits in the game, there is no clock pulse block. We have to spend half a dozen blocks to build it every single time.

    Block based AI programming fits in very nicely with the general gameplay and build ethos we currently have. A full on menu drive mix and match coding interface does not, there is nothing else even remotely like that in the game.

    It is better to stick to unified elements across the board that make it where knowledge in one transfers to another seamlessly than it is to have a dozen different unique structures that all have to be learned and memorized separately.
     

    madman Captain

    Self-appointet Overlord of the Scaffold
    Joined
    Jan 11, 2015
    Messages
    263
    Reaction score
    491
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 5
    A large advanced logic system instead of a simple comfortable menu?

    Ohh yes, Why simple when it can be difficult.
     
    Joined
    Dec 3, 2016
    Messages
    93
    Reaction score
    7
    It is generally considered bad form at the very least to go onto someone's suggestion and basically go "No, I like my way better" and then promote your own thread.

    Also, please stop and consider the game as a whole.

    We have logic gate blocks. The game has an established leaning towards giving players block based components and letting them figure out creative ways to use them.

    For example, despite a simple clock being one of the most common logic circuits in the game, there is no clock pulse block. We have to spend half a dozen blocks to build it every single time.

    Block based AI programming fits in very nicely with the general gameplay and build ethos we currently have. A full on menu drive mix and match coding interface does not, there is nothing else even remotely like that in the game.

    It is better to stick to unified elements across the board that make it where knowledge in one transfers to another seamlessly than it is to have a dozen different unique structures that all have to be learned and memorized separately.
    Stop blamming me. Our suggestions are about 90% equals. Difference is between block and code.

    I agree that game have logic blocks it's a part of gameplay now. But you should to think about amount of blocks that will be needed. Dude, I really don't want to put a 50 logic blocks on drone sized 100-200 blocks! One Bobby AI is enought.

    Common! Look at NPC update video: developers will add ship's roles already. Logic blocks are cool. But not while they are more then 5% of ship's space.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    I really don't want to put a 50 logic blocks on drone sized 100-200 blocks! One Bobby AI is enought.
    So you want better results with no additional cost?

    We can all agree that the AI needs a revamp, its a glorified placeholder at the moment. But, I prefer the idea that tiny drone ships are "dumb" and unreliable, while larger more complex ships are capable of doing more complicated and precise things.

    So frankly, yes, I do think a 100 block drone should be far less capable of flying "smart" and picking it's targets compared to a thousand block fighter.

    That is a tradeoff that SHOULD be there, IMO.

    And again, when you're talking about drones, you could replicate the entire AI we have now with no extra blocks what-so-ever if default is "Attack: Any". You would only need extra blocks if you wanted to give the drone a complicated "brain", which again IMO should take up extra space and require a more complex build.
     
    Joined
    Nov 30, 2015
    Messages
    855
    Reaction score
    75
    At a minimum, you could completely replicate the current AI with at most a single block. Instead of going into the Bobby and telling to "Aim at Ships", you slave a single Target:Ship block to it. "Aim at Missiles" would add a single Target:Missile block. And "Target Any" would be simply not slaving anything at all.
    I repeat that your suggestion with logic block will increase server load and just make small ships useless. In real life, about 1x1x1 sm circuit is able to do stuff like 1 000 000 logic blocks or more! And you want us to make a lot of blocks? So if I want to make good logic enought I have to put 50+ (or 500+) logic blocks for AI?!
    Did you read it? Pls. Just read the OP.
    Do you think about light ships with mass < 100?
    That "light ship" has a maximum size of a noob cube 10 by 10 by 10. That's tiny!
    A large advanced logic system instead of a simple comfortable menu?

    Ohh yes, Why simple when it can be difficult.
    It[the current system] needs are redo, for one, as it isn't simple menu at all. And all games have a "late game hardmode" that make the game easier but aren't nessecary. Redstone in minecraft. The TIM system in SE. Ksp Kirblenet. Factorio Production balancing. Starmade AI. If you want something simple stay away from AI or just do a 2 block system anyway.
     
    Joined
    Dec 28, 2014
    Messages
    262
    Reaction score
    64
    Rather not have another thing I have to set aside space for to add blocks to. It'd be like if the thrust config needed 5000000 blocks just to alter your allocation.

    Just stick it in the Bobby AI menu.
     
    Joined
    Nov 30, 2015
    Messages
    855
    Reaction score
    75
    Rather not have another thing I have to set aside space for to add blocks to. It'd be like if the thrust config needed 5000000 blocks just to alter your allocation.

    Just stick it in the Bobby AI menu.
    you could completely replicate the current AI with at most a single block. Instead of going into the Bobby and telling to "Aim at Ships", you slave a single Target:Ship block to it. "Aim at Missiles" would add a single Target:Missile block. And "Target Any" would be simply not slaving anything at all.
    Stap. You're making me cry.
     
    Joined
    Dec 3, 2016
    Messages
    93
    Reaction score
    7
    So you want better results with no additional cost?
    I don't say so. We may add some additional cost for increasing of logic. I can suggest it's manual version a bit later. It's important, but not as much as just basic AI improvement.

    And again, when you're talking about drones, you could replicate the entire AI we have now with no extra blocks what-so-ever if default is "Attack: Any". You would only need extra blocks if you wanted to give the drone a complicated "brain", which again IMO should take up extra space and require a more complex build.
    As I said, it will make small drones useless. Drones with mass < 100 are great. But logic blocks can make them less useful. Any AI now may be useless while fight with a lot of enemies, because ships with anti-capital weapon may try to hit fast and small drones without any success. You can't make any drone to choose target you want at the moment. If we will have AI logic control, it just will not affect small AI ships.

    That "light ship" has a maximum size of a noob cube 10 by 10 by 10. That's tiny!
    Relax, it's light and medium air (drones) with 100-700 blocks and mass upto 100. And they can get just any ship without aa (anti-air) stuff if able to down it's shields. I can show any of them.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    So just what kind of complex priority of fire list would you want to give a drone that small?

    You're talking about cannon fodder sized drones that won't live past a few seconds of direct fire hitting them. Just what kind of super complex stuff do you think they need to be doing besides "Fly out and shoot whatever you can get a bead on before they blow you up"?
     
    Joined
    Nov 30, 2015
    Messages
    855
    Reaction score
    75
    So just what kind of complex priority of fire list would you want to give a drone that small?

    You're talking about cannon fodder sized drones that won't live past a few seconds of direct fire hitting them. Just what kind of super complex stuff do you think they need to be doing besides "Fly out and shoot whatever you can get a bead on before they blow you up"?
    It's like why a tie fighter pilot is never a main character. They don't do anything more complex than follow something around and shoot.
    [doublepost=1481830073,1481828426][/doublepost]
    Relax, it's light and medium air (drones) with 100-700 blocks and mass upto 100. And they can get just any ship without aa (anti-air) stuff if able to down it's shields. I can show any of them.
    I wager that I could make a good 7/7/7 C/C/Exp turret that would shred your drones. Five could probably take on 20 of your drones. More if AI worked correctly.

    I'd spend more time making it look good than the actual design.
     
    Joined
    Dec 28, 2014
    Messages
    262
    Reaction score
    64
    I wager that I could make a good 7/7/7 C/C/Exp turret that would shred your drones. Five could probably take on 20 of your drones. More if AI worked correctly.

    I'd spend more time making it look good than the actual design.
    your shots would do 1-2 damage to Adv armor per hit, i find that pretty unlikely
     
    Joined
    Dec 3, 2016
    Messages
    93
    Reaction score
    7
    So just what kind of complex priority of fire list would you want to give a drone that small?
    Depends on it's functions. Developers want to add ship roles like fighter and bomber. It may be enought, but I want to configure AI by myself.

    You're talking about cannon fodder sized drones that won't live past a few seconds of direct fire hitting them. Just what kind of super complex stuff do you think they need to be doing besides "Fly out and shoot whatever you can get a bead on before they blow you up"?
    I wager that I could make a good 7/7/7 C/C/Exp turret that would shred your drones. Five could probably take on 20 of your drones. More if AI worked correctly.
    your shots would do 1-2 damage to Adv armor per hit, i find that pretty unlikely
    And how many blocks of Adv armor could you fit into 100 mass?

    These aren't armor cubes either, ya know.

    I can't say more about my drones, because it's fractional secret. But they're really dangerous. Best way to kill them is fighters. You can also use AA turrets with missiles or flak (but here is no flak and a bug that makes cannon/explosive effect just useless).


    I mean small drones are important and should be configured too.