Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by neuron · Jun 17, 2011 at 10:16 PM · terraintexture2dloadingtilemesh-deformation

How to handle the ground [mesh?] of an infinitely large world?

I've made a little prototype game that uses perlin noise to make very large maps. My game has a top-down 2d orthographic perspective, so very little of the total map is visible at any given time.

I wasn't sure the best way to handle this huge world, so I simply made a bunch of tiles (~400) that fill my screen and I have them change their textures as I run around. I never create/destroy any tiles, I just have them recheck the underlying map data every time they move. I'm not sure if that's silly or not, but it appears to work fine.

What I'm looking for is a way to have the ground elevation change, and make these "tiles" look more sophisticated. I can change the camera to isometric, but what next?

Can I alter/move a mesh as my player runs around?

How can I maintain tile-like behavior within a mesh?

How would I get started?

Could I make a mountain, or would I have to fake it a bit?

Would I want to texture 2 triangles (an approximate square) of the mesh at a time?

Here's an old picture of Ultima Online showing some minor deformations/bumps of the ground where the sand meets rocky path, also see the rocky stuff. This game also had ramps in it, though it failed to ever convey a sense of going up a mountain (it felt more like going into a mountain, due to the lack of legit elevation change). I'd love to get a similar or better effect.

Thanks!

alt text

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Oliver Eberlei · Jun 18, 2011 at 10:21 AM

Regardless of how you would get your height data into the game (I don't have enough information how you store your terrainData) you can change the vertices of each tile like so.

This assumes all your tiles have only 4 vertices.

 Mesh mesh = GetComponent<MeshFilter>().mesh;
 Vector3[] vertices = mesh.vertices;

 for( int i = 0; i < 4; ++i )
 {
     vertices[i] = new Vector3(vertices[i].x, heightOfTheTerrain[i], vertices[i].y);
 }

 mesh.vertices = vertices;

To create mountainranges its probably easiest to create mountain tiles in your 3d application and swap your default terrain tiles for mountain tiles if neccessary.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image neuron · Jun 18, 2011 at 11:22 PM 0
Share

Thanks, that's the exact type of thing that I was looking for!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Changing terrain in real time 1 Answer

How should you make an MMORPG world? 3 Answers

Any resources for using grid/tile data structures with terrains? 1 Answer

Make a simple tree 1 Answer

Issues getting WWW.LoadImageIntoTexture to use DXT1 compression at runtime 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges