Turret/Ship AI Scripting

    Joined
    May 27, 2014
    Messages
    138
    Reaction score
    152
    A block that acts like the normal BOBBY AI module, except it also stores a short Lua script that allows you to customize the firing sequence of weapons, select which targets to fire at first and how much leads, target specific block types, etc.

    Ships could have special options to follow enemy or friendly ships around, you could make missiles or mines that run up real close to enemy ships and attempt to blow them up, or have drones that follow you around and repair you/defend you, etc.

    Maybe even - for launched fighters/ships/drones - have something that attempts to find and dock with the docking module it launched from.

    If the ship/turret is unable to complete the script, it simply reverts to default AI behavior.
     
    Joined
    Jul 29, 2013
    Messages
    1,173
    Reaction score
    494
    • Competition Winner - Small Fleets
    • Top Forum Contributor
    • Legacy Citizen 5
    All of this will probably be achievable with the soon-to-be-released fleet AI. We'll just have to wait and see how the team decides to implement this stuff.
     
    Joined
    Dec 2, 2013
    Messages
    52
    Reaction score
    6
    This is pretty awesome. However, what would I be scripting? where to aim? who to attack? What about the overhead of running a lua VM in starmade. lua is small, but when you multiply out the resources required to run a single server (upwards of 75 ai ships * ~500kB per VM = 37.5MB minimum to run. Now if all the number of scripted ai units is limited per player this might be feasible.

    Also, lua has a weird syntax and I prefer an offline editor, so if this is implemented I would like to see a way to access pastebin to download scripts or upload my own written using an external editor, as any in game code editor would be like windows notepad (bare bones).
     
    Joined
    Aug 8, 2013
    Messages
    4
    Reaction score
    0
    • Legacy Citizen 4
    This is pretty awesome. However, what would I be scripting? where to aim? who to attack? What about the overhead of running a lua VM in starmade. lua is small, but when you multiply out the resources required to run a single server (upwards of 75 ai ships * ~500kB per VM = 37.5MB minimum to run. Now if all the number of scripted ai units is limited per player this might be feasible.

    Also, lua has a weird syntax and I prefer an offline editor, so if this is implemented I would like to see a way to access pastebin to download scripts or upload my own written using an external editor, as any in game code editor would be like windows notepad (bare bones).
    I feel you can do it ... and I don't know how you could do it exactly but you could make an in-game computer (like how the amc's are set up) and use the new indicator gun (the one used for the warp gates) to label them as under that computers control (you should limit it to ten per ship and only allow one comp per ship) that could work for fighters/ships/drones. For control it could be a drop down menu in the hot bar by using right click and to do the selected (item or thing) left click. and if there is an indicator block for the docking that would let the fighters/ships/drones know were to land and you can use the "f" key (selector key) indicate who to attack. mite want to limit how far there allowed to get away from the "mother ship". to make it fair. That's all i can think of... tell me if this helps. This could also be used for turrets (mite want to go higher on the number under control to like 20) and make it a separate computer.
     

    Lecic

    Convicted Lancake Abuser
    Joined
    Apr 14, 2013
    Messages
    5,115
    Reaction score
    1,229
    • Thinking Positive Gold
    • Purchased!
    • Legacy Citizen 11
    LUA Scripting for AI is already planned.
     
    Joined
    Dec 2, 2013
    Messages
    52
    Reaction score
    6
    I feel you can do it ... and I don't know how you could do it exactly but you could make an in-game computer (like how the amc's are set up) and use the new indicator gun (the one used for the warp gates) to label them as under that computers control (you should limit it to ten per ship and only allow one comp per ship) that could work for fighters/ships/drones. For control it could be a drop down menu in the hot bar by using right click and to do the selected (item or thing) left click. and if there is an indicator block for the docking that would let the fighters/ships/drones know were to land and you can use the "f" key (selector key) indicate who to attack. mite want to limit how far there allowed to get away from the "mother ship". to make it fair. That's all i can think of... tell me if this helps. This could also be used for turrets (mite want to go higher on the number under control to like 20) and make it a separate computer.
    This is much better than scripting, because it's just an extension of the existing ai module and wouldn't require any additional interpreters allowing for a performance boost.
    However, there is a problem with remembering the docking module, what if the ai controlled ship's home block was destroyed where would it go?[DOUBLEPOST=1411868785,1411868685][/DOUBLEPOST]
    LUA Scripting for AI is already planned.
    Where would the API for LUA scripting be found for starmade. For lua scripting to work in star-made, we need an active wiki.
     

    Lecic

    Convicted Lancake Abuser
    Joined
    Apr 14, 2013
    Messages
    5,115
    Reaction score
    1,229
    • Thinking Positive Gold
    • Purchased!
    • Legacy Citizen 11
    This is much better than scripting, because it's just an extension of the existing ai module and wouldn't require any additional interpreters allowing for a performance boost.
    However, there is a problem with remembering the docking module, what if the ai controlled ship's home block was destroyed where would it go?[DOUBLEPOST=1411868785,1411868685][/DOUBLEPOST]
    Where would the API for LUA scripting be found for starmade. For lua scripting to work in star-made, we need an active wiki.
    If the home docking module was destroyed it would probably panic and just float around.

    There are people working on updating the wiki. I believe they have a thread somewhere in general discussion.
     
    Joined
    Dec 2, 2013
    Messages
    52
    Reaction score
    6
    If the home docking module was destroyed it would probably panic and just float around.

    There are people working on updating the wiki. I believe they have a thread somewhere in general discussion.
    The random floating around would work, but what if the ship just became derelict because that ship's docking module on the carrier was transmitting a signal to it. It's the same thing that will happen once voyanger stops recieving a signal it just shuts down.

    The whole problem with lua to script ai for ships is the scripts will be very verbose (just how much of the ai could be scriptable?) The OP states that it would only add a few tasks and that could just allow a few changes in the ai config panel.