Marcousik Posted May 29, 2020 Share Posted May 29, 2020 This a showcase of creating a world randomly generated where paint, vegetation and models are placed with a script. Performance is ok. Map 4096*4096 4 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted May 29, 2020 Share Posted May 29, 2020 I don't know if you've talked about this before but how do you try to optimize for speed (if you do)? Do you use LODs, for example? Quote Link to comment Share on other sites More sharing options...
Marcousik Posted May 29, 2020 Author Share Posted May 29, 2020 Speed? Do you mean performances ? Is this the same? Well I give it a try: Well the first thing I do is to start an empty map because whatever why I always got performances problems by trying to fill the map from the editor; most of the time, while a "save" procedure, occured a crashing bug that ruined the entire work. Or it saved but all the paint work wouldn't be saved and - one more time - lost work. So now i try to do everything from script. The second thing was the illusion that this setting https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_SetViewRange MediumViewRange would save ressources. Well it is true, it saves performances, but precisely a test show me that while the setting to FarViewRange was as expected ignoring the rendering of the model, it left the shape of the model be considered and calculated. (I'm sure about this.) I found this by chance while desperating why ignored models had a performance cost...! So 100 shaped models far away from the camera that were NOT rendered had a significant perfomance cost. So I removed the shape and could easily put 1000 models far away from the player - the map was running well - as you expect it to run. Then, I restore the shapes to the model with a script catching the entities near the player ... and remove the shape if they are out of range. With a script calculating and placing the models in the area I want them to appear (it must be not 100% randomly), you can cover all the map (with no shapes!!) The beautiful thing with this is that you can put a script on whatever model you want and let the player cut trees or harverst stones, all this should be no problem. So to answer your question, I think removing the shape is the key for speed and smooth gameplay. The other thing making driving quickly is the possibility of using Update(4) that Josh created in the main script, so everything goes quicker and smoother. (but no idea what exactly change this setting, it feels like the engine would ignore some details maybe in the physics, but really not sure about this) 2 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted May 29, 2020 Share Posted May 29, 2020 Thanks for the details. It's good to know these tricks for optimization. Quote Link to comment Share on other sites More sharing options...
Marcousik Posted May 30, 2020 Author Share Posted May 30, 2020 I have to add something to this. I just tested one more time, just to be sure: > About this: "setting to FarViewRange is ignoring the rendering of the model, it left the shape of the model be considered and calculated." It's not quite correct to say this because if you test it, you will see that a model marked as FarViewRange will be hidden on long distance and its shape too. > But it is anyway a necessity to remove the shapes of the models to summon a scene like this, even through script. if I let one tree shape of the 6 different shaped models used in the scene, the game runs with FPS=10 or 15 ! If I let 2 shapes and removed the 4 others of the 6 different shaped models used in this scene: Here is what comes out: It is impossible to move anything / FPS=0 !! > You have to remove the shapes; setting the models collisiontype to Collision.None seems to be no alternativ option. Quote Link to comment Share on other sites More sharing options...
Marcousik Posted October 11, 2020 Author Share Posted October 11, 2020 Tropical jungle: I try to run out of this green, but it is almost impossible to get an orientation FPS 30, really ok with this density. 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.