Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Race Track made with MegaShapes

Discussion in 'Made With Unity' started by SpookyCat, Apr 6, 2014.

  1. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748

    The track in the image above was created in a couple of minutes using the new Multi Material Loft layer we have added to MegaShapes, this makes it a lot quicker to model complex lofts with multiple materials, if you watch the video below it will show the process. Once a track is made you can easily change the number of vertices it uses, or create sections of track each with different vertex counts for LODs or you can change the source splines to change the shape of the track at runtime if you like so making a nice and easy track editor.

    You are not just limited to a single loft, you can add any number of loft objects and any number of layers to those objects to build up complex scenes, so for example you could add crass barriers around different parts of the track, or scatter trees, or tire walls. When you add new layers on top off lofts they automatically mapped onto the surface. And if you want your track to conform to an existing terrain or ground mesh that is included as well, just pick your collider and set the conform amount value to have your track fit the ground.

    The vertex color system also allows you with suitable shaders to blend between different textures so adding variation to the ground or road textures is very simple, again check the video below to see that working.

    MegaShapes is an advanced Spline and Lofting system for the Unity game engine, it allows you to create splines in the editor or import splines directly from Max or Maya or import SVG files. You can then make objects follow those splines or turn them into simple meshes. Also included is an advanced layer based lofting system that allows for complex objects to be created in your game and easily changed, even at runtime,

    This video shows the new Multi Material Layer in MegaShapes being used to create a complete race track from just a couple of splines and a single loft. The new Multi Material Layer allows you to define different materials for each knot on the cross section spline so making it easy to and quick to build detailed lofts.

    More information on MegaShapes can be found on our website at www.megafiers.com

    Video guide to the new Layer


    Carve your lofts into your terrains
     
    Last edited: Apr 14, 2014
  2. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    That looks fun to play with, does it come with the example scene?
     
  3. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Yes the latest version of MegaShapes has the track scene included so you can mess about with it and get a feel for the new layer. The car model isnt included but the textures are. If you have any suggestions just let me know.
     
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Always impressive!
     
  5. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    I'll have to update and play...that looks nice. Thanks.
     
  6. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Would it possible to add a new layer type that is like the clone but where you can set the position of the mesh, for example in your track scene I wanted to add some advertising to the wall which I can do with the clone but it is regularly spaced, so if one could set a count and then position each one that could be useful.
     
  7. Autonoma

    Autonoma

    Joined:
    Jul 21, 2013
    Posts:
    92
    Is this using a collider or is the car positioned using walk loft?
     
  8. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    The system does generate colliders for any of the lofts but in the case in the video the car is being driven along the spline used to create the track though it is free to steer within the limits of the track and change speed etc. In the demo scene included there is a cube that is using the walk loft system to move. I am just about to tinker a bit more with the demo and play some more with the car control. Is there something you would like to see or is it a general question? The next update will have an improved demo scene with crash barriers, different color kirbing, advertising banners on the wall etc.
     
  9. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Sorry Mike missed your question. I do have that on my todo list, will keep you posted.
     
  10. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    New feature we have just added to MegaShapes, now you can have your terrains match perfectly to your MegaShapes lofts with a click of a button, the system will match up whatever terrain you have so that the sides of your loft blend in nicely. You have complete control over the distance the blend happens as well as the profile of the blend. So now making race tracks or any other game level with MegaShapes is even easier and more fun. Also remember the system also includes the option to have your loft conform to the terrain, so you can easily meet in the middle if you wish, ie make a flat track then conform that a little to your terrain then carve the rest. It is up to you, you have complete freedom to experiment as everything is procedural. Even while your game is running you can have the the terrain adjust so making track or level editors easy. And again as everything is procedural you can adjust the number of vertices depending on the system the game is running on, or have your levels be built at runtime so making your games much smaller and load faster.

    Terrain Carve

     
  11. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    We have just updated MegaShapes to include the new terrain system, it is in the Asset Store now.
     
  12. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Hey,

    What I'd like to see added and judging from the video you can do is: e.g. I have imported a height map from government satellite. It has an area of 2 sq km in Unity (it's really about 11 sq km) but has alot of polygons. Can you add a feature to MegaShapes that lets the user decrease the polygons to make game performance better? e.g. There is a scripts, I think on that Unity Wiki site that lets you choose from how many polygons you want and export the terrain as an obj file so you feature would be like that except if wouldn't convert to obj file and export it's work directly on Unity terrain so that your MegaShapes could still do all what is shown in video.

    I'd also like building over and underpasses and intersections (like the famous crazy 8 shaped tracks).

    Thanks.

    Ciao
     
    Last edited: Apr 15, 2014
  13. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    When you import the height data why don't you just change the Heightmap Resolution value or am I missing something?
     
  14. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    No, except visual inspection but I thought I'd if you'd add a slider or such for resolution since you are already changing the terrain in a much more complex way. Also, we might want a higher resolution so MegaShapes can do a better job of conforming and then try and reduce resolution of the terrain or not if it ruins the look wanted. It is a bit of a play by ear thing. I suppose could do it directly on the terrain as well after import MegaShapes design then have MegaShapes re-conform after lowing the resolution.
     
    Last edited: Apr 15, 2014
  15. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I will plop it on the todo list, not hard to re sample a height map, need to add support for multiple terrains and multiple lofts as well so lots more to come from the terrain carver and for MegaShapes in general.
    $arace2.jpg
    View attachment 96046
     
  16. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Cool. Thanks.

    I didn't think it was too hard compared to the rest of what you are doing. Unity is adding mesh terrains in Unity 5 I hear but if that is true you've probably known for a while.
     
  17. JordanYakuto

    JordanYakuto

    Joined:
    Apr 12, 2014
    Posts:
    48
    This looks great. Apart from just making entire finished tracks from it, I think larger studios (who may prefer to hand-construct their final environments in order to really control poly budget and art-direct asset placement) could use it as a really rapid way to prototype track shapes and test out broader environmental changes and ideas.

    I don't personally have a need for track building right now, but definitely bookmarking for the future! Good little set of tools! :)
     
  18. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Nearly done adding Mutli Material support to the complex loft layer, so you will be able to have any number of different cross sections along your loft path so being able to have more control over the resulting loft.
    $multimatcomplex.jpg
     
  19. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just a quick note to say MegaShapes now has support for Multi Materials when using Complex lofts, the latest version is in the Asset Store now.
     
  20. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    479
    Can Megafiers export splines or even the meshes modified in Megafiers to my modeling tool?
    Just asking if Megafiers can export SVGs.
     
  21. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I have just added for the next update the option to export the shapes to SVG so they could be edited in an external editor then imported back. It is on the todo list to have a way to export meshes, you can do it already with the OBJ exporter in the Unity Wiki or one of the other assets on the asset store.
     
  22. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Have just submitted an update that has support for export of MegaShapes to SVG files.
     
  23. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Hi, bought Megashapes and amazing. The track is conforming to the terrain just fine, but I can't find the "Match Terrain Loft" script that you attached to the terrain to conform the terrain to the track.
     
  24. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @MIK3K - The script you need is called MegaLoftTerrainCarve.cs the video was from a beta version before the script was incorporated into MegaShapes and renamed accordingly, sorry about the confusion.
     
  25. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Thanks, looked for "carve" just now (from seeing it somewhere on another forum thread) and found the script and came here to update my post.

    Thanks for all these great tools you make. Just picked up Megaflow to play with.
     
  26. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Thanks :) Just noticed I haven't done the docs page for the Terrain Carve system, will see about getting that done today.
     
  27. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Oh, should say I see there is an editor script (megaterraincarveeditor), but I couldn't find the script through "add component" on the terrain itself in the list of megashapes scripts, and it's not listed in any of the menus through new game object or component at the top of the unity window. I've got almost all your programs (not the book one, terrain, or daz) so maybe it is listed under a different category like megafiers? I will search some more.

    I'm new to all this stuff, so half of what I say is probably wrong. The only place I was able to find it (without using the search box) was assets > mega-fiers > editor > megafiers > megashape > megapro

    Edit - *facepalm* - found all the scripts under "components > scripts." I got confused because there are megashapes and modifiers component categories, but I guess it makes sense being in scripts because there are so many of them they would probably clutter up more used components.
     
    Last edited: Nov 8, 2014
  28. GiantGrey

    GiantGrey

    Joined:
    Jul 2, 2012
    Posts:
    266
    wow this looks impressive! Will definitely keep an eye on this!
     
  29. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Would it be possible to scale up or down loft portions ? This would be usefull to make larger roads and thinner ones like real circuits.
     
  30. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Each loft layer type has a scale curve so you define the scale along the length of the track so you can make sections wider or narrower. If you need more control then you can use the ocmplex loft layer which allows you to use any number of cross section splines along the loft so you can define different widths of road, banking etc, also each loft cross section has its own scale values to allow even more control of the loft created,
     
    zenGarden likes this.
  31. hlx

    hlx

    Joined:
    Sep 18, 2012
    Posts:
    57
    Hello Chris,

    I would like to know if there is a way (or some other tools from your "arsenal") to make connection between 2 lofts objects like an intersection feature for connecting 2 roads.

    Regards,

    Hlx
     
  32. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    That is something I hope to be doing soon, it is something we need in our own game project, it is quite easy to do if you model up the connecting pieces then you just need to mark the connection point and direction and then have your spline join to that point and going in the right direction when it gets there. I did a test on the connection system in the video below but it is not using the MegaShape system in the video just pre created pieces but for our project we model the level procedurally so we have a loft then put a connection piece then do lofts for any exits from that piece and so on.
     
  33. hlx

    hlx

    Joined:
    Sep 18, 2012
    Posts:
    57
    Hi Chris,

    It sounds very good ! Since my need is to connect a meagloft track to a complex intersection, I was supposing indeed to model in Max the intersection and be able to set it about his connection points. As megahape customer and intending to build a "complex" offroad trial area for my work, I would be very interested to test this feature (and give you my user feedback) when you think it will be ready for that. Do you have an approximative idea of the development/release date ?

    Regards,

    hlx
     
  34. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I am not sure when I can find the time at the moment but as I said it is something I need and I know others could find a use for so I will move it up the todo list and see if I can find some time to get something working.
     
  35. hlx

    hlx

    Joined:
    Sep 18, 2012
    Posts:
    57
    Thanks for the answer. I stay tuned !

    hlx
     
  36. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    as far as i can see runtime editing works right? but also runtime creation? so like a racetrack level editor?
     
  37. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @Der_Kevin - You can change the spline for the paths or cross sections at runtime so the track will change, that is what I did in the MegaMoo example in the video below:

    There is a webplayer demo of that scene available at http://www.west-racing.com/mf/?page_id=4987 if you have firefox or IE.
    And I did add an example script to the system a few months back that showed how you can draw splines and whole lofts at runtime, so depending on your scripting skills a track editor could be made.
     
  38. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    that was exactly what i was looking for! :eek:
    is this example included?
    edit: is there a light/trail version available? i am not 100% sure if this will work with my project and 100$ are quiete a lot
     
    Last edited: Feb 9, 2016
  39. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    There is a demo scene with the draw spline example, using the draw loft is the same just need to point the component at a loft object in the scene instead of defining the mesh params in the draw spline example.

    We not have a lite or demo version since the system is source code based there is noway to limit the functionality or time period of such a version. If you have specific needs please to email or message me with what you need the system to do I will be able to say whether it is possible or not.