SotAMapper - shows items of interest and tracks player location on map

Discussion in 'Player Created Resources' started by coder1024, Sep 3, 2016.

Thread Status:
Not open for further replies.
  1. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    LATEST UPDATE
    • 2016.09.21 - Updated to v1.7

    OVERVIEW

    SotAMapper is a tool for SotA which uses a list of "items of interest" in a .csv file and renders them graphically along with the current player position (which is obtained from the SotA log files).

    It is necessary to manually use the /loc command in game once each time the player enters a map for which there is a map data .csv file to sync.

    Initially the set of map data files is pretty limited. The intent is that over time people will create maps and contribute them (send them to coder1024@gmail.com) and they will be included in a future release. So to see this in action without creating any additional data, you'll need to go into a map for which there is a map data file and type /loc while running the app.

    The idea also is that it provides an easy way for you to record locations while playing on a map and see them graphically.

    [​IMG]
    Code:
    Project Creator, Programmer
    
        coder1024 (coder1024@gmail.com)
    
    Data Files (Maps, Icons, etc.)
    
        LiquidSky
        lollie
        moko
    
    Testing Feedback, Suggestions, Bug Reports
    
        Berek
        Bom
        Bushmaster
        cartodude
        Frostll
        Kabalyero
        Link_of_Hyrule
        LiquidSky
        lollie
        moko
        Umuri
        Womby
    
    Code:
    - one user reported running for a long time and eventually having SotAMapper
      appear to be "stuck" on a single map, but could not later reproduce this,
      and so this may or may not be an issue still out there -- UPDATE: It has also
      been reported that after running for awhile, SotA stops updating its log files
      which may explain this issue
    
    Code:
    - ability to create a new map file using the name reported by SotA, saving the
      need to manually create it with a matching filename
    - add a background image which could represent the local area better than
      just the black background
    - zoom function
    - pre-canned Add functionality to save the need to type out common names for
      resource types, etc.
    - edit item, change name, remove item for accidentally added items or typos
    - add separate field in map .csv file for symbol, allowing independently setting
      the name and symbol to allow re-using a single symbol for multiple differently
      named items, for example towns
    - support map files with the full name, area and map as reported by /loc, as
      currently all POTs have the same map name but different area names and this
      would allow having different maps (for player run quests for example) for
      different POTs built on the same template
    - allow specifying text color for map items, and/or allow defining named colors
      in which case the name could be used instead of the color value
         Well, 242.239, 89.40163, -198.2776,0x0000FF
         or...
         Color,POI,0x0000FF
         Well, 242.239, 89.40163, -198.2776,POI
    - layer support so you could toggle on/off items of a certain color/category
    
    Code:
    2016.09.21, v1.7
    - relaxed map .csv parsing to account for Excel saving with extra empty fields
    
    2016.09.20, v1.6
    - added two additional coordinate systems, both rotated an additional 90 degs
      from the previous, now all 4 possible cases are covered
    
    2016.09.19, v1.5
    - added support for specifying one of two coordinate systems in a map file to
      address the issue of maps being incorrectly rotated
    
    2016.09.19, v1.4
    - data updates
    - when using the Add button to add a new map item, the min/max extents of the
      data are re-computed so the rendering doesn't get wonky as you add items when
      building a new map
    - empty map file is now tolerated and handled correctly, this allows running
      the app with an empty map file and adding all items using the Add button and
      now (for real this time!) never having to manually enter any coordinates
    - fixed a bug with date/time parsing from log file entries which prevented
      it from working on a machine whose date/time locale was not compatible
      by default with the format used in the SotA log file
    
    2016.09.11, v1.3
    - added TopMost checkbox, checking it will attempt to keep the window on top
      of other windows
    - added settings.ini file which is created when run (if it doesn't exist) and
      which will persist settings (like TopMost) between runs.  The settings.ini
      file is stored in "%APPDATA%\SotAMapper".  there is NO NEED to hand edit
      this file, there is only 1 setting so far (the TopMost setting) and its
      set from the UI.
    - fixed string formatting bug with MapCoord and spaced out values
      for readability
    - there is now an Add button which allows adding a map item at the current
      player location to the current map file.  no more need to type in coordinate
      values!
    - when loading map .csv files, ignore lines with empty item names
    
    2016.09.08, v1.2
    - added status bar which shows name of map item on mouse over for items which
      render as images (due to the presence of a .PNG with matching name in the
      data/icons folder)
    - added link to forum discussion thread in status bar
    - data updates (maps, icons), added map for Highvale
    - fixed upper/lower case bug when case of map file didn't match what was
      reported by SotA
    - fixed crash when map data .csv file was empty (no items)
    - added descriptive error messages which render in red when the "NO DATA"
      condition occurs to help in identifying why a map is not showing
    
    2016.09.04, v1.1
    - player position updates automatically on map while in a map for which there is
      a map data .csv file
    - when first entering a map, it is necessary to do 1 manual /loc to sync
    
    2016.09.03, v1.0
    - initial release
    

    SYSTEM REQUIREMENTS


    MAP DATA FILES

    A separate .csv file is needed for each SotA map and should be in the "data/maps" directory having a name matching the SotA map name as reported in the /loc command.

    The map data .csv file must be plain text format, make sure you're text editor isn't saving it as RTF or some other format.

    For example, suppose the /loc command printed out the below. In this case, there should be a file "data/maps/Novia_R1_City_Soltown.csv" which contains a list of items for that map.
    Code:
       Area: Soltown (Novia_R1_City_Soltown) Loc: (-15.7, 28.0, 23,2)
    
    The map .csv file contains name and position for each item to be shown on the map. As you discover items on a map, you can add them to the .csv file and they will be shown on the map (although you need to exit and restart the application to show changes to the .csv file). Here are some examples of items in a map .csv file. An example file is provided also as a starting point.
    Code:
       Name,X,Y,Z
       Cotton,-93.2,19.1,21.8
       Bear Cave,-88,18.8,-88.9
       Mandrake,-53.8,18.5,3.5
    
    Note that this tool only uses the X and Z values, but all (X, Y, and Z) are expected in the file. This is done to avoid confusion between going from what is shown in game and what goes in the file. The middle value (Y) represents the elevation which, of course, is not used for a 2D map. Having it here for completeness may help if this data were to be used in other tools also.

    When building a map .csv file, the /loctrack command can be helpful. This causes the location to be continually shown on screen.

    You can also click the Add button in SotAMapper to add an item to the map at the current player location. With this feature, there's no need to type in coordinate values!

    If you have Excel installed, you can double-click on the .csv files and edit them in that, just make sure to save them out as .csv if prompted.

    MAP COORD SYS

    Different maps in SotA have different coordinate systems. If things don't appear at the correct orientation in SotAMapper its possible the wrong coord sys is being used. To figure this out, turn on /loctrack and see which of the below applies. The letters on the below indicate positive direction. So you can walk north while watching the loc values and then do the same thing walking east and figure out which one it is. Here are the possible choices.

    Code:
            //
            //       X
            //       |
            //       |
            //  Z----*
            //
            XZ_NorthWest,
    
            //
            //  Z
            //  |
            //  |
            //  *----X
            //
            ZX_NorthEast,
    
            //
            //  *----Z
            //  |
            //  |
            //  X
            //
            ZX_EastSouth,
    
            //
            //  X----*
            //       |
            //       |
            //       Z
            //
            ZX_SouthWest
    
    Once you figure out which one is in use, add a line like the below somewhere in
    the map .csv file. That will specify which coord sys to use for that map. The
    default, if not specified, is XZ_NorthWest.

    Code:
    MapCoordSys,ZX_NorthEast
    
    MAP ICONS

    By default, map items are rendered as text labels with dots at the map location. If a .PNG file is present in the "data/icons" directory which matches the name of the item in the map data .csv file, then the image will be shown instead.
     
    Last edited: Sep 22, 2016
  2. Umuri

    Umuri Avatar

    Messages:
    527
    Likes Received:
    1,828
    Trophy Points:
    63
    Awesome! You actually beat me to it, I was aiming for implementing a map + stored point reference list implementation for the HUD 0.3.0. :) So probably will be next month.
    Using /loc to populate the player location is good, but really you should only need it once, as the player location is dumped to another file in the game directory every 2 seconds.
     
  3. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    Just to be clear, so far I have only created 1 map file which is for the East Perennial Trail adventure zone near Soltown.

    So the tool will only "work" for that map. You'll need to create other map files for other areas. If you do so and would like to send them to me for inclusion in an update, you can Email them to coder1024@gmail.com
     
    Time Lord, FrostII and Black Tortoise like this.
  4. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    ah, I didn't realize that. If you know where that gets written please let me know, otherwise I'll dig around and see if I can find it. I'll update the tool to use that instead, I didn't realize that was available.
     
    Time Lord and FrostII like this.
  5. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    @Umuri I see there's CurrentPlayerData.txt in the game install folder which appears to have the player position. It doesn't show the current map name though, but I guess I could use that for updates and then still rely on a manual /loc to get the map name when you switch maps, etc. I'll add that to the next version, thanks for the tip :)
     
    Time Lord and FrostII like this.
  6. Umuri

    Umuri Avatar

    Messages:
    527
    Likes Received:
    1,828
    Trophy Points:
    63
    No problem. :) You can also use the "Entering" message from the chatlog to have it know where you're going on the fly.
    The only cave-at to these methods:
    #1. CurrentPlayerdata.txt only works if one copy of the game client is open. If you have multiples, they both fight over it.
    #2. Using Entering from the chatlog only works for every scenechange after the first login. First scene load (login) doesn't say what scene it is.

    Still a great tool and great idea. In the interest of cross-compatibility, I may use a similar or same file format so tools can use the same map files in both of our apps. But again mine's at least a full version out (just now finishing up 0.2.0)
     
  7. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    @Umuri interesting, thanks for the additional info. Cross compatibility sounds like a good idea. If you end up wanting the format to be a little different as you're working on it, let me know and we can coordinate so they match. I chose .csv because its a simple text format and you can double-click it and edit it in Excel easily. The file contains X, Y, and Z which is more than needed, but it makes it a direct match to what the user sees in the /loc info so I thought it best. Plus who knows if some other tool may end up using elevation info someday and could then pull it from existing files.
     
    Time Lord and FrostII like this.
  8. Bushmaster

    Bushmaster Avatar

    Messages:
    525
    Likes Received:
    911
    Trophy Points:
    63
    Location:
    Colorado
    This is great! I was thinking about doing something like the old UO automap. I will give it a try this afternoon.
     
    Time Lord, coder1024 and FrostII like this.
  9. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    Just updated to v1.1. Player position now tracks automatically while in a map for which a map data .csv file exists. It is necessary to do /loc once each time on entering a scene to sync. - thanks to @Umuri for pointing out the current player data file which makes this possible!
     
    Time Lord and FrostII like this.
  10. Bom

    Bom Avatar

    Messages:
    308
    Likes Received:
    622
    Trophy Points:
    43
    How do you create the maps to begin with? Do you have to do that part by manually typing up a csv file?
     
    Time Lord, coder1024 and FrostII like this.
  11. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    Yes, you create map data .csv files in the "data/maps" directory inside the install directory (extracted from the downloaded .zip). You can see the OP for an example of how the info should be formatted, you can also look at the example map which is provided. When creating the map file, the name of the file should match the map name reported by SotA as described in the OP.

    The idea is a tool which lets you record items of interest on adventure maps as you encounter them and which then renders them graphically for you along with your position. As the tool is brand new, it only has 1 example map provided so far. Over time, hopefully people will create and submit maps which can be included in future releases :)
     
    Time Lord, FrostII and Bom like this.
  12. moko

    moko Avatar

    Messages:
    428
    Likes Received:
    1,205
    Trophy Points:
    43
    Location:
    Bear Tavern
    I'm unable to create a .csv via /loc - what am I doing wrong? If I just empty the map that comes with the mapper and rename it it crashes. How can I make a valid .csv?

    EDIT: solved it, had to add one point of interest manually
     
    Last edited: Sep 6, 2016
  13. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    ah... good catch. I'll debug that and see what's going on when there are zero items in the file. Even once you add one or two the rendering will still look a bit funky since it scales to available data. once you get more data in there it should improve :)

    EDIT: Found and fixed that crash, it'll be in the next version. Thanks for reporting it!
     
    Last edited: Sep 6, 2016
    Time Lord, FrostII, Bom and 1 other person like this.
  14. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    Just released v1.2!!! See below or the included readme for a summary of the changes.
    • added status bar which shows name of map item on mouse over for items which render as images (due to the presence of a .PNG with matching name in the data/icons folder)
    • added link to forum discussion thread in status bar
    • data updates (maps, icons), added map for Highvale
    • fixed upper/lower case bug when case of map file didn't match what was reported by SotA
    • fixed crash when map data .csv file was empty (no items)
    • added descriptive error messages which render in red when the "NO DATA" condition occurs to help in identifying why a map is not showing
     
  15. coder1024

    coder1024 Avatar

    Messages:
    499
    Likes Received:
    531
    Trophy Points:
    75
    Gender:
    Male
    Just released v1.3!!! See below or the included readme for a summary of the changes.
    • added TopMost checkbox, checking it will attempt to keep the window on top of other windows
    • added settings.ini file which is created when run (if it doesn't exist) and which will persist settings (like TopMost) between runs. The settings.ini file is stored in "%APPDATA%\SotAMapper". there is NO NEED to hand edit this file, there is only 1 setting so far (the TopMost setting) and its set from the UI.
    • fixed string formatting bug with MapCoord and spaced out values for readability
    • there is now an Add button which allows adding a map item at the current player location to the current map file. no more need to type in coordinate values!
    • when loading map .csv files, ignore lines with empty item names
     
    Time Lord, Bom, FrostII and 2 others like this.
  16. FrostII

    FrostII Bug Hunter

    Messages:
    5,890
    Likes Received:
    11,039
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Pacific Northwest
    Is there any way that we could add locations that are not created by the client, ie exits, etc... ?
    Or is that ability already there and I overlooked it...
     
    Time Lord and coder1024 like this.
  17. FrostII

    FrostII Bug Hunter

    Messages:
    5,890
    Likes Received:
    11,039
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Pacific Northwest
    A "map item" ?
    Is that an item that we can create or does it depend on "items" that the game defines as worthy of having a spot on our compass ?
     
    Time Lord and coder1024 like this.
  18. Umuri

    Umuri Avatar

    Messages:
    527
    Likes Received:
    1,828
    Trophy Points:
    63
    Looks like all you'd have to do is find a spot in-game, type /loc to get the coordinates, then add it to the map file with the description you wanted at thoose coordinates. For example a miner might make a map of node locations, a woodsman might node trees.
     
  19. FrostII

    FrostII Bug Hunter

    Messages:
    5,890
    Likes Received:
    11,039
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Pacific Northwest
    Roger.... Gonna give this a try for sure...
    Looks promising... ;)
     
    Time Lord and coder1024 like this.
  20. lollie

    lollie Avatar

    Messages:
    493
    Likes Received:
    1,552
    Trophy Points:
    55
    Gender:
    Female
    Location:
    Brittany
    Awesome work, thanks for making this it's exactly what we need :)
     
    Time Lord, coder1024 and FrostII like this.
Thread Status:
Not open for further replies.