{"action":"created","issue":{"url":"https://api.github.com/repos/MegaMek/megamek/issues/305","repository_url":"https://api.github.com/repos/MegaMek/megamek","labels_url":"https://api.github.com/repos/MegaMek/megamek/issues/305/labels{/name}","comments_url":"https://api.github.com/repos/MegaMek/megamek/issues/305/comments","events_url":"https://api.github.com/repos/MegaMek/megamek/issues/305/events","html_url":"https://github.com/MegaMek/megamek/issues/305","id":170066323,"number":305,"title":"When A Tileset Theme Is Not Found ","user":{"login":"BLOODWOLF333","id":16950832,"avatar_url":"https://avatars.githubusercontent.com/u/16950832?v=3","gravatar_id":"","url":"https://api.github.com/users/BLOODWOLF333","html_url":"https://github.com/BLOODWOLF333","followers_url":"https://api.github.com/users/BLOODWOLF333/followers","following_url":"https://api.github.com/users/BLOODWOLF333/following{/other_user}","gists_url":"https://api.github.com/users/BLOODWOLF333/gists{/gist_id}","starred_url":"https://api.github.com/users/BLOODWOLF333/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BLOODWOLF333/subscriptions","organizations_url":"https://api.github.com/users/BLOODWOLF333/orgs","repos_url":"https://api.github.com/users/BLOODWOLF333/repos","events_url":"https://api.github.com/users/BLOODWOLF333/events{/privacy}","received_events_url":"https://api.github.com/users/BLOODWOLF333/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-09T02:09:17Z","updated_at":"2016-08-14T19:16:34Z","closed_at":"2016-08-14T19:10:27Z","body":"Currently when a player types in a theme for a board or when snowcapped mountains are used and such a theme does not exist MM will go into the StandardThemes.tileinc and use the first theme listed in place of the request theme that does not exist.\r\n\r\n# The Standard MM themes\r\n\r\ninclude \"lunar/ThemeLunar.tileinc\"    <Is what MM will use for non-existent themes\r\ninclude \"mars/ThemeMars.tileinc\"\r\ninclude \"volcano/ThemeVolcano.tileinc\"\r\ninclude \"grass/ThemeGrass.tileinc\"\r\ninclude \"volcano/ThemeVolcano.tileinc\"\r\n\r\nDiscussed with Arlith that maybe it would be better if MM instead ignored the request for a non-existent theme and just used the blank/no theme for the current tileset."},"comment":{"url":"https://api.github.com/repos/MegaMek/megamek/issues/comments/239690910","html_url":"https://github.com/MegaMek/megamek/issues/305#issuecomment-239690910","issue_url":"https://api.github.com/repos/MegaMek/megamek/issues/305","id":239690910,"user":{"login":"arlith","id":13815237,"avatar_url":"https://avatars.githubusercontent.com/u/13815237?v=3","gravatar_id":"","url":"https://api.github.com/users/arlith","html_url":"https://github.com/arlith","followers_url":"https://api.github.com/users/arlith/followers","following_url":"https://api.github.com/users/arlith/following{/other_user}","gists_url":"https://api.github.com/users/arlith/gists{/gist_id}","starred_url":"https://api.github.com/users/arlith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arlith/subscriptions","organizations_url":"https://api.github.com/users/arlith/orgs","repos_url":"https://api.github.com/users/arlith/repos","events_url":"https://api.github.com/users/arlith/events{/privacy}","received_events_url":"https://api.github.com/users/arlith/received_events","type":"User","site_admin":false},"created_at":"2016-08-14T19:16:34Z","updated_at":"2016-08-14T19:16:34Z","body":"The issue, as I see it, is when you have a theme specified for a hex, but the tileset doesn't have a definition for that theme.  In that case, there won't be any good matches, but it'll pick the first shitty match.  Because atmospheric includes StandardThemes.tileinc before it defines the \"base\" clear hex, whatever theme is defined first gets picked.  I don't feel like this is desired behavior, so what I did was adjust the cod a bit.\r\n\r\nThe relevant method is `HexTileset.baseMatch`.  Essentially, it defines a similarity measure for matching a given hex to a hex defined in the tileset.  The similarity is based on three terms: elevation, terrain, and theme.  Each of these values are multiplied together.\r\n\r\nPreviously, the theme value would either be 1 or 0.0001.  If both hexes had the same theme (including no theme) or they had a theme match, the value was 1, otherwise it was 0.0001.  I added an additional term that says if the original has a theme and the match has a null theme, use 0.001, otherwise use 0.0001.  The effect of this is that, if there's a theme match, it scores well, if the hex has a theme but the tileset entry has no theme, it's penalized a small amount, otherwise if there are differing themes it's penalized a large amount.  The effect of this is that the tileset will prefer unthemed bases if there's not a theme match, but if there's a suitably good entry with a mismatched theme it could still pick that one."}}
{"actor":{"display_login":"arlith"}}