Author Topic: Am I the only one who hates physics distortion?  (Read 405 times)

cupid_the_conqueror

  • Global Moderator
  • Experienced Member
  • *****
  • Posts: 89
  • Likes: +0/-0
  • A filthy casual
    • View Profile
    • the truth of rawbots
Am I the only one who hates physics distortion?
« on: March 27, 2016, 04:22:41 pm »
I know there is alotta flaws in rawbots. I know the early devs didn't really do their best. But nothing pisses me off like the way they decided to tie the visual rendering of the game, to its physical computation. WHY!?

Like get this okay, I spent alot of time tinkering with pressurlines ballistic cannon bot to make my own variation which fired a rocket. I had it so it hit the target 100% of the time. Then I modified the map and added some other bots and stuff.

I later came back to show a friend my amazing rocket bot, and it missed time after time. I reset the map to remove all the chnages I made, and then it Hit!

so just to make sure I was right, I reset, then spawned in my BigVTOL. And sure enough, the rocket missed by a mile (over the target).

That is hands down the dumbest thing I've ever seen from my pyshics based sandbox. If your going to lag the game when there is lots of stuff on screen, Fine, thats cool, But why do the LAWS OF PHYSICS BEND WITH THE CPU PERFORMANCE IF THE GAME IS ALREADY LAGGED?! AAAARRRGGHH!


in short, my robot I was working on which would deliver a volley of 12 long range ballistic dumb fire rockets has been put on hold indefinitely due to stupidity.
At the end of the day, love conquerors all.

MarvinMan

  • Automation Expert
  • Experienced Member
  • ***
  • Posts: 236
  • Likes: +4/-0
    • View Profile
Re: Am I the only one who hates physics distortion?
« Reply #1 on: March 27, 2016, 09:43:20 pm »
I've not really noticed anything like that before. If anything, it's usually the opposite problem where the physics keeps trying to run in real time while the engine lags up, making control systems unstable.

Regardless of the actual problem, the best solution would be to tie the in-game time to the physics time step so that time slows down as the engine lags up.

z26

  • Experienced Member
  • ***
  • Posts: 108
  • Likes: +0/-0
    • View Profile
Re: Am I the only one who hates physics distortion?
« Reply #2 on: March 28, 2016, 03:16:21 pm »
I don't think the reason rawbots physics fail when rawbots is lagging has anything to do with the graphics.  Instead, it all has to do with the physics themselves.  The physics stimulation tries to calculate a precise number of frames each in-game second.  if its not fast enough to do that without being late its left with the following choices:

1. Make the in-game time go slower than real world time.  That way the game looks like it runs in slow-mo to the player, but the simulation still calculates the same number each in-game second, so the physics act the same.

2. Keep the game running the same speed to the players eyes, but calculate frames less often per in game second.  This makes the physics less accurate like discussed in this article http://gafferongames.com/game-physics/fix-your-timestep/ because the less often the physics are calculated the more errors accumulate.  Thats basically the physics engine half-assing its job because its the only way to meet the deadline.

Rawbots is probably doing 2 and as Marvinman said it should be doing 1.  We should be able to choose whatever timestep we want in the settings and if the game isnt able to keep up it should slow down time.
« Last Edit: March 28, 2016, 03:19:18 pm by z26 »

MarvinMan

  • Automation Expert
  • Experienced Member
  • ***
  • Posts: 236
  • Likes: +4/-0
    • View Profile
Re: Am I the only one who hates physics distortion?
« Reply #3 on: March 28, 2016, 08:30:14 pm »
If the game insists on trying to run in real time at the expense of physics accuracy, it would be nice if it would keep the graphics framerate up so it at least looks like it's running smoothly.

PressureLine

  • XFM Developer
  • Administrator
  • Experienced Member
  • *****
  • Posts: 192
  • Likes: +4/-0
    • View Profile
    • Rawbots Club Forums
Re: Am I the only one who hates physics distortion?
« Reply #4 on: March 29, 2016, 07:49:18 am »
I'll have another go at getting framerate independence set up properly, no guarantees though.
"Never assume that anything you've never seen before is benign. Most particularly not something that says 'MARINES' on it."

PressureLine

  • XFM Developer
  • Administrator
  • Experienced Member
  • *****
  • Posts: 192
  • Likes: +4/-0
    • View Profile
    • Rawbots Club Forums
Re: Am I the only one who hates physics distortion?
« Reply #5 on: March 29, 2016, 10:15:13 am »
1. Make the in-game time go slower than real world time.  That way the game looks like it runs in slow-mo to the player, but the simulation still calculates the same number each in-game second, so the physics act the same.

...

Rawbots is probably doing 2 and as Marvinman said it should be doing 1.  We should be able to choose whatever timestep we want in the settings and if the game isnt able to keep up it should slow down time.

I can do that... kinda... but I don't think it will affect timer-based actions like where you use a 'ki' controller to fire a jet for a certain amount of time before it turns off, since I think they run off the system clock. As I said earlier, I'll see what I can do, but I have tried a few things (both tonight, and back in 2014 when I first started looking into it) and nothing useful has come out of it :/
"Never assume that anything you've never seen before is benign. Most particularly not something that says 'MARINES' on it."

MarvinMan

  • Automation Expert
  • Experienced Member
  • ***
  • Posts: 236
  • Likes: +4/-0
    • View Profile
Re: Am I the only one who hates physics distortion?
« Reply #6 on: March 29, 2016, 01:22:16 pm »
In terms of stability of control systems, having integrators tied to the system clock shouldn't be a problem. However, timed functions could be annoying if they ran on a different clock to the main physics engine. Although, you could argue that if the game is lagging enough for that to be noticeable, you probably have bigger problems.