Author Topic: StuntsLegacyEngine  (Read 5911 times)

llm

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
Re: StuntsLegacyEngine
« Reply #60 on: December 15, 2021, 08:21:21 AM »
For the original engine I can't even imagine how to get that done.
I was thinking about the collision part of CAS his engine. (Updated that post for clarity)

I know, but a greefield projects makes it still not easy in detail
Your description of the case will still result in 2000-3000 lines of code with more or less complex math

Daniel3D

  • Tunnel Twister
  • ***
  • Posts: 1383
  • so many ideas....
    • View Profile
    • Stunts resources.
Re: StuntsLegacyEngine
« Reply #61 on: December 15, 2021, 09:01:43 AM »
I just hope I can help envision the basic structure.
Edison once said,
“I have not failed 10,000 times,
I’ve successfully found 10,000 ways that will not work.”
---------
Currently running over 20 separate instances of Stunts or 4D Sports Driving.

llm

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
Re: StuntsLegacyEngine
« Reply #62 on: December 15, 2021, 10:14:21 AM »
I just hope I can help envision the basic structure.

no problem - but your text was on such a high abstract level thats its compareable to "how to bring a man on the moon"
build a rocket, put a man in it, fly to moon, finished :)

Daniel3D

  • Tunnel Twister
  • ***
  • Posts: 1383
  • so many ideas....
    • View Profile
    • Stunts resources.
Re: StuntsLegacyEngine
« Reply #63 on: December 15, 2021, 12:18:28 PM »
I never said it be much of a help.
Nor did I claim to have the answer.
I'm not Sherlock Holmes, more like Dr Watson.
Blurting stuff out until someone else see's the light...
Edison once said,
“I have not failed 10,000 times,
I’ve successfully found 10,000 ways that will not work.”
---------
Currently running over 20 separate instances of Stunts or 4D Sports Driving.

Cas

  • Highway Horror
  • ****
  • Posts: 1430
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: StuntsLegacyEngine
« Reply #64 on: December 15, 2021, 09:13:27 PM »
Alright, so these are more or less the difficulties:

  • When in the air, you want to calculate the next position. If that position is also in the air (no collision), it seems easy, but it's not that much. The car is a non-point-like solid object and thus, it has an angular momentum. I have to calculate where each of the vertices that make the block are going to be and maintain the distances between them. Also, at the speed a car can fly in the air like in Stunts, air drag is significant, so the angular momentum will not be fully preserved. This has to be calculated too.
  • When landing, there are several problems. I could say that the car will land if the centre of mass will cross from one side to another of a surface during that cycle, but this surface, while in a plane, does not go to infinity, so even if the centre of mass crosses it, maybe the wheels don't, or some wheels do and some wheels don't. And if the centre of mass does not cross it, maybe one or more wheels does, in which case, the car should rotate so that the wheel that crosses is forced to stay on top of the ground. Again, rotation of a solid. I don't know if I should individually calculate for each wheel and then put everything together or calculate the wheels from the car in general. Both options are complex.
  • It gets even worse when going from a plane to another. In reality, because the car has for wheels, there is no guarantee that there will exist a plane that shares the positions that the four of them should have at any given time when transitioning between two planes. So one or two wheels might be in the air and their "right" position is undefined. I have to choose. Looking at Stunts, it seems it makes an "average". Get to a slow diagonally and you'll see what I mean. Suspension could be a solution, but it will add extra complexity.
  • For an impact, if it happens above a certain speed, it should be a crash, no matter the angle. If it isn't that fast, then we have to see about the dot product between the car's normal and the surface normal first to decide if it'll land straight or upside down, but it shouldn't crash immediately even if upside down. It would just be uncontrollable. In Stunts, this is how it works. It stays like that for a moment and then it crashes alone.
  • There are some configuration when Stunts clearly doesn't do the things the way it should and emulating it would require adding some tweaking or being smart enough to realise why that happens. One such case is when you drive by the side of the bridge part of a cork u/d. You only have the wheels of one side on the surface, yet the car remains straight. It'd be even harder to do if I wanted to create angular momentum from this. The other case is when driving upside down inside a pipe just staying on the ceiling. Almost the same principle.
  • There's a lot more to consider
Earth is my country. Science is my religion.