Possible change for npc Escorts:
Moderators: winston, another_commander
Possible change for npc Escorts:
In their "ENTER_WORMHOLE" section, they have:
"DESIRED_RANGE_ACHIEVED" = ("LOOK_FOR_BUSINESS");
Which means after reaching the wormhole (the desired range being in the wormhole), they immediately switch to looking for business/looking for a mothership to escort.
How about instead change that line to read:
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: EXIT_WORMHOLE");
...so after entering a wormhole they aren't waiting on top of the exit point looking for a mothership that might run them over a couple seconds later.
"DESIRED_RANGE_ACHIEVED" = ("LOOK_FOR_BUSINESS");
Which means after reaching the wormhole (the desired range being in the wormhole), they immediately switch to looking for business/looking for a mothership to escort.
How about instead change that line to read:
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: EXIT_WORMHOLE");
...so after entering a wormhole they aren't waiting on top of the exit point looking for a mothership that might run them over a couple seconds later.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Possible change for npc Escorts:
No, they don't, because when entering their mother's wormhole they don't receive a DESIRED_RANGE_ACHIEVED message. The logical reason for this would be: wormholes tend to be quite a lot bigger than 1 meter, therefore a ship that collides with a wormhole and is removed will never achieve the desired range of 1 meter from its centre. Only if the wormhole has already collapsed will the escort get so close to its centre. Therefore I guess this line is in the AI for the purpose of an escort missing its mother's wormhole (being too late to enter). In that case it gets the DESIRED_RANGE_ACHIEVED message at some point, and will go looking for another mother, which is the sensible thing to do.Switeck wrote:In their "ENTER_WORMHOLE" section, they have:
"DESIRED_RANGE_ACHIEVED" = ("LOOK_FOR_BUSINESS");
Which means after reaching the wormhole (the desired range being in the wormhole), they immediately switch to looking for business/looking for a mothership to escort.
Here's some AI-log for the situation of an escort following its mother:
Code: Select all
15:06:38.018 [ai.takeAction]: Gemini Escort 478 to take action escortCheckMother
15:06:38.018 [ai.takeAction]: Gemini Escort 478 to take action pauseAI: 15
15:06:38.018 [ai.message.receive]: AI escortAI.plist for Gemini Escort 478 in state 'FLYING_ESCORT' receives message 'ESCORTING'. Context: handling deferred message, stack depth: 0
15:06:38.018 [ai.takeAction]: Gemini Escort 478 to take action setDesiredRangeTo: 0.0
15:06:38.018 [ai.takeAction]: Gemini Escort 478 to take action performEscort
15:06:46.627 [ai.message.receive]: AI escortAI.plist for Gemini Escort 478 in state 'FLYING_ESCORT' receives message 'ENTER WORMHOLE'. Context: <ShipEntity 0x1014cce00>{"Boa Class Cruiser"} wormholeEscorts, stack depth: 2
15:06:46.627 [ai.takeAction]: Gemini Escort 478 to take action setStateTo: ENTER_WORMHOLE
15:06:46.627 [ai.message.receive]: AI escortAI.plist for Gemini Escort 478 in state 'FLYING_ESCORT' receives message 'EXIT'. Context: changing state, stack depth: 3
15:06:46.627 [ai.message.receive]: AI escortAI.plist for Gemini Escort 478 in state 'ENTER_WORMHOLE' receives message 'ENTER'. Context: changing state, stack depth: 3
15:06:46.627 [ai.takeAction]: Gemini Escort 478 to take action setDestinationToTarget
15:06:46.627 [ai.takeAction]: Gemini Escort 478 to take action setDesiredRangeTo: 1.0
15:06:46.627 [ai.takeAction]: Gemini Escort 478 to take action setSpeedFactorTo: 1.0
15:06:46.627 [ai.takeAction]: Gemini Escort 478 to take action performFlyToRangeFromDestination
15:06:46.627 [ai.takeAction]: Gemini Escort 478 to take action dropMessages: TARGET_LOST
15:06:51.728 [ai.message.receive]: AI escortAI.plist for Gemini Escort 478 in state 'ENTER_WORMHOLE' receives message 'WITCHSPACE OKAY'. Context: performHyperSpaceExit, stack depth: 0
15:07:17.478 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'ENTER_WORMHOLE' receives message 'EXIT'. Context: changing state, stack depth: 0
15:07:17.478 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'GLOBAL' receives message 'ENTER'. Context: changing state, stack depth: 0
15:07:17.479 [ai.takeAction]: Gemini Escort 547 to take action setStateTo: BEGIN_BUSINESS
15:07:17.479 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'GLOBAL' receives message 'EXIT'. Context: changing state, stack depth: 1
15:07:17.479 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'BEGIN_BUSINESS' receives message 'ENTER'. Context: changing state, stack depth: 1
15:07:17.479 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'BEGIN_BUSINESS' receives message 'EXITED WITCHSPACE'. Context: unspecified, stack depth: 0
15:07:17.479 [ai.takeAction]: Gemini Escort 547 to take action setStateTo: EXIT_WORMHOLE
15:07:17.479 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'BEGIN_BUSINESS' receives message 'EXIT'. Context: changing state, stack depth: 1
15:07:17.479 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'EXIT_WORMHOLE' receives message 'ENTER'. Context: changing state, stack depth: 1
15:07:17.479 [ai.takeAction]: Gemini Escort 547 to take action setDestinationToCurrentLocation
15:07:17.479 [ai.takeAction]: Gemini Escort 547 to take action setDesiredRangeTo: 7500.0
15:07:17.479 [ai.takeAction]: Gemini Escort 547 to take action setSpeedTo: 50
15:07:17.479 [ai.takeAction]: Gemini Escort 547 to take action performFlyToRangeFromDestination
15:07:17.508 [ai.takeAction]: Gemini Escort 547 to take action escortCheckMother
15:07:17.509 [ai.takeAction]: Gemini Escort 547 to take action pauseAI: 2.5
15:07:17.509 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'EXIT_WORMHOLE' receives message 'ENTERED_WITCHSPACE'. Context: handling deferred message, stack depth: 0
15:07:17.509 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'EXIT_WORMHOLE' receives message 'AWAY_FROM_PLANET'. Context: handling deferred message, stack depth: 0
15:07:17.509 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'EXIT_WORMHOLE' receives message 'ESCORTING'. Context: handling deferred message, stack depth: 0
15:07:17.509 [ai.takeAction]: Gemini Escort 547 to take action setDesiredRangeTo: 0.0
15:07:17.509 [ai.takeAction]: Gemini Escort 547 to take action setStateTo: NEXT_TARGET
15:07:17.509 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'EXIT_WORMHOLE' receives message 'EXIT'. Context: changing state, stack depth: 1
15:07:17.509 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'NEXT_TARGET' receives message 'ENTER'. Context: changing state, stack depth: 1
15:07:17.509 [ai.takeAction]: Gemini Escort 547 to take action requestNewTarget
15:07:17.509 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'NEXT_TARGET' receives message 'TARGET_LOST'. Context: handling deferred message, stack depth: 0
15:07:17.509 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'NEXT_TARGET' receives message 'AEGIS_NONE'. Context: handling deferred message, stack depth: 0
15:07:17.509 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'NEXT_TARGET' receives message 'AEGIS_LEAVING_DOCKING_RANGE'. Context: handling deferred message, stack depth: 0
15:07:19.894 [Total_patrol]: Adding additional police.
15:07:20.008 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'NEXT_TARGET' receives message 'NOTHING_FOUND'. Context: handling deferred message, stack depth: 0
15:07:20.008 [ai.takeAction]: Gemini Escort 547 to take action switchLightsOff
15:07:20.009 [ai.takeAction]: Gemini Escort 547 to take action setStateTo: FLYING_ESCORT
15:07:20.009 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'NEXT_TARGET' receives message 'EXIT'. Context: changing state, stack depth: 1
15:07:20.009 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'FLYING_ESCORT' receives message 'ENTER'. Context: changing state, stack depth: 1
15:07:20.009 [ai.takeAction]: Gemini Escort 547 to take action performEscort
15:07:20.009 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'FLYING_ESCORT' receives message 'DESIRED_RANGE_ACHIEVED'. Context: handling deferred message, stack depth: 0
15:07:20.138 [ai.takeAction]: Gemini Escort 547 to take action escortCheckMother
15:07:20.139 [ai.takeAction]: Gemini Escort 547 to take action pauseAI: 15
15:07:20.139 [ai.message.receive]: AI escortAI.plist for Gemini Escort 547 in state 'FLYING_ESCORT' receives message 'ESCORTING'. Context: handling deferred message, stack depth: 0
15:07:20.139 [ai.takeAction]: Gemini Escort 547 to take action setDesiredRangeTo: 0.0
15:07:20.139 [ai.takeAction]: Gemini Escort 547 to take action performEscort
So the escort is doing exactly what it's supposed to do, and indeed escorts following their mother do not tend to collide with each other when exiting witchspace. (To be more precise: when you as player have followed and the new system is created, they are spawned in some distance to each other, not at the same coordinates.)
Re: Possible change for npc Escorts:
Seems like a kludge, even if it works.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Possible change for npc Escorts:
Why? This is just how all AI works all the time. Receiving messages and reacting upon them is all an AI ever does. The art of AI writing is to choose which of the gazillion messages shall be acted upon in which way under which circumstances.
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Re: Possible change for npc Escorts:
Is that a US or an Imperial gazillion?
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Possible change for npc Escorts:
Imperial (Empire of Achenar)DaddyHoggy wrote:Is that a US or an Imperial gazillion?
Re: Possible change for npc Escorts:
In "ENTER_WORMHOLE" section, there is only sections for:
ENTER
"PLAYER WITCHSPACE" = (enterTargetWormhole);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LOOK_FOR_BUSINESS");
...how the escorts return to other modes if they DON'T get "DESIRED_RANGE_ACHIEVED" is what seems a kludge.
ENTER
"PLAYER WITCHSPACE" = (enterTargetWormhole);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LOOK_FOR_BUSINESS");
...how the escorts return to other modes if they DON'T get "DESIRED_RANGE_ACHIEVED" is what seems a kludge.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Possible change for npc Escorts:
Yes, there don't need to be other sections, because there are no other messages which need to be reacted upon. Even the WITCHSPACE OKAY message, although received (see the log above), is irrelevant for the AI, because the ship doesn't need to react upon it. If it enters the wormhole, it is removed from the system, and thereby from existence. It dies. Only if the player happens to enter the system it was "jumping" to, the ship is recreated from scratch. Therefore it starts in GLOBAL state when recreated, and continues from there.Switeck wrote:In "ENTER_WORMHOLE" section, there is only sections for:
ENTER
"PLAYER WITCHSPACE" = (enterTargetWormhole);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LOOK_FOR_BUSINESS");
...how the escorts return to other modes if they DON'T get "DESIRED_RANGE_ACHIEVED" is what seems a kludge.
So the only relevant question is: what happens if the ship somehow fails to enter the wormhole? I answered that question above: the commands issued in the ENTER section cause the ship to head towards the location of the wormhole. So, if the wormhole does no longer exist, the ship will soon reach its former location, and DESIRED_RANGE_ACHIEVED is issued. This can only happen if the wormhole has disappeared, therefore there is nothing to follow anymore, therefore the ship is as of now an orphaned escort, therefore the logical way to go is to look for other business.
This is exactly what the ENTER_WORMHOLE state needs to do. What other sections need there to be?
Re: Possible change for npc Escorts:
Yep, definitely a kludge. Thanks for filling me in.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Possible change for npc Escorts:
Perhaps I am being dense, but I don't understand how this definition fits to the ingenious (and rather well-thought-out) mechanism of a [wiki]state machine[/wiki].My Dictionary wrote:kludge
an ill-assorted collection of parts assembled to fulfill a particular purpose.
• Computing: a machine, system, or program that has been badly put together
- CommonSenseOTB
- ---- E L I T E ----
- Posts: 1397
- Joined: Wed May 04, 2011 10:42 am
- Location: Saskatchewan, Canada
Re: Possible change for npc Escorts:
By this definition my numeric hud is definately a "kludge".Commander McLane wrote:Perhaps I am being dense, but I don't understand how this definition fits to the ingenious (and rather well-thought-out) mechanism of a [wiki]state machine[/wiki].My Dictionary wrote:kludge
an ill-assorted collection of parts assembled to fulfill a particular purpose.
• Computing: a machine, system, or program that has been badly put together
Vocabulary improvement +1. Learn something new everyday.
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.
CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Possible change for npc Escorts:
I think that makes me a Kludge!Commander McLane wrote:My Dictionary wrote:kludge
an ill-assorted collection of parts assembled to fulfill a particular purpose.
Commander Smivs, the friendliest Gourd this side of Riedquat.
Re: Possible change for npc Escorts:
I don't agree that it is ingenious. It works, but in a lackluster way...as I have seen escorts gets stuck doing nothing after their mother enters a wormhole.Commander McLane wrote:Perhaps I am being dense, but I don't understand how this definition fits to the ingenious (and rather well-thought-out) mechanism of a [wiki]state machine[/wiki].
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LOOK_FOR_BUSINESS"); ...for instance is to be used when it fails to reach its goal of actually entering the wormhole. I mistakenly thought that meant it reached its goal -- thus the whole point of me starting this message thread.
And if it manages to reach its goal, then it automagically gets reset to GLOBAL because it's actually been killed and replaced with the same shiptype in the new system. This means it regains lost/used missiles and is back to full energy (and NPC shields OXP).
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Possible change for npc Escorts:
The whole recent change to let escorts behave correct after jumping through a wormhole is a compromise.:
It must work when the escorts follow a mother through the wormhole (escorts arrive after the mother) AND it must work when escorts arrive before their mother jumps. (escorts arrive first)
The latter is for example the case when a ship with escorts follows the player. And because escorts fly in general faster than the mother, the escorts normally jump through the wormhole before heir mother does.
And AI is not so flexible to differentiate between every situation. It is often a challenge to write something that works in all cases.
It must work when the escorts follow a mother through the wormhole (escorts arrive after the mother) AND it must work when escorts arrive before their mother jumps. (escorts arrive first)
The latter is for example the case when a ship with escorts follows the player. And because escorts fly in general faster than the mother, the escorts normally jump through the wormhole before heir mother does.
And AI is not so flexible to differentiate between every situation. It is often a challenge to write something that works in all cases.
UPS-Courier & DeepSpacePirates & others at the box and some older versions