MapzenGo Part 7 : Plugins

Well yes, I decided to change the name of the series to simply “MapzenGo”. It’s shorter and admittedly, “PokemonGo clone” was a bit of a click bait. But hey, advertisement eh??
Anyway, we have another big update here. Mainly infrastructure stuff but I think you’ll all find them useful.

mapzen pokemongo openstreetmap layers offline maps buildings tokyoGood old Manhattan

-Major thing here is the new plugin system. Well I changed the factories a bit…again but nothing big really. First of all, I introduced a new base class called “Plugin”. It has a simple “Create” function and will be used for both factories and additional… plugins. So plugins are classes which operates on Tiles. Simple as that. Factories take tiles and creates buildings, roads etc. Other plugins, takes tiles and puts map images on them, add custom objects, maybe create forests or something.

So now you can create a class, inherit it from plugin, fill up the create method and put it under the World object in the scene. It’ll work right away.
That being said, I’m not done with refactoring the factories yet, I’ll remove the create from base factory class and leave that part to sub classes as well. That won’t effect the plugin system though, you’ll be able to work on your own plugins unaffected.

-Then I implement as very simple CustomObjectPlugin. People has been asking about how to visualized their own custom locations for weeks now. And yes it wasn’t really straight forward how to convert lat/long to unity3d position but this new plugin should help you with that. It’s just a sample really, nothing fancy going on there and you’ll probably need something much more complex for your needs but this should be enough to get you started.

-Then there is a great editor script, written by Roman (thanks mate!), to search places and use their lat/long right away. Admittedly I haven’t checked the code in detail but it uses Mapzen search api to find places, retrieve their lat/long and pass it to the tile manager. It’s so much easier now to navigate between different places, be it Manhatta, Paris or Istanbul.

mapzen pokemongo openstreetmap layers offline maps buildings tokyo search mapzengoSo much easier to test different place now.

-And I also fixed namespaces to match file locations. Should have done this much earlier, no idea how I missed it.

-Oh wait I actually forgot the biggest thing, entity settings and filtering! Well I did talked about this a little in previous posts but extended it a lot since then.
Ok, what is it? Remember, we didn’t have much chance to customize stuff before; hust some hard coded materials which wasn’t enough for anything really. No chance to set road widths, materials by building type etc.
So we have a new settings system to fix that! If you check the factory objects in the scene, you’ll see that there is a new Settings list under it. Using that list, you can customize, let’s say highway roads width or religious buildings material.

Even better, some factories (not all) are using those settings to filter entities, i.e. Road factory won’t render “ferry” routes if you don’t have a settings for that! This saves us from all the mess in big cities and helps us get a cleaner look. If I recall correctly, only building factory doesn’t use this filtering method. Building factory will render every single building and use custom settings on selected typed buildings.
We have only a few customization properties for now but it’s quite easy to add anything whenever we need. Ah and Roman is also working on moving all those settings to ScriptableObjects, it’ll get much easier to use as well.

mapzen pokemongo openstreetmap layers offline maps buildings stockholmStockholm

And that’s all for now I guess. I’ll try to look into gps, UV maps and other stuff next few weeks, no promises though, day job is getting quite intense these days.

Let me know what you think! You can mail me, post here or create issues on MapzenGo Github page. I also added a donation button at the right column (and at the bottom of this post), consider that as buying me a coffee or a beer. Oh I can definitely use a weihenstephaner right now…


MapzenGo Github Page
Twitter (started posting beauty shots and whatever there)
Download MapzenGo Part 7: Plugins

[paypal_donation_button align=”left”]


14 thoughts on “MapzenGo Part 7 : Plugins

  1. hi brnkhy,im testing this new the missing building appears….but i have a few questions.if i want to see the map plane,the only way is using the map image script without url?is the only way i found to do it.
    And the other question is about coordinate y on objects.the map is y=-1,the buldings and landfuse on y=0, but roads are on y= 3.6…..can that be changed?
    ah…and the search script is great….now is more easy to test places….thanks….

  2. Hey,
    I’m afraid I don’t understand that first part 🙁 You want the base mesh (rectangle) without the map? You can simply comment out the texture calls in that plugin for that?
    Y axis usage is incomplete at the moment, we’re work on it here;
    Feel free to change that as you like 😉
    And kudos to Roman for that search script, he submitted that!

  3. thanks brnkhy……thas it what i mean… other version you can activate or not the image map,but the base mesh still there,in this version, i only can do it changing code…..ok…;-)…..

    1. Coffee first!!! 🙂
      You can use it however you want man. It’s already MIT license. All you have to do it to include that license txt file somewhere and it would be great if you can give credit somewhere so I’ll be able to brag about it around 🙂
      Other than that, change it, use it whatever, I don’t really care 🙂 good luck

  4. Hi brnkhy, Thank you so much for the work done here. I can’t wait for the GPS and path navigation. That’s really awesome…

      1. It’s ace! Quick question, you’ve managed to get the roads to be mapped out with the factory. Would it be difficult to transfer that to the rail?

Leave a Reply