Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 epiris · Mar 20, 2012 at 10:07 PM · performancexmlarchitecturetower defense

Unity and the cost of nested game objects

This is my first question, I am a game developer for some years now, having worked with UDK, Android, and some other proprietary C++ engines. I feel like I am beginning to wrap my head around the unity way of doing things, but am a bit stalled converting my android tower defense game to unity.

What I am trying to accomplish

I need to store the information for my tower defense games Waves, in android I had a XML file that added Wave objects to a WaveManager. A Wave object contains a list of WaveConfigurations, each WaveConfiguration object has a Creep, the spawn count, delay between them, some other minor details.. you get the drift.

How I am attempting it in unity

The way I am trying to do this in unity, is I added a empty Waves object, under it I have a empty Wave01 object, under this I am planning on placing Creep objects that have a component which allows you to choose a creep Prefab, spawn count, delay etc.

I feel like this approach may have performance impacts however.

Does anyone have a suggestion on doing this Unity like? Is my original XML -> To object structure the best approach in Unity as well?

So in short I should look into XML Parsing and add that to the Start of a WaveManager to build the object represenation I am familiar with in android?

EDIT

Here's a visualization of what I was wanting to do:

I.E.

Waves -> Wave01 -> Creep01 -Creep Component (Transform (Creep Prefab)) -CreepSpellCastComponent -DoWhatYouWantComponent ...

Seemed like modifying and creating waves could be much easier, done visually. But maybe this isn't appropriate design for unity.

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
0

Answer by DaveA · Mar 20, 2012 at 10:12 PM

You can use one script (one object) to parse and store all your wave data. Gameobjects are generally best separate and parented if they are geometrically and hierarchically related, because each one has a Transform. Doesn't sound like this data would need that.

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 epiris · Mar 20, 2012 at 10:32 PM 0
Share

Thanks for your reply, I added a edit to better represent what I am trying to achieve, but maybe it just doesn't fit correctly. I could end up having 1000+ game objects for a single map. (10 creeps average across 100 levels).

avatar image DaveA · Mar 20, 2012 at 11:47 PM 0
Share

Well I suppose you could do it that way. Also the Asset Store has some visual tools for doing stuff like this, it might be a way to go. I don't know the actual overhead for carrying around more game objects, just that they contain a Transform and some bookkeeping like all the fields you see on GameObject. So a bit of waste there. With machines today.... I wouldn't want to do it on $$anonymous$$obile. If you are working on an Editor script, that's different.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Loading a XML file via WWW is slow, How can I make it faster? 1 Answer

2D Side Scroller Background 3 Answers

Why so much GPU usage for an empty scene ? 0 Answers

How to implement fast forward feature in a tower defense game? 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