PokeVideoPlayer v23.9-app.js-020924_
0143ab93_videojs8_1563605_YT_2d24ba15 licensed under gpl3-or-later
Views : 685,781
Genre: Gaming
License: Standard YouTube License
Uploaded At Jul 27, 2024 ^^
warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.954 (704/60,760 LTDR)
98.85% of the users lieked the video!!
1.15% of the users dislieked the video!!
User score: 98.27- Masterpiece Video
RYD date created : 2024-11-22T15:03:28.222148Z
See in json
Top Comments of this video!! :3
The much bigger optimization is to choose a completely different approach , on a low end machine you should be having hundreds of enemies pathfinding at once without dropping below 60 fps , especially in a 2d game, so the problem here is the algorithm itself and not the frequency, but i understand this is just an example
2.6K |
My game has about 500 enemies pathfinding on screen at a time. The pathfinder updates every 6 frames and I use multithreading and ECS to lessen the load on the main thread and reference the data more efficiently.
I still have some optimizing to do, currently creating and destroying enemies and I saw your video about instantiating all objects on start then disable and renable when needed but I feel like that takes the same amount if not more processing than creating and destroying.
God optimization is a real puzzle sometimes
162 |
Another optimization you can do is have a dedicated pathfinder thread. That way you can queue up as many pathfinding requests as you want and it won't hurt FPS. Instead the mobs will react slower if the pathfinder is overwhelmed.
This is something oxygen not included does for example.
Another thing you can also do is for the second pathfinding is not start at the position you are at but like halfway through it or 2-3 tiles of movement that way you also support that players can fakeout the AI and it isn't magically going to see what you do before you do it.
Edit: another thing you could do is a reverse search with dystars Algorithm. That way you only have 1 pathfinding check no matter the enemies and they all can just ask the player where they need to go :)
(Its a floodfill search that gets crazy efficient if you have multiple targets)
22 |
I know this about time slicing and not pathfinding, but it this case you can probably use steering behaviours without any pathfinding at all! Fliers are usually found in big open spaces rather than tight mazes. So simply casting a shape towards the player and avoiding obstacles that intersect it can often do the trick. If it doesn't, try combining it with portal based waypoints or very course grid DFA. Remember to use string tightening on the result!
1 |
Just make sure to have each one checking on different frames so that you don't have a lag spike every 15 frames. You also only need to check the ones that are in frame or close enough to be relevant. You can also use 2D voxel pathfinding which may be more performant depending on the size of those voxels. There's probably some other methods too, but that's off the top of my head.
1 |
@InboundShovel
3 months ago
Wishlist Isadora's Edge on Steam!
store.steampowered.com/app/3125320/Isadoras_Edge/
And you can follow the Kickstarter here: www.kickstarter.com/projects/inboundshovel/isadora…
Thank you!
380 |