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. Montreseur

    Montreseur

    Joined:
    Jan 24, 2014
    Posts:
    49
    @Wright I am still having a lot of problems even when following your videos exactly. I messaged you about it.
     
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Hm, the only message I can see from you is just pays my attention to your forums post. Anyways, could you please describe your problems here?
     
  3. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    This is my problem in the moment, sorry if its a dumb question, thank you for giving me a hint.

     
  4. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Trees that come with MM are models, they are neither Unity trees nor SpeedTree, they cannot swing with the windzone wind. You've got to use standard trees or spt models for that.
     
    Hormic likes this.
  5. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    Putting map magic to use with substance textures and rtp shaders, thanks very much for developing map magic! It's a dream to work with.
    Screenshot08.png Screenshot07.png Screenshot06.png
     
  6. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    WOW, Beautiful
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    MattyWS, thanks a lot for such a feedback and for your images of stunning landscapes!
     
  8. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    Hello everybody,

    I'm currently wrong with MapMagic and wanted to ask if maybe someone can show examples by example by a few examples.

    My biggest problem is that some building blocks have changed and so some examples here from the forum can not reconstruct

    The tutorials etc. are also no longer just new

    would be nice
     
  9. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    I watched the videos in order, they replaced the documents.

    https://www.youtube.com/channel/UC-mZzMZiGW9L00RgztziFIA/videos

    Go to the oldest then watch to the newest.
     
    Last edited: Feb 4, 2017
  10. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    This tutorial is a few months old but not much has changed and you can follow along from start to end without problems ->

    after that you have the grip with MM.
     
  11. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    Thanks for your efforts but unfortunately you have not read my question.

    And there have been some building blocks changed scatter, blend just to name a few
     
  12. auhfel

    auhfel

    Joined:
    Jul 5, 2015
    Posts:
    92
    I cannot figure out how to generate objects. The scatter thing does nothing -- objects are not spawned at 0 level or terrain level. The settings are vastly different than in the video.
     
  13. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    here a little example in the picture
     

    Attached Files:

  14. auhfel

    auhfel

    Joined:
    Jul 5, 2015
    Posts:
    92
    I have copied this exactly, and nothing shows.
    EDIT: Nevermind, I have found the issue. I had a terrain pinned that was created because it was next to the main camera. But at one point I turned off the main camera generate and instead used objects tagged player. My game doesn't spawn players yet until the server is started. Anyways, because the terrain was generated next to the main camera, and I turned that off, it was not updating.

    It might be nice to auto-update the pinned terrains regardless of a map marker being generated -- only if it is locked, it doesn't update? I don't know, I'm still too new to really know what effect that would have.

    Thanks for the help though -- the image gave me a sanity check and prompted me to look elsewhere for the problem.
     
    Last edited: Feb 4, 2017
  15. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    You're input the heightmap data as "probability' for objects to spawn. That means at 0.0 height there will be zero chance. and only at the maximum top peak of you tallest mountains will there be a full 1.0 chance for anything to spawn.

    You should use a constant 1.0 generator for the probability or a noise generator.

    Always check things using the right-click on output -> preview method to see what's up. Your height portal output there will show mostly red across your terrain which is why the rocks won't show up.

    If you guys have specific questions just post them here, we can answer. The tutorial has only changed in a couple places.
     
  16. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    If anyone is interested, I've done a couple of videos showing how I create terrain with Map Magic for my game, EXO ONE.

    Part 1:

    Part 2:


    Will probably carry on doing these for a little while if there's much interest.
     
    Hormic, malkere, Mazak and 1 other person like this.
  17. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Fascinating! For one thing, it's nice to see some terrain building that isn't all mountains, green forests, and meadows full of flowers. It's also interesting to see that the heightmaps are integral to gameplay and not just there to look pretty. By the end of the second video, it was looking mighty good.

    I was a little confused right off the bat, since it wasn't clear where the splat map and texture assignments were being done. Off screen nodes? It'd be nice to see at least a brief mention of the RTP setup too.

    Since you're using infinite terrain, are you running into any floating point precision issues when traveling far from the origin? Are you using any kind of moving origin approach?

    Anyway, the game looks cool. The clouds, the moody lighting and image effects, and sound effects really come together.
     
    Hormic and malkere like this.
  18. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    No splats setup in that video. Just snow on top of a single texture. RTP just mixes them so nicely it looks more complex than it is.

    This scares the crap out of me, lol. I had a quick go with a community provided (unity wikia maybe?) 'world zeroing' script that didn't seem to work very well for me. It was a little while back, I forget why. Just seemed super jerky - might need a bit of custom camera code as well, not sure! Didn't spend that long trying to get it to work either. The main issue I've found so far with floating point is the shadows/lighting getting messed up. Otherwise things hold together amazingly well considering the 100's of kms you can cover in the game.

    Thanks!
     
  19. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Denis!
    Since no one has brought this up, I would like to ask about the copy component feature.
    In the game I make, there are a lot of scripts we need to attach to terrains, so I checked the "Copy Component" box in general settings and attached my scripts to the 0,0 terrain under Map Magic.
    However, it doesn't seems to work in runtime, newly generated terrains are blank.
    Would like to know how do I use this feature or is this a bug for now?
     
  20. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    Looking great and I'd love to watch a few more of these if you get the chance to make them. Quick question, what are you using to make your clouds? The game looks super dark and moody with the lighting, clouds and sounds.
     
  21. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    I report some success in the deal with MapMagic.

    I try to make the mistakes more concrete.

    1: I use Blob and Substract to prevent objects from splaying together, but how do I make it in a forest or split object can not be that one then every one of each Blob and Substract has to avoid a hineinspawnen?

    Are there easier ways?
     

    Attached Files:

    • test.jpg
      test.jpg
      File size:
      416.4 KB
      Views:
      886
    malkere likes this.
  22. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Thank you very much for these, your game looks very interesting and unique.

    I second that, would be very nice to see a video or tut how to implement the Relief Terrain Pack within MapMagic.
     
  23. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    You can see he's got trueSKY in the scene. :)
     
  24. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Wow, that's surprising.


    Interesting.

    I ran into a problem with precision on a space game where you have cockpit elements close to one of the cameras. Beyond 5-10k from the origin, shadows started to wig out, weird rendering artifacts appeared, and things started to "jitter." It may have been more noticeable become of those close elements. So I ended up doing a "floating origin" thing, inspired by a wiki (probably the same one). In my case I don't have tons of stuff to move, so it's worked out pretty good so far. The only visual weirdness is with certain particle systems and trail renderers. If you don't turn those off during the move, you can get long streaks that pop in for one frame.

    The reason I ask is that I'd eventually like to have one or more planet surface missions, and for that the floating origin thing could get messy on those. For one thing, moving things around wouldn't play nice with anything marked as static, which seems more likely in a ground environment. In your case, I can see it as a challenge, since you have an entire complex cloud system to deal with, etc. I suppose I could design the ground missions to not have first-person cockpit elements near the camera. Could go with a third-person camera like you have for vehicles and hope for the best.
     
  25. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Don't place your scripts on the 0,0 terrain - put them on the terrain manager component with the MapMagic script itself. They'll then be copied to all chunks that are generated.
     
  26. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    yeah I tried to put scripts on the manager object, still no copy. :(
     
  27. DesertRaven

    DesertRaven

    Joined:
    Jul 15, 2012
    Posts:
    137
    Okay, now that that's out of the way, I am now wondering if I can marry up Voxeland and MM in one scene? I am thinking of creating cliffs, rocks and overhangs with Voxeland, since it uses the identical materials grasses and trees. then take those as prefabs and place them on my MM terrain? Would that approach work?
     
  28. RandomDevil

    RandomDevil

    Joined:
    Dec 15, 2016
    Posts:
    11
    Are there two forums for this tool? The store links you here, but the link in MapMagic sends you elsewhere. Anyway, here's what I posted in the other one:

    I'm not sure what I'm doing wrong, but I cannot get the RTP plugin to work.

    1. I add MapMagic and RTP into Unity, pull the scripts into RTPOutputGenerator and InstantUpdater into the MapMagic top level, and the InstantUpdaterEditor script into the MapMagic/Editor folder.
    2. In the MapMagic GUI, I go to Terrain Settings and change the material to RTP.
    3. Add the MapMagic 3D Object.
    4. Add the component for RTP to the MapMagic Object
    5. It adds the RTP_LODmanager.
    6. I click the compile button in the RTP_LODmanager.

    From there the terrain goes white and I start getting the error:
    MissingComponentException: There is no 'Renderer' attached to the "Map Magic" game object, but a script is trying to access it.
    You probably need to add a Renderer to the game object "Map Magic". Or your script needs to check if the component is attached before using it.
    UnityEngine.Renderer.get_bounds () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GraphicsBindings.gen.cs:894)
    ReliefTerrain.InitTerrainTileSizes () (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:184)
    ReliefTerrain.RefreshTextures (UnityEngine.Material mat, Boolean check_weak_references) (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:263)
    ReliefTerrainEditor.OnDisable () (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:104)

    It's strange because I have another person on my team that this doesn't happen to. I even rolled back to 5.5.0 just to make sure. I just put in a purchase request at my company for multiple licenses for MM and RTP and could really use some help getting them to work on my system.

    Thanks in advance.
     
  29. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Are you using the last downloaded version? You don't need to do most of what you listed. Once RTP and MM are in your project, create a mapmagic object in a new scene. Click on the mapmagic object and in the inspect click the open graph editor button. In there add an RTP output generator. It will tell you what is wrong with the scene and offer to make the changes automatically. Have it to do so and it will change the material, add the LOD manager, and a couple other steps it needs to do to work. You are missing a step or two trying to do it manually. Best wishes.

    And yes there are two, but this one is much more active.
     
  30. RandomDevil

    RandomDevil

    Joined:
    Dec 15, 2016
    Posts:
    11
    Thanks for the reply. We're still not sure what's going on with the one computer, but we think it might be a DX11 or something else Windows 10 related, or and issue with our company's security programs.

    Now the next big question before a mass purchase. This might be more RTP related, but still involves MM at the same time.
    How many textures can RTP and MM handle? 8 is easy, but I've seen talk of 11, but cannot figure out how to get the slots to even appear in RTP. Any ideas?

    Thanks in advance.
     
  31. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Is there some sort of raycasting node anywhere (possibly third party)? I would like to place objects B on top of other placed objects A, but only where the color of objects A matches a certain color.
     
  32. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    RTP and MM both should have no restrictions to the amount of textures you can use. Most shaders will make a single render pass with up to four textures used on the material, meaning 5-8 will require two render passes. RTP has a shader that will combine 8 into a single pass with some minor demerits. You can always add more it will just decrease your performance.

    I'm not at home and the laptop I'm on has a bad PSU I can't open Unity or it will shut down =[ =[ =[ =[ but I will try to add a bunch of textures when I get home. Isn't there an Add button above the texture list on the RTP inspector window?
     
    RandomDevil likes this.
  33. skipw20

    skipw20

    Joined:
    Nov 5, 2015
    Posts:
    4
    I have been following both of the MM forums for some time now. I am intrigued by this terrain creation approach. I currently own MM and Erosion Brush and have Noise Brush in my stable of tools. I have watched most all of the MM videos including the excellent marathon tutorial. Please don't laugh but I have a fundamental stumbling block issue that I could use some help resolving by either you or perhaps one of the MM users. Additionally, I believe this issue has been mentioned by others a couple of times on the forums though maybe not so directly as I will now attempt.

    I'm primarily an OS X user and I don't have a current Photoshop subscription. I actually owned Photoshop through the CS2 version but my limited need did not justify the on-going cost so I dropped Photoshop some time ago. Now I am finding it extremely difficult to find a reliable and reasonably-priced program that will run under OS X that I can use to create base height maps and then save that data as 16-bit raw images in PC format. I understand the reason why 16-bit grayscale is preferred over 8-bit data for most height map data and I also understand that MM adapted / leveraged Unity's format approach to saving the height map data.

    However, I'm asking you to consider creating a second, though maybe less-effective, alternate approach for importing gray-scale images for base height map data using a common format such as jpg or png or tiff and perhaps even at 8-bit resolution. I may be missing something but it's not obvious to me, given this terrain creation approach, that 16-bit resolution is required in all cases for the base starting height maps. A base height map starting resolution of 8-bit might be more than adequate especially after you apply a substantial amount of noise and additional processing such as terracing in route to creating the final terrain product. I'm not suggesting that 8-bit resolution data be used for the final height map product but I am suggesting that, perhaps, 8-bit resolution data could be used for a reasonable starting base for those who don't have ready access to apps that are capable of saving 16-bit raw PC-format data. I would be greatly appreciative for such an addition and I believe that a reasonable percentage of the mac-user community (the non-Photoshop subscribers) might be as well.

    Regardless of your decision on this matter, I thank you for the time that you have expended developing these great products.
     
    Last edited: Feb 8, 2017
  34. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    @skipw20 is there a reason why you want to have static bitmap heighmaps, instead of generating them procedurally with MM?
     
  35. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Doesn't GIMP save raw images?
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    skipw20, you can use Texture Input generator to import 8-bit images in any format Unity can read: jpg, png, tiff, etc.

    RandomDevil, here are the steps that should be taken to use RTP Plugin:
    - install it anywhere in Assets folder;
    - load a scene with MapMagic object (or create a new one);
    - add RTP Output Generator to the graph;
    - follow instructions displayed in RTP Output (or just press the button "Make it all automatically");
    To fix the error you encounter you should add Mesh Renderer component to MM object and disable it. RTP checks if renderer assigned even if it is not required.

    I'll add a simple readme file with this instructions to RTP Plugin right after I finish writing this post.

    This is the main MMWG forum. Thanks, I will fix the link.

    You can bake Voxeland terrain to mesh and then use it in the other scene with standard terrain, but I don't think that it would be convenient. Voxeland is too big by default to make a stone, and you cannot edit baked stones in your scene.

    Hmm, just checked that Copy Component feature works. Try unpinning and then pinning again your pinned terrains. And yeah, components should be assigned to parent MapMagic object.

    Twoonebe, sorry, I just can't get it what you are trying to achieve. Could you please re-phrase?
     
    RandomDevil likes this.
  37. RandomDevil

    RandomDevil

    Joined:
    Dec 15, 2016
    Posts:
    11
    I can add the 8 texture sets (albedo, normal, height) then it doesn't let you add anymore. If you can get it to accept more than 8, I'd be very interested in how. We're going to try substances today as a possible solution.
     
  38. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Ahh I must have been thinking of just MM and TC2 which I used to use... RTP does a lot of blending the height/normal maps in pairs and stuff I don't fully understand, might limit it to 8... I think it can do more but the Add button does grey out after 8. You should probably ask on the RTP thread. Thomasz is very quick to reply usually. MM alone will let you add as many as you like.
     
  39. skipw20

    skipw20

    Joined:
    Nov 5, 2015
    Posts:
    4
    Denis - Thanks for the quick answer. I did not realize this. I will try it immediately. Thanks.

    malkere - I can create a height bitmap image that looks good on screen using GIMP but I cannot seem to save it into a PC-ordered, 16-bit grayscale raw image that MM can use properly. Someone else mentioned this earlier in the forum. Is there a special plug-in that we could be missing for this format? Thanks for help.

    iddqd - I just want to start with a static height bitmap for the general shape and then let MM generate the height maps procedurally. I'm following the general processing flow from the tutorial that Denis created. I believe you are correct in that the general shape for say an island could be generated procedurally. If done procedurally, the general island shape could be different based on seeds. Unfortunately and obviously, I don't understand MM well enough to be able to accomplish this yet - but thanks for the comment.
     
  40. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Denis,
    Is it possible for you to make MM compatible with MegaSplat?
    It uses it's own splat format for terrain rendering and the effect is stunning.
    Would like to see MM add a new output channel to MegaSplat's rendering format!
     
  41. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    95
    Alternatively you can do a google image search for height map. You're sure to find something close enough to fit the bill.
     
  42. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    fyi I fixed my grass waves that weren't blending together at terrain edges via: http://answers.unity3d.com/questions/541456/why-does-the-grass-change-color-by-default.html

    @skipw20 You can download Photoshop CS2 for free from Adobe's website, though it's a little difficult to find. I promise you it is there, I just downloaded Illustrator CS2 for a PC last week.

    I did however get GIMP 2 to save RAW (they call is .data) and import to MM just fine (on PC). I just did file->export as, then selected Raw image data (*.data) and used the settings standard and normal. It was inverted when compared to the photoshop save I did, but it was the same data esentially. Make sure it is square and grayscale? Best wishes.
     
    Wright likes this.
  43. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    We're blending several biomes using a similar approach to in one of @Wright's videos here, and it works great.

    Now however, we'd like to be able to evaluate at runtime the biome in which the player is currently situated (in order to choose the appropiate background music or adjust image effect settings, for example). Any ideas what the most efficient/most flexible way to do that would be?
    I guess the ideal solution would be if we were able to access the appropriate generator at runtime and query it for a given input position what the output weights being sent to the biome outputs were. Or perhaps we could generate "dummy" biome indicator gameobjects on each terrain chunk and then triangulate the closest three objects at any point? Or maybe raycast down from the player to determine the predominant splatmap texture under their feet (but not sure this would work across multiple terrain chunks when one has terrain splat 0 = grass and another has terrain splat 0 = snow, say)....

    I feel this must be a pretty common requirement so does anyone have any better suggestions?!
     
  44. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    504
    If you're not using an infinite terrain, you can use the preview options in the node graph and select texture preview - that'll give you a black and white image, I think you can save that. Align it with your terrain and it should but readable with a 'getpixel' or something at runtime. Bear in mind you'd have to generate a b/w image for each biome...
     
    tanoshimi likes this.
  45. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Good idea, but we are using infinite with a random seed - sorry, should have mentioned that.
     
  46. yrucrem

    yrucrem

    Joined:
    Aug 5, 2013
    Posts:
    17
    Hello @Wright

    I just played around a bit with the technique to create villages you described in an earlier post. Currently I'm trying to find a solution to a similar problem, up to the step where you use the Flatten Generator. But I would need flattened areas with a rectangular shape. I admit that I still have a way to go before I even reach noob level with Map Magic, so I hope you don't mind my question.

    Is it possible to scatter flattened areas with a rectangular form? My experiments so far failed rather horribly, so any prods in the right direction would be greatly appreciated.

    Best regards,
    Patrick
     
  47. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I use global variables in my custom generators to define terrain resolution in the game settings. If you could do the reverse, and call a generator to calculate the biome noise output for a given location that should be a simple call you'd only have to make every so often.
     
    tanoshimi likes this.
  48. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Thanks for the suggestion. I'll have to do some research as to how I could adapt the input into the biome split from expecting a matrix input defined relative to the currently_processed chunk to a single workspace Vector3 instead. Will post back if I get any progress!
     
    malkere likes this.
  49. skipw20

    skipw20

    Joined:
    Nov 5, 2015
    Posts:
    4
    malkere
    I may take your suggestion about looking for Photoshop CS2. I know I have the license key around here somewhere. I was able to create a starting base height map image with GIMP as well. However, I went the texture (*.tiff) import route that Denis suggested. I may go back and try the raw image data (*.data) approach since you got it to work. I was able to import a raw image but it seemed like the data was incorrectly ordered and it looked nothing like my original.

    I have another question regarding one of your posts on this thread from a couple of weeks ago. Did you ever resolve the "Left or Top or Bottom or Right neighbor of the terrain has a different heightmap resolution. Stop neighboring." warning when you were pinning terrains. I've been stuck for some time on this issue. I would just ignore the warnings and go forward but if I use the blur tool it really amplifies that there is a boundary problem. Plus, I can't adjust the border parameters enough to fix the seam problems. What did you do about this?

    Dorian-Dowse
    You are correct. There are plenty of sample images that would serve as a general starting point but I really wanted to create an image from scratch so I can learn the process end to end. Thanks for the suggestion though.
     
  50. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I've just been ignoring it unfortunately.