Search Unity

Assets [Outdated thread] Map Magic

Discussion in 'Works In Progress' started by Wright, Jul 29, 2015.

?

Vote for the plugin name:

Poll closed Feb 25, 2016.
  1. Map Magic

    5 vote(s)
    71.4%
  2. Map Magic Editor

    1 vote(s)
    14.3%
  3. Magic: Map Editor

    2 vote(s)
    28.6%
  4. Magic: Map Designer

    0 vote(s)
    0.0%
  5. Magic Editor

    0 vote(s)
    0.0%
  6. Magic: Land Editor

    1 vote(s)
    14.3%
  7. Land Magic

    1 vote(s)
    14.3%
  8. Terrain Magic

    0 vote(s)
    0.0%
  9. Level Magic

    0 vote(s)
    0.0%
  10. MagicLand

    1 vote(s)
    14.3%
Multiple votes are allowed.
Thread Status:
Not open for further replies.
  1. totallylegitunicorn

    totallylegitunicorn

    Joined:
    May 11, 2016
    Posts:
    14
    I've seen two threads for MM, so not sure which one to really utilize the most but I'll post on this one.

    Disclaimer: We are using the current beta, 5.4.0b22, which in itself probably is the issue (we need to use this version for the Valve VR renderer & the collaboration beta option).

    We have found that the node editor will lock up when we interact with it at random times. An example is when we load a new raw input, even if it is not connected to any other nodes. We can sit for 30-45 seconds waiting for it "unstick" itself and when it catches up, any random clicks that we did before we realized it was frozen, would be processed, leading it to freeze up again. This wasn't the case with the evaluation version on Unity Beta.

    Another issue is we get this error when we load the demo scenes that are included.

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[MapMagic.Serializer+SerializedObject].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    MapMagic.Serializer.Retrieve (Int32 num) (at Assets/MapMagic/Main/Serializer.cs:238)
    MapMagic.MapMagic.LoadOldNonAssetData () (at Assets/MapMagic/MapMagic.cs:830)
    MapMagic.MapMagic.OnEnable () (at Assets/MapMagic/MapMagic.cs:385)
    UnityEditor.DockArea:OnGUI()

    *EDIT*

    This error is also display each time we open the node editor for the first time (pressing "Show Editor" Button

    InvalidOperationException: Operation is not valid due to the current state of the object
    System.Collections.Stack.Peek () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections/Stack.cs:321)
    UnityEngine.GUILayoutUtility.EndLayoutGroup () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:289)
    UnityEngine.GUILayout.EndVertical () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:317)
    UnityEditor.EditorGUILayout.EndVertical () (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7048)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1245)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1030)
    UnityEditor.InspectorWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:352)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


    Hopefully it's something ridiculous that I am overlooking and not that it's the Unity Beta (Grrr.)
     
    Last edited: Jun 26, 2016
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Yeah, setting a texture with a string might be the solution. I think that it's better to use MaterialPropertyBlock instead of Material, but in general I like the idea.

    That's an old thread from the times when MapMagic was was not yet released, but it's ok - since this thread is still alive I periodically monitor it.

    What is your RAW file resolution?

    Looks like your demo scenes were not updated with the rest of the plugin. Try making a clean install by removing the MapMagic folder and importing it again.

    This error is the weird one. It does not have a link to any of the MapMagic scripts. It starts in Unity and leads to Unity itself. I have tested MapMagic with Beta 20, maybe they changed something in Beta 22, but it's unlikely - EditorGUI and IMGUI are the relics that do not seem to be changed for lots of versions.
    Does this error occurs in a clear project?

    Btw EditorGUI.cs has over 7048 lines of code... What a monster compared to any asset on the Asset Store!
     
  3. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    994
    I need our trees to be objects, so I combined the Objects Generator and Forest generator to make my own "ObjectForest" generator (not using any of the two other generators). (Will also be looking to split it up later to define seperate object groups more easily.)

    However, since the update to 1.3 somehow my generator doesn't work anymore. I fixed the obvious compile errors with layout etc. Would you have any idea how/why it could be broken otherwise?
     
    Last edited: Jun 28, 2016
  4. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Would you mind send me the generator code or post it here?
     
  5. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    994
    Sure thing, here's two generators, it's all about the second one:

    I see that its adding 1000+ instances, but I dont see any objects popping up:
    ObjectForestGenerator - http://pastebin.com/jHZpygpV

    BTW: is there a list of community generators..or do you take requests/community generators?
     
    Last edited: Jun 27, 2016
  6. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    994
    I think i found why the 1.3 update broke it: it kept purging after spawning my custom objects.
    It purges all objects because there is no default ObjectGenerator, see source:

    Above I hacked in my own spawner instead of the default Objectspawner.

    However, we would need some way to extend upon the default objectspawner instead. How would you suggest we extend upon this?

    Having 1 big list in the Objects generator doesn't seem very workable/scalable. (We want groups for trees/rocks...possibly even spawnpoints for NPCs)
     
    Last edited: Jun 28, 2016
  7. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    131
    yeah I will add something about trees as objects (i am using it too).

    I would prefer multi objects outputs - like 1 for trees (or more for trees - bushes, leaf trees, evergreen...), one for stones, one for idk mushrooms... whatever. It could be instantiated under one new parent transform (might still remain under tarrain) but then you will be able to simple turn off some things in editor. Also it would be much nicer in your chart map to dont have one massive object output feeded by many splitters and portals.

    Conclusion: So I am also for allowing multiple object outputs with new parent for that group under terrain :)
     
  8. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    MikeHergaarden, I've looked through the code and at the firs glance could not find the main thing: what is the difference of your generator from the Objects Output? Why don't you just use it as an output from the Forest Generator, and just assign tree prefabs as an objects?
    Writing a custom Output Generator is not an easy task, and, the main thing, unlike the simple Generator you'll have to change the MapMagic code (and do it with each new version).

    Kusras, I'm going to split layered output structure in several output generators. Each layer will be represented as a separate output generator - and then outputs could be grouped together the way you want. I'm doing it in scope of biomes feature - seems that it is the most straightforward way to implement biomes, but I'm afraid that this system will be even more confusing then the layered one.
     
  9. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    403
    Can we save terrains as a unity terrain? seems If I remove map magic all terrains become useless too! right?
    Is there a way to save terrains on the project? (to use them even after removing map magic?)
     
    Last edited: Jun 29, 2016
  10. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    All the pinned terrains are saved in scene. If you remove MapMagic component (or even all of MapMagic scripts) all the already generated terrains will persist.

    You can save terrain "terrain" data as a separate asset at "path" with something like that:
    Code (CSharp):
    1. AssetDatabase.CreateAsset(terrain.terrainData, path);
    but it's not mandatory - all the terrains are saved anyways.
     
  11. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    131
    Good to hear. I wrote there about other problem... which was whoa really brutal and took me 8 hours to solve... So I am reporting that bug - if you have non-existing path on texture import. Please throw an exception. It something wrote me, but after 8 hours of hopeless try of fix... I moved project on other pc but unfortunately i locked terrain so it did not throw error immediately and then after some time i unlocked it and the terrain flattened and anything in editor was ignored, also it moved coords somehow and it did not throw any error at first. Sometimes later it threw then many exceptions about missing terrain data. So if you get a time, look on it. It may scary someone again in the future....

    P.S. i deleted that post, because it has no sense now.
     
    Last edited: Jun 30, 2016
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Kusras, thanks for bug report! Texture import will be slightly modified (internally) to avoid re-loading texture each generate for each terrain, and btw I'll check if it works properly with a null texture.
     
  13. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    131
    You are welcome. I think the problem was, that I moved whole project, so texture remained somewhere in unity cache for a day. And dunno what everything happened afterwards... black magic :D

    By the way, could you give me a hint, if I want to make brush to add hand-painted details into process. I need raw inputs/outputs. where can I find part about raw input in your asset? I did not realise, that raw format probably will not work with getPixels/setPixels... which i used to work with rgb/rgba... and this could work absolutely different. If it would be useful i can post it there.

    And as I work with grass... I found that grass mostly grow in groups same as trees... so if there would be something like scatter for maps (set n pixels based on input as probability) and expand with falloff... Sorry for too much ideas :D
     
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Do you mean the code of the Raw Input generator or how it should be used? You can find the Raw Input use case here, and the code in MatrixGenerators.cs, RawInputN class.

    You can use the standard Scatter Generator and then stroke them with a Blob Generator - btw it uses falloff curve so that seems to be exactly what you need.
     
  15. totallylegitunicorn

    totallylegitunicorn

    Joined:
    May 11, 2016
    Posts:
    14
    @Wright

    1025 x 1025, should I just keep it at 513 x 513 for everything?

    Oddly this happens with clean installs (and the RAW heightmap with the island demo is missing for some reason, we just whip one up and import it)

    We figured it had to do with the Beta. We will wait it out until the release, which I believe is soon.

    No joke! It's a crazy little bloated beast, for sure.
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    I've asked just to be sure that you are not using something like 8K resolution. Anything less than 2K should work without hiccups, especially 30-40 seconds ones. Could you please send me the scene?

    MapMagic imports raw file into it's internal map format, and saves this map in a scene (or graph .asset file) so there is no need for the .raw file itself. It's just a source.
     
  17. hargisss

    hargisss

    Joined:
    Dec 15, 2012
    Posts:
    1
    Hi! Getting started with MapMagic, and loving every moment of it.
    How do you use the new stamp generator? There's the map input marked Stamp, but whatever I put into it the result is the same: squares around the objects. What sort of input do I need, and what does the input do? Thanks!
    Screen Shot 2016-07-02 at 6.50.07 PM.png
     
  18. Temesis

    Temesis

    Joined:
    Feb 19, 2013
    Posts:
    2
    Hello! Been eyeing this asset for some months now, looks like something that would fit my project nicely.... but I also need biomes. Any estimate when they could be added? Thanks.
     
  19. totallylegitunicorn

    totallylegitunicorn

    Joined:
    May 11, 2016
    Posts:
    14
    @Wright Awhile ago we were having a bunch of weird activity and I never got back to you as we were out of the office. All is well since upgrading to the newest Unity beta, so hurray!

    This question is for all (hopefully I didn't miss the answer to this in these threads):

    I have what seems like an overly complex method of making sure objects don't spawn under sea level, but then I can't spawn anything there.

    How can I restrict object spawning to height ranges? Example: seaweed spawns at all heights under 50, Tree A spawns between 55-100, Tree B spawns 101 and up?

    Every day I am so thankful I came across your engine. It has literally knocked weeks off our project time and has allowed us to focus on combining it into our voxel terrain engine!
     
  20. PaybackTony

    PaybackTony

    Joined:
    Mar 11, 2012
    Posts:
    5
    Count me in for biomes support. I haven't purchased yet as this feature is a must, but I would think the easiest way to do this would be to allow for custom masks (perhaps I paint areas of the overall map for each biome) and have the generators run on those custom masks? So for instance, my desert generators would only be generated on top of my desert mask, rain forest on my rain forest mask, etc. ? Perhaps there is already support for custom masks and I just didn't see it in the tutorial or the running doc you referred earlier in this thread.
     
  21. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    PaybackTony, the biomes feature will make it possible to combine different graphs that are not related with each other. They will use masks, that's true, but you can assign mask into almost any generator now (where does it make sense). Do not consider it as a call to buy MMWG now, if you need a full scale biomes implementation it's better wait a couple of weeks.

    You can make the Split Generator to output only those objects that have a certain conditions. For example, in this case only those trees are used that grow below a certain height level (in 0 - 0.1 height range):

    You can use the same Split Generator for all of the seaweeds, tree A and tree B if they are spawned using the same algorithm (i.e. single input); or use 3 separate Split Generators if they are not.
     
  22. PaybackTony

    PaybackTony

    Joined:
    Mar 11, 2012
    Posts:
    5
    Does this mean MM already supports such masks? Or was that a reference to what will be possible after you release the update that addresses biomes?

    Just being able to run generators based on a mask is all I need. Weather and other conditions are going to be handled in game logic so essentially the only real biome feature needed for me is having different ground textures, trees and grass based on the area of the map.
     
  23. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    131
    yes I think any node can be masked, and that effect is applied only on unmasked areas. Only problem in this version is that you will get very long lists of outputs as you can have only one of each type. So all objects are in list, all grasses... but if you like games with following connections it is possible. And if you will do it with portals it might not be so scareful :D
     
  24. thedailyasset

    thedailyasset

    Joined:
    Jul 16, 2016
    Posts:
    10
    Last edited: Jul 17, 2016
  25. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    PaybackTony, I've got nothing more to add to to that what Kusras said. You can really mask all the generators you like (or at least use the blend nodes to mask the results of several generators at once), but implementing biomes this way will result in a huge and over-complicated graph. So I'm going to simplify this by implementing a more comvenient way to create biomes.

    thedailyasset, congratulations on the first asset review! I'm flattered that you decided to start with MMWG, and pleased to see such positive feedback. I wish you luck with further assets!
     
  26. PaybackTony

    PaybackTony

    Joined:
    Mar 11, 2012
    Posts:
    5
    @Kusras and @Wright Thank you for the information, it is indeed helpful.
     
  27. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    131
    Hi, I forgot to tell you about one missing feature.

    As I had problems before I got editor very slov if I add blank new node without any connection - i get lag for like a minute. I change 1 number and again 1 minute lag despite it is not connected and no computing icon in corner shows. I think it is somehow broken. But i do not want to make nodes again as it is quite complex. Could you please add some export/import for mm, if something crash you can set new clear mm and import just work what you have done, also for example usable for other scenes if you want to make similiar nodes but change only some. You should be able to import your save and change only what you want to change and not making it from a scratch again.

    Thanks for your support.
     
  28. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    The new version (1.4) is out. It brings mostly the bug fixes:
    • object pool duplicating fix
    • further Raw Input lag fix
    • Raw Input now reads r16
    • curve undo
    • copy component to terrain fix
    • Simple Form offset fix
    • Stamp, Blob and Flatten now work on all terrains
    • other minor fixes
    and some new generators:
    • Clean Up Objects - to remove objects with a mask
    • Intensity/Bias - like brightness/contrast in image editing tools
    • Invert - the one from the manual
    Kusras, actually you can export all of your data, a group or a single node by right-clicking on it (or on the empty space in case of all data) and selecting "Save". Then you can load it in the other graph by clicking on empty space and choosing "Load". Note that outputs that already exist in scene will not be loaded.
     
  29. siblingrivalry

    siblingrivalry

    Joined:
    Nov 25, 2014
    Posts:
    384
    Hi,
    Two questions :)

    is map magic going to work with your voxel tool? So that if you already have a world created using map magic, it can be converted to work with your voxel engine?

    Is biome functionality working now?

    Thanks
     
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Hi, I have plans for implementing Voxeland support right after I'll deal with biomes. I plan to start biomes beta in a week or so.
     
    siblingrivalry likes this.
  31. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    403
    It's really magic :eek:

    Anyway, I have a new issue, I need to create tessellation map for "RTP" but as below pic it's need source terrain data but Map magic didn't created any source data. any advice how can I make my maps?

     
  32. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    131
    Ah I have probably older version, but as i do not have downloaded it on new computer(just copied whole project), it did not said, you have published newer version :) And yes in new version it is :) thanks.

    #Crossway that rtp problem, i solved it similiar problem for terrain collider, by some magic combination of creating new terrain manualy and saving it as asset. And maybe by clicking on properties. Do not know what happened but MM and other terrain got connected somehow so that terrain data from my terrain was exactly same as mm data and then I deleted my terrain but connection lasts... thats why it is called map magic :D No, there should be any simple rule, like look into assets folder if there is any terrain data with splatmaps which looks like your on mm. In other case try to create new terrain.
     
    Last edited: Jul 26, 2016
  33. morphex

    morphex

    Joined:
    Dec 18, 2012
    Posts:
    67
    Heya, great asset, quick question though :
    How would I go about making this work with the Relief Terrain Pack ? (RTP?)
     
  34. Goffa

    Goffa

    Joined:
    Dec 2, 2013
    Posts:
    5
    Hi, This is a pretty darn awesome asset, love it!

    But I have the same question as hargisss, how does the new stamp work?
     
  35. totallylegitunicorn

    totallylegitunicorn

    Joined:
    May 11, 2016
    Posts:
    14
    Need any guinea pigs for the biome beta? OR I guess in our case, guinea unicorns?
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Crossway, you can export terrain data to asset file using this editor function:
    Code (CSharp):
    1.     void ExportTerrainData (Terrain terrain)
    2.     {
    3.         if (!export) return;
    4.         export = false;
    5.  
    6.         string path= UnityEditor.EditorUtility.SaveFilePanel(
    7.             "Save Terrain as Unity Asset",
    8.             "Assets",
    9.             "ExportedTerrain.asset",
    10.             "asset");
    11.         if (path!=null && path.Length!=0)
    12.         {
    13.             path = path.Replace(Application.dataPath, "Assets");
    14.  
    15.             Terrain terrain = GetComponent<Terrain>();
    16.             float[,,] splats = terrain.terrainData.GetAlphamaps(0,0,terrain.terrainData.alphamapResolution, terrain.terrainData.alphamapResolution);
    17.  
    18.             UnityEditor.AssetDatabase.CreateAsset(terrain.terrainData, path);
    19.             terrain.terrainData.SetAlphamaps(0,0,splats);
    20.             UnityEditor.AssetDatabase.SaveAssets();
    21.         }
    22.     }
    Note that somehow just exporting with CreateAsset removes splat map information, but this code has already a workaround for that. A ready script could be found here.

    morphex, you can use RTP on all of the pinned terrains.

    Goffa, here is a video demonstrating the use of Simple Form and Stamp Generators:

    totallylegitunicorn, sure, but to spare guinea pigs and unicorns I've got to try it myself first - and that's what I'm currently doing :)
     
  37. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    279
    Hey Wright, quick question. Is there any way to scale the output of a voronoi generator? I can only find the cell count property, however it can only be a power of 2. 2 is too small, and 4 is too large, so I cannot use this.

    Also: I'm writing my own matrix generator, and I have a question. I want to get the surrounding heights of a chunk, which when processing a point on an edge would mean getting a point on a neighboring chunk. Any way to do this? Or whats the pattern here?
     
    Last edited: Aug 4, 2016
  38. D3m0nProwl3r

    D3m0nProwl3r

    Joined:
    May 6, 2013
    Posts:
    6
    Hi, great work with the updates! I've recently been trying to address issues with floating point precision and infinite terrain with MapMagic. Are there any plans to implement a floating origin solution?

    I have contacted the author of the Terrain Slicing & Dynamic Loading Kit which has a solution that unfortunately does not work with MapMagic because the system handles the loading of terrain which conflicts with MapMagic.
     
  39. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    507
    Hi, I've been working with the evaluation version and so far it's been pretty sweet and I definitely think I'm going to purchase.

    One question I have though, is how should I go about adding grass when it is a detail mesh? Currently the Grass node only accepts a texture, unless the mesh is vertex lit (mine is not). I tried searching the manual but my searching abilities may not be up to par.

    Thanks!
     
  40. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    It is not possible to tile a voronoi pattern with a non-POT cell count. It's an artificial limitation, you can disable it by removing "cellCount = Mathf.ClosestPowerOfTwo(cellCount);" in Voronoi Generator if you do not need tiling. But I'd like to recommend you consider changing the chunk size - for example lower it 1.5 times and use 2 cells.

    Chunk separation is one of the core principles that define MMWG work. No chunk is aware of anything that happens in the neighbor one, otherwise it will not be possible to generate the terrain in any direction. If chunk generator should have the height data of the other chunks then it should generate them first, and doing this will cause terrain generation up to infinity.
    There is an exception though - terrain welding, but it is done out of the generator and it can produce different results based on the player movement direction. But these differences are almost not noticeable.

    Thanks! MMWG has no built-in floating origin feature, but there are plenty solutions on the Internet, and there are free ones among them. You can take a look at this script. Shortly it moves camera and all of the objects to world origin when camera is out of some threshold distance (while most of the code deals with particles and collision to avoid related bugs). Map Magic object could be moved to any position at any time, no matter if the terrains are generating or not. I've even experimented with static camera, moving terrain instead in demo scene - and it is still works.

    Is there any way to add non-vertex lit grass meshes to the terrain? As far as I can see when I try to assign detail mesh only the diffuse texture (multiplied by color) is used no matter of the material or shader settings. And internally detail mesh prototypes have only these render modes: Grass, GrassBillboard and VertexLit (and MMWG modes inherit those modes without renaming). Maybe I'm missing something?
     
  41. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    507
    I might just be bad at explaining or understanding what I'm doing. The grass I am trying to use is currently set up in a texture with about 6 other grasses, so attempting to use that texture just puts the jumble of grasses as a rectangle.

    The grasses were separated into prefabs though, which is what their demo scene uses in conjunction with the terrain system as a grass detail mesh.

    Here's some pictures to help: GrassTexture GrassPrefab

    I mean if I have to I can probably just cut up the grasses and put them as their own separate textures.

    Thanks!
     
  42. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Let me make it clear: "Vertex Lit" grass mode is absolutely the same as the "Detail Mesh" in standard terrain. If you can assign your prefab as a detail mesh, then it will work as a vertex lit grass in a Grass Output and will look exactly the same. Yes, it will be vertex lit as the mode name says, but so will be the detail mesh too.

    Vertex lit does not mean that it will be filled with one color only. The object still can use a texture, and it will be multiplied with a grass color.
     
  43. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    279
    Thanks for the help Wright. I managed to make a pretty cool Warp node, check it out:



    I also have some suggestions.
    • Different node tree layers would be great. Instead of having to put a group of unrelated nodes apart on the same node canvas, we could just have different layers of node canvas that we can switch between, and connect with portals if need be.
    • I don't think MapMagic is properly using the Terrain.SetNeighbours work right now, so that there aren't seams between terrains.
    • Your coding style is unconventional - I don't mean that as an insult, all coding styles are just as good as what you make with them, but it does make your code quite difficult to read. May I suggest using a more common style?
    • It would be cool if it was easier to create new sets of generators (like more than Objects, Map, Trees, etc). For instance, your node workflow could quite easily do things like procedural generation of Textures, something I looked into extending it for, but decided that the architecture wasn't flexible enough.
    • Some kind of "go to portal in" button for portals would be awesome. Just a button on any out portal that will scroll the node canvas to where the in portal is defined.
    • On the same note - some way to see where all the out portals for a given in portal are.
    • You seem to be limiting the concept of object rotation to just be the Y-spin? Any particular reason for that? Seems to be a silly limitation.
    • The same applies for object scale. This means we can't do things like flip or scale on one axis.
    • While it makes sense for the tree and splat generators to be exclusive (that is, only one one in a node canvas) it doesn't make as much sense for object generators. Why can I not have a different Object Output for say, rocks and houses? This would neaten up my canvas a lot.
     
    Last edited: Aug 8, 2016
  44. whalleyboi2015

    whalleyboi2015

    Joined:
    Jan 27, 2015
    Posts:
    7
    Hey! Great asset!

    Im relatively new to creating terrains so I bought this asset an I'm currently having issues understanding how to use it. Very few tutorials on your YouTube channel. All I wanted to create was a 200kmx200km terrain with a few mountain, some places for water (no ocean just rivers and a lake) and a few hotspots for a town. I have no clue where to begin.

    I was hoping I could select a tile terrain and add inputs. Any help would be greatly appreciated :)

    Again great asset mostly user friendly easy to navigate. I do recommend a purchase!
     
  45. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    whalleyboi2015, have you seen this tutorial? It literally does what you are going to do: I show how to create a relatively big land (although not as big as yours, just 100 square kilometers) using the initial draft heightmap, passing through all of the terrain creation stages.

    cowtrix, your Warp Generator seems to be really cool! Do you mind publishing the code in this thread?

    Sounds like a useful feature. I cannot promise implementing it, but at least I'll keep that in mind.

    I've got bug reports for that and it's already in my to-do list for the next version.

    I always try to follow main coding guidelines, but maybe I'm just missing something. Could you please email or pm me example fragments that you think should be rewritten?

    That makes a sense too. I've added "Go To Input Portal" button in my to-do list. About highlighting the output portals - I'm going to make a toggle in the input portal to display output portals as a standard connections.

    I'm afraid this will cause terrible interface cluttering of an Adjust, Split and other generators that have rotation and scale parameters. And I cannot imagine an essential use case for that.

    In the upcoming version you will be able to have as many outputs of one type as you like. Btw this extends to all outputs including height and splat, not only the object ones.
     
  46. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    279
    Sure thing Wright, here's a link to the repo where I'll put all my custom generators.

    I'll write you a PM :)

    You don't necessarily have to change the Adjust or Split generators, or any other generators with those rotation and scale parameters. It's more that you do the quantification and de-quantification in the generator, and store the data as what it actually is.

    So, currently in ObjectOutput you transform the SpatialObject.rotation into a Quaternion with
    Code (CSharp):
    1. (obj.rotation%360).EulerToQuat()
    . Instead, I suggest you move this code into generators which affect rotation, and store rotation as either a Vector3 and a Quaternion. So at the start of say, the Adjust generator you would transform the rotation into a float, do whatever you want with it, and then at the end transform it back into a Vector3 or Quaternion.

    I've done this already as part of a bit of a refactor, changing the SpatialObject.size to be a Vector3, so I can write a generator that randomly flips the objects on their X, Y or Z axis. You can see it in the repo I posted above, called FlipGenerator.cs. I've changed the SpatialObject class to have a sizeScalar property (which is effectively the same as what size is now) and also a Vector3 size.

    I've actually just implemented the node layers and it seem to be working quite well! I'd be happy to share the code with you if you'd like. In my opinion it vastly improves the user experience.

    Ah, I have another suggestion that I may also go about implementing. Being able to say, shift-click a node and drag, and that would drag that node and every connected node. Would make moving groups much easier!
     
    Last edited: Aug 10, 2016
    XPAction and Wright like this.
  47. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Thanks for sharing your generator!

    I don't get it what is the reason of storing quaternion and converting it back to float in each adjust generator if the object will be rotated around one axis only (at least, using the default generators). Most of the users will not even note that. If this should be done then it's better get the full usability of quaternions, allowing rotation in any axis.

    I like the idea, so I'm adding it in my to-do list.

    Edit: just took a glance at a repo you shared - and urge everybody to do the same! Great work, thanks!
     
    Last edited: Aug 10, 2016
  48. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    198
    Does Map Magic work with Terrain Relief Pack?
    Specially regarding using tri-planar terrain shader...
     
  49. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    279
    Because a float isn't a rotation, and just because the default generators treat the rotation like a float doesn't mean that other generators will. It was pretty much the first refactor I did and it's allowed me to implement much more complex generators - like aligning objects to the terrain normal, for instance. Why oversimplify for the common case, when there's no advantage to doing so?

    By the way, do you know when this next version with an arbitrary amount of outputs will be? That is a feature that I would really like. If I can suggest, it would be really good if the output realized when a certain input wasn't needed. So, for instance, if there are no trees of type X on a terrain, it doesn't include it in that terrain's tree prototypes.
     
  50. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,668
    Yep:

    Version 1.5 beta test has begun. I've sent a Beta 1 to all who filled out the Beta form - please email me if you have filled the form but got no Beta version link; or fill it in if you want to take part in beta test. The main features that v1.5 will introduce:
    • Biome Generators;
    • Multiple outputs of the same type in the same graph;
    • New graph/node serialization and import/export in a xml-like format;
    • Flooring objects to terrain is simplified - Relative Height in Object output is used instead of the Floor Generator;
    • New toolbar buttons: generate changed/all, focus generators and zoom graph.
    Please note that it is the first beta version, the further version will be sent to those who provide bug reports or other kind of feedback. And thank you guys for testing MapMagic!
     
Thread Status:
Not open for further replies.
unityunity