{"action":"created","issue":{"url":"https://api.github.com/repos/bjorn/tiled/issues/1669","repository_url":"https://api.github.com/repos/bjorn/tiled","labels_url":"https://api.github.com/repos/bjorn/tiled/issues/1669/labels{/name}","comments_url":"https://api.github.com/repos/bjorn/tiled/issues/1669/comments","events_url":"https://api.github.com/repos/bjorn/tiled/issues/1669/events","html_url":"https://github.com/bjorn/tiled/issues/1669","id":246809997,"number":1669,"title":"Showing adjacent maps in the same map view","user":{"login":"bjorn","id":531764,"avatar_url":"https://avatars3.githubusercontent.com/u/531764?v=4","gravatar_id":"","url":"https://api.github.com/users/bjorn","html_url":"https://github.com/bjorn","followers_url":"https://api.github.com/users/bjorn/followers","following_url":"https://api.github.com/users/bjorn/following{/other_user}","gists_url":"https://api.github.com/users/bjorn/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn/subscriptions","organizations_url":"https://api.github.com/users/bjorn/orgs","repos_url":"https://api.github.com/users/bjorn/repos","events_url":"https://api.github.com/users/bjorn/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn/received_events","type":"User","site_admin":false},"labels":[{"id":91394,"url":"https://api.github.com/repos/bjorn/tiled/labels/Feature","name":"Feature","color":"6b7a22","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-31T16:09:41Z","updated_at":"2017-08-07T01:58:37Z","closed_at":null,"body":"### Introduction\r\n\r\nSometimes a game has a large world which is split up into multiple maps to make the world more digestible  by the game (less memory usage) or easier to edit by multiple people (avoiding merge conflicts). For the player, the transition between these maps should generally be seamless. It would be nice if Tiled would able to show also the maps adjacent to the current map, to make it easy to ensure their borders fit together.\r\n\r\nTo do this, I would introduce the concept of a \"world\". Each map can be part of a single world, to which it would refer from its map file. And each world can list any number of maps. In addition, each map gains an \"x\" and \"y\" attribute to store its location within its world (in tile coordinates).\r\n\r\n### Additional Features\r\n\r\nTo make it easier for existing projects to start using this system, the location of a map can also be derived from its file name based on a custom regular expression and a multiplier.\r\n\r\nIn addition to a location, each map could have a \"level\" attribute, which determines at what level this map occurs. This way, multiple maps could be stacked on top of each other rather than adjacent to each other. It would similarly help with matching up different maps that represent for example different floors of the same building.\r\n\r\n### Implementation Details\r\n\r\nExample world definition file:\r\n\r\n```xml\r\n<world>\r\n  <pattern regexp=\"(%d+).(%d+).tmx\" multiplier=\"100\"/>\r\n  <map source=\"1.1.tmx\"/>\r\n  <map source=\"1.2.tmx\"/>\r\n  <map source=\"2.1.tmx\"/>\r\n  <map source=\"2.2.tmx\"/>\r\n</world>\r\n```\r\nOr potentially in JSON (I'd prefer to avoid two formats...):\r\n```json\r\n{\r\n    \"pattern\": {\r\n        \"regexp\": \"(%d+).(%d+).tmx\",\r\n        \"multiplier\": 100\r\n    },\r\n    \"maps\": [\r\n        \"1.1.tmx\",\r\n        \"1.2.tmx\",\r\n        \"2.1.tmx\",\r\n        \"2.2.tmx\"\r\n    ],\r\n    \"type\": \"world\"\r\n}\r\n```\r\nMap with some new attributes:\r\n```xml\r\n<map x=\"100\" y=\"100\" width=\"100\" height=\"100\" level=\"1\" world=\"outside.world\">\r\n  ...\r\n</map>\r\n```\r\n\r\nNew classes introduced would be `WorldManager`, which loads and owns each referenced world, and a `World` class that keeps the list of maps and their locations.\r\n\r\nPart of the logic in `MapScene` will need to be moved to a new `MapItem` graphics item, so that multiple of those can be instantiated on-demand. Interaction with items shown in \"other maps\" should be disabled. The other maps should be clickable so that it is easy to open it for editing.\r\n"},"comment":{"url":"https://api.github.com/repos/bjorn/tiled/issues/comments/320550475","html_url":"https://github.com/bjorn/tiled/issues/1669#issuecomment-320550475","issue_url":"https://api.github.com/repos/bjorn/tiled/issues/1669","id":320550475,"user":{"login":"Arcanorum","id":9785268,"avatar_url":"https://avatars2.githubusercontent.com/u/9785268?v=4","gravatar_id":"","url":"https://api.github.com/users/Arcanorum","html_url":"https://github.com/Arcanorum","followers_url":"https://api.github.com/users/Arcanorum/followers","following_url":"https://api.github.com/users/Arcanorum/following{/other_user}","gists_url":"https://api.github.com/users/Arcanorum/gists{/gist_id}","starred_url":"https://api.github.com/users/Arcanorum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arcanorum/subscriptions","organizations_url":"https://api.github.com/users/Arcanorum/orgs","repos_url":"https://api.github.com/users/Arcanorum/repos","events_url":"https://api.github.com/users/Arcanorum/events{/privacy}","received_events_url":"https://api.github.com/users/Arcanorum/received_events","type":"User","site_admin":false},"created_at":"2017-08-07T01:58:37Z","updated_at":"2017-08-07T01:58:37Z","body":"Sounds cool to me.\r\n\r\nThis lines up nicely with how I have been handing the space representation in my game.\r\nI think you should consider using \"_elevation_\" instead of the somewhat ambiguous and commonly used term \"_level_\" when talking about stacking things on top of each other like floors of a building.\r\n\r\nWould a map being a part of a \"world\" be required?\r\nWould we be able to set world-level properties?\r\nIf so, how would this interact with the proposed Project #1665 structure?\r\n_Project < Worlds < Maps < Layers < Objects_ ?"}}
{"actor":{"display_login":"Arcanorum"}}