RELEASED NPC Map Locations Mod 2.2.2

Shows NPC locations on map. Uses a more accurate map page for more accurate tracking!

Tags:
  1. Bouhm

    Bouhm Big Damn Hero

  2. Hieno

    Hieno Space Hobo

    Sweet, this really should help out. :)
     
    • Kaireo

      Kaireo Scruffy Nerf-Herder

      Full support
       
      • OmegaX123

        OmegaX123 Scruffy Nerf-Herder

        I put my support behind this. 'Knowing where the NPCs are' was the main reason I downloaded the 'social edit menu with locations' mod. It's too tempting to use it now that I have it though, so something like this would help greatly while also removing/reducing the temptation to cheat my social levels up.
         
        • LinJean57

          LinJean57 Scruffy Nerf-Herder

          Sounds and looks great! I'd love to have this updated to SMAPI 0.39 as well.
           
          • Folixe

            Folixe Void-Bound Voyager

            You sir, hit the jackpot. This was one of the most requested mods and you managed to get it done first, gj.

            I wouldn't worry about porting it to storm, it seems to be dying/dead due to the developer getting a job and denouncing it by porting his stuff back to smapi.

            Thanks for this awesome mod, look forward to the progress.
             
            • dem0z

              dem0z Star Wrangler

              yeah same as you , i do hope this gets stable enough so everybody can use this great mod.
               
              • Kazuga

                Kazuga Scruffy Nerf-Herder

                Awesome mod, looking forward to using it. Thanks for the work! :)
                 
                • Bouhm

                  Bouhm Big Damn Hero

                  Hey everyone, thank you so much for the support. Definitely feeling the pressure now, the good kind of pressure :)

                  So a little update on what I'm working on/struggling with:

                  - Trying to get the map markers to scale correctly when using zoom. While debugging, only activeClickableMenu.xPositionOnScreen and activeClickableMenu.xPositionOnScreen really change when the game zooms in/out, the other menu border/width/height and pixelZoom remain static. If anyone knows how to get zoom changes from the API, that'd be really helpful.

                  - Accurate real-time tracking. I improved this a bit by partitioning the map into the various locations. This is really tricky since the in-game map is just terrible. It's solely for letting players know where things generally are, there's no good sense of scale relative to the actual game map. I'm considering redrawing a better, accurate map, but that's also a bit tricky. So currently my solution is to create partitions within the partitioned locations to track the NPCs. You may notice the NPCs suddenly jump locations when entering a different section, though. Here's image of what I'm talking about:

                  map.png

                  I'll try to get an update out later today with at least one of these things done. Debugging/Testing takes a long time, though.

                  Started streaming my progress twitch.tv/bbouhm to stay focused.
                   
                    Last edited: Mar 28, 2016
                  • Kaireo

                    Kaireo Scruffy Nerf-Herder

                    Looking forward to the new update :DD
                     
                    • Bouhm

                      Bouhm Big Damn Hero

                      So I've finally made an update that now makes the real-time tracking of NPCs actually accurate. This took way longer than expected, and I'll explain why. I'll update the main post for the file.



                      The map page has a lot of problems in portraying the actual game map. It's straight-up misleading; here are some of the problems I've highlighted:

                      1.png 2.png 3.png 4.png 5.png

                      This is why occasionally you will see NPCs in the water. For example, when Leah goes to the Beach from the town, she will walk through the water on the map instead of the bridge. In the actual game, the bride is right below the intersecting paths, so the real-time tracking is accurate. However, in the map, the bride is for whatever reason off to the right.


                      And my solution was to partition the maps into different parts within each location to appropriately scale the locations to the map page to the locations in the game. Here's a look into what I did:

                      mapPartitions.png EXCEL.png

                      Each red rectangle represents a partition, and each partition has different scaling. The scaling coefficients were all calculated on the excel spreadsheet in a tedious process of actually figuring out the tile widths and heights of the partitions, and the pixel widths and heights of the map. If a partition has a scale X of 3 and scale Y of 2, it means that in that partition, every tile the NPC moves horizontally represents 3 pixels of horizontal movement on the map and every tile the NPC moves vertically represents 2 pixels of vertical movement on the map. This is why when the NPCs go from one partition to the other, you may notice their movements getting faster, or slower, or even jumping a few pixels. This is inevitable with how bad the map page is.

                      I haven't been able to test all locations/schedules so please let me know if you notice something wonky!

                      Now to make this mod even better without making the real-time tracking funky, there's really only one thing left to do which is to redraw or alter the map page so that it's actually accurate to the game map. I'll be addressing issues in inconsistency like the 5 I showed up there.


                      So the next thing I'll work on is supporting zooming out, all resoutions, and creating a map page that is actually accurate and complements this mod. If anyone has any clue on scaling things with game resolution, it'd help me out a lot :)

                      ----

                      Zoom support now added! Special thanks to jlee100 for his public discovery on using Game1.options.zoomLevel. Working on resolutions next.
                       
                        Last edited: Mar 26, 2016
                        dega0819, dem0z, Kaireo and 2 others like this.
                      • toonyoza

                        toonyoza Subatomic Cosmonaut

                        that great mod ever ! now map look like my fav game (Rune factory) thank you very much !!
                         
                        • SuccuIncu

                          SuccuIncu Scruffy Nerf-Herder

                          Yasss...
                          keep it up!! This is really useful mod....
                          thank you for making this...
                           
                          • Honeybee

                            Honeybee Scruffy Nerf-Herder

                            Thank you so very much. This was a much needed mod.
                             
                            • SuccuIncu

                              SuccuIncu Scruffy Nerf-Herder

                              hey.. sorry to bother you..
                              but it got crashed when I tried to open it..
                              it worked just fine..
                              but when I reach the first day spring second year..
                              it crashed my game..
                              and this is the error I got..
                              21:00:55] An exception occured in XNA DrawTick: System.NullReferenceException: Object reference not set to an instance of an object.
                              at NPCMapLocations.NPCMapModMain.drawMarkers(GameMenu menu) in C:\Users\Brian\Documents\Projects\SVMods\NPCMapLocationsMod\SMAPI\MapMod\Class1.cs:line 235
                              at NPCMapLocations.NPCMapModMain.updateMap(Object sender, EventArgs e) in C:\Users\Brian\Documents\Projects\SVMods\NPCMapLocationsMod\SMAPI\MapMod\Class1.cs:line 105
                              at System.EventHandler.Invoke(Object sender, EventArgs e)
                              at StardewModdingAPI.Events.GraphicsEvents.InvokeDrawTick()
                              [21:00:55] An error occured in the base draw loop: System.InvalidOperationException: Begin cannot be called again until End has been successfully called.
                              at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
                              at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState)
                              at StardewValley.Game1.Draw(GameTime gameTime) in C:\Users\Barone_\Documents\Visual Studio 2010\Projects\Farmer\Farmer\Farmer\Game1.cs:line 9299
                              at StardewModdingAPI.Inheritance.SGame.Draw(GameTime gameTime)
                               
                              • Bouhm

                                Bouhm Big Damn Hero

                                Thanks for letting me know! I can't test everything so things like this is really helpful. You're not bothering me at all, if anything, please do keep reporting errors.

                                The bug was caused by Kent returning to the town in Year 2 and should be fixed now. The extra detail you added about when the error occurred really helped me track it down.


                                Along with the bug fix, the code has been optimized and I added support for all resolutions yesterday but didn't make a post about it.

                                I'm not entirely sure if resolutions beyond 1366 x 768 work, so if you have monitors capable of running high resolutions, please test and report back any issues.

                                Anyway, happy to be getting closer and closer to a stable release. I'm now just trying get the hover text for location descriptions to overlap the NPC markers. It seems the only way to do this is to redraw the hover textboxes with the descriptions, but I'm having a hard time finding the location descriptions from the API.
                                 
                                  Last edited: Mar 28, 2016
                                • curi0

                                  curi0 Scruffy Nerf-Herder

                                  Hi there, I tried this mod but it keeps freezing my computer when I try to access the map, with the following error:
                                  Code:
                                  An exception occured in XNA DrawTick: System.NullReferenceException: Object reference not set to an instance of an object.
                                    at NPCMapLocations.NPCMapModMain.drawMarkers(GameMenu menu) in C:\Users\Brian\Documents\Projects\SVMods\NPCMapLocationsMod\SMAPI\MapMod\Class1.cs:line 329
                                    at NPCMapLocations.NPCMapModMain.updateMap(Object sender, EventArgs e) in C:\Users\Brian\Documents\Projects\SVMods\NPCMapLocationsMod\SMAPI\MapMod\Class1.cs:line 199
                                    at System.EventHandler.Invoke(Object sender, EventArgs e)
                                    at StardewModdingAPI.Events.GraphicsEvents.InvokeDrawTick()
                                  [02:24:19] An error occured in the base draw loop: System.InvalidOperationException: Begin cannot be called again until End has been successfully called.
                                    at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
                                    at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState)
                                    at StardewValley.Game1.Draw(GameTime gameTime) in C:\Users\Barone_\Documents\Visual Studio 2010\Projects\Farmer\Farmer\Farmer\Game1.cs:line 9299
                                    at StardewModdingAPI.Inheritance.SGame.Draw(GameTime gameTime)
                                  I test this with SV v1.06 + SMAPI v0.39.2 and no other mods at 2048x1152 resolution.
                                   
                                  • Bouhm

                                    Bouhm Big Damn Hero

                                    Did you put NPCMarkers in the correct place? {Directory containing StardewValley.exe}\Content\Characters\

                                    Also, try installing the file from github again, I had to temporarily rollback to do some quick fixes and you might have the version before I pushed the changes
                                     
                                    • vroomsegway

                                      vroomsegway Void-Bound Voyager

                                      nortons blocking it ._. weird? Nod ESET doesnt.
                                       
                                      • curi0

                                        curi0 Scruffy Nerf-Herder

                                        I'm not sure.. using the currently available version on Github, I tried these:

                                        1. Unpacked NPCMarkers.zip into {Directory containing StardewValley.exe}\Content\Characters\NPCMarkers\

                                        2. Unpacked NPCMarkers.zip into {Directory containing StardewValley.exe}\Content\Characters\

                                        3. Put NPCMarkers.zip inside {Directory containing StardewValley.exe}\Content\Characters\NPCMarkers\

                                        4. Put NPCMarkers.zip inside {Directory containing StardewValley.exe}\Content\Characters\

                                        Which one is correct? coz all produce the same errors:
                                        Code:
                                        An exception occured in XNA UpdateTick: System.NullReferenceException: Object reference not set to an instance of an object.
                                          at NPCMapLocations.NPCMapModMain.getMarkers(Object sender, EventArgs e) in C:\Users\Brian\Documents\Projects\SVMods\NPCMapLocationsMod\SMAPI\MapMod\Class1.cs:line 189
                                          at System.EventHandler.Invoke(Object sender, EventArgs e)
                                          at StardewModdingAPI.Events.GameEvents.InvokeUpdateTick()
                                        
                                         

                                        Share This Page