greggman / o3dtoydefense

Automatically exported from code.google.com/p/o3dtoydefense
0 stars 0 forks source link

Make adding a tower fast #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently when adding a tower the game will noticeably pause.

I'm guessing the issue is that the code is deserializing a character which
is a lot of work. Two solutions off the top of my head

#1) create instances of all the towers before the game starts and then just
add them to the transform graph as needed.

This has the issue that you'll basically need to create enough of each type
of tower to cover the playfield and that it will make initialization slow.

#2) Put a place holder graphic (colored cube or instance geometry) at the
new tower spot and then deserialize a tower over multiple game frames so as
not to pause the game.  The deserialization code is already supposed to
support this. There was just a bug in IE that no one has bothered to look at.

That cube or geometry could scale up overtime which would actually be much
more like a normal RTS that shows building time for the tower to appear.

Original issue reported on code.google.com by g...@google.com on 31 Oct 2009 at 9:26