Author Topic: Bullettime  (Read 2763 times)

Would it be possible to create a 'bullettime' system for combat, that would (presumably) set the client timescale of anyone within a certain range / in view of the player to a slower value (ex. 0.2)?
I'd imagine it'd be possible if there's a way to check if someone can see a player.

there is a flash bang addon that does something similar to this. It also has a flash too, as that's the main purpose of the addon.

there is a flash bang addon that does something similar to this. It also has a flash too, as that's the main purpose of the addon.

fairly sure what the flashbang does is set the clientcmdtimescale of anyone near the explosion to something lower
could try to use that for the bullettime

Changing timescales on individual client's doesn't work. It looks like it does when you do it, but it doesn't
All it does is cause network desynchs, and multiple add-ons that have tried to do this have been failbinned for this reason

Example: A bullet 100 units away is traveling directly towards your face at 50 units/per second. You're running at 0.5 timescale, so after two seconds, you see it has traveled halfway. But the server is running at 1.0 timescale, so it has actually just hit you in the face, and now you have died to an object that you don't even see anywhere near you
« Last Edit: November 30, 2014, 11:11:06 AM by Headcrab Zombie »

there is a flash bang addon that does something similar to this. It also has a flash too, as that's the main purpose of the addon.
fairly sure what the flashbang does is set the clientcmdtimescale of anyone near the explosion to something lower
could try to use that for the bullettime
Taking a look at the flashbang code (I have it for something else), this sticks out and seems like what we're looking at -
Code: [Select]
function flashGrenadeProjectile::onExplode(%this,%obj)
{
   parent::onExplode(%this, %obj);
   initContainerRadiusSearch(%obj.getPosition(),23,$TypeMasks::PlayerObjectType);
   while((%target = ContainerSearchNext()) != 0)
   {
      if(!isObstruction(%obj.getPosition(),%target) && isObject(%obj.client.minigame) && %obj.client.minigame == %target.client.minigame && %obj.client.minigame.weapondamage == 1)
      {
         %angle = calculateAngle(%target,%obj.getPosition());
         //echo("Angle:"SPC %angle);
         if(%angle < 100 && %angle > -100 || %angle > -360 && %angle < -260 || %angle < 360 && %angle > 260)
         {
    if(%angle < 0)
       %angle = mAbs(%angle);

    if(%angle > 180)
       %angle = %angle/6;

    if(%angle < 10)
    {
       %start = 2;
    }
    else
    {
       %start = mFloatLength(1/%angle*25,4);
    }

    if(%start < 0.2)
       %start = 0.2;
    //echo("Start:"SPC %start);
    %target.setWhiteout(%start);
    %sched = %start*1000;

    setTime(%target.client,0.2);
    %target.timeSched = schedule(%sched,0,"setTime",%target.client,1);

    %target.client.play2D(FlashDeafenSound);
         }
      }
   }
}

function setTime(%client,%time)
{
   if(!%client.isHost) //Due to client-sided timescale glitches and Torques Networking, if they host is set in a different timescale, all other players get a weird kind of lag. Players on my server reported that it's "Like a setTransform relay trap, you can't move". This makes it so host won't get 'stunned' and the whole server will lag.
   {
      if(%time >= 0.2 && %time <= 2)
      {
         commandToClient(%client,'timescale',%time);
      }
      else
      {
         error("Error - setTime: Time must be between 0.2 and 2");
         warn("Usage: setTime(client, float time)");
         return;
      }
   }
   else
   {
      //echo("This guy's the host, don't wanna mess with him!");
      return;
   }
}
This on it's own is neat, but it's not what I want. I'm thinking of something similar to the system in Max Payne 3's multiplayer, where everyone in line of sight of a player is affected, instead of it being triggered by some sort of explosive.
Changing timescales on individual client's doesn't work. It looks like it does when you do it, but it doesn't
All it does is cause network desynchs, and multiple add-ons that have tried to do this have been failbinned for this reason

Example: A bullet 100 units away is traveling directly towards your face at 50 units/per second. You're running at 0.5 timescale, so after two seconds, you see it has traveled halfway. But the server is running at 1.0 timescale, so it has actually just hit you in the face
Would it be possible to have projectiles that detect what timescale a person's in, or something?
« Last Edit: November 30, 2014, 11:13:20 AM by AutoBahn »

Would it be possible to have projectiles that detect what timescale a person's in, or something?
Yes, but what are you going to do with that information? Make the bullet travel at a speed proportional? What happens to clients who aren't slowed down, and see it?
How do you work projectiles with a gravityMod? Slowing them down would affect how far they arch, and I don't believe gravityMod can be changed on a per projectile basis, only on the datablock
« Last Edit: November 30, 2014, 11:17:48 AM by Headcrab Zombie »

Yes, but what are you going to do with that information? Make the bullet travel at a speed proportional?
Presumably.
Slowing them down would affect how far they arch, and I don't believe gravityMod can be changed on a per projectile basis, only on the datablock.
You could have the projectile change to a different datablock without gravityMod, or to one with a different value for it so that it flies correctly(which would probably require the timescale for the bullettime to be a set, unchangable value, but it works). I was more thinking along the lines of possibly having a bunch of weapons set up specifically for bullettime, and have the ability be stowed in the pack with those weapons that support it, so that's another solution.
What happens to clients who aren't slowed down, and see it?
It could be possible to just have it so that all datablocks within view or range of someone who's affected by bullettime also get the effect themselves.
« Last Edit: November 30, 2014, 11:23:58 AM by AutoBahn »

Just do what they do for the multiplayer in TimeShift, where it creates a time bubble. You move slower, projectiles almost stop, and vignette changes color.
There could also be a fast variant, which speeds up time, making bullets faster and insta kill when it passes through. Plus, you could use it to run through really fast, like when moving between cover!

Ok, I've never seen a proposed solution to this that I like, but that sounds really cool
A bubble around the player that slows down projectiles and movement speed of players inside it, but doesn't affect the player using it, or allies

The only problem is there's no good way to slow a player. The only way to slow movement speed is to change the datablock, which messes up any settings on the datablock they were using before, and I don't think there's any reliable way to slow down the fall speed

Ok, I've never seen a proposed solution to this that I like, but that sounds really cool
A bubble around the player that slows down projectiles and movement speed of players inside it, but doesn't affect the player using it, or allies

The only problem is there's no good way to slow a player. The only way to slow movement speed is to change the datablock, which messes up any settings on the datablock they were using before
There's Nekram's push and pop functions
which are kind of insane but they'd work for that

There was a script made a few months ago that changed the client time scale when a player dies in mid-air. It changed it for the killer and victim.
Can't we change that and make this happen?

There was a script made a few months ago that changed the client time scale when a player dies in mid-air. It changed it for the killer and victim.
That's just terrible
I understand victim, they're dead so you can't really forget them over any more, but killer, forget no. Like imagine you're in a huge firefight with people everywhere, then you kill someone, now you're forgeted because your speed is slowed down

It sounds cool, people who don't know better think "yeah the bullets will be slowed down and you can avoid them easierr" but the reality is everything is slowed down; your movement speed, allowing other players to catch up to faster, your camera turning speed, so you can't aim as effectively, you don't see bullets coming at you correctly (see my first post in this thread), etc.

Can't we change that and make this happen?
There's no reason it can't happen; the add-on you described is very simple. It just that it's a terrible idea because it doesn't work the way people suggesting it think it does
« Last Edit: December 02, 2014, 07:31:29 PM by Headcrab Zombie »

A bubble around the player that slows down projectiles and movement speed of players inside it, but doesn't affect the player using it, or allies
well, the time grenades in timeshift affect everyone who ends up in the little bubbles, including the player who threw it and their teammates