Jump to content

Sathaerz

Members
  • Posts

    43
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Sathaerz

  1. To add on to FuryOfTheStars' point - I don't really care if someone is "ready for the area" or not. And it is completely irrelevant to the discussion. If they're not, they'd get wiped out shortly after loading invincibility anyways.

    It's just problematic to have things happening while a loading screen is up. Imagine if that happened in a MMO or a FPS?

  2. Would be nice if we could get some info on exactly how TurretTemplate.simultaneousShooting works. An answer here would be fine but I'd like to see an update to the documentation so other modders aren't as confused as I am when looking at it.

    It looks like it instantly overheats the turret but fires all of a turret's weapons at the same time?

    That means that the tooltips that say that say that it offers multiple continuous shots are wrong, since it only fires once before overheating.

  3. One of the things about the AI ship is that the programming function to place turrets tries to spread turrets evenly over the entire hull. This, combined with the fact that the AI ships are kinda skinny, is why the AI ships never seem to have issues with aiming weapons while the player ships do, since players, generally speaking, prefer to place their turrets in an organized manner.

    I've actually ended up talking with the devs about this and submitted a fairly detailed bug report about it. I've also dropped a few showcase videos on how poor the AI targeting is on player-designed ships with organized turret placements.

    Believe it or not, things actually have gotten better over the last few patches, but I agree with the original poster that there is still significant room for improvement - especially when a larger ship simply stays in place, rotates, and doesn't effectively maneuver vs. smaller ships - you can see that quite clearly in the Baleful Katana behavior in this video: 

     

    Note how the Baleful Katana - which is much larger than the ships it is fighting - simply rotates in place while the smaller ships maneuver around it. This sometimes causes it to be out of range of its primary target, which is something that I actually inadvertently end up taking advantage of during the 2nd fight. The Katana should try to push through the swarm of smaller ships and engage its primary target (me in the Euryale) or simply switch targets to one of its closer enemies that it can actually damage.

    Koonschi mentioned that this was a pathfinding issue, so he seems to be aware of what might be causing the issue and how to fix it. I'm hoping that the AI is improved in 2.0. Otherwise it will continue to remain a significant problem with combat in this game.

    I get why the AI tries to avoid ramming things, but it is far too cautious - especially in combat. If you are in a do-or-die combat situation, some minor hull damage from pushing through a number of smaller ships simply doesn't matter.

    • Like 1
  4. One more for the pile - run init.lua when a torpedo is fired. It would let us attach a custom script to a torpedo on creation instead of having to do some weird workarounds.

    This has since been confirmed by Koonschi to not be possible.

  5. Sorry, I know I'm tossing in a lot of these but it would be awesome if we could have a way to bypass or remove the pauseTime in the event scheduler on a per-event basis. I added some events that have a % chance to simply terminate immediately and it causes a massive lack of events to happen due to incrementing the pauseTime.

    I implemented my own event scheduler, but I don't want to have to maintain it every time you guys end up changing the event scheduler as well.

    Ended up figuring out a better way to do this than completely reimplementing the event scheduler. Would still be a nice feature, though!

  6. Oh yeah, it would be nice if we could get a way to flag a ship as not counting for a warzone (other than setting is_pirate / is_xsotan / is_persecutor) without having to mess with the warzone script ourselves. I'm not too stressed about this one, though.

  7. --Custom AI script.
    package.path = package.path .. ";data/scripts/lib/?.lua"
    include ("stringutility")
    include ("randomext")
    
    local targetEntity
    local minDist = -1
    
    --namespace PursuitAIScript
    PursuitAIScript = {}
    
    if onServer() then
    
        function PursuitAIScript.getUpdateInterval()
            --Per Koonschi, this needs to be run every single frame.
            return 0
        end
    
        function PursuitAIScript.initialize(...)
            --Immediately set the AI idle. PursuitAIScript will tell it how to behave instead of the default ship AI.
            local ship = Entity()
            local ai = ShipAI()
            local ctlUnit = ControlUnit()
            --print("PursuitAIScript AI successfully attached to " .. ship.name)
    
            ai:stop()
            ai:setIdle()
            for _, t in pairs({ship:getTurrets()}) do
                local xt = Turret(t)
                xt.group = 8
                local xw = Weapons(t)
                if xw.damageType ~= DamageType.Fragments and (xw.reach < minDist or minDist == -1) then
                    minDist = xw.reach
                end
            end
            if minDist <= ship:getBoundingSphere().radius then
                --Make sure it is at least the bounding radius
                minDist = ship:getBoundingSphere().radius
            else
                --Make it a bit smaller than the minimum range to make sure we're always inside of it.
                minDist = math.max(ship:getBoundingSphere().radius, minDist - 200)
            end
            --print("minimum range is " .. minDist)
        end
    
        function PursuitAIScript.updateServer(timeStep)
            local ship = Entity()
            local ai = ShipAI()
            local ctlUnit = ControlUnit()
            local eng = Engine()
    
            for _, t in pairs({ship:getTurrets()}) do
                local xt = Turret(t)
                print("xt group is " .. tostring(xt.group))
            end
    
            if not targetEntity then
                local ships = {Sector():getEntitiesByType(EntityType.Ship)}
                local possibleTargets = {}
                for _,p in pairs(ships) do
                    if ai:isEnemy(p) then
                        table.insert(possibleTargets, p)
                    end
                end
                --print("PursuitAIScript AI picked " .. targetEntity.name .. " as a pursuit target.")
                targetEntity = possibleTargets[math.random(1, #possibleTargets)]
            end
    
            if targetEntity and valid(targetEntity) then
                --Set the aimed position of all the weapons in group 1.
                ctlUnit:setAimedPosition(targetEntity.translationf, 0)
                ctlUnit:setControlActions(ControlActionBit.Fire1, 0)
                ctlUnit:setKeyDownMask(ControlActionBit.Fire1, 0)
                --Use the AI to fly.
                local distanceToTarget = distance(targetEntity.translationf, ship.translationf)
                if distanceToTarget > minDist then
                    --print("Distance to target is ... " .. distanceToTarget .. " desired is " .. minDist)
                    ctlUnit:flyToLocation(targetEntity.translationf, eng.maxVelocity)
                    --ai:setFlyLinear(targetEntity.translationf, minDist * 2, false)
                end
            else
                --print("PursuitAIScript AI lost track of its current target, and will pick a new one on its next update.")
                targetEntity = nil
            end
        end
    
    end

    So a while back, I was working on this custom AI script. The issue that I ran into was that it would only shoot at the exact position of the target ship, which would obviously only work for hitscan weapons like lightning guns, railguns, etc.

    I had the idea to reassign weapons into different groups and control the position that the weapons were aiming based on that. However, when the first section of the script executes (that ostensibly sets all turret groups to group 8 ) there are no errors BUT executing the code immediately afterwards shows that the AI has reassigned all of the turrets to group 1 (or group 2 - I can't remember) which makes it impossible to group up turrets by a metric like projectile velocity.

    It would be awesome if there was a way to hard stop the AI from attempting to reassign turret groups, especially while idle.

    Be careful attaching this to a ship btw - it will spam messages like no tomorrow.

  8. This is pretty easily solvable via script. All the devs would have to do is something like this:

    local hpFactor = 10 --Or another appropriate number.
    if math.random() < 0.5 then
    	traderShip = ShipGenerator.createTradingShip(traderFaction, MatrixLookUpPosition(-dir, vec3(0, 1, 0), traderPos))
    else
    	traderShip = ShipGenerator.createFreighterShip(traderFaction, MatrixLookUpPosition(-dir, vec3(0, 1, 0), traderPos))
    end
    local traderDurability = Durability(traderShip)
    if traderDurability then traderDurability.maxDurabilityFactor = (traderDurability.maxDurabilityFactor or 0) + hpFactor end
    traderShip:addScript("deleteonplayersleft.lua")
    ShipAI(traderShip.index):setPassiveShooting(true)
    traderShip:registerCallback("onDestroyed", "onTraderShipDestroyed")

     

    • Like 1
  9. The API for torpedoes could use some work. I have a ship with two torpedo tubes that each have 6 available slots. The following code:

    local _Player = Player(callingPlayer)
    local _Craft = _Player.craft
    local _Launcher = TorpedoLauncher(_Craft.index)
    local _Shafts = {_Launcher:getShafts()}
    
    for _, _Shaft in pairs(_Shafts) do
        print("K : " .. tostring(_) .. " - V : " .. tostring(_Shaft))
    end
    
    print("numShafts : " .. tostring(_Launcher.numShafts) .. " - maxShafts : " .. tostring(_Launcher.maxShafts))

    returns 10 shafts in _Shafts, and both numShafts and maxShafts returns 10.

    _Launcher:getFreeSlots(_Shaft) will also return 15 if the shaft is unavailable for use.

    Trying to dynamically load the launchers based on the number of available slots will KILL the game and corrupt a save to the point where it needs to be restored from a backup.

×
×
  • Create New...