[WIP] Captain AI overhaul. Updated 09.12.2014
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Sucellus VS Xenon K
Sucellus runs at full speed while trying to turn towards its target, this is the fail.
An artillery needs to stay put and turn towards its target. If not in range by then, move closer, if in range, let em have it and reverse if target still coming towards you. Once too close, full throttle and do a fly-by to gain x-distance. Then again, turn in place and use the range.
Sucellus runs at full speed while trying to turn towards its target, this is the fail.
An artillery needs to stay put and turn towards its target. If not in range by then, move closer, if in range, let em have it and reverse if target still coming towards you. Once too close, full throttle and do a fly-by to gain x-distance. Then again, turn in place and use the range.
-
- Moderator (English)
- Posts: 8074
- Joined: Tue, 30. Mar 04, 12:28
@YorrickVander
Yup, that long update interval does not work good in "close combat" situations. Are experimenting with different strategies, update intervals and interrupts based on ranges, ship type and hull/shield states on both sides.
On close range evade strategy (enemy hull below 15%) I've removed the target destroyed interrupt to avoid them stopping to take a close look at the explosion if no new targets, and using a fixed "runaway" timer instead.
@swatti
The mod should do this + are coming in ego's new AI package too.
Ranges for Sucellus in current alpha is:
Maxdistance: 7500
Holddistance: 3500
Minimum distance: 1000.
For station targets the ranges are increased with 2KM.
It will prefer to be between max and hold distance ranges (hold position/rotate to target), start reversing when between hold and minimum, and break off and try to gain distance when below minimum. Have changed minimum range to 2KM in the version I'm working on now.
Yup, that long update interval does not work good in "close combat" situations. Are experimenting with different strategies, update intervals and interrupts based on ranges, ship type and hull/shield states on both sides.
On close range evade strategy (enemy hull below 15%) I've removed the target destroyed interrupt to avoid them stopping to take a close look at the explosion if no new targets, and using a fixed "runaway" timer instead.
@swatti
The mod should do this + are coming in ego's new AI package too.
Ranges for Sucellus in current alpha is:
Maxdistance: 7500
Holddistance: 3500
Minimum distance: 1000.
For station targets the ranges are increased with 2KM.
It will prefer to be between max and hold distance ranges (hold position/rotate to target), start reversing when between hold and minimum, and break off and try to gain distance when below minimum. Have changed minimum range to 2KM in the version I'm working on now.
@swatti
Yeah, can think of a couple scenarios where that may happen - is mainly when they are flying straight toward each other, and happens more often if using the fasterships mod (I do). Doing a new attack order when enemy comes a bit closer will force it to recheck ranges and make it stop/rotate if in correct range.
Are experimenting with some interrupts to force them to recheck ranges when flying to waypoint - with promising results.
Have to do some more testing before the next release, and will support a lot more ships in that one.
@sparky
Almost forgot - thanks for the pancakes
Yeah, can think of a couple scenarios where that may happen - is mainly when they are flying straight toward each other, and happens more often if using the fasterships mod (I do). Doing a new attack order when enemy comes a bit closer will force it to recheck ranges and make it stop/rotate if in correct range.
Are experimenting with some interrupts to force them to recheck ranges when flying to waypoint - with promising results.
Have to do some more testing before the next release, and will support a lot more ships in that one.
@sparky
Almost forgot - thanks for the pancakes
Hi folks,
new version is up. Added a bunch of new stuff so renamed the mod - list updated in OP.
Calling this one beta since is getting close to feature complete to what I had planned.
Decided to remove the reversing function from B/S - was good idea in theory, but did not work well in practice (slooow turnrate and speed when reversing, and often flailing away from correct vector to fire). The breakoff distance have been shortened to have as much fire at target as possible before turning away - seems to work nice.
Still have to do a lot more testing/tuning, especially when it comes to formation behavior. Which takes a lot of time - anyone know if the debugging tools shown in one of the pre release videos (timecompression and visible path spline) is available to mere mortals?
new version is up. Added a bunch of new stuff so renamed the mod - list updated in OP.
Calling this one beta since is getting close to feature complete to what I had planned.
Decided to remove the reversing function from B/S - was good idea in theory, but did not work well in practice (slooow turnrate and speed when reversing, and often flailing away from correct vector to fire). The breakoff distance have been shortened to have as much fire at target as possible before turning away - seems to work nice.
Still have to do a lot more testing/tuning, especially when it comes to formation behavior. Which takes a lot of time - anyone know if the debugging tools shown in one of the pre release videos (timecompression and visible path spline) is available to mere mortals?
-
- Moderator (English)
- Posts: 8074
- Joined: Tue, 30. Mar 04, 12:28
-
- Moderator (English)
- Posts: 8074
- Joined: Tue, 30. Mar 04, 12:28
- YorrickVander
- Posts: 2705
- Joined: Tue, 29. Oct 13, 21:59
Heh yeah I tried that too The best result was 'Boson! F**k shooting let's ram the b*****d!' lol. The rest was more like a Benny Hill sketch...cicero111 wrote:Yeah, you're probably right - those were the early days of ghost ships. Well, patience is a virtue and so on I guess
Tried enabling in sector boosting to get them moving faster to enemy - besides getting some really good laughs out of it that did not help much in the way of testing
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.
afaik nope, but i think you can hack in time compression with a hex editor - try to find a memory address which switches between 0 and 1 when you pause and unpause the game, maybe you find something..cicero111 wrote:anyone know if the debugging tools shown in one of the pre release videos (timecompression and visible path spline) is available to mere mortals?
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
@YorrickVander
Would be really cool if one could make short boosts work though - an interesting problem to solve
Have been thinking about a stop/rotate, when aligned boost/move x seconds (either range check interrupt or move timer calculated by magic math - i.e. trial&error bruteforcing) to come within 10-15 km of target.
A rats nest of problems though - wingmen is in theory doable with interupt/align/start booster/stop booster sequence when leader charges boosters/boosting/stops boost. But how to make this work in regions with stations though..
LOS check/boost only if in direct sight else move normally maybe... Will most likely end in the entire fleet exploding madly in all directions, worth a try just for the laughs I think
@UniTrader
Direct memory hacks is probably way way way above my abilities, especially on winOS which I don't have much lowlevel competence on - looking forward to dat Linux port
Would be really cool if one could make short boosts work though - an interesting problem to solve
Have been thinking about a stop/rotate, when aligned boost/move x seconds (either range check interrupt or move timer calculated by magic math - i.e. trial&error bruteforcing) to come within 10-15 km of target.
A rats nest of problems though - wingmen is in theory doable with interupt/align/start booster/stop booster sequence when leader charges boosters/boosting/stops boost. But how to make this work in regions with stations though..
LOS check/boost only if in direct sight else move normally maybe... Will most likely end in the entire fleet exploding madly in all directions, worth a try just for the laughs I think
@UniTrader
Direct memory hacks is probably way way way above my abilities, especially on winOS which I don't have much lowlevel competence on - looking forward to dat Linux port
well, you dont need special knowledge, just a cheat program like artmoney for that
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
@UniTrader
That looks nice, thanks for the tip Have to look in to that, some speed hacks would be great for testing.
Actually got in sector boosting working relatively reliably yesterday Only challenge now is to force the get_safe_pos to give a consistent output. Trying to force it to return a point in space from the target toward ship which is ca 13KM away from target with:
Works relatively OK but the output is sometimes a bit random and might give me a point on the opposite side of target, but usually get a OK position after 1-5 tries so have a do_while recheck hack for now. The range from target is always consistent. Any tip on what I'm doing wrong here?
The direction statement is not often used in the vanilla code so not much to go on, only in the undock code IIRC.
Here is the current codesnippet if someone want to play with it over the weekend. Have cleaned up some of my debugging stuff to help readability.
The forceposition="false" in boost move is important, without it the game will throw the ships around wildly on arrival. Have the minimum range for IS boost set to 20KM here.
That looks nice, thanks for the tip Have to look in to that, some speed hacks would be great for testing.
Actually got in sector boosting working relatively reliably yesterday Only challenge now is to force the get_safe_pos to give a consistent output. Trying to force it to return a point in space from the target toward ship which is ca 13KM away from target with:
Code: Select all
<get_safe_pos object="$target" zone="this.zone" directionobject="this.ship" angle="35deg" min="12500" max="13500" radius="this.ship.size" result="$pos" allowyaxis="false"/>
The direction statement is not often used in the vanilla code so not much to go on, only in the undock code IIRC.
Here is the current codesnippet if someone want to play with it over the weekend. Have cleaned up some of my debugging stuff to help readability.
The forceposition="false" in boost move is important, without it the game will throw the ships around wildly on arrival. Have the minimum range for IS boost set to 20KM here.
Code: Select all
<do_if value="this.ship.distanceto.{$target} gt 20000 and this.ship.isplayerowned" >'
<!--Stop and hold position/rotate to target-->
<create_orientation name="$targetvector" refobject="$target" orientation="look_at">
<position object="this.ship" space="this.ship.zone" />
</create_orientation>
<move_to destination="this.zone" object="this.ship" >
<position object="this.ship" z="5m" />
<rotation value="$targetvector" />
<interrupt_after_time time="60s" />
<interrupt>
<conditions>
<check_any>
<event_object_destroyed object="$target"/>
<event_boost_started object="$target" />
</check_any>
</conditions>
</interrupt>
</move_to>
<!--Find safe pos ca 13KM from target in direction of this ship-->
<set_avoid_collisions object="this.ship" enabled="false" />
<get_safe_pos object="$target" zone="this.zone" directionobject="this.ship" angle="35deg" min="12500" max="13500" radius="this.ship.size" result="$pos" allowyaxis="false"/>
<set_value name="$counter" exact="1"/>
<!--HACK!: position sanity validation/force rechecks, max 30 retries to avoid infinite loop lockup...-->
<do_while value="(this.ship.distanceto.{$target} - this.ship.distanceto.{$pos}) le 7000">
<get_safe_pos object="$target" zone="this.zone" directionobject="this.ship" angle="35deg" min="12500" max="13500" radius="this.ship.size" result="$pos" allowyaxis="false"/>
<set_value name="$counter" exact="$counter + 1"/>
<do_if value="$counter ge 30">
<break />
</do_if>
</do_while>
<set_value name="$posY" exact="$target.position.y"/>
<do_if value="$isstation">
<set_value name="$posY" exact="$pos.y"/>
</do_if>
<do_if value="player.ship == this.ship">
<speak actor="this" line="1029" comment="Engaging boosters." />
</do_if>
<start_boost object="this.ship" />
<move_to destination="this.zone" object="this.ship" forceposition="false" finishonapproach="true" usehighways="false">
<position x="$pos.x" y="$posY" z="$pos.z" />
<rotation value="$targetvector" />
<interrupt_after_time time="$updatetime" />
<interrupt>
<conditions>
<check_any>
<event_object_destroyed object="$target"/>
<event_boost_started object="$target" />
<check_all>
<event_boost_charging_started object="$target" />
<check_value value="this.ship.distanceto.{$target} le 15km" />
</check_all>
</check_any>
</conditions>
</interrupt>
</move_to>
<stop_boost object="this.ship" />
<set_avoid_collisions object="this.ship" enabled="true" />
</do_if>
-
- Moderator (English)
- Posts: 8074
- Joined: Tue, 30. Mar 04, 12:28
maybe you should add a » ignored="this.ship" « attribute here to avoid getting a diffrent position when your Ship is already nearby? i am not really sure if this is in any way related you your problem, but i jast saw this when looking through the move.autopilot and thought it might be useful for youcicero111 wrote:Actually got in sector boosting working relatively reliably yesterday Only challenge now is to force the get_safe_pos to give a consistent output. Trying to force it to return a point in space from the target toward ship which is ca 13KM away from target with:Works relatively OK but the output is sometimes a bit random and might give me a point on the opposite side of target, but usually get a OK position after 1-5 tries so have a do_while recheck hack for now. The range from target is always consistent. Any tip on what I'm doing wrong here?Code: Select all
<get_safe_pos object="$target" zone="this.zone" directionobject="this.ship" angle="35deg" min="12500" max="13500" radius="this.ship.size" result="$pos" allowyaxis="false"/>
The direction statement is not often used in the vanilla code so not much to go on, only in the undock code IIRC.[/code]
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
- Sandalpocalypse
- Posts: 4447
- Joined: Tue, 2. Dec 03, 22:28