Search Unity

Map Magic World Generator - a node based procedural and infinite game map tool

Discussion in 'Assets and Asset Store' started by Wright, Mar 10, 2016.

  1. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    Thanks, fixed for the next version.

    Sure, Mr-Logan pointed the right checkbox.

    You can blend your heat noise with the simple form gradient so that southern areas would be hotter than the northern ones (or vice versa). Also it would be useful to blend-in inverted heightmap then to make elevated areas colder.

    And speaking about Whittaker Diagram: I plan to add some functions (aka node presets) in v2, and Whittaker diagram will be among them.

    MapMagic can generate an infinite terrain, but it does not mean that your game world have to be infinite too. You can limit your game world with colliders or scripts, this way MM will still generate the terrain, but it will be unreachable, the background. And the game area could use heat gradients and other non-repetitive stuff.
     
  2. Cosmoraph

    Cosmoraph

    Joined:
    Jan 25, 2017
    Posts:
    52
    Yes. My project is proceeding a finite map based on your method. I do not want to break out of the basics of MapMagic. Because it is a very good feature. I am using a modified MM for my game.(I have many custom nodes.)

    But I want you change to 'Partial Class' most of the scalable classes. currently, I converted the classes(noise, matrix, etc) to partial class each every time update. or 'private' change to 'protected' for 'overwride'. I hope MM's code is easy to extend. In fact, this is a request for my convenience so if you don't like it, you don't have to.
     
    Last edited: Apr 25, 2018
  3. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    92
    Ideally I would like to find a way to implement those things and get realistic world generation. Map magic doesn't need to have built in features for handling these features it just needs to be able to import the temperature and humidity maps from the script that does. But I don't know how to make a script that converts this information into a pair of two color maps and haven't seen a plugin for it on the workshop so that would be a later feature of the game. I also plan to eventually take other things such as the planet's distance from the sun into consideration which would globally impact the temperature and shift the positions of biomes.

    that is awesome I didn't think rain shadows was a thing that map magic could do. I'm going to need that custom node.

    Oh so if I'm patient my vision will be even easier in version 2. ok.
     
    boysenberry likes this.
  4. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,595
    can anyone tell me, what is going to be in MM2?? What is going to be different improved compared to 1?

    Thanks!
     
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    Extending already existing classes by making them partial is usually a bad practice, as well as using their private variables. All of the private part could be changed, and in worst cases it could change the way private values work without changing their names and types. This will make your code compile, but it will not work properly. It's a rare case, but you can expect it from any class in any update, your code will not be guaranteed to work right. It will take a lot of time and will hit your nerves to find such issues.

    So you have the script that generates these maps? What is it's output format?

    Here are the new big features that are planned for MapMagic 2:
    • All nodes will be resolution-independent: you can switch the resolution and get the same result, but more (or less) detailed.
    • Functions: the biomes with inputs, outputs and values exposed. Now you can use other graphs as presets, or, in other words, create your own nodes without scripting using the way you create graph. I'm going to make the video soon.
    • Low-res previews: terrain placeholders that will be generated way faster to be displayed at far distance (in playmode too)
    • Extra margins: each chunk will generate a border area of the neighbor chunk to improve the seam masking.
    • Native C++ generators in editor (erosion, noise, forest - Mac and Win editors only). Beta will have only erosion node written in C++. It works up to 5x times faster in editor.
    • Height, splats, objects inputs: MapMagic as an editor tool - you can sculpt the terrain manually and then let MM texture it or place objects. Or place objects and automatically create grass around them. Not sure that that they will work stable in beta, so they could be disabled at least in first beta release.
    • Partial lock: will lock only one output type, while others will generate. Works together with Inputs.
    • Splines support. New type of objects to make roads, rivers or other spline objects. Will be experimental in initial MM2 release just to find out what community expects of splines. Initially it will have just a couple of nodes, and will be extended with every new release. Will not be included in first beta release.
    You can get access to MapMagic 2 in it's current state at GitLab now (email me your order number to get an access). And I plan to release a public MM2 preview version (some sort of evaluation version) in early May.
     
    antoripa, sfoust, boysenberry and 6 others like this.
  6. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    92
    no it's a hypothetical script that doesn't exist yet but once it does I will be using it.
     
  7. RektDad

    RektDad

    Joined:
    Apr 17, 2018
    Posts:
    5
    Is MM2 a separate Asset Store purchase? In other words... since I purchased MM1, will I be eligible for MM2 at no cost, or will I need to pay for it separately? (sorry if my question is silly, I don't typically use Assets)
     
  8. dimych1990

    dimych1990

    Joined:
    Apr 23, 2014
    Posts:
    6
    Was just about to ask the same.
     
  9. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    92
    woot!
     
  10. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,595

    Thanks Denis, sounds exciting, I like the biomes change and the sculpt terrain, something every tool is missing or doing in a odd way. So looking forward to this.
     
  11. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Why only in editor ?

    [QUOTE="Splines support. New type of objects to make roads, rivers“[/QUOTE]

    I really waiting for that one! To make road or river, the spline need to conform to the terrain.
     
    recon0303 likes this.
  12. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    114
    Great features and I´m looking forward using them !

    I thought about one more feature for a future release: Lately I have a lot of different groups and s"subgroups" of plants to generate. For performance and testing purpose, I need to switch the render output off several different groups on and off a lot. After a while this starts to get annoying so it would be nice to have one main power switch to activate either the object output (or activate entire groups ?). I made a picture:



    Would somebody else find this useful ? Thoughts @Wright ?
     
  13. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    92
    I didn't realize that wasn't a feature yet. I can imagine how bad that could potentially get
     
  14. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,060
    I gotta ask.. I have "big rocks" that are 200m +/- in size that I am currently placing at one per terrain(1km^2) because they seem to not place at all if I turn the scatter less than 1, though in the MM docs I'm pretty sure Denis uses 0.5 in his village stuff. I would prefer that they actually go more like one per 2-3 terrains, ie: scatter of 0.3 or so. Is that not possible or am I just doing it wrong?
    Do other people use MM in this capacity?

    One even more difficult problem I would still have is my distant terrains. One point of interest is a large tower with bad guys and loot. My game world renders "distant terrains" or low resolution fakes using a second MM instance to create the illusion of a big world.
    2018.04.27-view.jpg
    You can see 4-5 distant towers in this screenshot, the most obvious being on the horizon above and to the right of the player (small black square). That's probably 10-12 kilometers away. The problem is, if I were to try and generate these as well using scatter, the low res version of the terrain (a separate MM graph) would have to be generating the exact same scatter/output data. That's easy with height and splat because it's noise based, but what about object output? If I were able to use a scatter value of say 0.1 what would I need to do to ensure that the scatter results are the same for both graphs?

    Going to see if I can get something working...

    edit: ok well.. I always figure things out when I take the time to write a proper question up.. why I do it I suppose =] I'm finding that setting scatter density to 1, but the constant input to 0.5 works... see if I can reproduce similiar results on different graphs now..

    edit2: ok I just solved another problem. When scatter density is 1 is always goes straight to the middle of the terrain creating very uniform results. Instead of a constant 0.5 and scatter density 1.0, constant 0.05 and scatter density 10 creates room for random placement.
     
    Last edited: Apr 28, 2018
  15. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    114
    None that I know off, at least :)
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    Didn't make myself clear: it will work in PC or Mac builds, but only those that were made with PC or Mac editors.

    You can use a switch custom node for that. It selects one of two inputs and pass them to the output. If the state is "on" the first input is used, if it is "off" then the second one is taken as an output.
    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using MapMagic;
    6. [System.Serializable]
    7. [GeneratorMenu (menu="Custom", name ="Input Switch", disengageable = true)]
    8. public class InputSwitchGenerator : Generator
    9. {
    10.     //input and output properties
    11.     public Input inputOff = new Input(InoutType.Map);
    12.     public Input inputOn = new Input(InoutType.Map);
    13.     public Output output = new Output(InoutType.Map);
    14.     //including in enumerator
    15.     public override IEnumerable<Input> Inputs() { yield return inputOff; yield return inputOn; }
    16.     public override IEnumerable<Output> Outputs() { yield return output; }
    17.     public bool on = false;
    18.     public string tag = "Switch";
    19.  
    20.     public override void Generate (CoordRect rect, Chunk.Results results, Chunk.Size terrainSize, int seed, Func<float,bool> stop = null)
    21.     {
    22.         Matrix m = null;
    23.         if (!on) m = (Matrix)inputOff.GetObject(results);
    24.         else m = (Matrix)inputOn.GetObject(results);
    25.         if (stop!=null && stop(0)) return;
    26.         output.SetObject(results, m);
    27.     }
    28.  
    29.     public override void OnGUI (GeneratorsAsset gens)
    30.     {
    31.         layout.Par(20); inputOff.DrawIcon(layout, "Off", mandatory:true); output.DrawIcon(layout, "Output");
    32.         layout.Par(20); inputOn.DrawIcon(layout, "On", mandatory:true);
    33.         layout.Field(ref on, "On");
    34.         layout.Field(ref tag, "Tag");
    35.     }
    36.  
    37.     public static void Switch (string tag, bool on)
    38.     {
    39.         foreach (InputSwitchGenerator gen in MapMagic.MapMagic.instance.gens.GeneratorsOfType<InputSwitchGenerator>())
    40.             if (gen.tag == tag) gen.on = on;
    41.     }
    42. }
    43.  
    44.  
    The main thing is that it could be controlled with scripts using the generator's custom tag like this:
    Code (CSharp):
    1. InputSwitchGenerator.Switch("GreenGrass", true);
    There's a feature request on GitLab somewhere, so you can expect density below 1 in a final MM2 version. For now low-density mask it the only workaround.
     
    Last edited: Apr 28, 2018
    blitzvb likes this.
  17. dreyn74

    dreyn74

    Joined:
    Mar 10, 2017
    Posts:
    14
    Still trying to recover a Map Magic Scene that became unusable after a Unity update, but I'm getting this error is happening when I simply move the mouse over the properties window.
     
  18. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    Unfortunately I could not restore the graph from the Unity scene. It seem to contain the pinned land only. Have you overwrote the scene file after the issue occured?

    If you don't mind, I'd like to prevent such issues in future. To do so I badly need the most detailed description of what had happened, what were you doing before and after the error. Could you try to reproduce it yourself?

    (sorry for duplicating the answer via email)
     
  19. Djayp

    Djayp

    Joined:
    Feb 16, 2015
    Posts:
    63
    The major usecase I have with splines is getting good results with R.A.M., didn't try a lot since I had a lot of work, but I'd love to be able to get realistic (or simply procedural, since it's already a lot) rivers at runtime.

    Is there any work around the Vegetation Studio node ?

    Already really happy with MM btw ! Thank you !
     
    blitzvb likes this.
  20. dreyn74

    dreyn74

    Joined:
    Mar 10, 2017
    Posts:
    14
    This error is now occurring when I try to add objects in a Map Magic Biome.
    Unity version 5.5. Map Magic version: latest release.

    And when I reopen the scene this warning appears:
     
    Last edited: Apr 30, 2018
  21. Cosmoraph

    Cosmoraph

    Joined:
    Jan 25, 2017
    Posts:
    52
    Yes. That's what i said.
    The more you pursue a reality, you must first create a finite World Map and set the T/H.
    your Mapmagic have reads the T/H like the 'rawInput' node for creates a Matrix.
    So, in Mapmagic, you only need to create a custom node that reads the T/H map.
    asd.png

    I referred here.

    As I was not a programmer, I couldn't even think of that part. I understand that your answer is a design for knowing the warning to extra development. Thank you for the details answer.

    P.S. I'm a non-English speaking Buyer. used Translator.
     
    Last edited: Apr 30, 2018
  22. dreyn74

    dreyn74

    Joined:
    Mar 10, 2017
    Posts:
    14
    I downgraded to Unity 5.5 because of the Standard Assets bug, and Map Magic was working well, for the most part. Now, updated to Unity 5.6 by your suggestion, but the same error is there when I open the same scene(which has been updated).
    [/QUOTE]
     
  23. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    115
    @Wright, will it support mixed resolutions? Example: finite map with 4x4 high resolutions terrains in the center, surrounded by some number of low resolutions terrains on the horizon, and then maybe something like Horizon[ON] further out. The game's "mission areas" will be on the high resolution terrains in the center, but the player can move into the surrounding low resolution terrains (or meshes), until they run out of food/fuel/etc.

    Also, what is the best way to completely flatten the outside edges of my terrain group? I'm assuming a RAW input image would be used, but not sure how to completely flatten (no noise, etc.).
     
    Last edited: Apr 30, 2018
  24. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    857
    Do you plan integration with cascade? That does excellent splines and on the surface seems a perfect fit for MM and I know the author there is a fan of MM.
     
    antoripa likes this.
  25. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    Well speaking of recommendations I would rather choose 2017.3 - Unity 5.6 is just the minimum supported version. But I do understand that sometimes it's not possible to upgrade the project.

    Could you please paste the first error? (Could not create texture: File could not be read).

    Yes. This feature will be called "preview terrains". It will create low resolution terrains first (almost immediately), and then generate full-res terrains in a separate thread (video).

    You can use Simple Form adjusted with Curve to mask the terrain at the edges:
    FlattenOnEdges.jpg

    Added it to the list of possible assets to integrate with. Later I will make a poll to find out what assets should be integrated first.
     
    antoripa, secondsight_ and blitzvb like this.
  26. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    115
    Sorry, I didn't make myself clear. I don't want to just preview in low resolution, I want it to always be low...a mix of some high resolution terrains in center and some low resolution surrounding.

    My scenario:
    - not infinite terrains
    -primary game/mission area is high resolution terrains (e.g. 4x4) at center of map
    - maybe 2-3 rows of low resolution terrains surrounding primary area
    - Horizon[ON] in the distance

    I'm guessing there might be some seam blending issues between different resolution terrains.
     
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    I can make the special "pin low-res" mode, but still there would be a seam problem. Why don't just increase the Pixel Error value on low resolution terrains?
     
  28. dreyn74

    dreyn74

    Joined:
    Mar 10, 2017
    Posts:
    14
    @Wright Does Map Magic have an official Discord guild? I think that a guild with separate channels for different Map Magic topics would serve the users of this forum by having more relevant feedback.
     
    malkere likes this.
  29. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,190
    That wouldn't be a problem if he prevent the player to get close, using non playable normal rez terrain as a buffer, I think he want a distant scenery to not feel like the world just end on finite game play area.
     
  30. broesby

    broesby

    Joined:
    Oct 14, 2012
    Posts:
    112
    I cannot figure out if MapMagic is compatible with MicroSplat (not MegaSplat) - I need to know before I buy ;)
     
  31. dreyn74

    dreyn74

    Joined:
    Mar 10, 2017
    Posts:
    14
    Maybe you did not understand why my Map Magic scene was corrupted. I was using the latest version of Unity for my Map Magic scene, and, after I added the Standard Assets' FPS controller, saved and closed the scene, I returned later to open the scene and the Map Magic nodes were gone.

    I am not using Unity for any projects. It's not suitable for my needs. I just use it for terrain editing.

    This issue does not occur in Unity 5.5 or 5.6.
     
  32. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    I'm not a frequent Discord user, but if you'd like to I can start a server: here. I will fill it with channels after a while. Will see how popular it will be.

    You can use any terrain shader on pinned terrains - but, unfortunately, there's no way to use MicroSplat with the dynamic (infinite) chunks out of the box. Only MegaSplat.

    Could you reproduce this issue? Just tried adding the standard FPS controller using Unity 2017.3.0f2 and everything seems to be OK.
    Can you open the demo scenes? Just wonder if it was the only scene broken after installing FPS controller.
     
  33. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    115
    I've never been very happy with high pixel error because of the popping that occurs when flying over the terrain. It does improve the FPS performance a lot, but doesn't look good. Horizon[ON] is really nice looking, but visually it doesn't match my terrain shader well enough where it meets the terrain (also: can't use terrain trees and grass, etc.)

    The infinite terrain in MM is great, but isn't working well for my flight game - too much of a performance hit when generating far out. Maybe the new low-res preview will help that, but I still think it would be useful to only show low-res terrains in certain areas.

    The problem of horizons and/or infinite terrain has always been a challenge in game development and it seems like MM could solve that for some scenarios with a few tweaks to the existing features - like support for mixed terrain resolutions and settings. Maybe this would be two distinct settings for pinned terrain vs. infinite terrain and/or your idea of pinning in low-res mode.

    If there was an interface for high-res settings and a low-res settings, then I could at least generate two types of terrain using MM. Regarding the seam issue between high and low-res terrains, I would think the high-res wouldn't have a problem matching the low-res. So, I could pin a 6x6 group of high-res terrains (main game area), surrounded by one or more rows of pinned low-res terrains to transition to the horizon or to infinite low-res terrains that are sparsely decorated with trees, grass, rocks, etc.

    Just ideas.... :)
     
    Last edited: May 2, 2018
  34. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    I guess making some "preview range" setting could solve the problem. This will generate preview terrains in a distance, but will not force them to generate full-res unless they are within "generate range". But the only problem that bothers me is the seam issue.
     
  35. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    199
    If you're already generating extra margins on the borders, can't this be used to blend the low resolution/LOD/preview terrain chunks with the high res ones? Or are you talking about blending with horizonON-type of stuff?

    I assumed the low res LODs would have an associated generate range, otherwise for large draw distances you're going to have a huge back-log of terrains to generate at high resolution? Unless you're distance-prioritizing chunks? Having an LOD generate range would also generally help players on older systems as we could raise/lower the range accordingly.
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    I don't want to use margins with the preview terrains because they should be generated fast. When using minimum 8-pixel margin with the 512 chunks it will have 6% overhead, but when using them with 32-pixel previews will make them generate two times slower. But I can try welding the border vertices to see if it will look fine and work fast.
     
  37. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    199
    I see. I guess if they're far enough in the distance, the chances you'll see a seam will be slim anyway? Maybe try pushing the edge vertices down as you do in Voxeland perhaps? Or welding as you suggest :) Can't wait to try it!
     
  38. HP

    HP

    Joined:
    Nov 20, 2012
    Posts:
    55
    @Wright

    1. Can you add the following lines to VegetationStudioOutput.cs method CheckAddComponent(Chunk chunk) to support this settings of your MapMagic script in the VegetationStudioSystem? Otherwise this settings of the VegetationStudioSystem are alway reset on each rebuild in MapMagic.

    Code (CSharp):
    1. vetSys.SetVegetationDistance(MapMagic.instance.detailDistance);
    2. vetSys.SetTreeDistance(MapMagic.instance.treeBillboardStart - MapMagic.instance.detailDistance);
    3. vetSys.SetBillboardDistance(MapMagic.instance.treeDistance - MapMagic.instance.treeBillboardStart);
    2. It would be good to have a Checkbox in the VegetationStudioOutput GUI to automatically add the "CTSWeatherController" Component of Vegetation Studio instead of adding this component to the MapMagic GameObject and check "Copy Components to Terrains".
    The reason why this would be good is that this component on MapMagic GameObject logs the Info message "CTS Weather Controller must be connected to a terrain to work." multiple times on runtime.

    3. Is it possible to add an position offset to trees for Vegetation Studio with any MapMagic node or can you add the "Position offset" of a Vegetation Item of Vegetation Studio? I have some trees on slopes where the half tree trunk is outside of the terrain.
     
    blitzvb likes this.
  39. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,149
    @Wright I can give you full help to extend the node and get meshes and shader from Cascade. I currently use Map Magic for terrain generator.
     
  40. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    857
    Does the infinite terrains work with RTP terrain shader @Wright ?


    Awesome @antoripa ^^^^^ :)

    Mapmagic with Cascade and VS integration will complete Outdoor environment creation for me.
     
    antoripa likes this.
  41. Southroner

    Southroner

    Joined:
    May 29, 2017
    Posts:
    4
    Just chiming in as a long-time map magic user to say that the features I'm most looking forward to in MM2 are the terrain previews due to the possibility of quick generation of low detail horizon terrain (splines will ve very nice as well of course!). This has been a feature I've been hoping for for some time. Thanks for all your hard work and continued support of this asset, Wright!
     
  42. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    25
    Bought MM a while back but just now starting to explore it. Took me about a day to start understand how it works but I'm really digging it so far.

    Question: The game I want to do has super tall sparsely scattered towers that the player can see on the horizon (maybe only one or two could be seen from any one location). These would be far beyond the generated terrain.

    My first thought is to code in a second tile distance value which only draws "horizon" type objects.

    Any ideas thoughts on how to approach this or alternative ideas? Just asking to see if anyone has already found a solution for such a thing or can give an educated guess as to were to start.
     
    Last edited: May 7, 2018
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    I was thinking of exposing these settings in generator but using common settings is more elegant solution. Thanks!
    Weather controller will be added too, however I'm not sure if I will release new 1.9 version for that or it will be added in 2.0

    Thanks! I'm a bit busy with MM2 yet, but once it's done I will consider integrating Cascade first

    Sure, you've got to use Custom Shader Output node for this.

    It's nice to hear that I'm doing a good job, thanks!

    If you have the fixed towers positions (i.e. they should not be scattered dynamically) you can place these towers outside MM and this way they will not be hidden. You can then pin terrains underneath and make the manual changes to make the tower fit in the terrain it's standing at.
     
    AndyNeoman and antoripa like this.
  44. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,149
    sounds good ..I have even many requests at my end about integration with your tool.
    Yeah . of course when MM2 is pretty done ...
     
    AndyNeoman likes this.
  45. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    25
    Thanks for the reply. It'll eventually be a location based GPS type game. So they would need to be scattered dynamically. So with that in mind, has anyone done any work toward dynamically created objects on the horizon yet?

    Don't want to reinvent the wheel if there is one.
     
  46. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    The problem is that you can't generate anything without creating a chunk. How complex should be the algorithm for scattering thee towers?
     
  47. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    25
    Yes, I've seen reference to chunk independence and it being a key part of MM's fast performance.

    Since I'm wanting to allow players to travel to the base of these distant towers, my initial thought is to:
    • Create a lightweight horizon object generator node that only calculates if the object (tower) exists in the chunk and if so what its horizontal location is (I'm willing to live with a specified vertical position so terrain height won't have to be considered).
    • Extend the tile (chunk) draw and trail distance system (the one that decided when to draw or remove chunks depending on camera position) to include a "horizon distance" value for which only the horizon object generators are considered (in other words, evaluate chunks further away to see if any horizon objects (my towers) should be drawn out there).
    Again, this is just my first thought toward what I'm hoping can be accomplished. With out knowing anything about how MM works under the hood, this could be totally naive approach.

    If what I'm hoping for is possible what's the best approach. And if anyone has already create a game where players are able to travel to distant objects, what was their solution?

    Any pointers greatly appreciated.
     
  48. shawnepdmartin

    shawnepdmartin

    Joined:
    Jul 27, 2015
    Posts:
    45
    Help! I want to use the Vegetation Studio output node, but it doesn't work.

    It keeps erroring with this message:

    Code (CSharp):
    1. Error generating chunk: MapMagic.Coord x:0 z:0: System.ArgumentOutOfRangeException: Argument is out of range.
    2. Parameter name: index
    3.   at System.Collections.Generic.List`1[AwesomeTechnologies.VegetationItemInfo].get_Item (Int32 index) [0x0000c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633
    4.   at MapMagic.VegetationStudioOutput.Process (CoordRect rect, MapMagic.Results results, MapMagic.GeneratorsAsset gens, Size terrainSize, System.Func`2 stop) [0x000b4] in C:\Unity Projects\vs\VegStudio\Assets\MapMagic\Generators\VegetationStudioOutput.cs:138
    5.   at (wrapper delegate-invoke) MapMagic.Action`5<MapMagic.CoordRect, MapMagic.Chunk/Results, MapMagic.GeneratorsAsset, MapMagic.Chunk/Size, System.Func`2<single, bool>>:invoke_void__this___CoordRect_Chunk/Results_GeneratorsAsset_Chunk/Size_Func`2<single, bool> (MapMagic.CoordRect,MapMagic.Chunk/Results,MapMagic.GeneratorsAsset,MapMagic.Chunk/Size,System.Func`2<single, bool>)
    6.   at MapMagic.GeneratorsAsset.Process (CoordRect rect, MapMagic.Results results, MapMagic.GeneratorsAsset gens, Size terrainSize, System.Collections.Generic.HashSet`1 changedTypes, System.Func`2 stop) [0x002c4] in C:\Unity Projects\vs\VegStudio\Assets\MapMagic\Main\GeneratorsAsset.cs:490
    7.   at MapMagic.GeneratorsAsset.Calculate (CoordRect rect, MapMagic.Results results, Size terrainSize, Int32 seed, System.Func`2 stop) [0x0001e] in C:\Unity Projects\vs\VegStudio\Assets\MapMagic\Main\GeneratorsAsset.cs:234
    8.   at MapMagic.Chunk.ThreadFn () [0x0005b] in C:\Unity Projects\vs\VegStudio\Assets\MapMagic\Main\Chunk.cs:224
    9. UnityEngine.Debug:LogError(Object)
    10. MapMagic.Chunk:ThreadFn() (at Assets/MapMagic/Main/Chunk.cs:227)
    11. MapMagic.ThreadWorker:ThreadFn() (at Assets/MapMagic/Main/ThreadWorker.cs:533)
    12.  
    It won't create the input options, it won't let me choose a different profile. Basically useless like this. What's going on?

    Tried this on 2017.3 and 2018.1
     
  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,596
    sfoust, I guess it will be easier to scatter the towers first with a custom script, generate the heightmap around them with MM and place them according to this heightmap at a specified height.

    A custom node to input the towers coordinated to MM could be used if you want to adjust the the land around. No, that should not cause an infinite loop as long as the custom node does not read towers' y position.

    shawnepdmartin, can't reproduce this issue. Just tried MM 1.9.1 with VS 1.3.0 in Unity 2017.3, and everything seems to be working as expected. Does this error occur in a clear project, with only MM and VS installed?
     
  50. shawnepdmartin

    shawnepdmartin

    Joined:
    Jul 27, 2015
    Posts:
    45
    Yes, I'm using 2018.1 though