While working on Morterra, I’ve come across a few things that I have questions about:
While rendering ground items, I’m currently just creating an instance of a plane with the item, and using billboard mode to display the item on the ground. I was looking into using Sprites (Sprites - Babylon.js Documentation) - one main reason is that I would like to reduce my load time (currently loading the item images individually, but I have a spritesheet ready to plug in) & Sprites make it easy to use the spritesheet. BUT the only problem I have with the Sprites is that there is no way that I have found to multipick sprites… I currently have it so players can see a list of stacked items if there are multiple items in the same position. I noticed the multipick methods return pickedSprites, but it always returns undefined… and there is a separate method for pickSprites, which works but only returns a single Sprite. Question: Is there a way to multipick sprites? If not, is there an easy way to implement a spritesheet to my current method (drawing image to a plane in billboard)?
Instanced objects sometimes have submeshes disappear when looking at them at the right angles. I have tried setting the mesh as always active, as I have seen in many other user’s posts, and that seems to only make the problem happen a little less. Cloning them works fine and never has the disappearing problem, but it would be more efficient to use instances. I’m wondering if there are any common reasons this would happen?
Morterra uses a zoning system so that players only render in zones close to them (the map will be huge in the future, so this feature is necessary). While crossing zones, there is a bit of a delay because the object models for the next zones are being loaded in at real-time. This causes a noticeable freeze in frames if there are enough models being loaded in. I’m considering writing a queue system to only load in the new object model if the client has the time/resources to load it (within reason). This would spread out the new models loading, so each frame would drop a few FPS, rather than a few frames going to 0. Is there anything remotely similar to this that I could look into, or are there any other things I should consider that may help reduce load times in general?
Thanks in advance for any help!