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 PxStardust · Jan 26, 2017 at 08:45 AM · clonecopyprocedural-generation

Create a copy of a procedurally generated dungeon

Hello !

We are making a short project (3days +/-) and I'm in charge of developpement. We wanted to make a procedurally generated dungeon crawler, multiplayable (1v1) in which :

  • Each room's light can be lit or not by the player.

  • Depending of the light, the player (either vampire or human), gets damaged if the room's light isn't in the right position for him.

Our first idea was to have two identical dungeons, one for each player, and when a player turn on a room's light in his dungeon, the same on the other dungeon gets turned on too :

  • For example, the Human turn on the middle left of Dungeon A, and the middle left of Dungeon B also turns on.

That way, each player can search for the end without finding the other.


Having a short time and being kind of lost, I created a first procedurally generated dungeon (Zelda/Isaac like) which work pretty well for the moment. I followed David Leon's Zelda tutorial

However, I don't really know how I could "clone" the whole dungeon without getting references error and so on.

I also thought about making only one dungeon but I don't know how I could make a player invisible to the other.

Does anyone have an advice about how to deal with that, what could be the better way to do...?

Thank in advance ! Also, excuse me for possible english mistakes =/ Don't hesitate to ask informations if it can help!

Comment
Add comment · Show 2
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 Cherno · Jan 26, 2017 at 10:53 AM 0
Share

Well, procedural generation or not, there has to be some kind of data created for the dungeon, like what each tile contains, the objects and their positions and rotations, where the player starts, and so on. This data you have to save so you can use it again to create teh same dungeon again. You can make objects invisible to each other by either giving them different layers and setting your cameras up so they do not render the other player object's layer, or add a script to each camera that uses the OnPreRender and OnPostRender functions to disable and enable the other player object's renderer.

avatar image PxStardust Cherno · Jan 26, 2017 at 06:42 PM 0
Share

Hm, actually the tiles are made by instantiating prefabs that contain their objects. But the other things like the tile's type and position are indeed stocked in some array. I get the idea and I think I have an idea on how to do thanks to you ! However, I went for the unique dungeon and played with layers and camera settings to make players invisible to each other. It may not be the best solution but it worked pretty good and was way faster x)

Anyway, thank you for your time and reply!

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Copy clone in prefab 1 Answer

Instantiate an instance (clone) only copies public fields? 1 Answer

Clone class variables to another... Copy class not by reference 4 Answers

Getting a copy/clone of an object from an array (C#) 1 Answer

How to copy the real size of another sphere gameobject 2 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