Trying to understand how NPC spawning works?
-
Absolutely incredible work adoxa, thankyou for this! I’ve added the SpacePop offset to the Limit Breaking page. Presumably the formula is similar for [c]relief_time[/c] only that it occurs during encounters rather than between them?
-
-
[c]density[/c] is a soft cap. If there’s space for still 1 more ship to spawn, the game still may throw an entire encounter into the zone.
[c]density_restriction[/c] on the other hand is a hard limit on an npc’s ship-class from the encounter files.Also it should be noted the game does behave differently if you spawn into a zone via connecting/loading/docking/jumping, and when you fly into one.
@adoxa I noticed especially there that the game can spawn encounters with 18 ships max. With a little weird thing here. Spawning into a zone of those encounters spawns them fine. When flying in the zone, the server dies. But when I have the encounter with 17 ships, the server survives it.
-
The 18 ship crash thing is good to know, thanks Skotty.
Adoxa, thank you again for putting the pin on this; I can say now after a week this seems a totally solved issue. Your formula and understanding is bang on target in every way I can confirm, and your offset for the spawning interval heartbeat has worked perfectly.
This has completely changed our mod overnight a thousand times for the better, and we now have perfect control over what spawns when and tons of room for nuance in the future. Thank you so much! It’s the difference between night and day, and I’m super grateful to you for helping us get there.
Just going to pop in the right google search words in case someone’s trying to search engine find this in the future - this is how Freelancer NPC spawning works!
-
from this post by fox in my todo list:
foxUnit01 wrote:
content.dll, C4C01, 500f, min distance from player position at spawn moment that an NPC patrol with arrival = cruise will fly to when spawned ~Gold_Sear, M0tah content.dll, C4C06, 2000f, max distance from player position at spawn moment that an NPC patrol with arrival = cruise will fly to when spawned ~Gold_Sear, M0tah
This poses a problem when spawn range is big. Instead, it should be from the spawn position, not player position.
Increasing these does help large spawn ranges, but it is annoying. It’d be nice if this behavior could be eliminated altogether. As it stands, even with higher ranges, there’s a good chance high-range NPCs will end up cruising behind you, since this point is picked at spawn time and could be picked to the side of (or behind) your position at the time.
While trying to fix this problem, I found that NPCs won’t spawn if the max spawn distance
content.dll, 11BC68, 2500d, NPC max spawn distance in SP and MP ~Dev
is below 2500. The following patch fixes this:
content.dll, C1771, 7A --> EB = allow NPC max spawn distance below 2500 ~Gold_Sear
@Ruppetthemuppet: I currently cannot display the 101 list, is this correct?
-
@Ruppetthemuppet: I currently cannot display the 101 list, is this correct?
My bad! I broke the list up into pages by category a few days ago, and in doing so broke the existing link. Here’s the new one:
https://wiki.the-starport.net/FL Binaries/limit-breaking/
Unfortunately the wiki search module isn’t as good as I’d hoped, so I may end up recombining it or at least consider new/clearer categories for the offsets here.