danbuis / ArmadaAIEngineNew

Revisit of an old project to create an AI for Star Wars Armada
1 stars 0 forks source link

Implement lazy asset creation #79

Open danbuis opened 2 years ago

danbuis commented 2 years ago

Requirements

ShaderPrograms seem to be fairly resource intensive to assemble.

Let's make that less of a burden.

One instance of this is the test where we build 40 squadrons. I'm about 95% sure that the vast majority of the time dedicated to that is creating some graphics assets.

We have a few adjacent issues around such as #47 and #35

Potential Solutions

Minimize number of shaders/assets

Create some sort of system to only build assets when we need them, and once they are built, we keep them around so that we don't need to do it again.

I like the 2nd option better as we are not trying to limit graphics stuff.

Potential Tasks

What does it take to call this issue complete?

danbuis commented 2 years ago

https://www.geeksforgeeks.org/singleton-class-java/

THis might be useful for delaying shader creation and such until its needed.

danbuis commented 2 years ago

I bet we can use singletons for camera and window. On the dice app I've gotten tired of typing camera and window for the rendering calls. I bet we can make a singleton somewhere and call it whenever we need it, rather than passing them into child UI objects.

I also bet that we can create our own renderer extension to just pass the widgit we want to render, and it adds the window and camera calls and passes it to the BBDGameLibrary renderer calls for us.