Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Thaeris on October 09, 2010, 12:44:08 am

Title: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Thaeris on October 09, 2010, 12:44:08 am
I'm believing SAFSO will have atmospheric missions eventually, and those missions will have physical ground geometry.

The player has no problem seeing (and in general, avoiding) the ground. The AI does.

Thus, I have a potential solution for the shortcomings of the AI - we introduce a sexp where, unless an override sexp is given to a ship, the ships of a given mission will stay at a minimum distance above the xz(horizontal)-plane, and if necessary, below an altitude. This would mean that if the AI were to fly below the minimum altitude, it would attempt to chage its flight vector after doing so, thus returning to the specified movement area. If the craft would need to land (just as an example), an override flag could be set when the event was ready, and the craft might then follow a path to its required destination (waypoints, for example).

In fact, if we could get a setup similar to the asteroid field bounding box, that would be great! Not only would this be extremely useful for atmospheric mods, it would also serve projects as the RTS mod (if anything is to be done with it), where bounding all directions of the mission region would be necessary. The downside to this approach is that all directions will be limited, not just two sides of a cube. Ultimately, it might just be better to have a single, large parameter declaration sexp for use in the respective mission. Thus, a certain direction may have no distance limitations, or every direction might have a limit.

In terms of operation, I precieve you'd need these elements:

(a.) A "flight vector change" algoritm - As as example, "If the ship is below the minimum altitude, it is in a region which is in the negative normal direction of a given bounding plane. If when doing this, the ship is inverted, that ship will roll so as to put its top direction at some positive component direction in relation to the bounding plane positive normal (this may be a debatable feature - space mods may not need a fighter to go upright after leaving a restricted altitude). The ship will then pull up according to some apprpriate algorithm - this may range from a simple inverse slope algorithm to, should there be a "warning altitude" region and an "absolute altitude" region ("hard deck"), an algorithm which computes the minimum pull out rate. AI profiles should determine how quickly the ship pitches up as well as how much of a percentage higher than the minimum pull-out rate the craft exits the minimum altitude region."

(b.) AI profile change/addition - a least a double value which determines how quickly the ship reacts to a negative altitude region.

I understand this is quite a bit, but I do think it would be very, very useful. Any consideration here would be appreciated. :)
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Black Wolf on October 09, 2010, 01:11:32 am
+1. Sexpinbg this is a mongrel.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: karajorma on October 09, 2010, 03:20:41 am
Why is it that everyone tries to shoehorn everything into the SEXP system. Even things that clearly don't belong there. :p
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Shivan Hunter on October 09, 2010, 05:03:16 am
because using SEXPs for that stuff is just plain SEXPy
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: The E on October 09, 2010, 05:46:01 am
No, just stupid. If anything, this should be a mission specs thing, or as said previously, defined similar to an asteroid field.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Black Wolf on October 09, 2010, 07:08:52 am
Well, however it's specifically implemented isn't as important as whether it can be implemented.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: General Battuta on October 09, 2010, 07:33:23 am
Actually...I think this should be done with existing SEXPs. The Luna mission in War in Heaven has a max altitude limit, as well as a max-distance-from-mission-center limit, and they work pretty well.

EDIT: though I may a bit too optimistic here.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Thaeris on October 09, 2010, 08:29:34 am
First off, forgive any ignorance on my part in the initial request - I've not played with FRED2 since 3.6.9; I'm merely trying to suggest a means of getting an atmospheric mission to be viable. Seeing as SEXPs are a direct means of dealing with mission parameters, I figured that would be the place to start.

Again, if we could set up a system of planes (or even multiple systems of planes) which would act as barriers, that would be ideal as it would offer maximum flexibility in terms of design to the mission creator. A bounding box might be more straightforward in terms of simplicity, but it may later have limiting factors which the mission designer could possibly have problems with.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: General Battuta on October 09, 2010, 08:51:48 am
If all you want to do is keep ships inside a given region, that can be done trivially with existing SEXPs. Behavior at the edges won't be pretty, but it can be done.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Thaeris on October 09, 2010, 09:00:51 am
I suppose that's a point, but what I'm trying to push is a non-hackish solution which can easily be set up within FRED2. Furthermore, it should be a solution that is reliable and always works.

To prevent any flaming here, if the set-up is so trivial in FRED2, can we have an example of the implementation? Though it may not be the best solution, I'd still like an example.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: General Battuta on October 09, 2010, 09:14:55 am
I suppose that's a point, but what I'm trying to push is a non-hackish solution which can easily be set up within FRED2. Furthermore, it should be a solution that is reliable and always works.

To prevent any flaming here, if the set-up is so trivial in FRED2, can we have an example of the implementation? Though it may not be the best solution, I'd still like an example.

Yeah, sure. For any ship on the list of arguments, when the ship's Y coordinate is > a certain value, give it a goal to move to the closest of a set of waypoints below the altitude ceiling. Remove the goal when it's say 100m below the Y ceiling again.

It's even easier if your mission space is spherical.

Pretty clean, not...TOO hackish, can easily be set up within FRED2. Maybe not ideal in that you would need to re-apply any critical orders. If a better altitude system can't be set up this will work.

TBP already did missions using large numbers of AI and with a large terrain object, go look at that one Raider Wars mission.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Thaeris on October 09, 2010, 09:26:16 am
Right - this is good to keep in mind.

However, I'll note that I'm certain JGZinv would like to see this feature for FringeSpace (which might have an arena area, which was seen in Tachyon), and I've got Shadow Gorrath's support for its use in his atmospheric mod.

This is a feature that would be well appreciated.

:)
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: General Battuta on October 09, 2010, 09:28:45 am
Right - this is good to keep in mind.

However, I'll note that I'm certain JGZinv would like to see this feature for FringeSpace (which might have an arena area, which was seen in Tachyon), and I've got Shadow Gorrath's support for its use in his atmospheric mod.

This is a feature that would be well appreciated.

:)

Do you read posts?

Quote from: Battuta the handsome and nigh-omnipotent
If a better altitude system can't be set up this will work.

I'd love a better system as well, but in the meantime you've got stuff to work with. Particularly in a spherical arena-style area the system used on One Perfect Moment is surprisingly functional.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Droid803 on October 10, 2010, 12:42:01 am
Except there's the fact that the AI doesn't really like following waypoint orders when being shot at...and will consequently probably crash into the ground anyway (or they'd be so "afraid" of the ground they probably won't be able to do much short of using long range weapons).

yeah it's pretty clean and easy when it's spherical...but unless you're dogfighting in a crater or something I don't see how that's a good approximation.

It works in One Perfect Moment cause there's absolutely no shooting involved.

It'd be best to set the behavior to a mission spec thing (toggleable I guess), that could be modified with an SEXP for whatever needs.

Yes, I just did it again goddammit.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: Quanto on October 10, 2010, 01:05:39 am
We really need what Thaeris suggested, the existing system simply isn't enough for what we have in mind. We have more than 1 mission that will be using this (probably 3 or more) and it would really come in handy. A sphere simply will not suffice.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: General Battuta on October 10, 2010, 08:52:26 am
Except there's the fact that the AI doesn't really like following waypoint orders when being shot at...and will consequently probably crash into the ground anyway (or they'd be so "afraid" of the ground they probably won't be able to do much short of using long range weapons).

You actually don't need to use waypoints.

Quote
yeah it's pretty clean and easy when it's spherical...but unless you're dogfighting in a crater or something I don't see how that's a good approximation.

Please read posts before replying to them. One of the suggested applications was FringeSpace arenas. Additionally you don't need to be spherical; this should work fine for a ceiling (though a lower bound is going to be a lot harder if it's too close to the deck....)

Quote
It works in One Perfect Moment cause there's absolutely no shooting involved.

Raider Wars pulled something off with shooting. Granted I think AI behavior was a bit wonky, but the mission was playable.

Anyway your criticism is off: it works in One Perfect Moment because it doesn't even apply to the AI (though it...should...)

The point here is not that a better system isn't needed, it's that you have material to work with until then if you need to move forward on your mission design.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: General Battuta on October 10, 2010, 09:25:37 am
So I've been putting together a little test mission to demonstrate an altitude ceiling. The biggest problem involved is how unreliable (totally nonfunctional?) ai-remove-goal is. In fact there seems to be some general weirdness going on in the orders system.
Title: Re: Feature/Sexp Request - Set Mission Max and Min Altitudes
Post by: General Battuta on October 10, 2010, 09:41:26 am
Okay, here's a mission with an altitude limit for the AI. It works. What needs massaging is the AI behavior after they stall out; they stall for a pretty long time in order to get some distance from the ceiling zone, but I'm not really satisfied with it. Should work with retail assets, if not I am dumb and will lick your scrotal zones.

Bear in mind this is sort of a horrible hack and would ideally be replaced with a way better feature. But it is a nice demonstration of how potent FRED can be.

[attachment deleted by admin]