Showing posts with label bug fixes. Show all posts
Showing posts with label bug fixes. Show all posts

2014-05-20

T5SS Data Update - April/May 2014

The new data is now live!

Summary of changes:

  • T5SS sectors now have 4-character allegiances; these are visible on the map and in tab-delimited and column-delimited data files. The new allegiance codes are mapped to 2-character codes when "SEC" files are output or at low scales. Codes are documented at http://travellermap.com/doc/secondsurvey
  • T5SS sectors now have 1- or 2-character base codes, e.g. NS for Naval Base and Scout Base, when shown in tab-delimited and column-delimited files. They are mapped to 1-character codes when "SEC" files are output. Codes are documented at http://travellermap.com/doc/secondsurvey
  • Booklet and World Data Sheets now use the newfangled allegiance and base codes
  • The following sectors are under review as part of the T5SS. The data is updated to conform to T5SS formats, but the data is still subject to heavy change.
  • Tab-delimited files are now assumed to be UTF-8 (previously, was Windows-1252)
  • And, of course, nearly all of the sectors covered by the T5SS have had some tweaks.
This will doubtless have introduced issues visible on the site (e.g. borders and routes that need tweaking) and due to the extensive code changes it's likely bugs have crept in that will affect booklet/poster creation. Let me know here or via email and I'll try and get them fixed ASAP.

Ω

2013-11-30

Nothing to see here, I hope...

I've rejiggered a bunch of the internal workings of the site in ways that are only of interest to developers. The last 40 or so revisions moved away from serving data and images using "ASPX" pages to HttpHandler. Ideally, there's no change in behavior except that unnecessary cruft isn't running. The best part from a developer perspective is that all URL handling for the services is now done programmatically - no hosted files are necessary to add APIs, just code. The code for that lives in the Global.asax.cs file, if you're curious. As an added bonus, I'm using regular expressions for URL dispatching so it's easier to e.g. distinguish /data/sector/subsector from /data/sector/hex and more possibilities are now available - I should be able to enable named subsector references, for example.

Since there are third party sites and services using the old "aspx" APIs I've carefully added aliases to allow those to continue to work. If you're using them, please try and migrate to the new APIs (/api/...) ASAP.

And of course, if I broke anything, please let me know. I fixed one bug along the way - JumpMaps were not correctly eliding out-sector borders. I can't believe no-one told me about that!




Ω

2013-07-26

It's here

The stuff I promised in my last post is now live.

And perhaps least interesting if you're a user of the site - unless I get run over by a cable car or something - is that the source code to travellermap.com is now up on github.

Also:
  • Slipped in a few bug fixes. Probably slipped in a few bugs, too. Let me know.
  • Added a ton more tests (unit tests, API tests).
  • I still need to post T5 data format documentation. (Writing good documentation is much harder and time consuming than writing code.)
  • The old-style SEC data output has been changed to match the column widths from the ancient GEnie data drop. This means names get truncated and all that fun stuff. If this breaks anything that consumes the data I would recommend changing to consume the tab-delimited data, which is inherently more flexible.

Ω

2013-04-06

Performance Fixes

To try and improve the stability and responsiveness of the site (sill hovering at about 99.6% which is okay but not great) I grabbed a trial copy of the ANTS Performance Profiler and did some CPU and Memory profiling. Good news - there was some low-hanging fruit that may explain some of the issues. All of it came down to non-obvious behavior in the PDFsharp library I use as an intermediary for rendering to bitmaps and PDFs.
  • GPU: Each transform applied to the graphics state resulted in two matrix multiplies. In many cases my code was stacking up to 5 transforms before rendering anything (scale, rotate, translate, rotate again, scale again...). This showed up as a CPU hot-spot. This was greatly reduced by composing the matrices locally then sending the final matrix into the graphics context.
  • Memory: Every text operation (DrawString, MeasureString) resulted in the allocation of several temporary StringFormat objects. Just a few seconds of panning around the map would generate 3MB of such objects - even more than temporary strings and at least an order of magnitude more than any other memory churn. They would all be GC'd eventually, but under load this could have caused the site to blow past the application memory pool limit resulting in a reset. This was fixed by changing PDFsharp to re-use the default objects and I reported the issue to the maintainers.
The remaining major CPU hot spot is, unsurprisingly, in clip path intersections for borders and sector boundaries, which is probably the most subtle and complex part of the map rendering process. Unfortunately, it will be hard to optimize directly but I can probably reduce the need to do it in the first place, e.g. more aggressively pruning which borders to render for a tile, and only doing sector edge clipping if there's a border that goes outside the sector in the first place.

I'm hoping that above fixes will result in higher site availability - I'll be watching my monitoring service (Pingdom) to see if they've made a material difference.

By the way, the ANTS profiling tools are quite nice. There's one for Memory and one for CPU. Like most profilers they work by attaching to your process and recording what functions are taking time (for CPU) or what objects are being allocated/freed (Memory). The ANTS tools integrate very nicely with ASP.NET - I was able to just point them at my development directory and say "go" and they launched a dedicated web server and browser so I could generate some traffic. The results are also really easy to understand - there's the traditional drill-in display that shows you inclusive time for each function, but also a source display and interactive call/allocation graph. Very effective!

UPDATE (2013-04-07):

Just to show how helpful profiling tools can be: I was investigating the border clip path logic and found a flaw in the "selector" code which helps determine which sectors are "in view" when rendering a tile. It was under-computing the number of sectors overlapped by a tile. Fortunately, there's already a 1-sector "slop factor" that's necessary so that e.g. routes or labels that cut across a sector's boundary are rendered, so this bug never manifested as missing content. Unfortunately, the correct code meant that even more time was spent on border path clipping (c/o the ANTS CPU profiler).

Borders are a special case where they are always clipped to the sector bounds anyway, though, so I rather than relying on the expensive clipping operations to do the right thing I added a simple bounds-intersection test. This cut border rendering from nearly 55% of the time of a typical tile rendering pass to only about 15%, under the overhead for drawing worlds (about 22%). This should also help with site stability.

Ω

2013-03-23

World Name Rendering

I was in a brick-and-mortar game store today and flipped through one of the Mongoose Solomani books. After noticing some glitches in the map (rendered using this here site!) I got off my duff and made a long-awaited tweak that ensures that world names are always rendered on top of nearby hex's zone indicators. It's a minor detail but should improve the situation in a couple of places.

On the "TODO" list but not yet done is ensuring that glyphs always have a background; some of them (e.g. Research Station, Prison) are difficult to see if the world is also a red zone.

Ω

2012-10-20

Image Regression Tests and Text Quality

I've started to put together a quick and dirty image regression test - an HTML page that will load a set of image pairs and generate a third image showing differences between the two so it's easy to spot changes - for example, if I intentionally moved a glyph up a few pixels (good) or introduced a bug so that gas giants stopped rendering (bad). If the images match perfectly, nothing shows up in the diff.


Call for input: what other URLs would be good to have in a corpus of tests as reference images?

While building this I compared my development machine vs. the live site, and was struck once again by how badly the text rendering is done on the server since it stands out in the image diffs. I was able to make a one line change which dramatically improves the text and glyph quality, so if you've saved off any bitmaps recently you probably want to redo them. It's embarrassing that I didn't do this earlier!

I also enabled CORS headers for image generating APIs, but that's probably not of use to anyone unless you're using WebGL to render map tiles or some such.

Ω

2012-10-14

Cursors and Glyphs

More To-Do items To-Done:

  • The mouse cursor over the map is once again a crosshair. When you start dragging it will change to a drag-hand.
  • Per discussion in a previous post, base symbols have been overhauled and the legend has been updated. Following precedent in paper publications from the CT and MT eras, there is no attempt to make map symbols universally unique. For example, non-Imperial naval bases all use red stars  regardless of allegiance (Vargr, Aslan Tlaukhu, Solomani, Federation, K'kree, Droyne...). I've tried to follow established precedent wherever possible.
  • In addition to Research Stations, symbols are now rendered for Imperial Prisons (code: Pr), Imperial Reserves (code: Re) and Exile Camps (code: Ex), following the Spinward Marches Map symbology.

Ω

2012-09-22

Making a Dent in the To-Do List

I had a little bit of time today so I decided to make sure the To-Do List was updated on Trello. This should cover everything that's been mentioned in comments here and sent in private email. If I missed anything let me know - or even better, sign up to Trello and I can let you add it to the list yourself.

I knocked off a handful of easy items:
  • Subsector names will once again show by default at 64 pixels/parsec (although dimmer than before)
  • Subsector names will NOT show by default for Poster.aspx-generated images, although this can be turned on via options
  • Decoding of "packed" base codes (2 = N+S, A = N+S, B = N+W) now handles per-allegiance specific packing: Vargr: H = C+G, Aslan: U = R+T, Hiver: F = L+M
  • Allegiance code "--" doesn't render. (Perhaps it should show as "Na" so it isn't assumed to be Imperial, but -- is usually only used far away from the Imperium so I don't think it's an issue.


Ω

2012-02-01

Rendering Fixes

Two quick rendering fixes.

  • With "World Colors" checked, white-on-white worlds (e.g. Spinward Marches 0622 in Print style) should now have an outline
  • Borders are now rendered as closed paths, which means small gaps near the "start" of each borders should be gone
The latter one was actually a substantial effort, but it's been sitting unpublished on my dev machine for some time now and I think I'm happy with the change.
Ω

2011-11-16

Small tweaks and fixes


Just fit and finish:

  • The Spinward/Rimward galactic direction display indicators are now rotated to match the Imperium Map poster (tested in IE8, Chrome and Firefox)
  • Double-clicking now correctly centers what you double clicked on. Previously, it was off by 15 or so pixels (half a parsec)
  • The Credits display at the bottom now shows the subsector name (and index) for the targeted location..
  • Some macro-scale labels were cut off too early as you zoomed in. I fixed that, but also tweaked the scale thresholds for various elements. The new thresholds are documented in the info page


Ω

2011-09-12

Deneb, Ziafrplians, SectorMetaData, bug fixes

A few recent updates, tweaks and fixes:
  • Updated data for Ziafrplians from Don McKinney. This is the same data as used for the Zhodani Alien Module recently published by Mongoose, now a canonical part of the OTU. Check out the book for many more details about the sector, of course.
  • Updated data for Deneb by Robert Eaglestone, including a few X-boat route tweaks. This is part of the ongoing T5 data cleanup project. Expect the rest of the Domain of Deneb to follow at some point soon.
  • A new SectorMetaData API
  • Tweaked Candy Style rendering. Now includes UWP at high scales, and scales a little more nicely.
  • Fixed behavior of the experimental touch version when moving from "pinch" to "drag" (i.e. letting go of one finger while the other is still touching)
Ω

2011-08-03

Bug Fix: Response Content Types

In a recent change I accidentally made the "Data" APIs (Coordinates, Credits, JumpWorlds, Search, Universe) produce JSON instead of XML unless otherwise requested if the default was XML. This has been corrected - the default content types should now be as documented in the API page.

While I don't intent to change the default data format for any API call - to maintain compatibility - new APIs may default to JSON... at least, until the Next Great Format comes along. To be robust, make sure you're requesting a specific format using the HTTP "Accept" header. Currently supported formats are:

  • XML: text/xml
  • JSON: application/json
Ω

2011-02-13

Minor fixes, interface tweaks

In order to increase the screen area available for search results, I've increased the section of the right-hand control panel that expands/collapses to include all of the style/appearance options. Previously this included only the label options. Also, to make the "Scroll Map" buttons more useful they now scroll the map by a much greater distance, and the scrolling is animated.

Feedback appreciated. I'm still trying to retain the visual style of the GURPS Traveller mockup that was the inspiration for the site. Is that holding the map back too much? Should I move to a more modern appearance with controls overlaying the map? (I'm planning to do that anyway for the touch-based version)

A handful of tiny bug fixes:

  • legend popup once again shows using current visual style
  • blue zones (for TNE) now render as gray in Atlas style (thanks to Alvin Plumber for the bug report)
  • Cleaned up metadata glitches in the XML (thanks to Mark McSweeny for the bug report)
  • Prevent overlapping map animations

Ω

2008-02-21

Bug Fix: Opera/Safari Searching

David Somers reported an issue with searching on Opera and Safari - odd, since I tested those browsers!

It turned out that search worked, but the options panel didn't reconfigure to make more room for the search results, so on small screens the results would be hidden. I think this dated back from the browser compatibility work from a while back... and I just assumed those browsers were buggy. Oops - turned out to be a subtle JavaScript issue - comparing an uninitialized parameter against null instead of undefined. It only worked because IE and Firefox apparently would report that state as === null and === undefined, even though null !== undefined. Weird.

Anyway, fixed. Ω

2008-02-02

Jump Maps, You Are Here, and More

I was out of town for several days with my computer but no Internet connection and evenings to myself, so I did a fair bit of work on the site. A lot of the work went into fielding requested features.

What's New:
  • Added JumpMap API - generate a Jump-N map for any location

Jump-3 Map for Regina

  • Keyboard scrolling is now enabled in IFRAMEs
    • You will want to specify SCROLLING="no" in the IFRAME tag on your site
  • Asteroids are now rendered as semi-random clusters of ellipses at high scales
  • Add MapOptions.ForceHexes (add 8192 to always draw hexagonal parsecs, not squares)
[UPDATE 2008-02-03] Fixed use of ForceHexes for the main page and IFRAME - it was being masked out. Should work now.
  • Tweak min scales for features to support 24 & 48 pixels/parsec more nicely
  • Lots of API documentation cleanup
Beta:
  • iframe.htm now takes "You Are Here" parameters (yah_sx, sah_sy, yah_hx, yah_hy) that define a sector/hex pair to put a marker on - example. There can be only one such marker, and there is no UI (or finalized script API) to set, move, or clear it.
Fixes:
  • Combat client-side memory bloat by:
    • Clearing tile cache after following a non-animated link
    • Request metadata with a time threshold, to avoid hundreds of aborted HTTP requests
  • Fix candy background tiling for legend (caused by a floating point underflow issue in GDI+)
Plus lots of (hopefully) invisible internal changes. Ω

2008-01-26

TODO List

Here's my "To Do" list for the site. Many of these are probably incomprehensible, but I thought I'd share anyway
  • FEATURE: Support custom data for sector.htm LBB generator
  • LOC: Detect language setting "Accept-Language:", serve Japanese version (it turns out a lot of the site traffic is from Japan. Go figure!)
  • IMPL/FEATURE: Style object that's data only
    • Cache object for brushes, etc
    • Allow passing in via parameters (options and scale are presets)
    • Scale is just a seed - use next-highest scale
  • FEATURE: Search by regex on (UWP, PBG, ...)
  • BUG: Terra should look like Earth in Candy style
  • BUG: iframe doesn't show if "Disable script debugging" is unchecked (WTF?) - IE bug? Maybe cookies can't be loaded or something?
  • IMPL/PERF: Add more condensed route storage (perf, size)
  • QUALITY: Investigate DrawClosedCurve for candy borders
  • FEATURE: Style options - hexes at every level
  • QUALITY: Up the JPEG quality for Candy a bit
  • DATA: Incorporate Theron sector from BeRKA (?)
  • DATA: Incorporate Uistilao sector from BeRKA (?)
  • DATA: Use Kaa'G!kul data from HIWG (?)
  • DATA: Incorporate MWM's new T5 data
  • IMPL: Reconsider JavaScript class/object style
    • Use Class.prototype.func = function() ... rather than this.func, and other extern logic
    • Verify that inline functions for event handlers aren't leaking memory
  • FEATURE: Support different data sets (Judge's Guild, etc)
What else should I have on the list? Ω

2008-01-12

Border Cleanup

A minor bit of cleanup:
  • Found and fixed a bug with candy-style border rendering along sector boundaries. Most notable in the Vargr Extents
  • Regenerated borders for Khoellighz, Windhorn, Mendan, Vland, Lishun, Antares, and tweaks in a few other sectors to make edges line up
Since I was playing around in a Win98 virtual machine I also made the map function in IE5. Search and the data display show mangled results, but I know the cause (it's using a newish feature of Javascript) so it's fixable; at least now you can still explore the map. Anyone care?

I have reports that dragging is no longer working in IE6 on WinXP since an update circa Jan 1st, but I can't reproduce the problem. Can anyone else? If so, tracking down the problem should be easy. Ω

2008-01-01

Mobile fixes

Mobile-related changes:
  • Fixed searching in Mobile page - I'd accidentally broken it when doing some code cleanup
  • Made Enter key in search box work on the Mobile page from within Firefox
  • Added Mobile link to main page
  • Added tooltips to Mobile page
  • Slightly changed how you scroll (was a factor of 0.5 of the width/height, now it's 0.4)
Also, fixed a data error causing Hicongengiso to not appear, and fixed the IFRAME API docs Ω

2007-12-29

Bug Fix: Searching

Minor fix here for an issue I noticed myself - if your search results included a sector, when you clicked it wouldn't be centered or scaled reasonably. A little digging found that when I switched from XML to JSON search result processing I'd dropped some of the logic. Clicking the search results now behaves as it did previously.

I also noticed that I wasn't "stemming" words at all, so I threw in a simple rule to drop 's when indexing - try searching on "trin" and you should get 3 results. Ω

2007-08-11

Metadata and Legend

Updates to "beta" version of the page that includes data and credits for location the map is centered on:
  • Click on Control box just inside the border to hide it
  • Tweak the formatting of metadata
  • Added a link to a Map Legend - feedback appreciated!
Other fixes:
  • Fix location of Lesser Rift label
  • Tweak UWP parser regex to catch travel zones w/ no base or codes - Clan (1103 Spinward Marches) wasn't showing as an Amber Zone
  • Added subsector names for: Provence, Windhorn, Meshan, Astron, Fulani, Theta Borealis, Theron, Iphigenaia, Touchstone, Delphi, Karleaya, Alpha Crucis, Spica, Uistilrao, Aldebaran, Neworld, Banners, Hanstone, Malorn, Hadji, Storr
  • Labels now render on top of routes (doesn't obscure the text)
  • Precise borders are now shown at scale 4 and higher (i.e. as soon as you zoom in)
  • Borders are now thicker at maximum zoom
[Update, January 2008]

The "beta" version of the page mentioned here is out of beta. Ω