Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

What is the fastest way to get distance between two objects? Godot 4 Tutorial - GDScript Perfomance

Автор: Nanotech Gamedev

Загружено: 2024-06-15

Просмотров: 3959

Описание:

NOTE: Although this video shows you how to benchmark your functions, the fastest way to optimize your code can be caching information outside of the looping methods, and depeding on the amount of operations executing inside the same looping function the math can drastically improve the perfomance.

On this project if I stored the global position outside of the looping function and execute the math inside the same looping function it runned at ~0.029 seconds, that's almost 10x times faster than what I showed in the video at ~0.281 seconds;

-
So I wanted to make sure what was the fastest way to check the distance between two objects, this is a replacement to physics collision systems as we can assert if a object is close enough to another it means we can do something, so this is way faster than using geometric physics with meshs colliding, because it's just based on distance, for RTS and games where you need this type of information, this can be quite handy,

But how do you even optmize functions, find out which one is the fastest or test them? In this video I also will be working with a Callable to inject itself as a argument in oder to bechmark all the functions you want, this way you can test a lot of different functions very easily, if you never used Callables or find them confusing, this video should provide you an example of how to use them.

This was prompted by a comment, so don't be afraid to comment on my videos as you can provide useful insight to many different people, thanks for the comment, I believe it works faster, I just could test it with C# or C++ yet, but I believe it is faster, with GDScript however, this works a little different,

Check the full video, subscribe and comment,

What is the fastest way to get distance between two objects? Godot 4 Tutorial - GDScript Perfomance

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

array(0) { }

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]