So i am coding a new game soon to be on byond but my code runs fine and the game runs fast but when i decide to turn on the shadows code for the objects it takes like 3 mins to open the game is there a way to fix this?
|
Jan 16 2016, 1:21 pm
Best response
|
|
We really can't help until you show us some snippets of code.
|
Does the game crash? sounds like an infinite loop. There's definitely something wrong with your shadows system.
|
Likely the shadow system is looping through every object in the world on startup and you have a fuckton of objects.
|
I'm not sure what shadow generation library you're using but if its mine (which needs a lot of work and optimisation now that I look back at it), I'd recommend you change the way shadows are generated. For the sake of the demo all it did was generate a shadow for all atoms, which YOU SHOULD NOT do.
Like Ter mentionned, you're probably generating all the shadows on world startup. I'd suggest you find a way to generate the shadows only for a few elements in your game or, find a way to generate the shadow gradually so it doesn't do it all at once when world starts. |