Jump to content
madtony26

Mod that Imports Real-World Tree Cover

36 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Holy $%&^!e! This game, these modders!  My head is going to explode! :D

I was thinking about something exactly like this recently, it was brought on by wondering if we could make a few more tree types that are thicker and fuller to approximate much denser areas of trees, without lagging the system too much.

Anyhow thanks for sharing this intriguing project!

**Try something like Asheville North Carolina, we live in a Temperate Rain forest, the Flora here is extremely unique and very dense, we have more variety here than anywhere else in the world, also this is the oldest above sea level mountain range that used to be higher than the Himalayas, much of the southern states below us were formed by the run-off.

  • Like 5

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

This is pretty amazing indeed!
Not to knock on the hard-working people that paint trees in their maps by hand (I've seen countless gems pass by in the Workshop), but holy smokes those first and third screenshots are on a whole new level - I had to look twice and then once more for good measure to figure out they were screenshots rather than actual aerial imagery!

  • Like 4

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

So smooth to get a nice natural feel in a map, then jump straight into details.  This is truly awesome.  I'm looking forward to painting that layer in photoshop too :D for custom maps.

How difficult would it be to have the various tree types have a colorkey in the cover map?  Or maybe each tree "mix" has a color key to make it simpler.  Something like green as default mix, then a coastal color, fresh water, parries, hobbiton etc etc.

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 4/25/2016 at 11:39 PM, Macronomicus said:

    **Try something like Asheville North Carolina, we live in a Temperate Rain forest, the Flora here is extremely unique and very dense, we have more variety here than anywhere else in the world, also this is the oldest above sea level mountain range that used to be higher than the Himalayas, much of the southern states below us were formed by the run-off.

    Thanks for the response, Macronomicus. I will try importing the Asheville terrain and tree-cover when I get a chance (work and home schedule is pretty tight right now). l enjoyed reading your comment about Asheville's  geological history. BTW, It's relatively close to me, in Durham.. although I used to live in Central KY, which is one reason I started with Frankfort as a test case. I visited Asheville a few years ago and loved the culture and landscape.

    On 4/25/2016 at 10:35 AM, Judazzz said:

    This is pretty amazing indeed!
    Not to knock on the hard-working people that paint trees in their maps by hand (I've seen countless gems pass by in the Workshop), but holy smokes those first and third screenshots are on a whole new level - I had to look twice and then once more for good measure to figure out they were screenshots rather than actual aerial imagery!

    Thanks, Judazzz! Those meticulous people were partially the inspiration for this (e.g. dedgren). The sparse tree-brush just doesn't look the same as their work. A mod will never be able to replace the tree-art that these builders can create by hand. However, this mod should allow for a good starting point to save builders from trying to re-create massive forests by hand. There will naturally be some touch-up after importing from the mod.

    12 hours ago, Macronomicus said:

    So smooth to get a nice natural feel in a map, then jump straight into details.  This is truly awesome.  I'm looking forward to painting that layer in photoshop too :D for custom maps.

    How difficult would it be to have the various tree types have a colorkey in the cover map?  Or maybe each tree "mix" has a color key to make it simpler.  Something like green as default mix, then a coastal color, fresh water, parries, hobbiton etc etc.

    Macronomicus, I like your suggestion and this would probably be one of the first updates made after the first release.

    At the moment no image files come into play. This saves the user a step of downloading the image from the server, putting it in the right location, and finding the image from the mod. Currently, the user provides lat/long bounding-box coordinates and the mod will directly connect to the web api to get the tree cover data and import the data onto the map.

    However, it would be a very simple addition to allow importing a color-coded image from your machine where each color is assigned a variety of tree. The workflow would be something like:

     1. Select an Image from your machine.
     2. Select a Tree from a drop-down list for each distinct pixel color.
     3. Import!

     

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    woah, this is so slick, I didn't realize it was pulling that data layer down.  What you've made already seems excellent enough to release.  I've not tested your code in github yet, but it certainly looks like your tests are going great!  Any contribution is greatly appreciated, I hope in my excitement i didn't come off as demanding anything. :)

    Ahh very cool, I do have info-terrets sometimes, it just pours out lol... so you obviously know quite well this region is pretty epic with foliage.  Are you using the Unlimited Trees mod too?  Tree's is the only limit ive hit so far, its worth it and hasn't dragged my system unless i make it insanely dense with high tri trees, I had to test it until it started to break :D 

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    ^ Unlimited Trees is a must.. My Frankfort test imported just over a Million trees at three trees per pixel. Asheville may push the 2 Million limit at the same density setting. That's something I've thought about warning against during the setup or import process.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Indeed it is very dense here, there is a nominal amount of agriculture & city which reduces coverage tho.  Im doing a couple different Asheville Maps, and modeling some of our local architecture.   Another bit of history, this is where the first American "sustainable" forestry was formed thanks to Vanderbilt's (Of Builtmore estate, yes im modeling it!) efforts, he found the region had been clear cut so veraciously (like the rain forests of today) it inspired him to change things, his work would later add to the improvements in how well all of America tends to its forests.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    wow that looks amazing!!!! ...nearly impossible by hand because its so easy to go too thick in spots, but your mod does the job perfectly, great density, and the empty spaces are perfect.  I have  a few asheville maps but none with perfect tree cover yet, wasnt planing on releasing them until I wrap up the builtmore a few other bits, plus using your mod is a must now hahaa!  Id test it out if you released it :)

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    3 hours ago, Mr_Maison said:

    Ok.....Now I have to make some trees with lower tri counts just for this. This is awesome!!! Looking forward to it on the workshop.

    Yes, I was contemplating this topic recently, im thinking another few tree types, for densities sake, any number (or none lol) of trees could be made in each style.

    Style 1, Canopy Trees -has a lot less lower branches, more of a canopy effect, maybe have vines reaching up on some.

    Style 2, Tree Clusters -a small to medium arrangement of trees and/or ground covering as one tree, the thickness of them could mean alphas for the trunks on some of them.  Wind effects might make this one weird, though hopefully not.

    Style 3, Clipping Trees -what if some trees dumped mesh when clipping with another tree or building?  Seems odd & difficult but im interested in clipping, even if only visual, for my giant greenhouses being modular against themselves, and also the plants within.

    Style 4, Density Aware Trees -Just like 1 & 3 but instead of collision its measured in density, so the denser the trees become the less lower branches they have. hahaaa  *#%()*@! that seems like it would be difficult!

    Then of course we can still  layer through all the amazing existing trees to mix it up even further. :D 

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    The best we can do now is make trees with low tri counts. Trees with exaggerated canopies and clusters are possible and may be the best solutions until we get more tree type support from CO. I'll see what I can do.

    • Like 4

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    oh you do so amazingly, im sure you'll have some before me, i had planned on a few trees but man i have made a big list in front of them, not to mention they're challenge in and of themselves! eg... ill have to learn to make foliage first then try some lol, and if they're not total $%&^! share them lol.

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Pease help!!!!!

    I've been stuck in a rut trying to add a simple dropdown list that lets the user select which tree they want to use for the import, and I'm not sure how to figure out what's going on. I'm getting the following error message on the Main Menu

    A Mod caused an error [ModException]

    Details:
    System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
      at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
      at System.Reflection.Assembly.GetExportedTypes () [0x00000] in <filename unknown>:0 
      at ColossalFramework.Plugins.PluginManager+PluginInfo.GetInstances[IUserMod] () [0x00000] in <filename unknown>:0 
      at ContentManagerPanel.RefreshPlugins () [0x00000] in <filename unknown>:0

    It only occurs after I add the following property to my TreeMapperUIPanel

    UIDropDown treeDropdown;

    I'm initializing it using the following, but I'm not sure that this code is even being hit in the Main Menu. It is called from the Awake() method override in the TreeMapperUIPanel

    treeDropdown = AddUIComponent<UIDropDown> ();

    Does anyone know why adding these two lines would cause the reflection error? I feel like it's probably an assembly conflict, but there's not even any info in the error about what couldn't be loaded. Is there any way I can tell where the assembly conflict is?

    This is a blocker to being able to release, so any help would be appreciated. In the meantime, I'll keep doing what I can to track it down!

    Thanks!

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Are you familiar with SamSamTS' UIUtils library? It contains a lot of helpers to quickly set up various controls (dropdown included) with just one function call, and it saved me a ton of time when working on my own mod. Many modders already use this library, so it's included in many mods: here's a link to the script used by the Building Themes mod: https://github.com/boformer/BuildingThemes/blob/master/BuildingThemes/GUI/UIUtils.cs
    I'm not sure it will fix your problem, but in any case it won't hurt if more modders use the same libraries, so I highly recommend using it.

    On a related note, I recently completely moved away from dropdowns and replaced them with FastLists instead (example): they're a bit more tricky to implement, but much more user friendly. The code for FastLists can also be found in the Building Themes repository, although ultimately I found the one used in the Advanced Vehicle Options (also by SamSamTS - link) to be a better starting point (I'm a web developer by 'nature', and Unity's approach to user controls left me scratching my head on more than one occasion).

    • Like 2

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    ^ Thanks for the suggestion, Judazzz. I would definitely be up for using tools created by other developers, especially if they work well and give a better user experience. I will give this a shot and let you know when I get past this current road block.

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    16 hours ago, Marcia Cemin said:

    I could not use this mod. Can someone please help me?

    The mod has not been "officially" released, so you won't see it on the workshop yet. It is open source, and the progress so far can be seen at https://github.com/madtony26/TreeMapper

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    How are you compiling your mod? Visual Studio?

    Make sure that .NET Framework 3.5 is selected in the compiler options.

    • Like 2

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    5 hours ago, boformer said:

    How are you compiling your mod? Visual Studio?

    Make sure that .NET Framework 3.5 is selected in the compiler options.

    ^ That was it.. Danke, boformer!

    I am compiling in Mono, but switched to 3.5 and it started working again. I should be able to move forward again.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    14 hours ago, madtony26 said:

    ^ That was it.. Danke, boformer!

    I am compiling in Mono, but switched to 3.5 and it started working again. I should be able to move forward again.

    Yay! :D this mod is uber exciting!

    Oh and thats interesting about mono, I hadnt realized there were other ways to compile, I must look into the mono thing too.

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    32 minutes ago, Macronomicus said:

    Yay! :D this mod is uber exciting!

    Oh and thats interesting about mono, I hadnt realized there were other ways to compile, I must look into the mono thing too.

    I've been meaning to get VS 2015 Community working, but haven't gotten around to it yet. In the meantime, Mono has been good enough for a small application like the one I'm developing. Mono is very similar to visual studio, but it will also allow you to build for multiple platforms including windows, android, and ios (yes, you can use mono to write ios apps in c#, but need a mac to compile)

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Very interesting, ive just been reading up on it, would you say either one has better command line functionality than the other?  I've tinkered with VS 2015 a bit, but ill give Mono a whirl at some point too, one of the main reasons im getting into modding this game is I want to learn c# in fun ways.  :D

    10 hours ago, madtony26 said:

    I've been meaning to get VS 2015 Community working, but haven't gotten around to it yet. In the meantime, Mono has been good enough for a small application like the one I'm developing. Mono is very similar to visual studio, but it will also allow you to build for multiple platforms including windows, android, and ios (yes, you can use mono to write ios apps in c#, but need a mac to compile)

     

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    It does not really matter which IDE you use. All of them are outputting dlls which can be executed by mono on Windows, Linux and OSX (the game uses a .NET 3.5 compatible mono runtime).

    Both can compile unsafe code, which is important for the detour technology.

    The game itself can also compile mods. You just have to place the cs files in the Source directory inside the mod directory. It also uses a mono compiler with unsafe code disabled.

    Personally I'm using VS with ReSharper. It provides a lot of useful hints, code autogeneration and the newest C# features.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I use Visual Studio 2015 Community - which doesn't seem to look/function much different compared to the Enterprise version I use at work, at least not within the scope of mod building - but with a heavy heart I had to get rid of ReSharper once the trial ran out (I really love it, but I'm not going to cough up hundreds of bucks for what essentially is a hobby project for me - same why I use Community instead of Enterprise).
    Getting set up was easy enough, btw: after the setup was complete it took about 15 minutes to get C:SL solutions up and running, including the Colossal/Unity assemblies and outputting the compiled code to the local mod folder.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Thanks for the insights guys, the VS ide is rather nice, I like how it can be tailored for c#. 

    I only ask because I tend to like command line quickness, truthfully ive been spoiled by the Drupal community which has tons of its own CLI goodness, its quite handy :)

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Well, if you really miss the CLI, you can always install the Git Command Line tool ;) 

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    3 hours ago, Judazzz said:

    Well, if you really miss the CLI, you can always install the Git Command Line tool ;) 

    oh yea, i love it! git-bash is great, I use it all the time in developing websites, I use git & other tools to version control my drupal websites, instance & branch them etc etc.    Windows command line is not so bad anymore either, but I still prefer linux cli because im much more familiar, at least from a server version that is, not so much desktop.

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections