Search Unity

3D Terrain?

Discussion in 'Formats & External Tools' started by Lallander, Apr 30, 2006.

  1. drJones

    drJones

    Joined:
    Oct 19, 2005
    Posts:
    1,351
    lol reminds me of an oldie but goodie:

    "reticulating splines..."

    also, i wonder if that's not possible, and you were having a script gererate terrain on every startup (for better download size for example), does it generate EXACTLY the same mesh every time?
     
  2. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    The reason why I had a delay on the collider was to speed up load times.IE load the level, get something interesting on the screen, then add the collider at an appropriate moment. In the Oasis, the collider was added when the gui"Game design By (ME)" was on the screen, so it froze momentarily, added the collider, then carried on. Its a successful workaround to speed the game up.

    I havent used it on a procedurally generated terrain, so I suggest follow Eric's advice. Other than a demo, Im really not sure of any good ways of using this approach after Aras said:

    "
    What are good situations for this, or was it just intended as an example of Unity's abilities?
    Cheers
    AC
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    One reason would be for generating extremely large areas (like entire planets), where it wouldn't be practical to build by hand. Obviously you wouldn't generate the entire thing at once, just the area in the immediate vicinity, and then generate more if the player moves far enough.

    Another reason is if you wanted randomization, so you get a different terrain every time you play.

    --Eric
     
  4. BigPowerfulMedia

    BigPowerfulMedia

    Joined:
    Oct 26, 2006
    Posts:
    20
    So, what sized area are we talking about at any given time? Obviously enough area must be generated at a time that it doesn't appear that a cliff exists in the distance at all times, and not be so small that it will seem fog is suffocating the player... My point is, it seems like as soon as you instantiate a mesh with a collider big enough to be useful, a noticable pause in the game will occur. Is this accurate? If not, does anyone know of an example of this type of thing being done properly? Anyone want to make one? It doesn;t have to be an infinite terrain... just a functional example of such a thing in use.

    And, yeah... in the end... if there isn't a way to make it work well, there's always the old fashioned way.
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yep. I have thought that it would be nice if adding a mesh collider didn't have to be an atomic action. That is, maybe it could be set up as a separate thread or something, so it computes in the background for a little while instead of holding everything up until it's ready. Because often I don't need the mesh collider active immediately, so a delay of a few seconds would be fine. But I guess that depends at least somewhat on Aegia's physics engine.

    In the meantime, you could put some text up that says "Loading..." or something whenever you need to generate another mesh collider and there's a pause. Or find some other way to disguise it.

    --Eric
     
  6. gon

    gon

    Joined:
    Jul 6, 2006
    Posts:
    53
    Bigkahuna wrote :
    Yes I'm dealing with exactly the same, namely a method to record what various players "draw" in order for others to see it. Something like a CVS tree? anyone has an idea how to talk to the server or so?

    would be amazing, thanks.

    Gon
     
  7. nkoste

    nkoste

    Joined:
    May 8, 2007
    Posts:
    7
    Hi sorry about reviving an older thread, but it's relevant to my current problem. I also use the "procedural" example to generate a mesh. My problem is not with adding the meshcollider, I think the script did that automatically actually. My problem is with assigning the generated mesh to the Mesh property in the Mesh Collider . I can't drag and drop this because the mesh has not been generated untill I push play.

    Is there some easy way I can assign the generated mesh to the Mesh Property through code or something else?

    PS: Total noob
     
  8. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    nkoste
    How you doin? Hey Im not sure what your question was...If you use the script at the top of this page, (add it to the same GameObject generating the mesh) you should have a collision surface. Is that not what you were asking? Perhaps elaborate a bit soo we can see what your trying to do?
    Cheers
    AC
     
  9. nkoste

    nkoste

    Joined:
    May 8, 2007
    Posts:
    7
    Hey Targos. I'm good now thanks you've been very helpful. Turned out I had already added a collider manually and forgot all about it and then there was no mesh assigned in the inspector. Got it working now thanks to your script.

    I'll be having plenty of more questions later as I've just started using unity and I'm using it for my bachelor-project. I'll tell more about it later :)