Home › Forums › General Questions › Project Optimization
- This topic has 25 replies, 5 voices, and was last updated 1 month, 1 week ago by xeon.
-
AuthorPosts
-
2024-09-25 at 7:06 am #77604c4ccParticipant
Please understand, the reason I distorted the mesh and material (the vertice count is still the same) is in this blend file because it’s confidential (I don’t prefer giving spoilers), and I will naturally release the original version when I release my app, which should hopefully be by the end of this month, or a week after.
But the puzzles are the same, vertice count, and shader methods are the same though
My project files as attached
https://drive.google.com/file/d/1JwReRbvBJ1d8SFhgfT7MSEfuEr4WguUc/view
2024-09-25 at 3:08 pm #77613xeonCustomerOk…so your loading time is pretty quick. On average it takes under 3 seconds to load.
Your project is pretty light weight but if this is going to be a game there are things you will need to consider as load times could get large.Performance ( after the loading )
The back wall should really be a textures with a normal map and perhaps the cylinders on that wall stay 3D objects. Unless you are doing something with them that requires all that geo.the floor elements – unless moving should also be one object and unnessary faces and geo removed from adjacent elements.
Puzzles….
you have two key down events and three key up events….I would recommend re-writing these so you just have on key down and one key up event.you have two Every Frame events…. i would recommend rewriting so you only have one.
I would also consider that there are potentially ways to eliminate many of the the things you have in Every Frame events. The more you can reduce the logic in these events the better.You have many after X seconds….events. With this sort of logic you could have conditions where events will be missed, our cued and cause lag and or prevent other items from triggering while a wait state completes, especially when the timer is triggering animation.
As an example a kick or repeated pressing of 5 on the keypad…many events are going to be missed or queued and because the animations is already playing and the time event and animation are on going… the animations will either be truncated and restarted or skipped and this causes performance issues. To solve this sort of thing you would need to create some logic for what should happen if the 5 key has been pressed and the animation is playing on in a wait state…..you could tell the play head to go back to start frame on interrupt…or ignore additional input….but something. But because you have these nested timers, a different approach may be more useful.You are also using physics….this will slow things down too from a performance stand point.
I am not sure how you are using it or what its purpose is but I am guessing that if the character hits an object it should do something (play some animation sequence). If the objects are predictive, meaning they move or are static, I would use a different method of collision detection to avoid using physics if possible.Performance is going to be measured by the target system requirements. Are you wanting this to playback on a mobile device via web server, going to output in Electron, Cordova?
- This reply was modified 2 months, 2 weeks ago by xeon.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2024-09-26 at 3:33 am #77620c4ccParticipantThanks for your suggestions here, I’ll assess them one at a time.
Performance ( after the loading )
The back wall should really be a textures with a normal map and perhaps the cylinders on that wall stay 3D objects. Unless you are doing something with them that requires all that geo.I need to get a 3d camera view during gameplay someday, so I need my walls to be 3d objects. Also, I may want one of the wall’s emission material to occasionally glow someday, so baking materials into textures is out of the question.
the floor elements – unless moving should also be one object and unnessary faces and geo removed from adjacent elements.
How do you remove unnecessary faces and geometry from elements?
My project is basically a 2d sidescrolling game. Unfortunately it means I need to have different objects to make up a stage, especially for floors.Puzzles….
you have two key down events and three key up events….I would recommend re-writing these so you just have on key down and one key up event.you have two Every Frame events…. i would recommend rewriting so you only have one.
I would also consider that there are potentially ways to eliminate many of the the things you have in Every Frame events. The more you can reduce the logic in these events the better.You have many after X seconds….events. With this sort of logic you could have conditions where events will be missed, our cued and cause lag and or prevent other items from triggering while a wait state completes, especially when the timer is triggering animation.
As an example a kick or repeated pressing of 5 on the keypad…many events are going to be missed or queued and because the animations is already playing and the time event and animation are on going… the animations will either be truncated and restarted or skipped and this causes performance issues. To solve this sort of thing you would need to create some logic for what should happen if the 5 key has been pressed and the animation is playing on in a wait state…..you could tell the play head to go back to start frame on interrupt…or ignore additional input….but something. But because you have these nested timers, a different approach may be more useful.You are also using physics….this will slow things down too from a performance stand point.
I am not sure how you are using it or what its purpose is but I am guessing that if the character hits an object it should do something (play some animation sequence). If the objects are predictive, meaning they move or are static, I would use a different method of collision detection to avoid using physics if possible.I’ll look into this puzzles issue for sure, thanks
Performance is going to be measured by the target system requirements. Are you wanting this to playback on a mobile device via web server, going to output in Electron, Cordova?
Pardon my stupid question, but what do you mean “playback on a mobile device via web server”? Do you mean my project NOT published as an app like apps on Google Playstore, but independently published on the web?
I’m currently planning to make this project a webgame on a website accessible to mobile devices as well as desktops/laptops.
Ngl, this is my first time hearing Electron, cordova. This is helpful, thanks.
2024-09-26 at 5:11 am #77625xeonCustomerSo your background wall…needs to “look” 3D and no reason it can’t with proper textures. Your walls need to have an emission glow layer…no problem…still a material will solve this. Far less expensive and far more performant than a mesh…but this of course is your call.
Obviously I don’t know the design criteria for you game but there are a lot of modeling details that could be optimized. Now..with that said…your performance gains will be minimal in this area at this moment but could depending on you overall game design become significant. So its always best to start off with optimal assets you can clone or replicate. Panel0 is currently 407 triangles…this panel could easily be reduced to 240 by deleting inside faces, and using a texture. With some careful planning you can get this down to 66 triangles but you will need to create code to manage some cloning of parts. But get the rest of your game built then come back and plan on optimizing these assets.
Textures will allow areas, lights, panels, etc to glow independently. So no need to assign multiple materials…just need a good UV map for color and one for emission. Depending on the colors you use..you could also color pack four maps into one.
As far as how to remove faces…in Panel 0, you have 4 objects that face the outside each of these sub objects are close to the front face of the larger object…all of the rear faces can be deleted as they are never seen.
Scrolling games are typically 2D…even when created in 3D because of the efficiency and performance. If you are wanting to create an perspective view scrolling game then a 3D floor might make since otherwise the camera angle is defined and a texture would be better and a lot easier to manage and far more performant. Your render out the camera angle of your floor to an image and then place that image on a plane in front of the camera and you will not be able to tell the difference. The benefit is only 2 triangles. You can still have the floor glow green like you are doing but you just simplified it.
Regarding web based games. Since you are going to target different devices and resolutions..you may want to consider loading in different assets for different devices.
If its a small phone screen and bandwidth is bad….load in a different scene than if you are on a desktop with a great GPU. The layouts and screens are going to be so different. Are you going to take into consideration landscape and portrait or are you going to lock one out?
Serving mobile games on a web server means extremely efficient code and optimization far more important than doing a mobile app via cordova. Now of course the most important question is how big is your game and will it load on a mobile device? I don’t know how big your game will be.Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2024-09-26 at 8:41 am #77662c4ccParticipantSo your background wall…needs to “look” 3D and no reason it can’t with proper textures. Your walls need to have an emission glow layer…no problem…still a material will solve this. Far less expensive and far more performant than a mesh…but this of course is your call.
This isn’t just about “looking” 3D, it’s about parts of stages viewed from various 3d angles. (Imagine Bamboo Pandemonium stage Rockman x8). Meaning if I just used a flat plane with textures, it’d look weird (flat-ish) to view the stage from a different angle.
Obviously I don’t know the design criteria for you game but there are a lot of modeling details that could be optimized. Now..with that said…your performance gains will be minimal in this area at this moment but could depending on you overall game design become significant. So its always best to start off with optimal assets you can clone or replicate. Panel0 is currently 407 triangles…this panel could easily be reduced to 240 by deleting inside faces, and using a texture. With some careful planning you can get this down to 66 triangles but you will need to create code to manage some cloning of parts. But get the rest of your game built then come back and plan on optimizing these assets.
Really, Panel0 is 407 triangles? I checked the statistics under viewport overlays at the sneak peak row, and it mentioned 472 triangles. Also, why do I need to create code for cloning, when the cloning is available via puzzles? Why does having several materials ruin performance?
Textures will allow areas, lights, panels, etc to glow independently. So no need to assign multiple materials…just need a good UV map for color and one for emission. Depending on the colors you use..you could also color pack four maps into one.
How does baking textures really reduce triangle count? Or at least improve performance?
I’m worried that baking textures is time consuming. Also, do I have to bake textures for animated meshes (with armature) too?As far as how to remove faces…in Panel 0, you have 4 objects that face the outside each of these sub objects are close to the front face of the larger object…all of the rear faces can be deleted as they are never seen.
Done. Here’s a way to delete inside faces:
Scrolling games are typically 2D…even when created in 3D because of the efficiency and performance. If you are wanting to create an perspective view scrolling game then a 3D floor might make since otherwise the camera angle is defined and a texture would be better and a lot easier to manage and far more performant. Your render out the camera angle of your floor to an image and then place that image on a plane in front of the camera and you will not be able to tell the difference. The benefit is only 2 triangles. You can still have the floor glow green like you are doing but you just simplified it.
I’ll try this. Sounds good
Regarding web based games. Since you are going to target different devices and resolutions..you may want to consider loading in different assets for different devices.
If its a small phone screen and bandwidth is bad….load in a different scene than if you are on a desktop with a great GPU. The layouts and screens are going to be so different. Are you going to take into consideration landscape and portrait or are you going to lock one out?
Serving mobile games on a web server means extremely efficient code and optimization far more important than doing a mobile app via cordova. Now of course the most important question is how big is your game and will it load on a mobile device? I don’t know how big your game will be.I’ll have to dig deeper into cordova and puzzles more.
2024-09-26 at 2:45 pm #77680c4ccParticipantAlso, to optimize overall performance, is it better to bake textures, or optimize material instead?
I’m thinking of replacing BSDF with emission for color only materials
2024-09-26 at 3:30 pm #77683xeonCustomerOptimization is a strategy based on so many factors. Changing out BSDFs will help a bit but you would have to do your own tests to see how much efficiency you get out of it for your application. Your current scene and materials are very light at the moment but if you expect a significant increase in them…then yes..you may want to add this to your overall optimization strategy.
Baking textures is another optimization strat. Different in its uses and has different potential benefits. In most cases, the idea is to create normal maps for high poly objects and created normal maps to reduce geo. Or it can be to reduce redraws and overall memory usage or it can be a simple way to have shadows without having lights. Lots of options with baking textures.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2024-10-09 at 8:00 pm #77877c4ccParticipantGuess for the moment, I’ll have to refer to these:
https://www.soft8soft.com/wiki/index.php/Video_textures_and_alpha_transparency
2024-10-15 at 7:11 pm #77963c4ccParticipantWhy is it that rendered images viewed in photo viewers are fine (the render engine was EEVEE with 3180 x 2160), but when the same image is uploaded as a mesh in blender viewport, it looks a bit unclear (Note the light is switched off)?
Viewed as photo:
In Blender viewport:
How do I get my video/image textures to appear in blender viewport as they did when they were still objects/scenes? I want my video/image textures to have the same appearance as their original objects in blender viewport.
2024-10-18 at 6:48 pm #78014c4ccParticipantOn second thought, I may have found the answer here:
aspect ratio calculator
2024-11-06 at 7:58 pm #78507xeonCustomertesting a reply here
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com -
AuthorPosts
- You must be logged in to reply to this topic.