PGD Home

P0-A1: Part 366: Dynamic Object Creation

by on May.06, 2018, under Astral Realms, P-0, Software and Games, Spiritus Astrum

In addition to porting over to Unity 2018.1, I have also been adding support for dynamically paging objects into and out of memory and also storing their locations on the server between sessions.

This was quite difficult to get right, given the fact that the player can “move” in a lot of ways (different vehicles, different speeds, etc) but I think that I have finally achieved this.

The universe objects themselves are being created procedurally, and will not change between play sessions (stars, planets, etc), but I needed a dynamic system for objects that can be interacted with, moved, destroyed, etc, like space debris, vehicles, space stations, etc. This system is now basically working, but I have run into one major problem.

I cannot instantiate an object asyncronously in unity. I can load object asyncronously, but not instantiate them. This is causing a problem for some of the large and complex prefabs that I have in my scenes. I was hoping that Unity 2018.1 would have a solution for this, but it doesn’t look like it. My only option is to split the complex objects up into many small objects, load them asyncronously, and then instantiate them one by one in a coroutine.

This should work, if I design my prefabs with this in mind, but it is not ideal, and I will probably still need a better solution later.

Unity 04/05/2018 , 12:22:59 PM Unity 2018.1.0f2 Personal (64bit) - P0Main.unity - P0-A1 - PC, Mac & Linux Standalone*

Unity
04/05/2018 , 12:22:59 PM
Unity 2018.1.0f2 Personal (64bit) – P0Main.unity – P0-A1 – PC, Mac & Linux Standalone*

wgnuplot_pipes 01/05/2018 , 09:32:14 PM Gnuplot (window id : 0)

wgnuplot_pipes
01/05/2018 , 09:32:14 PM
Gnuplot (window id : 0)

wgnuplot_pipes 01/05/2018 , 09:33:48 PM Gnuplot (window id : 0)

wgnuplot_pipes
01/05/2018 , 09:33:48 PM
Gnuplot (window id : 0)

Facebooktwitterredditpinterestlinkedinmail

Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!