Author Topic: [feature request] Waypoint limit bump  (Read 5806 times)

0 Members and 1 Guest are viewing this topic.

Offline 666maslo666

  • 28
  • Artificial Neural Network
[feature request] Waypoint limit bump
I am making a rather huge experimental mission, and I have already hit mission waypoint limit (32). Can it be bumped?  ;7

Alternativelly, cant all limits just be made dynamic (so you can add new objects until your PC can handle it, like for example gravity wells in Sins of a Solar Empire dont have any artificial limit)?
"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return." - Leonardo da Vinci

Arguing on the internet is like running in the Special Olympics. Even if you win you are still retarded.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [feature request] Waypoint limit bump
I support this, and there's more people who would really like to see the limit gone or made dynamic.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: [feature request] Waypoint limit bump
Alternativelly, cant all limits just be made dynamic (so you can add new objects until your PC can handle it, like for example gravity wells in Sins of a Solar Empire dont have any artificial limit)?

No.

However, dynamic waypoints would be cool.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: [feature request] Waypoint limit bump
To elaborate, we would very much like to remove all of the hardcoded limits.

Unfortunately, doing so is impossible without some major refactoring of several critical areas of the code, which is not on anyones' list of favourite things to do.

The problem, in a nutshell, is that the engine implicitly assumes that pointers to things like ship data are valid for more than a single frame, or a single run through the engine's main loop. Which is an assumption that you simply cannot make when you make stuff like the Objects[] array dynamic.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [feature request] Waypoint limit bump
Maybe it could be bumped to an enormous value then, something like 4096 waypoints.
I don't think we'd see somebody running into this one anytime soon.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: [feature request] Waypoint limit bump
And limits can't be bumped to ridiculous values because 1) the code might assume that the limit will always be below a certain threshold (the historical problem with the ship class limit); and 2) all those unused slots waste space that the computer must still keep in runtime memory.

 

Offline Sushi

  • Art Critic
  • 211
Re: [feature request] Waypoint limit bump
And limits can't be bumped to ridiculous values because 1) the code might assume that the limit will always be below a certain threshold (the historical problem with the ship class limit); and 2) all those unused slots waste space that the computer must still keep in runtime memory.

Could you go into more detail on #1? I'm wondering if we're running into something like that with the Diaspora weapon/object limit bump.

#2, IMO, isn't that big of an issue a most of the time, especially when the contained object is small. Pretty sure 4096 waypoints would be measured in kilobytes, which is basically chump change.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: [feature request] Waypoint limit bump
#1: The assumptions don't have to be explicit.  For example, 130 is the maximum number of ships that will fit into a multiplayer packet, or something like that.  Bumping to 131 requires a different-sized packet, causing a cascade of compatibility errors.  Something similar happens with the pilot file format.  I don't know the details offhand, but chasing them down is the major reason it took so long to make ship classes dynamic.

#2: It is most certainly an issue.  First, nobody in their right mind will ever need 4096 waypoints, it'll just be wasted space that's never used.  Second, you may think that bumping some limit won't matter because the data structure is so small, but the problem is that there are a lot of data structures in the game, and a lot of arrays that have limits higher than they need to be, and all those little pebbles add up.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: [feature request] Waypoint limit bump
#1: The assumptions don't have to be explicit.  For example, 130 is the maximum number of ships that will fit into a multiplayer packet, or something like that.  Bumping to 131 requires a different-sized packet, causing a cascade of compatibility errors.  Something similar happens with the pilot file format.  I don't know the details offhand, but chasing them down is the major reason it took so long to make ship classes dynamic.

I remember the issue cause I was the one who fixed it based on Kazan's advice. If you had more than 130 ships you'd run out of space in the packet because it required a certain number of bytes per ship. The solution was to split the ships up into several packets and IIRC explain in the first packet that there were more packets to come.

Multiplayer makes several assumptions of that type and the more we bump limits the more likely it is that we'll hit one of them.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: [feature request] Waypoint limit bump
Still, 32 does seem kinda low - Is that the limit for the total number of waypoints, or the total number of waypoint paths?
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline Thaeris

  • Can take his lumps
  • 211
  • Away in Limbo
Re: [feature request] Waypoint limit bump
Could waypoints actually be written as a vector, which would expand dynamically for any given ship? In such a manner, nothing would have to be hard-coded. I understand I'm not familiar with the code, but in concept, a vector should do the trick - an array is inherently fixed in how many variables it may contain.
"trolls are clearly social rejects and therefore should be isolated from society, or perhaps impaled."

-Nuke



"Look on the bright side, how many release dates have been given for Doomsday, and it still isn't out yet.

It's the Duke Nukem Forever of prophecies..."


"Jesus saves.

Everyone else takes normal damage.
"

-Flipside

"pirating software is a lesser evil than stealing but its still evil. but since i pride myself for being evil, almost anything is fair game."


"i never understood why women get the creeps so ****ing easily. i mean most serial killers act perfectly normal, until they kill you."


-Nuke

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: [feature request] Waypoint limit bump
That's what we'd do if we made waypoints dynamic.  And I don't think there would be any show-stoppers for that.

 

Offline Sushi

  • Art Critic
  • 211
Re: [feature request] Waypoint limit bump
Could waypoints actually be written as a vector, which would expand dynamically for any given ship? In such a manner, nothing would have to be hard-coded. I understand I'm not familiar with the code, but in concept, a vector should do the trick - an array is inherently fixed in how many variables it may contain.

AFAIK the only problem scenario is if you have a pointer to an element of the array, then the array gets resized (and relocated elsewhere in memory). The pointer that was being used previously is now garbage, causing strange and unpredicatable bugs.

In other words, making the waypoint array a vector is possible, but someone would need to carefully double-check all of the references to the array first to make sure that the change wouldn't cause problems.

 

Offline Echelon9

  • 210
Re: [feature request] Waypoint limit bump
AFAIK the only problem scenario is if you have a pointer to an element of the array, then the array gets resized (and relocated elsewhere in memory). The pointer that was being used previously is now garbage, causing strange and unpredicatable bugs.

In other words, making the waypoint array a vector is possible, but someone would need to carefully double-check all of the references to the array first to make sure that the change wouldn't cause problems.
This is also the reason why a number of our core data containers haven't been moved to STL types. At present, the structures often include an index within themselves into another container, so having dynamically resizing containers leads to breaks.

More work to do here with the STL containers other than simple Vector.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [feature request] Waypoint limit bump
 :nervous:

 :bump:

Is a path limit bump possible?
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Iss Mneur

  • 210
  • TODO:
Re: [feature request] Waypoint limit bump
:nervous:

 :bump:

Is a path limit bump possible?
Its the same problem.  The data-structure is an array of a arrays.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: [feature request] Waypoint limit bump
Okay, I checked the code and it looks like there are pointers which are saved from frame to frame.  Specifically, if the AI is in waypoint mode, it stores a reference to the waypoint list it's currently following.  This technique would lead to a bad pointer if the vector was resized and relocated.

It occurs to me that this might not be a problem if the waypoint list is never resized once the mission starts.  Waypoints are static, after all.  Of course, someone may decide to go and add dynamic waypoints in the future, so scratch that idea.

What if we made waypoints (as well as lists of waypoints) a linked list instead?  That way it's the links which move around in memory, not the nodes themselves.  And there usually isn't a need for random access to the middle of a waypoint list; all the AI needs to know is the start, end, and current waypoint.

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: [feature request] Waypoint limit bump
Would that mean we'd be able to move waypoints around, and have the AI work with it? Or is that what's meant by making them dynamic?
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: [feature request] Waypoint limit bump
Well, I used dynamic to refer to two different things in the post there.  The purpose of making the waypoint arrays into vectors or linked lists is to remove the hard limit of 32 or so that it has now.  When I said "dynamic waypoints" in the second paragraph, I was thinking of waypoints added during the course of the mission, although that would be tricky to implement.

Moving waypoints around is completely different from either of those.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: [feature request] Waypoint limit bump
this is one of the things that killed the fsrts mod. every time you hit the move command youd use up a waypoint, after you issued the command a number of times it just stopped working.  if waypoints can expire and expired waypoint slots can be reused for something else that would be awesome.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN