Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Mobius on April 28, 2009, 12:36:35 pm

Title: Maximum number of waypoints...?
Post by: Mobius on April 28, 2009, 12:36:35 pm
I heard somewhere that there's a max number of waypoints (maybe it was waypoint paths) FSO can handle in a mission. I tried with the Wiki, but there aren't any references in this (http://www.hard-light.net/wiki/index.php/Engine_Limitations) Wiki article.

Is the maximum number of waypoints and/or waypoint paths unlimited? If so, it seems a bit strange giving the limits both Retail FS2 and FSO have.
Title: Re: Maximum number of waypoints...?
Post by: karajorma on April 28, 2009, 01:33:48 pm
#define MAX_WAYPOINTS_PER_LIST 20
#define MAX_WAYPOINT_LISTS 32
Title: Re: Maximum number of waypoints...?
Post by: chief1983 on April 28, 2009, 04:11:47 pm
It's in the wiki now.
Title: Re: Maximum number of waypoints...?
Post by: Mobius on April 29, 2009, 10:25:10 am
Another question - what kind of oddities are known to occur if someone goes well beyond the limit? Does the mission crash upon clicking on "Commit"?
Title: Re: Maximum number of waypoints...?
Post by: Echelon9 on April 29, 2009, 10:52:05 am
Another question - what kind of oddities are known to occur if someone goes well beyond the limit? Does the mission crash upon clicking on "Commit"?
As these are used to define fixed sized arrays in a number of oft used structs, I believe that if you manually added too many waypoints manually to the mission using Notepad then trying to play the mission could cause all kinds of bad out-of-array memory corruption. Probably.

Code: [Select]
typedef struct waypoint_list {
char name[NAME_LENGTH];
int count;
char flags[MAX_WAYPOINTS_PER_LIST];
vec3d waypoints[MAX_WAYPOINTS_PER_LIST];
} waypoint_list;

But that's just from looking at the code and using the well known mark 1 human brain compiler. Give it a test.

Title: Re: Maximum number of waypoints...?
Post by: chief1983 on April 29, 2009, 11:04:12 am
...I believe that if you manually added too many waypoints manually to the mission...

The Department of Redundancy Department issues you a fine.
Title: Re: Maximum number of waypoints...?
Post by: Mobius on April 29, 2009, 11:19:50 am
I'm asking because I have a mission featuring a great many waypoints and waypoints paths crashing upon clicking on Commit. FRED2 Open let me place the waypoints, I did not need Notepad to hack the mission, but still... :nervous:

Also, I edited the Wiki article to replace "list" and "lists" with "path" and "paths", respectively. I thought it was more appropriate. :)
Title: Re: Maximum number of waypoints...?
Post by: karajorma on April 29, 2009, 12:55:22 pm
FRED also allowed you to place far too many ships in a mission as well (and maybe still does if you're insane enough to add 401 ships to a mission).

FRED frequently uses a different array to hold data in from the one that is used in-game so hitting the limit in one doesn't always mean you'll hit it in the other.
Title: Re: Maximum number of waypoints...?
Post by: Mobius on April 29, 2009, 01:01:24 pm
FRED frequently uses a different array to hold data in from the one that is used in-game so hitting the limit in one doesn't always mean you'll hit it in the other.

What do you mean?
Title: Re: Maximum number of waypoints...?
Post by: Angelus on April 29, 2009, 01:05:22 pm
FRED frequently uses a different array to hold data in from the one that is used in-game so hitting the limit in one doesn't always mean you'll hit it in the other.

What do you mean?

If i understand that correctly, it means FRED allows you to exceed the limit of waypoints and probably ships.
The game engine doesn't.


It seems i have to cheat to make my mission work.
Title: Re: Maximum number of waypoints...?
Post by: Mobius on April 29, 2009, 01:06:55 pm
Oh right, I didn't get what "other" stands for in that post. :)