• 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
Question by martov · Nov 09, 2015 at 01:03 PM · 2d gameoptimizationtilemaptilerts

optimizing game objects - deciding what way to organize my level.

Hi!,

i'm trying to decide how to organize the objects in the game i'm making, i'm building a game similar to prison architect in object complexity and density, but with multiple z-levels (like dwarf fortress)

for those who are not familiar with prison architect, it's basically a big grid where you build stuff and AI agents interact with what you build.

here is a pic http://www.otogami.com/uncroped/01/34/img13412.jpg

I did a bit of research, what i found is that having individual game objects for each tile is too expensive, on the other hand, building and texturing a mesh dynamically is a bit complicated over so many layers of objects (floor with dirt on top with items on top with objects on top) and for some things i will need the physics engine.

I think I come up with a compromise between game objects and meshes that should let me use the best of both worlds, but i wanted to know if this still means having too many game objects or not.

My aproach would be to render all the floor tiles with a mesh, and have AI agents and buildings (walls, doors, beds, etc) as game objects drawn on top of that mesh. would this be feasible considering ultra basic physics (square coliders) ? this is the kind of object density I'm expecting to have, but multiplied by at least 5 z-levels (when viewing one z-level the other objects would not render, but they need to still run their update functions)

https://introversion.co.uk/prisonarchitect/images/screenshots/large/prison-architect-1.jpg

Alternatively, I thought of representing all the objects that dont need physics as structs stored in an array with an update function, and i would iterate over each object in the array executing an update function and drawing it using a Quad (pretty much rolling my own game object system), but i'm not really sure if this would be lighter than using actual game objects.

Any thoughts on how to optimize this are welcome!

Comment

People who like this

0 Show 0
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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

TileMap won't show up in 2d object in heirarchy. 0 Answers

How to store tile data for placing tiles 2 Answers

How to set tile from ScriptedTile script? 1 Answer

tile palette offset tiles stacking not lining up 0 Answers

My 2D tiles have holes in them 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