Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Dave Thaler

Registered:
Posts: 417
Reply with quote  #1 
In the MOD FAQ thread, it's been discussed that "whalehater" and "whalelover" do not function correctly in mission scripts (and I verified this as well).  What are approximations that can be used in mission scripts?

For whalehater, manually adding CHASE_WHALE to the end of the brain stack of any Torgoth ship created is a good approximation, but what range would be similar to whatever "whalehater" does?

For whalelover, there's AVOID_WHALE but that's not the same thing.

First problem is that Arvonian ships spawn fighters, so to manage the brain stacks of fighters you'd have to know the fighter's designation.  But how could you predict fighter designations?   Is there any way to force a specific random number seed?

Second problem is that, from my understanding whalelover makes the ship attack anyone who harms a whale, and I haven't found a way yet to detect that.  You can test for when a whale no longer exists, but you can't tell which ship damaged it.

Any other ideas?

Dave Thaler

Registered:
Posts: 417
Reply with quote  #2 
Quote:
Originally Posted by Dave Thaler
First problem is that Arvonian ships spawn fighters, so to manage the brain stacks of fighters you'd have to know the fighter's designation.  But how could you predict fighter designations?


After some experimentation, I am able to modify fighter brain stacks using Xavier's technique in this thread.  The disadvantage is that I have to keep the loop running all the time that the carrier exists, to handle any newly launched fighters.
https://artemis.forumchitchat.com/post/destroy-all-randomly-named-ships-problem-solved-8572294?pid=1296341393
ryleyra

Registered:
Posts: 2,852
Reply with quote  #3 
All good questions and ideas.

IIRC, the whalelover tag means that any time a player ship destroys a whale, all Arvonians on the screen will refuse to surrender from that point on. One way to simulate this in a script would be to detect when a whale is destroyed (you'd have to assume the player did it, unless you check first to see if the player has TARGETTED any whale) and immediately set the surrenderChance of all Arvonians to 0.

As noted, you'll have to do this with the fighters using Xavier's method -- although I'm not actually sure fighters can be made to surrender.

I don't know that Arvonians have ever attacked Torgoth that kill a whale. That was the behavior that was described by the game manual, but I've never actually seen it happen. That being said, in a script you can have a storyline where a bunch of Torgoths show up in a mission hunting whales, and Arvonians show up to stop them.

My guess at the range of CHASE_WHALE would be 5000, which is the range at which CHASE_PLAYER normally functions. I don't think Torgoths will pursue whales across the whole sector (except in a script as noted above) so I'm assuming they turn to pursue when they get within close sensor range.
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,061
Reply with quote  #4 
Quote:
Originally Posted by ryleyra
I don't know that Arvonians have ever attacked Torgoth that kill a whale. That was the behavior that was described by the game manual, but I've never actually seen it happen. That being said, in a script you can have a storyline where a bunch of Torgoths show up in a mission hunting whales, and Arvonians show up to stop them.


Was that described in the manual? If so it is wrong and I apologize, since I wrote the manual.

Here is what should happen:

If any whalehater kills any whale, all whalelover ships will immediately surrender. In effect, if a Torgoth kills a whale all Arvonians will say "Screw you guys, I'm going home."

It is impossible to perfectly simulate the whalelover behavior in the current mission scripting system because the script cannot tell which ship fired which shot. But it is possible to approximate the behavior by making assumptions based on who is nearby when a whale dies.

__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,061
Reply with quote  #5 
Also, you can manage the Arvonian fighters manually. That is, remove the LAUNCH_FIGHTERS element from the carrier's brain stack and use CREATE and SET_RELATIVE_POSITION to build the fighters. Use FIGHTER_BINGO or timers and TARGET_THROTTLE and DESTROY to simulate the rest of the fighter behavior. All it takes is a few hundred lines of code. As a bonus, you get to give the fighters cool names.
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
ryleyra

Registered:
Posts: 2,852
Reply with quote  #6 
Quote:
Originally Posted by Mike Substelny

Was that described in the manual? If so it is wrong and I apologize, since I wrote the manual.


I don't think it was described per se, but implied by the "flavor" text.

Quote:

If any whalehater kills any whale, all whalelover ships will immediately surrender. In effect, if a Torgoth kills a whale all Arvonians will say "Screw you guys, I'm going home."


Well, that's certainly more pacifistic than that the Arvonians will turn on the Torgoth. 😃 Makes a lot more sense, too.

And of course if the players shoot a whale, it has the exact opposite effect. The Arvonians won't surrender no matter what.

Quote:

It is impossible to perfectly simulate the whalelover behavior in the current mission scripting system because the script cannot tell which ship fired which shot. But it is possible to approximate the behavior by making assumptions based on who is nearby when a whale dies.


Yep, that's how I do it. Make sure the ship being checked for is in range, and then check if whatever target is destroyed.

It would be nice to have a "who fired on this target" flag, but it would have to be some sort of value set on the target. Or, perhaps there could be a if_target_fired_on command, similar to if_player_targetting, taking a target object and a firing ship as arguments.

Dave Thaler

Registered:
Posts: 417
Reply with quote  #7 

Quote:
Originally Posted by Mike Substelny
Was that described in the manual? If so it is wrong and I apologize, since I wrote the manual.

Here is what should happen:

If any whalehater kills any whale, all whalelover ships will immediately surrender. In effect, if a Torgoth kills a whale all Arvonians will say "Screw you guys, I'm going home."


Indeed, I now see that the 1.70 manual says this: "If a Torgoth slaughters a space whale, all Arvonians who witness the act will immediately withdraw from battle to report that their ally has committed an atrocity."

However, one of the posts in the MOD FAQ thread said, "I've seen Arvonian Fleets attack Torgoth Fleets in Invasion Mode, so at least the Invasion Mode whalelover and whalehater AI functions as one might expect."

And the wiki page on Arvonians currently says, "Torgoth, in particular, often hunt whales for trophies, and Arvonians will break off in the middle of battle and turn on their former allies" so I think that ought to be corrected.


Quote:
It is impossible to perfectly simulate the whalelover behavior in the current mission scripting system because the script cannot tell which ship fired which shot. But it is possible to approximate the behavior by making assumptions based on who is nearby when a whale dies.


Yep, that's what I'm now doing in my mission script.

ryleyra

Registered:
Posts: 2,852
Reply with quote  #8 
Quote:
Originally Posted by Dave Thaler

Indeed, I now see that the 1.70 manual says this: "If a Torgoth slaughters a space whale, all Arvonians who witness the act will immediately withdraw from battle to report that their ally has committed an atrocity."


That definitely seems to describe the surrender behavior a lot better than turning on their former allies.

EDIT: The Arvonian entry in the manual (quoted on the wiki) says this:

"Arvonians also love space whales. If they see you harm a space whale the Arvonians will fight to the death rather than allow you to live."

Again, if you understand what that means (Arvonians will not surrender) it makes sense. If you combine the two statements, however, it's easy to come to the conclusion that if a Torgoth harms a space whale the Arvonian will "fight to the death" to destroy it.

Quote:

And the wiki page on Arvonians currently says, "Torgoth, in particular, often hunt whales for trophies, and Arvonians will break off in the middle of battle and turn on their former allies" so I think that ought to be corrected.


Yeah, once the assumption that Arvonians will turn on the Torgoth was established, it was pretty quickly regarded as true. But that never really matched the actual behavior, and I had never seen that behavior myself.

The wiki could definitely use correcting. I'm pretty sure I noted in multiple places that the assumed behavior had never been confirmed, but I'm also pretty sure I wrote what's on that Arvonian page. I'll have to see if I properly copied the text from the manual, because that's supposed to be there.

EDIT: Wiki corrected. I leave game behavior out of the Backstory, but I added links to Space Whales, where the proper behavior is (now) described.

I'll add that the in game behavior can be simulated by simply setting surrenderChance of all Arvonians to 0 or setting hasSurrendered to true on the death of any whale, depending on whether the player ship was in range to have fired the shot. (You could also check for Torgoth ships in range, but that would take longer. I'm also not sure CHASE_WHALE will make a Torgoth fire on a whale, but it seems reasonable that it would)

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.