Тёмный

Pathfinding and Async Tasks in Bevy 

Logic Projects
Подписаться 7 тыс.
Просмотров 8 тыс.
50% 1

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@vincenthoward9378
@vincenthoward9378 Год назад
Cannot wait for the new Bevy release along with your new series
@logicprojects
@logicprojects Год назад
I'm excited too! I've been drafting it for a while
@stephenjjbrown
@stephenjjbrown Год назад
I've been implementing pathfinding in my Bevy game and have referenced this video so many times. Thank you for putting this together!
@TheTwyker
@TheTwyker Год назад
I cannot tell you how excited I am about this video ❤☺️🙌🏻
@igz
@igz Год назад
Very cool! How many dudes can you have before you notice any lag?
@logicprojects
@logicprojects Год назад
It's hard to say, with the compute tasks you don't get frame drops but you can notice the dudes waiting for their pathfinding job to complete for a little bit with larger grids (>200x200). Frame lag would be driven by other systems like sprite rendering
@alexkazimir3835
@alexkazimir3835 2 месяца назад
Great 🎉
@kablouserful
@kablouserful Год назад
Are you copying the entire grid for every entity pathfind query in every frame? That seems expensive. I would instead do 1 grid copy at the end of `fn wander()`. And spawn many tasks all sharing an immutable grid.
@logicprojects
@logicprojects Год назад
Yeah I am. That's one of the optimizations worth looking more into. You would need to put it behind a shared pointer. In practice the limiting factor is the raw cost of astar and not the clone in my quick profiling though so I haven't dug into that yet.
@kablouserful
@kablouserful Год назад
@@logicprojects Yes I agree. The overall cost is still dominated by astar. But the astar time cost can be hidden by the async nature. But the copying is not async to the game loop. So this causes the most amount of game loop lag.
@logicprojects
@logicprojects Год назад
I realized this last night. You are 100% right that the copy happens in the loop
@Tszyu01
@Tszyu01 Год назад
Great videos. Can you suggest any ideas or resources on enemy entity field of vision. Such as a metal gear solid where enemies have a cone of vision to determine if your character is visible to them.
@jeffg4686
@jeffg4686 Год назад
I'm moving into AR. I found a great middle ground, for now. Unity with C#, but calling into Rust libraries that I build. This would allow best of both worlds for now. Haven't done anything yet - still have lots of AR training ahead of me. I want to get past the basics. I hated the thought of losing Rust though - put so much time in. Gonna move back to Bevy once it gets OpenXR integration. this pathfinding is a perfect example. Run that on a whole bunch of items.
@logicprojects
@logicprojects Год назад
I haven't looked into much AR myself but I have started toying with bevy on Android. I'm excited to give it some more time when they have a prototype OpenXR ready
@jeffg4686
@jeffg4686 Год назад
@@logicprojects - there's a lot of great training out there for Unity even if you don't plan on using it - shows you what you can do. Then when OpenXR comes to Bevy, all the concepts are solid. Can't wait for it to come to bevy, but I don't mind using unity for now.
@jeffg4686
@jeffg4686 Год назад
@@logicprojects - It also looks like the "Component Model" is coming along, so should be able to use Rust compiled to Wasm inside a WebXR app in Unity. Don't know how far out that is. Not sure if Unity compiles to Web GPU (vs webgl) yet either, but likely soon if it doesn't support it already.
@IcyTorment
@IcyTorment 6 месяцев назад
Good video, but that dark-grey-on-black syntax highlighting is a bit of a problem.
@bigenough2122
@bigenough2122 Год назад
cool, thanks ❤
@cherloire7978
@cherloire7978 Год назад
Hey, with the Grid struct, what happens if an Entity is despawned from the game? Do you have to go and manually find that entity in the grid and remove it?
@logicprojects
@logicprojects Год назад
I have systems in the grid plugin that should keep the grid accurate. Specifically in the grid.rs file in the source (in description) I have a remove_from_grid system that uses RemovedComponents to check for despawns and clean the grid. My main open problem is if 2 entities have the same location the only the most recent will be properly in the grid but I mitigate that with an error log message
@cherloire7978
@cherloire7978 Год назад
@@logicprojects Ok, thanks. Are there any more general issues with storing entities in places, such as in resources, components, etc as struct fields?
@indierusty
@indierusty Год назад
Without an Editor , Is developing game in bevy is slow in comparison to other game engines? Will bevy have an editor and when?
@logicprojects
@logicprojects Год назад
It's not slower for the games I like to make that are more procedurally generated. If anything it's faster for me because the editor doesn't really get you much if you're not laying out scenes. Bevy is also missing some of the other built in editor tools like animation state machines and particles. There are plans for a bevy editor this year though!
@larperdixon723
@larperdixon723 11 месяцев назад
Just wanna chime in here.. if you are building a 3d game with scenes where the position and orientations of the objects in the scene need to be taylored, I do not recommend doing that in bevy+rust, I recommend using something like blender to export a gltf (glb) and load that with bevy. @@logicprojects
@darknetworld
@darknetworld Год назад
May take a while until I start working on the pathing. But good ref still I wonder about the 3D which is tricky since I no clue how it works. I bet it a lot of work and depend how it build.
@logicprojects
@logicprojects Год назад
I'm sure there's a lot of resources out there. This crate is just the raw algorithms. I think Unity's navmesh is the general solution where each triangle in a mesh would be one of the graph points you feed into astar (if I understand it right)
@SuperSkydrake
@SuperSkydrake 11 месяцев назад
Very good video, I tried your project on Ubuntu linux, it became very slow after 1 minute playing :( I think it have a bug somewhere.
@JohnSmith-ox3gy
@JohnSmith-ox3gy Месяц назад
Uh, oh. Rust asynch. Truly cursed.
@micycle8778
@micycle8778 8 месяцев назад
why do they call them von neumann neighbors when they could be called rook neighbors
@etopowertwon
@etopowertwon Год назад
*Screams silently in imagining copying entire grid of Dwarf Fortress*
@logicprojects
@logicprojects Год назад
Probably actually wouldn't be that bad. This grid is just entity references and I tested on maps larger than df. Multiple z levels would start to push it though, definitely a smarter connected components approach would be needed at some point
Далее
Sprite Sheet Animation and Asset Loading in Bevy
3:34
Compute Shaders in Bevy
21:12
Просмотров 12 тыс.
Новый уровень твоей сосиски
00:33
I Optimised My Game Engine Up To 12000 FPS
11:58
Просмотров 663 тыс.
A Comparison of Pathfinding Algorithms
7:54
Просмотров 715 тыс.
Bevy: A quick introduction
7:20
Просмотров 13 тыс.
So I Made My Own Game Engine...
10:19
Просмотров 93 тыс.
The Strange Graphics Of LETHAL COMPANY
15:59
Просмотров 834 тыс.
Pathfinding - Understanding A* (A star)
12:52
Просмотров 126 тыс.
Learn Bevy 0.11 By Making a Game! (part 1)
13:01
Просмотров 43 тыс.
Procedual Voxel Tree Generation - Rust Game
7:26
Просмотров 33 тыс.
Новый уровень твоей сосиски
00:33