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
0
Question by shamunity · Feb 13, 2017 at 03:33 PM · wallroom

Is there a basic tutorial on building rooms and walls (like in the sims)

Hi! I can't believe how hard this is, even though I'm not new to Unity, but I'm hitting a major brain block here.

I want a basic system where:

  • a user clicks a point on a grid and release somewhere else, creating a wall. (not too difficult)

  • walls are formed of segments that can be deleted (again, i can have i
    happen using multiple game objects)

  • 'rooms' are determined if the space is enclosed: seemingly impossible. I could raycast all day long from the center of the room, if it hits a free-standing wall it thinks the room is closed when it isn't.

  • when a room is enclosed, you can 'paint' the floor using a 'paint
    bucket tool' - again, impossible because i'm not using a tile system but free standing gameobjects. There's nothing to 'paint' because I'd have to create a flat polygon structure based on the boundaries of the room which I do not know how to obtain

TLDR: the sims did it 10 years ago - aren't there basic tutorials on the above somewhere?

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

Answer by jdean300 · Feb 13, 2017 at 03:45 PM

I don't know of any tutorials specific to this, but I'll help you on some of your points. You said you understand how to do the first two points from above.

For the 3rd point, you could use something called a flood fill algorithm. Start from a point in the room and then run the algorithm and you will receive all the grid-squares in that room. There are plenty of examples of these online, here is one.

For point 4 - in point one you said the user can click on the grid, so I am assuming you have a grid, yet you also say you aren't using a tile based system. You can use 'tiles' but have them be seamless to where a user cannot see tiles. Then use these tiles and the flood fill algorithm to paint the floor.

Comment
Add comment · Show 2 · 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 shamunity · Feb 13, 2017 at 05:00 PM 0
Share

Thank you! The challenge is that I have them on a grid right, which is purely a 'snapping' mechanism so the user won't be able draw 'free' lines.

The problem with using this system alone is that I cannot figure out the maths behind doing 45degree or even more complex wall angles. I don't think it's impossible, it's just I have no idea where to start. Drawing it is one thing, but if a wall is draw at 45 degree angle on a tile, that tile has the task to track 2 rooms, which is not possible as the floor color is different. Flooding algos are also usually described in the context of 'grids' and not just random intersection of meshes.

avatar image unity_HxF9bz13Mt5zfw · Jun 27, 2018 at 11:34 AM 0
Share

How do you create a grid to add all these stuff . Is it a UI element or a 3D object

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to do room detection on non-grid based walls 2 Answers

Limiting Wall Jump to only certain Object Collisions 1 Answer

Creating a Barrier 1 Answer

A collision wall with different behavior 2 Answers

Spotting Enemies Like In Battlefield 3? 1 Answer


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