I recently found out that the projectile speed is measured in cm/s, and units are in cm. So, trying to use a realistic measurement, projectiles are broken.
The default speed is 6000 which means 60 m/s. A projectile with 500 m/s initial speed should have 50000. As far as I know this kind of speed has some problems with collisions due to it being checked every frame. So, higher speeds means it will ignore some collisions.
In Rust, the first x units, the gun shoots a line trace, then spawns a projectile at the end of the trace. How do I know when to spawn the projectile? What’s the safe speed for a projectile so it doesn’t make any trouble?
How do other games achieve a smooth projectile movement? How is a tracer round looking smooth when making the transition from linetrace to projectile?
For single player games, I learned a good limit is about 11,000 or 110 cm/s. For multiplayer games, it seems the best practice is the use of line traces (“hit scans”) rather than projectiles.
I completely understand why line traces are recommended, but if I intend to use a more complex “bullet”, I don’t know how to approach things with hit scans. For example how do I simulate gravity, and drag on a hit scan bullet? How do I make it curve? Maybe I want to attribute a certain dimension and weight to the bullet. I don’t want a huge artillery shell go through a crack in a ceiling because the line trace doesn’t detect collision…
Is there some sort of documentation about how different games approach projectiles?
This works a lot better in c++, though. In this example we might skip an array element with the swap, in BP that can be fixed with a While loop and conditionally ++… but it’s just to communicate the idea.
Thank you for the information! I’ve looked a bit at the blueprint, and I see some nodes that I’ve never used or even knew about. Such as the math expressions, setting members and getting data table.
It seems like the right path, but I need time to dissect the BP, and absorb the information to be able to use it further.
Do you have any recommendations for some learning materials? I have some UE knowledge, but I’m always hitting a brick wall when making more complex stuff. I ignored coding in C++ to accommodate with UE interface and BPs, but perhaps it’s time to switch to C++. Haven’t coded in C++ in 2 years, so any recommendations are welcome.
I’ve found that the more confident I get with math, the easier everything else becomes. So rather than dedicating time in learning what X node does, git gud with math / problem solving and the rest should fall into place.