Bounce Bug Question

  • Hey guys,


    I'm creating a game in UE4 (or rather having people create it for me) and I wanted to recreate the bounce bug as it works in CoD4. Since you guys specifically do jumping and bouncing in CoD4 and have made mods around it, I wondered if you had any information regarding how that bug works or how to reproduce it?


    Is it inherent in the Quake 3 movement engine as is or did the way the bounce works in CoD4 come from the changes infinity ward made to it?


    Any information by anyone knowledgeable in this would be greatly appreciated!


    Thanks.

  • I can't help you that much with explaining how the movement works in cod4.
    Since the files aren't open source you can just look at other games related to the quake3 engine.


    I think a good step to start would be this file:
    Enemy-Territory/bg_pmove.c at master · id-Software/Enemy-Territory · GitHub
    Afaik the ET and Quake3 (and maybe CoD4) speed calculations are done here.


    If you want more detailed info you could ask @IzNoGoD. He has more knowledge about the code behind the game.


    Also it would be cool if there is a way to check out (and maybe contribute) your work somewhere ;-)

  • Hey,


    I've already looked at that file (although I'm not a programmer), and although it seems that they barely made any changes to the way the movement works, I think a few changes were still made. Most of what existed in the movement file of the Quake 3 engine can be found within the CoD4 console as a command that can be tweaked.


    For example:


    1. g_speed (walking speed, and then using base walk speed in CoD4 they scale it, for example sprinting is set to 1.5 scale which is 50% extra speed on top of the base speed)
    2. Friction (responsible for slowing down the player when releasing any directional key)
    3. Jump Height
    4. Jump velocity


    Even strafe is readily available and the theory behind how it works is explained online, but so far nothing on CoD4 bounces. Other variables added to CoD4 which didn't exist in Quake 3 are two commands called linear and angular drag.


    This is only through doing my own research as a non-programmer!

  • If you're just trying to create a jump-game yourself, why not just code up (or get your programmers to code up) a bounce system? The concept is quite easy - much easier than intentionally recreating a bug from a different engine anyway. I've done it a long time ago in Python using the Blender Game Engine, although I never got to the variables (such as turn based speed increases) but they should be easy enough to add if you have dedicated and competent programmers.

  • Hey,


    It's not a jump game. I'm using the movement / feel of CoD4 (for an FPS), I have everything down already other than the bounces. I wanted the bounces to work like they do in CoD4 (almost identical), and the best way to do it is understand why it happens or if that's something visible in the original movement file or something that became possible in CoD4. Otherwise it's very hard and timely to use trial and error to code from scratch something that works the same. If instead I consult people who already understand and can explain why it does, it saves much more time.


    For example, in Quake 3 the closest thing I could find to bounces were something called Overbounces, but they function differently to how bounces do in CoD4, but I assume have something to do with why bounces happen in CoD4 too.

  • yea that doing "if hit then bounce scripts" doesnt work we see all day in cod4s scripted bounces scripts, should rly be a part of the engine.


    I also cant tell you how the bug is happening enginewise. an important thing to know is:
    The best angle for bouncing is when you cut a block diagonal which is 32 units thick x 100 units high. So the ratio is 3.125.

  • This is only a hunch on my part, but most likely this bug has to do with imprecision. My guess is that when a bounce happens it is because the collision box of the player enters the collision box of a piece of terrain and the algorithm that handles the collision physics causes the player to be reflected off the surface. But perhaps you have already come to this conclusion. Good luck with making your game, I am excited to see how it turns out!

  • I've ever been thinking about an ingame testexperiment using movementmeasurements such as the 'speedometer' which is a feature currently included in some of the current codjumper mods. Maybe there is a way to check out exact values in some sort of scripts or enginefiles but I am personally very ignorant about that..
    Nevertheless the ingame testexperiment would require 'accelerationometers' and 'speedometers' to properly run the experiment which could give some valuable answers to how bouncing and the other cj-mechanics really work. Maybe even up until a point where it's even possible to calculate whether a jump is possible or not or even going to a point where it's possible to calculate the difficulty of a jump.. but well.. that's an idea which is far ahead to realise.


    First we would need a modmaker or scripter who has the knowledge, motivation and time to create an 'accelerationometer' and a 'speedometer' for the X-axis, Y-axis, Z-axis, XY-axis, YZ-axis, XZ-axis and if possible the XYZ-axis. the thickened ones for sure since you could calculate the speed and acceleration of the other axisses once you know the speedmeasurements of the thickened axisses.

  • First we would need a modmaker or scripter who has the knowledge, motivation and time to create an 'accelerationometer' and a 'speedometer' for the X-axis, Y-axis, Z-axis, XY-axis, YZ-axis, XZ-axis and if possible the XYZ-axis


    I started a test branch very short after the release of the 3xP' CJ Mod. Came to a point that I could barely say if a jump was good or bad.
    I would have to spend more time to investigate this and compare it with the original ET files (because cod4 changed/removed some dvars which were in the ET calculation). But until 24th Jan 2017 I've no time for this

  • Correct me if I am wrong, but speed is just change in position over time, and acceleration is just change in speed over time. Both of these should be able to be calculated using the origin of the player over time. If I am right about this, then after getting myself accustomed to the cod4 version of gsc I could probably get what @frisbeesky asked for done in a few days at most, or at least the 'accelerationometer' and 'speedometer' parts for the various axis and combinations of axis. I dont know much about file io with gsc, but if someone can point me in the right direction with it I can also implement that to make accessing the data easier. Also what does the current 'speedometer' in the 3xP' cj mod monitor specifically?

  • atm it shows your speed in x and y direction.
    I think what @frisbeesky wants is a graphical tool how good is your strafe. Or better: how much you have to turn in one direction to get the optimal strafe


    no, I don't want a strafeguide display telling me how well my strafe is like jh has which, by the way, isn't always an accurate thing to use since you don't always have to keep the acceleration to the max to perform a jump. Esspecially by small jumps.
    I only want those speedometers and accelerationmeters as I explained. :p

  • Haha thread hijacked!


    I don't think so. We have still the same topic: bounces and strafes. If we find a way to detect how good a strafe / bounce is, then you could use this as "small unit test" to check if your system get the same values as our function ;-)


    Anyway, here are some Links I've found so far:
    quake3-movement-unity3d/CPMPlayer.js at master · Zinglish/quake3-movement-unity3d · GitHub
    seems to be based on a quake mod:
    bg_promode.c (there some other files in the parent folder)
    Source:


    IDK if it helps but maybe it does

  • Yeah I've spoken to this guy who also had a port of the quake 3 movement for UE4 too, but he hasn't released it yet and plans to as a package for licensing. Even with that, I'm not sure if the bug would be reproduced (bouncing) and it still needs a few values changing to get it to work like CoD4.


    I already have a few people who can give me a movement component for the character that works like Quake 3 so I can modify it to CoD4, but that still wouldn't include or inform me on how the bounces work.


    It's more or less the last piece of the puzzle to work out!