Tuesday 26 January 2016

Lunar new year!

We have another seasonal event on us, with some minor stuff that can be collected.
This build contains the locations of the firecrackers for the lunar new year.
Grab it here.

Friday 22 January 2016

Polish

This build contains some polishing of the code and a few updates to the markers supplied by default.
Also a much requested feature, an update checker has been added.

Grab the new build here.

Change Notes
  • Removed dependencies to d3dcompiler_xx.dlls - this should increase compatibility
  • The "screen edge herds icons" feature now correctly keeps the sizes of icons. This means the markers will have perspective correct size up-close for a better sense of how far they are.
  • Reduced per-frame CPU and memory overhead of the tactical display significantly
  • the 'heightOffset' parameter for markers and categories is now functional. The default value is 1.5, a value of 0 will put the icon center on the ground (if you were standing on the ground when you placed the marker)
  • GW2 TacO will now check for any available updates. I don't intend to support auto updating as that's problematic (mainly due to the security reasons, and I'd prefer not to go down that rabbit hole), but a simple http fetch of a page of the blog where the current version ID is up shouldn't be an issue.
  • Replaced 'fadeDistance' marker parameter with 'fadeNear' and 'fadeFar' parameters. The howto has been updated to explain the change.
  • 'Reappear after timer' marker behavior has been implemented.
  • Silverwastes chest map expanded to 114 chest locations courtesy of Elycian. The chest markers now disappear for 5 minutes after you pressed 'F' on them.
  • Added locations for 'a study in gold' achievement as well as the location of Herta, courtesy of Elycian.

Sunday 17 January 2016

Performance fix, Silverwastes round 1

There's a new build!

This one contains a single bugfix that will have an impact on the performance of the overlay in situations where a lot of icons are on the screen at the same time.

I also added the results of my silverwastes chest farm (about 90-ish chest locations), and all the golden lost badge locations, courtesy of Elycian and his awesome guild of ninja mesmers who set up a task force to mark all of these on the map.

You can grab the new build here.

Change notes
  • Fixed a bug in the string class that caused the internal hash not to update when converted to lowercase (caused constant cache misses and thus the loading of icons several times, overloading the texture atlas system and slowing things down)
  • Added about 90 silverwastes chest locations
  • Added golden lost badge locations, courtesy of Elycian
  • Reduced resolution of N S E W icons because they were taking up too much space on the texture atlas

Friday 15 January 2016

How to create your own Marker Pack

I would like GW2 TacO to be useful for many people. It was easy to use the tech I built to help out in Spirit Vale, but placing a few directional markers and setting up some locational timers isn't too much work, and the raid audience is limited. This system can be used for so much more, and with the latest build I aim to have it open enough for anyone to be able to create and share markers in an organized fashion.

So here's a reference on how GW2 TacO supports this effort.

What is a marker?

On the face of it, what GW2 TacO does is pretty simple: it asks GW2 what your current location and the camera position are, and draws billboards in 3D space based on that. The trick is knowing where in space to place those points in the first place. The locations come from the information that we already have: your character position. You press a key, the system takes your current position and creates a marker. But if this was all there is to it, there would only be one type of marker and soon enough chaos would ensue. 
The current default marker icon
So besides the position in 3D space, markers need other properties:
  • What image should be drawn for the marker?
  • What size should the marker be in the game world?
  • How transparent should the marker be?
  • At which distance should the marker show up at all?
  • How high off the ground should the marker be? (Your location is actually on the ground)
  • What should happen if you press the action button when you're at the marker?
  • ... and a lot of things I probably haven't encountered yet
Each marker can store all of the information above, and if you wanted you could edit the poidata.xml right now by hand and add these properties to all the markers individually (given that you know the format, but more on that later). So there is a need to somehow organize markers into groups, optimally in a way that lets us keep the option open to change markers individually.

Enter Marker Categories.

An introduction to Marker Categories

A marker category is a description of a group of markers containing some or all of the information mentioned above in the list. Each marker can have a type field that describes which category it fits into. Any values defined by the category will be set for the marker, unless the marker defines them for itself as well - in this case the value coming from the category is overwritten by the value specified in the marker itself. With this we have a system where we both have grouped data (if I change the image for the category all the markers in that category will change their icon) but with the option of having individual markers a say in how they behave (a marker can still have its own separate icon defined with all the rest of the values coming from the category it is in).

Each marker can belong to exactly one category.

But categories can be organized into a hierarchy.
Example hierarchy for categories: resourcenode.chest.mapspecific.verdantbrink
The point here is that categories themselves will often contain very similar data. Think about all the in-world collectible achievements of late: golden lost badges, lost coins, exalted masks, etc. All of these can easily be marked, and their behavior has to be pretty much the same: if you press 'F' on one of these markers, it should disappear forever because you already have the achievement point for that one and it's irrelevant from that point on. They might all however have different icons. Hierarchic categories solve this in the following way: you can define a category (let's say 'collectible') that defines their behavior: 'disappear forever when activated' (more on how to do this later). Then you define categories under 'collectible' for the examples above: 'goldenlostbadge', 'lostcoin', 'exaltedmask'. These categories will inherit all settings from their parents (in this case their behavior), and you can set icons separately for each of them.

Now to set the category for a marker you need to write out the full name of the category, which is the parent-to-child order combination of the names of the categories separated by dots. For example: 'collectible.goldenlostbadge' will refer to the golden lost badge category. Category names are case insensitive to avoid any confusion.

This is all pretty standard, but the biggest point of this system is that it's expandable. Nothing is hardcoded into the overlay and if you distribute your own marker pack that can have its own category definitions that will seamlessly integrate into the hierarchic system. The final category tree you will see in the overlay is a combination of all the categories loaded from all the marker files.

Data formats, file system info, what goes where

GW2 TacO stores all data in xml files. There a bunch of these, but the ones used in displaying markers are the following:

  • poidata.xml - this is your local marker database, it contains all the markers you placed on your own. It can also contain category descriptions.
  • categorydata.xml - this file is loaded first, it contains a default category tree. This category tree for now is pretty much only preliminary and will be expanded/rearranged later.
  • activationdata.xml - this file contains when you last pressed 'F' on a marker that has a behavior different than 'always visible'.
  • any xmls under the POIs directory will be loaded. The format of these matches the format of poidata.xml, however the markers in these data files will always be loaded. If you get a new marker pack you just need to drop it in there and restart the overlay.
All of these xml files have the root tag <OverlayData>. All tags in the xml files are case sensitive.

Marker description


Markers in the xml files are described under the <POIs> tag under the root <OverlayData> tag. The <POI> tag describes a marker. The following attributes can be set for each marker:
  • MapID - integer, required. Describes which map the marker is located on.
  • xpos - float, required. X position of the marker in world space.
  • ypos - float, required. Y position of the marker in world space.
  • zpos - float, required. Z position of the marker in world space.
  • type - string, optional. This is the full name of the category the marker belongs to. If this is not set, the marker will be presented with default parameters. Must not contain any spaces or special characters.
  • GUID - base64 encoded string, optional. This is a unique identifier for the marker used in tracking activation of markers through the activationdata.xml file. If this doesn't exist for a marker, one will be generated automatically and added on the next export.
  • The following tags are all optional, and can be both set for each category (description below) and each marker individually. Ideally these should be set in the categories and only overridden for a handful of icons if at all, but the option is there.
    • iconFile - string. The icon to be displayed for the marker. If not given, this defaults to the image shown at the start of this article. This should point to a .png file. The overlay looks for the image files both starting from the root directory and the POIs directory for convenience. Make sure you don't use too high resolution (above 128x128) images because the texture atlas used for these is limited in size and it's a needless waste of resources to fill it quickly.
    • iconSize - float. The size of the icon in the game world. Default is 1.0 if this is not defined. Note that the "screen edges herd icons" option will limit the size of the displayed images for technical reasons.
    • alpha - float. How opaque the displayed icon should be. The default is 1.0
    • behavior - integer. This is an important one, it describes the way the marker will behave when a player presses 'F' over it. The following values are valid for this parameter:
      • 0: the default value. Marker is always visible.
      • 1: 'Reappear on map change' - this is not implemented yet, it will be useful for markers that need to reappear if the player changes the map instance.
      • 2: 'Reappear on daily reset' - these markers disappear if the player presses 'F' over them, and reappear at the daily reset. These were used for the orphan markers during wintersday.
      • 3: 'Only visible before activation' - these markers disappear forever once the player pressed 'F' over them. Useful for collection style markers like golden lost badges, etc.
      • 4: 'Reappear after timer' - This behavior makes the marker reappear after a fix amount of time given in 'resetLength'.
      • 5: 'Reappear on map reset' - not implemented yet. This will make the marker reappear when the map cycles. In this case 'resetLength' will define the map cycle length in seconds, and 'resetOffset' will define when the first map cycle of the day begins after the daily reset, in seconds.
      • 6: 'Once per instance' - these markers disappear when triggered but reappear if you go into another instance of the map
      • 7: 'Once daily per character' - these markers disappear when triggered, but reappear with the daily reset, and can be triggered separately for every character
    • fadeNear - float. Determines how far the marker will start to fade out. If below 0, the marker won't disappear at any distance. Default is -1. This value is in game units (inches).
    • fadeFar - float. Determines how far the marker will completely disappear. If below 0, the marker won't disappear at any distance. Default is -1. FadeFar needs to be higher than fadeNear for sane results. This value is in game units (inches).
    • heightOffset - float. Specifies how high above the ground the marker is displayed. Default value is 1.5
    • resetLength - integer. For behavior 4 this tells how long the marker should be invisible after pressing 'F'. For behavior 5 this will tell how long a map cycle is.
    • resetOffset - integer. Not currently used, this will supply data for behavior 5. The data will be given in seconds.
    • DisplayName - string. This text is used to display the type of the marker. It can contain spaces.
    • color - hex value. The color tint of the marker
    • autoTrigger - boolean. Determines if going near the marker triggers it
    • hasCountdown - boolean. Determines if a marker has a countdown timer display when triggered
    • triggerRange - float. Determines the range from where the marker is triggered
    • minSize - integer. Determines the minimum size of a marker on the screen, in pixels.
    • maxSize - integer. Determines the maximum size of a marker on the screen, in pixels.
    • achievementId - integer. An ID for an achievement from the GW2 API. Markers with the corresponding achievement ID will be hidden if the ID is marked as "done" for the API key that's entered in TacO. For a list of achievement IDs see https://wiki.guildwars2.com/wiki/API:2/achievements
    • achievementBit - integer. This is similar to achievementId, but works for partially completed achievements as well, if the achievement has "bits", they can be individually referenced with this.
    • info - string. This can be a multiline string, it will show up on screen as a text when the player is inside of infoRange of the marker
    • infoRange - float. This determines how far away from the marker the info string will be visible
    • toggledefault - boolean. If set, the category will be enabled/disabled by default when loading the marker pack (0 = disabled)
    • festival - string. A comma separated list of strings (without spaces) from the following pool that makes the markers in this category only show up during the associated festival: halloween, wintersday, superadventurefestival, lunarnewyear, festivalofthefourwinds, dragonbash
    • copy - string. This string will be copied to the clipboard when the marker is triggered. Usually used with autotrigger enabled.
    • copy-message - string. This string will be displayed in the middle of the screen when the clipboard copy is triggered. Useful to let the user know that the clipboard has been updated.
    Example: 

    <OverlayData>
      <POIs>
        <POI MapID="1062" type="collectible.journalentry" xpos="-266.477" ypos="52.4114" zpos="-628.789" GUID="XtFDXUUJO0aDsDzjZOt7NQ=="/>
      </POIs>
    </OverlayData>

    Category description


    Categories in the xml files are described by <MarkerCategory> tags under the root <OverlayData> tag. They can be nested to build a hierarchy. Any marker parameter defined in a category will propagate down to categories nested in it unless they opt to override the parameter. Besides the marker parameters described above the only thing that can be set for a category is the name parameter. 

    Example:

    <OverlayData>
      <MarkerCategory name="Collectible">
        <MarkerCategory name="JournalEntry" iconFile="Data\raid1_achievements.png" behavior="3"/>
      </MarkerCategory>  
    </OverlayData>

    If you're planning on creating a marker pack and your markers don't fit into existing categories I suggest you start with an empty poidata.xml and create your categories in that file. This way if you distribute your poidata.xml people can drop it into their POIs directory and load your markers easily.

    Creating categories


    For the time being you'll need to create new categories by hand using any text editor. Just add the category to your poidata.xml, restart TacO and you're good to go.

    Trails


    Trails are a feature meant to optimize the creation of routes and to remove marker clutter from the system. A trail is a continuous line that is recorded in a recording session by simply walking around. They are a bit different from markers in that the trail data needs to be exported from the recording session in order to be usable, and it's stored in a dense binary format that's not easily editable by hand.

    How to record a trail


    To record a trail, you need to have the Marker Editor window open.
    You can start recording a trail simply by pressing the Start New Trail button. Everywhere you walk on the map, the trail will be built. You can pause recording with the Pause Recording button, which will simply stop the accumulation of trail points behind you while the pause function is enabled. This should allow you to inspect the results of a recording session before exporting it.

    The Delete Last Segment button allows for a rudimentary type of undo. It should come in handy if you miss a jump for example and don't want to redo the whole trail up to that point. It's highly recommended to bind this functionality to a key.

    Once your trail is finished, you can export it with the help of the Export Trail button.

    Stopping a recording session will also restart the trail, so be careful to always export a finished trail before starting to record a new one.

    Using and sharing trails


    In order to get an exported trail to show up in TacO, it needs to be added to a marker pack just like a marker. Trails are described by the <Trail> tag and uses the same category system as the markers. If you put a marker and a trail in the same category, the user can hide them both at the same time by hiding the category.
    Here's an example trail:

    <OverlayData>
    <POIs>
    <Trail trailData="Trails/poobadoo.trl" texture="data/Bounty.png" color="ffffffff" animSpeed="1" alpha="1" type="tactical.guildmission.bounty.poobadoo" fadeNear="3000" fadeFar="4000"/>
    </POIs>
    </OverlayData>

    The color, type, alphafadeNear and fadeFar attributes function the same as they do for markers.
    The trailData tag needs to point to a binary trail. These are the files that you get by exporting them during a recording session. The binary trails also contain the map they were recorded on, so the MapID tag is ignored for trails.
    The texture tag points to the texture that should scroll on the trail.
    The animSpeed tag is a float value that modifies the speed of the animation on a trail.
    There's also a trailScale tag that is a float value that modifies how stretched the texture will look on the trail.

    In order to share trails you need to include the binary files into the marker packs just like you do with images.

    Placing your own Markers

    This is the easy part. Any markers you place will be added into poidata.xml. You can place markers by default using the '+' button and remove them with the '-' button.
    If you have the marker editor open (toggle it open in the TacO menu, then turn on window edit mode to move and resize the window to the correct position) and you're standing on a marker you placed, the marker editor will show the type of the marker you're standing on, a button to change that category, the default type a new marker gets assigned to and a button to change the default category. Assuming you want to create a marker pack for similar items all you need to do is select a default and visit all the locations you want marked. The poidata.xml will be written every time you add or remove a marker.
    To override category settings for individual markers you'll need to edit the xml by hand for the time being. Later updates will address this issue.

    Ideal targets for marking

    • world chest locations
    • any type of location based achievements like lost coins etc (for these I suggest you use the corresponding achievement icon)
    • map chest spawn positions (think dry top, silverwastes, HoT maps, etc)
    • JP start locations
    • where to place siege in WvW
    • etc
    If you create a high quality (all positions marked, precisely) marker pack send it my way and I'll put it in the next release.

    Sharing

    If you have created a marker pack that you feel can be shared with the community simply rename the poidata.xml, gather the images you used, zip them all up, and tell people to decompress the package into the POIs directory next to TacO. It's also wise to try the marker pack on a freshly uncompressed download of TacO this way to make sure that the markers load the correct icons.
    That's it!

    What's still missing

    As you might have noted, some features are still under development. Anything that says "not implemented yet" above will be coming soon.

    Quick Bugfix

    Hi, you can download a new version from here. This should now properly track if GW2 actually closed, not just the window. Patches and restarts might still cause issues, but there was no way to test that yet.

    I also added a warning message that handles another issue I found out today: now TacO will warn you if it's running at a lower privilege level than GW2 (this causes TacO not to get any mouse/keyboard input when GW2 is in focus).

    Change log:

    • Proper process tracking of GW2 should avoid false automatic termination of the overlay
    • Warning message if TacO is running at lower privileges than GW2

    Thursday 14 January 2016

    Keybindings, proper marker activation tracking

    EDIT: KNOWN ISSUE WITH THIS BUILD - if you have the "Close when GW2 quits" option on (it's on by default) and run TacO before the game opens the main window, TacO will falsely think that you quit the game and it'll close. To remedy this either start TacO only after the game is already running or turn the auto close option off. A new build to fix this will be up soon.

    A new build is up!

    This one started out as a couple small things and ended up being a more thorough rewrite of several systems. Most notably key rebinding, proper marker activation tracking and a brand new marker type hierarchy system have been implemented. The window init code has also had some upgrades, so hopefully more people will be able to run the overlay.

    Most importantly, with the addition of the hierarchic marker type system and the marker editor window this build is the foundation upon which user created and shared marker packs can be built. I will write a thorough tutorial on how to create and share your own marker packs, which will hopefully mean no more running around trying to figure out Lost Badge or Exalted Mask locations based on 2D images from a website or a youtube video. If someone creates the marker location pack for the content, you'll easily be able to load it in the overlay, keep track of your progress, and hide specific types of markers if they are in the way.

    Key rebinding interface
    How to filter markers based on type

    Grab the new build here.

    Change notes:
    • Added GUIDs for all markers
    • Activation times of markers (when you last pressed F on them) are now stored in a separate file, referenced by GUIDs
    • Added a new marker behavior type that allows for markers that will only show up if they haven't been triggered yet. This will be very useful for sharing collection-style achievement locations like the lost coins or diving goggles.
    • Added option to rebind actions to different keys. For now only keys producing characters are supported, when the keyboard handling is updated this will likely change. Use the "rebind keys" subtree in the TacO menu to access key rebinding.
    • Removed the orphan locations from the POI datafile as Wintersday is over.
    • TS3 window will now show the number of people in each displayed channel
    • Changed the old icon type system to a hierarchy based template system that allows expansion by content creators (tutorial coming soon)
    • Dynamic UI texture atlas use for icons should now be optimal without any duplicates even over several datafiles (given that the referenced file names are the same)
    • Removed orphan markers from default datafiles as Wintersday is over
    • Moved raid markers to separate xml and added categorization to markers
    • Removed some of the hackery from the transparent window creation process. Hopefully this will result in fewer instances of people not being able to use the overlay.
    • GW2 TacO can now exit automatically if GW2 is closed
    • Added option to toggle TacO exit behavior when GW2 is closed (exits by default)
    • Moved existing marker data to 'external' files, freeing the local datafile for your personal markers
    • Added marker packs for two Spirit Vale collection achievements (Piecing It Together and Closure)
    • Mouse highlight is now off by default
    • Enabled logging to GW2TacO.log
    • Added a basic marker editor window
    • Markers placed by you can have their type changed via the marker editor window (for now the types need to be hand edited in the xml files, a tutorial will follow on how to create and share your own marker packs)
    • Extended the versions of d3dcompiler_xx.dll that the UI will look for, this should make sure that your DirectX install is not an issue when running the overlay
    • Tactical layer settings will now only appear in the TacO menu if the tactical layer is enabled
    • Added the ability to filter which types of markers show up
    • The overlay now remembers your filter settings between runs
    • Added a way to set the category of the default placed marker. The setting isn't remembered between sessions for now.

    Sunday 3 January 2016

    Locational timers (Sabetha cannon timers!)

    A new build is up!
    This one has a cool new feature: locational timed events. These are timed on-screen messages that are triggered when you enter an area. Like for example the Sabetha fight. Cannon timers are included, however the timing won't be 100% perfect as the fight starts once you get in combat. Should be close enough though.


    Grab the new build from here.

    Change log:

    • Added locational timers feature
    • Added Sabetha cannon timers
    • Default interface size is now 'normal'
    • Changed the background of the TeamSpeak window to be transparent by default
    • Expanded bitmap fonts for Trebuchet with more symbols and added fonts used by GW2 for the on-screen notifications of the timers

    Saturday 2 January 2016

    TeamSpeak integration and POI sharing

    A new build is up!

    The main feature is experimental TeamSpeak 3 integration, it uses the TS3 Client Query plugin that's installed and activated by default so if you haven't disabled it intentionally this should work. You will need to place the TeamSpeak widget for yourself (open the window from the Taco menu, then go into window editing mode from the Taco menu and move/resize the window as you see fit). The contents of this window change automatically based on which TS channel you are in. Multiple server tabs are supported, they show up below each other.
    This is a very first iteration, so if you notice anything odd just let me know.

    Grab the new build here.

    Change notes:

    • Added TeamSpeak window that automatically shows your current TS channels
    • The overlay will now read any .xml files found in the POIs directory and load them in addition to the main poidata.xml file - this method should be a valid way of sharing markers for the time being. The overlay will search for icon files both relative to the root directory and the POIs directory, so you can easily bundle custom icons with your shared markers.
    • Added window skins
    • Changed some of the UI colors, map timer background can now be changed from css

    A small preview

    This is in testing at the moment, and non-interactive for the time being, but if I find it stable enough it'll be out this weekend. TeamSpeak integration should help with raiding a bit.