First off, I am using Unity3d.
Question: How can I scale up the size of my world/level to include more gameobjects without causing lag for the player?
I am creating an asset for the asset store. So far it has gone great, and it will be one of the best assets for this type of game. It is a random procedural world generator, and one style of world you can generate resembles Terraria very very closely -caves, mobs, structures, etc. It is awesome, and has gone much better than I expected. It is nearly complete, and packed full with features. There is only one major problem -world size.
Anyways, I am have a lot of trouble figuring out how to scale up the worlds to have more objects/tiles.
- I have generated worlds up to 2000x500 tiles, but it lags very badly.
- The maximum sized world that will not affect the speed of the game is around 500x200 tiles.
- I have generated worlds of the same size with smaller blocks -1/4th the size (it doesn't affect how many tiles you can spawn)
- Terraria's SMALL world is 4200x1200 blocks!
I would like to be able to create a world at least the size of Terraria's small world without having any lag spikes.
So far:
- I have looked at object pooling (it doesn't seem like it can help me that much)
- I have looked at LoadLevelAsync (don't really know how to use this, and rumor is that you need Unity Pro)
- I have tried setting chunks Active or Deactive based on player position (This caused more lag than just leaving the blocks alone).
Additional Information: The terrain is split up into chunks. It is 2d, and I have box colliders on all solid tiles/blocks. Players can dig/place blocks. I am not worried about the amount of time it takes for the level to load initially, but rather about the smoothness of the game while playing it -no lag spikes while playing. I am open to all ideas, as long as they are proven to work. Thank you SOO much for your time, it makes a big difference.
Link to question on Unity Forums http://ift.tt/1JwItZJ
Aucun commentaire:
Enregistrer un commentaire