please make a mod like this for SVE and other mods like that so you can toggle the versions of the game you are using, or additions you have like down town zuzu .... I don't know if that changes any pathing but it might.....
Path Display This mod failed in the Player.Warped event. Technical details: System.NullReferenceException: Object reference not set to an instance of an object. at PathDisplay.Components.DrawTiles.renderTiles(GameLocation l, List`1 whichchar) in C:\Users\AFRAZ\source\repos\PathDisplay\PathDisplay\Components\DrawTiles.cs:line 32 at PathDisplay.ModEntry.playerWarped(Object sender, WarpedEventArgs e) in C:\Users\AFRAZ\source\repos\PathDisplay\PathDisplay\ModEntry.cs:line 82 at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args, Func`2 match) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\Events\ManagedEvent.cs:line 125
Eventually this constant spam results in the game freezing and generating a tonne of lack of memory errors.
I tried parsing the schedules at runtime, but found it takes far too long to do so. At runtime, the schedules are generated one day at a time with a list of points generated at the end of the pathing work. Basically, generate this mod at run time, as far as I can think of, you have to go through each NPCs schedule for all 112 days, have them generated, and add the paths to the array. And then you have to consider the paths change whether its raining or snowing, meaning that's 224 days of parsing per NPC.
I did this to create the array files, and it generated around 15K files (one per day) and took about 15 minutes. I then used some python scripting to deal with overlapping points and generally compress the data as much as possible into the json files to minimize the amount of work the files need.
With that said, if there's a lot of hoopla about custom NPCs, I might be able to add compatibility for certain mods. Or include my generation script as a utility mod and allow the arrays for custom NPCs to be added. You know, something like that.
Hi! <3 Uh, fangirl moment I'm a big fan of all your modding work!
That aside, I described the method of getting the schedules at runtime that I thought of in my other reply and how it takes way too long to do it. But, I'd love to hear your thoughts as a more experienced modder of any way to do it at runtime quickly enough to be viable. That is, if you don't mind me asking.
I would like to request additions for Stardew Valley Expanded and Ridgeside Village. I'm running other custom NPC mods too, but those are large expansion style mods with a lot of NPCs, and have NPCs that do a lot more walking all around town. Other custom NPCs outside of those 2 mods are far easier to track and less likely to run into your chests, destroying them.
I can probably make that happen without much trouble. :3 I'll update soon with the new path data for those mod's NPCs and logic to only add them if those mods are included.
(Sorry for the slow response! I guess there's no Nexus notification if I didn't post the original comment.)
Each NPC has a few schedules that get reused, and we can ignore GOTO schedules (since they just redirect to a different schedule). For example, Abigail has 16 non-GOTO schedules total. So you might be able to optimize a lot by only checking those specific schedules, instead of doing it twice for each day in the year.
But otherwise I think it'd be fine to just add a note on the mod page that it's precalculated, and not generated live.
This is exactly what I wanted to be able to start decorating around the valley! I would love to see the island be included in this but its not super necessary. It'd help to decorate with some of the island furniture outside in the [dock area] and also to know where [new npc] will be so they don't break the chest i keep trying to place... (apparently I keep placing it right in their path lol)
I did notice when I first ran it, Smapi was caught in an error loop until i enabled all paths. It seems if it starts activated you can then turn it off and not get error messages when transitioning between maps? I'm not sure it it was that or maybe the config had just needed to generate.
Oh! figured out the error message was while entering farm buildings! Mine was basically the same Path Display error CristianZ has/had. There does seem to be inconsistency with indoor pathing? At least it seems the Museum/Library has the info but other 'public' spaces like the community center or saloon don't.
26 comments
https://smapi.io/log/b74a07036b0e4c1984a69538bbfc75b2
Basically this is the error that pops up:
Path Display This mod failed in the Player.Warped event. Technical details: System.NullReferenceException: Object reference not set to an instance of an object.
at PathDisplay.Components.DrawTiles.renderTiles(GameLocation l, List`1 whichchar) in C:\Users\AFRAZ\source\repos\PathDisplay\PathDisplay\Components\DrawTiles.cs:line 32
at PathDisplay.ModEntry.playerWarped(Object sender, WarpedEventArgs e) in C:\Users\AFRAZ\source\repos\PathDisplay\PathDisplay\ModEntry.cs:line 82
at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args, Func`2 match) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\Events\ManagedEvent.cs:line 125
Eventually this constant spam results in the game freezing and generating a tonne of lack of memory errors.
EDIT: Seems like it just reads from an array of included coordinate points, and doesn't generate the coordinates based on parsing schedules in game?
I did this to create the array files, and it generated around 15K files (one per day) and took about 15 minutes. I then used some python scripting to deal with overlapping points and generally compress the data as much as possible into the json files to minimize the amount of work the files need.
With that said, if there's a lot of hoopla about custom NPCs, I might be able to add compatibility for certain mods. Or include my generation script as a utility mod and allow the arrays for custom NPCs to be added. You know, something like that.
That aside, I described the method of getting the schedules at runtime that I thought of in my other reply and how it takes way too long to do it. But, I'd love to hear your thoughts as a more experienced modder of any way to do it at runtime quickly enough to be viable. That is, if you don't mind me asking.
Each NPC has a few schedules that get reused, and we can ignore GOTO schedules (since they just redirect to a different schedule). For example, Abigail has 16 non-GOTO schedules total. So you might be able to optimize a lot by only checking those specific schedules, instead of doing it twice for each day in the year.
But otherwise I think it'd be fine to just add a note on the mod page that it's precalculated, and not generated live.
I did notice when I first ran it, Smapi was caught in an error loop until i enabled all paths. It seems if it starts activated you can then turn it off and not get error messages when transitioning between maps? I'm not sure it it was that or maybe the config had just needed to generate.
There does seem to be inconsistency with indoor pathing? At least it seems the Museum/Library has the info but other 'public' spaces like the community center or saloon don't.
Here my log: https://smapi.io/log/ee9a875da1484e24af51877207911014