Source Engine Tick System Explained

  Рет қаралды 125,703

Pinsplash

Pinsplash

Жыл бұрын

Fix Your Timestep (mentioned at 6:44): gafferongames.com/post/fix_yo...
King's Quest run: www.speedrun.com/kings_quest_...
GoldenEye 007 run: • Statue - 00 Agent - 2:...
OneShortEye: / oneshorteye
This video's subtitles took 36 minutes.
This project started around December 6.

Пікірлер: 400
@Pinsplash
@Pinsplash Жыл бұрын
People keep saying things along the lines of this so let me just inform you all that what happens in one engine has no bearing on another engine. Patch 1.1 Removed bit where I spoke poorly about the downsides of delta timing
@izzieb
@izzieb Жыл бұрын
I know exactly what a tick rate is. It's how many ticks bite you per minute and it influences how quickly you get Lyme Disease.
@wayamiownqwuj896z83ZMWAGVwfa
@wayamiownqwuj896z83ZMWAGVwfa Жыл бұрын
lmaoo
@truestbluu
@truestbluu Жыл бұрын
exactly
@ScootyPuffJrSux
@ScootyPuffJrSux Жыл бұрын
A disease that turns you into a lime? Horrifying
@WDC_OSA
@WDC_OSA Жыл бұрын
I think KZfaq has the same idea. It served me an ad for a mobile game about bugs fighting.
@joejoemyo
@joejoemyo Жыл бұрын
The midwest be like
@bugjams
@bugjams Жыл бұрын
"You won't understand what ticks until you understand the issues with the alternatives." Ah yes, _lice._
@CodeF53
@CodeF53 Жыл бұрын
Minecraft with the Carpet mod gives an excellent demo of ticks. /tick freeze allows you to stop all game ticks while still allowing movement /tick step does one step You can speed or slow time by changing the tick rate /tick rate 20 is the default rate of the game /tick rate 10 makes 1/2 speed Its an excellent way to introduce the concept of ticks to people, and very helpful for debugging redstone contraptions
@alejandroooow
@alejandroooow Жыл бұрын
/tick freeze stops the internal server ticks, and therefore doesn’t harm or affect in any way the client itself. I think it’s quite important to make clear how Minecraft works, where your world or save is actually a separate server. The client doesn’t necessarily rely on ticks, and only on the information provided by the internal server (your world). This means that while the server might be dying, your client is likely going to be just fine as it’s not affected by the server’s tick timings. It’s pretty much like getting the official Minecraft server JAR and running it on localhost. The results would be the same
@ShadowTheAge
@ShadowTheAge Жыл бұрын
In the minecraft however there is no delta timin, everything assumes there will be 20 ticks per second and changing that will make everything slower or faster
@sety5591
@sety5591 Жыл бұрын
​@@ShadowTheAge delta timing is tick, and tick is delta timing. I mean, because the code has to explain to CPU what "tick" is, and the meaning of ticks for a low-level programming is delta-time (as said in the video). Maybe some games call "ticks" as "ticks" in their game code, but it is merely an abstraction, instead there's a lower-level code that actually explain what "ticks" is, and it is delta-time. For example, let's do 10ticks per second, which is delta-time of 0.1second, so for a low-level code, such as C++, you do an infinite loop and for each pass you add a ""sleep" command to CPU for 0.1second (to let the CPU rest for 0.1second or let it to do other task), and you define this as 1 tick for higher-level code like LUA, and modders and devs only need to code on LUA.
@cheesepop7175
@cheesepop7175 Жыл бұрын
so now you can TAS minecraft, neat
@agmass
@agmass 3 ай бұрын
Minecraft sets ticks on the server, not the client. This is also how most multiplayer games would do this; as baissicaly all of the game code is done on servers; and the client is just a dummy, making the graphics and sending out inputs.
@lucialambda
@lucialambda Жыл бұрын
"skyrim was made by bethesda" 💀 great video! this is the best explanation i've heard for what ticks actually are. i've never fully understood the difference between ticks and frames before, and people talk about tickrates etc. quite a bit when it comes to setting up servers for bhopping capabilities (in css at least).
@lucialambda
@lucialambda Жыл бұрын
the credits at the end were funny as well lmao
@nodrognameerf
@nodrognameerf Жыл бұрын
2 days ago?
@olegmoki
@olegmoki Жыл бұрын
@@nodrognameerf unforeseen consequences of being a sponsor
@nodrognameerf
@nodrognameerf Жыл бұрын
@@olegmoki lol
@jgibbles
@jgibbles Жыл бұрын
That gave me a good laugh
@hermitgreenn
@hermitgreenn Жыл бұрын
It deserves to be pointed out how unique the Goldsrc, Source and (to a lesser extent) IDTech engines are regarding how they process game logic in general. Everything, even the menus and single player runs on a server, a local server in this case. In a way. When you open Half Life 2 you effectively start a local dedicated server just for your game session. This is the reason enabling cheats is a server command, same with changing the tickrate. IDTech games tie some game logic to the frame rate even to this day whereas Source relies on tickrate. Frame rate dependent movement is why you have super bounce bugs in Quake 3 and Call of Duty 4.
@davisdf3064
@davisdf3064 3 ай бұрын
@sbr9598 It's all just a really well made Quake mod
@randomcommenter10_
@randomcommenter10_ Жыл бұрын
The Half-Life version of shounic
@Artyomann
@Artyomann Ай бұрын
Or decino
@Whomobile
@Whomobile Жыл бұрын
I love how you explained this ! I didn't know things like the airboat gun or the screen shaking! Splatoon's game engine also uses a tick rate, but runs at 60 frames while the game itself plays at around 15 ticks online. which can result in very wacky experiences where 1 player can splat another and half a second later be splatted by the dead player. I think the reason why it's so low is because Splatoon uses Peer to Peer rather than Server-Client like Source, and a lower tick rate helps keep connections more stable.
@boogameow
@boogameow Жыл бұрын
Since it's peer to peer, the issue with being splatted by a dead player is more likely that the other player's screen showed that they killed the first player before they received info that they died, resulting in both players saying "I killed you". Since there's no server to sanity check or to prioritize one player based off timestamps, both kills end up going through regardless.
@Wavy667_
@Wavy667_ Жыл бұрын
Splatoon tickrate is 60, but only sends and receives data packets from other players every 4 ticks (so 15 ticks a second). This is why replays in Splatoon 3 look really floaty and not 100% accurate in terms of the movements and actions you've made during a battle as it's showing how you would of appeared to other players (as you and other players were only being captured every 4 ticks). The packets sent still contain certain info of events that occured between those other 3 ticks when packets weren't being sent however. OatmealDome has an excellent article on Splatoon (2)'s netcode if you're interested. It's a bit technical and has more info than what I've mentioned here, but it was an interestimg read.
@Thornskade
@Thornskade Жыл бұрын
When a company doesn't host servers but still asks you to pay for online
@SomeRandomPiggo
@SomeRandomPiggo 20 күн бұрын
I guess it helps that ink moves a lot slower than bullets which are usually implemented as a single raycast
@WhiteDragon103
@WhiteDragon103 Жыл бұрын
Something else to consider: When dt is extremely small, (extremely high frame rates) floating point accuracy issues may occur, or in other words, rounding errors. If tiny values are being accumulated into a large value, the tiny value may be too small compared to the large value and get rounded down, and the large value doesn't change. For example, if your velocity is tiny (0.001 units/sec), and you're position is large (1000 units away from 0), and the delta time is tiny (1000fps) your position may not change. 1000 (position) + 0.001 (vel) * 0.001 (deltaTIme) = 1000.0000001 (nextFramePosition), but it might just get rounded to 1000. This is why when you fly away from the center of a map extremely far, you can start to notice bugs. There are ways to fix this but sometimes devs don't bother.
@ahmettay2382
@ahmettay2382 Жыл бұрын
and what you said can be seen on GTA 3 and VC's engine
@vibaj16
@vibaj16 Жыл бұрын
also, the dt system is often the culprit of nondeterministic physics.
@ghost_ship_supreme
@ghost_ship_supreme Жыл бұрын
The valve equivalent to the farlands
@jetfaker6666
@jetfaker6666 Жыл бұрын
A lot of problems are caused when divisions are involved too. I remember seeing bugs in some old games where values proportional to dt were being used as the divisor for certain algorithms and when they get too small that's how you get the objects that fly around too quickly and so on. I believe in the simpsons hit and run, dt was calculated with such low precision that it could be 0 on modern hardware, which would just instantly set your coordinates to NaN and the world would disappear.
@WhiteDragon103
@WhiteDragon103 Жыл бұрын
@@jetfaker6666 >instantly set your coordinates to NaN and the world would disappear. Lmao
@tomaz02
@tomaz02 Жыл бұрын
idk why but i have a soft spot for these type of technical explanations of video game mechanics, especially in the source engine. looking forward to see what vids u come up with next!
@yarknark
@yarknark Жыл бұрын
You would love shounic's videos, if you don't already watch them
@tomaz02
@tomaz02 Жыл бұрын
@@yarknark i'm aware of that channel and really like the vids but thank u anyway :)
@killingtimeitself
@killingtimeitself Жыл бұрын
same
@kylemproductions
@kylemproductions Жыл бұрын
It’s worth noting that the tick system was made specifically for multiplayer. The server runs the game simulation and replicates the tick snapshots across the network so multiple source clients can view roughly the same game state. I suspect they use that model for single player simply because it’s easier to have unified game logic not because they thought it would fix bugs that are linked to framerate. You can read more about this tick system and source networking on the valve software wiki. This also means that the assumption that the tick rate would always be 66 is very sane. You shouldn't need to change the tick rate of a single player game at all so the option being exposed is a bit silly.
@Pinsplash
@Pinsplash Жыл бұрын
This video contains 5 examples of singleplayer games that do have issues stemming from frame rate, so this doesn't make sense.
@DefineOutside
@DefineOutside Жыл бұрын
Games don't need to run the client and server at the same TPS to function correctly, as long as they track stuff with real time instead of ticks
@koye4427
@koye4427 Жыл бұрын
While it's true that this video is just a simplified explication of the client/server architecture, there's a reason games like Minecraft also use it in single player - it solves performance problems and is much more predictable. Before Minecraft separated the server and client, chunk generation used to briefly freeze the game. (Unrelated , but wayyy back when, Minecraft used to use the SYSTEM CLOCK to calculate delta time)
@kylemproductions
@kylemproductions Жыл бұрын
@pinsplash I mean that the Source engine’s tick system is much much more than a simple fixed rate function system. Other game engines have fixed rate functions but that alone is no where near enough to make multiplayer possible. You mentioned that Source does interpolation but you didn’t explain why. Source does interpolation because the game state is only updated on each tick. The vast majority of games update the game state on every frame so it’s always deterministic and there is no jitter. So why does source do it? Because you can’t instantly broadcast every state update over the network. It’s just too expensive and error prone. It’s a model that is developed solely for multiplayer and reused for single player because it’s easier than maintaining two distinct systems. I’m not saying that you’re wrong. It does help fix framerate dependency issues but talking about the broader context is fun and informative . :)
@kylemproductions
@kylemproductions Жыл бұрын
@Hunter M Using clocks to synchronize the client and server is really quite difficult. It means that the client and server need to have their clocks tightly synchronized and all clients need to have a timer with high resolution (1ms or less). Also, source clients don’t really “run” the server ticks. They just store the snapshots and use them for interpolation. The client can sample the ticks at a rate different than the server without much issues if tuned correctly. In fact the interpolation period is 100ms is so clients can continuously interpolate even if they’re receiving ticks slower than 66 per second. Why? Valve was accounting for packet loss, network jitter, etc
@OmegaRC59
@OmegaRC59 Жыл бұрын
In my experience with modding older unreal games, which are basically a really strict implementation of deltatime with the tickrate matching your current FPS, every single "high FPS issue" has boiled down to bad code, or very rarely just not enough precision. Big example in one of the old unreal games I mod, Harry Potter and the Chamber of Secrets (Classic PC adventure game if any of y'all never played it, it's actually really well made) has a lot of random high FPS bugs, most of the ones that are game specific were made by one guy who always referred to DeltaTime (the normal way) as DTime. Basically all of his equations would produce highly inconsistent results to the point we've nicknamed him DTime guy, and some of his comments very confidently stated that "DeltaTime isn't accurate" and made way worse code because he just didn't quite understand what he was doing wrong lol. Wonder if he ever learned what was wrong in these 20 years haha But yeah this shit is like a super common problem when people overthink things
@OmegaRC59
@OmegaRC59 Жыл бұрын
@@richardvlasek2445 Literally everything because we were given source code to a proto version of the game lmfao. There's a lot of really cool shit going on in the modding discord all the time if you're interested at all. As for what content people want to make, depends on your creativity ofc. People are getting more and more into custom code and full game mods, which weren't possible with previous tools
@TarenGarond
@TarenGarond Жыл бұрын
I didn't know Harry Potter and the Chamber of Secrets was considered a part of the Unreal series, but surely it makes sense when you think about it!!!!!!111
@OmegaRC59
@OmegaRC59 Жыл бұрын
@@TarenGarond Lmfao I get the joke but I mean it's a UE1 game, same with HP1PC and HP3PC is on UE2
@TarenGarond
@TarenGarond Жыл бұрын
​@@OmegaRC59 Remember Unreal is a game(series) and Unreal Engine is a game engine, if you ever disrespect the Unreal series like this again I will find you, and one day stand beside you at the bus stop making a mildly annoying noise for a few seconds! You hearing me dude!!!
@OmegaRC59
@OmegaRC59 Жыл бұрын
@@TarenGarond you know what i take it back hp2 is part of the unreal series
@saniel2748
@saniel2748 Жыл бұрын
Minecraft is, weirdly enough, an interesting example of such technique. As far as I know, it not only separated gameplay update and rendering update, it also puts them in completely different threads. Therefore, minecraft is like, the only game I know of, that can lag without drops in FPS. Stuff just won't move, but still render in 60fps .....Though maybe I'm misunderstanding why exactly those things happen
@killingtimeitself
@killingtimeitself Жыл бұрын
minecraft is a weird example, as you suggested, the client and server are isolated from eachother, if the server runs at 1/5 the TPS (ticks per second) (its also worth mentioning MSPT, milliseconds per tick, which is the measure of how long each tick takes to calculate, useful for lag scale testing and benchmarking) the default is 20 btw so 1/5 would be 4, the game will run 4 times slower on the server end, so mobs will move 4 times slower and etc... however the player will still be moving normally, its also possible you'll experience rubber banding as well just because of the nature of lagging, but there are some very cursed things you can do because of this. similarly your client can be experiencing 2fps while the server can be running at 20tps perfectly, this is really annoying from the player side but the server can be practically idling, for instance, idk about newer versions but in 1.17 if you place about 125000 composters and place a piston and start clocking it at a 5gt interval (fast observer clock) the client will absolutely kill itself, however basically nothing happens to the server. Why the client kills itself is a mystery to me but the suggestion that the client for some reason checks 125k composters every piston activation (on the client side) is fucking hilarious. In recent versions the lighting has been decoupled from the server thread and up until you could artificially slow down the lighting thread so much that it just quit processing updates all together, this allowed you to get cursed lighting sources as well as objects that should emit light, not emitting light (portals for instance) though this specific issue was patched fairly shortly after 1.16 iirc, the threads are still decoupled though. excuse the long winded rant, im a bit of a technical player and have seen some shit so i know a bit about the game lol.
@DefineOutside
@DefineOutside Жыл бұрын
The minecraft client's tickrate is actually tied to FPS, indirectly. The game attempts to tick every frame. It will do a max of 10 ticks per frame. This means that at 1 FPS, your game will run at half speed. 0.5 FPS, quarter speed. No clue what the fuck mojang was thinking.
@killingtimeitself
@killingtimeitself Жыл бұрын
@@DefineOutside yet the server is still independent from the client lol. Mojang does a lot of stupid shit.
@liquidextal
@liquidextal Жыл бұрын
IIRC the Quake III engine not only has separate threads for server & client, but they have to use the OS's network stack to communicate, as if the server was a dedicated instance on another system makes sense for a multiplayer focused game, saves a lot of unnecessary code, and apparently worked fine for the singleplayer games that ran the engine as well.
@wumi2419
@wumi2419 Жыл бұрын
@@liquidextal iirc OSes are just smart enough to detect programs using network stack to communicate on the same machine and run the communications through internal messaging structures instead of full network stack.
@BakersTuts
@BakersTuts Жыл бұрын
Hello. I was one of those people that asked how the tick rate affects the game engine. Thank you for the video!
@TheMAZZTer
@TheMAZZTer Жыл бұрын
I'm familiar with how this works in Unity so maybe I can offer a little insight as well. Like any modern game engine including Source Unity has a variable frame rate as well as a tick rate... this results in two different ways your scripts can run code regularly (well there are others but these are the types discussed in this video). "Updates" happen every frame. These are useful for updating things that only change visually. For example if I am running at 30 FPS I don't need to update my hud at a full 60 times per second since it is only rendered 30 times. So it makes sense to use the Update functionality. I can add an Update() function to any script and use Time.deltaTime to figure out how long its been since the last Update() call. "Fixed Updates" happen every 1/60 of a second by default, but this can be changed per project in Unity. This allows for code that must be run regularly at a fixed rate, such as physics updates. This calls the FixedUpdate() function on any script and Time.fixedDeltaTime can be referenced to determine the time since the last FixedUpdate() call. Since the interval is configured per-project, it makes sense to use fixedDeltaTime despite it being unchanging (well, if the code is slow enough, potentially it could miss a call I suppose) for plugins or even just your own project code to properly handle fixed intervals. Related, Unity also has time scale, which allows you to slow down and speed up the game (Source has a similar concept). The Time class can handle this too and provide unscaled real time intervals (the ones I documented above are scaled based on time scale). It's useful for any time-effects in your game as well as pausing the game with a zero time scale for a pause screen and such.
@Architector_4
@Architector_4 Жыл бұрын
@Hoovy Simulator 2 host_framerate is a descendant from Goldsource. In there, if it's not zero, the engine overrides the "delta time" variable used for game logic with that command's value. So if you set it to 0.1, Goldsource would consider each frame to have taken 0.1 seconds. If you're running at 60FPS, which is 1/60 ≈ 0.0166 seconds per frame, this would result in the game logic running at 0.1/0.0166 ≈ 6 times faster than intended. Infact, if your FPS is a constant value like 60, you can set host_framerate to an equivalent value like 1/60 and the experience will seem basically the same. That's all for Half Life 1's Goldsource though. In Half Life 2's Source, I'd imagine it's the same thing, but in relation to the ticks and the tickrate lol
@akabe9375
@akabe9375 Жыл бұрын
great explanation. i'd occasionally hear about the tick system in hl2/tf2 discussion but i never understood how it worked until now
@KateGrayCode
@KateGrayCode Жыл бұрын
Half life was based on the quake engine. The multiplayer “QuakeWorld” did ticks, which is how the first speed cheats worked.
@EastingAndNorthing
@EastingAndNorthing Жыл бұрын
I have to give props to your writing style! Very clear to understand and to the point :)
@XanderNiles
@XanderNiles Жыл бұрын
Wow! I'm amazed about the explanation on how the tick rate works in the Source engine now. This is such a helpful insight.
@yiannis1236
@yiannis1236 Жыл бұрын
I think describing DeltaTime(DT) as the time that has passed since the previous frame would be a little more accurate. A simple implementation of an object moving based on DT would be to move the object x amount of studs DT * speed/time period.
@Pinsplash
@Pinsplash Жыл бұрын
i think that would actually cause more non-deterministic behavior since objects getting iterated on later would be using a slightly higher DT
@Positroni
@Positroni Жыл бұрын
@@Pinsplash DT is from my understanding the time from the start of the previous frame to the start of the current frame, it is same for all calculations in the frame.
@Pinsplash
@Pinsplash Жыл бұрын
so just the length of the previous frame?
@MuffinTastic
@MuffinTastic Жыл бұрын
@@Pinsplash yeah, i've only ever seen it as the length of the previous frame
@richardg8376
@richardg8376 Жыл бұрын
@Pinsplash Yes, the "delta" refers to the time elapsed since the previous frame. If your framerate is at a fixed 60fps, then your deltatime value every frame will be 0.01666666. This is generally useful, because it means that if your framerate is halved then your deltatime is doubled, meaning that objects will be moved twice as far per tick to compensate for the fact that each tick is happening half as frequently. However, it is not perfect by itself. Extremely high frame rates can lead to very tiny deltatime values which might cause weirdness due to floating point precision issues when fed into a highly sensitive physics engine. Very low framerates can result in collision detection issues because objects are moving too far in a single frame to correctly detect collisions with surfaces. On one frame they're on one side of the wall, the next frame they're on the other side, no chance to check for a collision in between. This is often exploited in older games like Donkey Kong 64 where they deliberately lower the framerate by spamming projectiles so they can clip through doors.
@Chillaxowo
@Chillaxowo Жыл бұрын
I use Delta Time in my games, and you actually can check how long the difference between each frame was (you can store the value in a variable and compare it). The issue with Delta Timing on the Spyro Triology is because the game simply does not take it into account correctly, it was implemented but not carefully implemented. When coding with Delta Timing you should always make sure to limit how effective Delta Timing is with where you apply it to avoid such things. Oh, also Donkey Kong 64 has the same issue. For example, a common solution to the lag issues breaking gameplay (allowing super high speeds or even clipping through walls) is to cap how much the game should compensate for it. For example, making it so if the duration is bigger than a certain amount, then cap it at a certain duration (if it's bigger than 0.20 then force it to NOT be bigger than this number). So you could make it be capped to 5 frames (about 0.2ms) as that's the lowest you want it to go, effectively making it so low framerates don't break it and pretty much fix most issues with it. I say 5 frames since usually the clipping issues or extreme boost are related to frames going below that number, or even your game freezing completely (for example, being 0 from a lag spike, causing really long frame difference making the game think it is "fine" to make you go super fast to compensate for it). But again, it requires proper knowledge on how to apply it to use it efficiently. Which funnily enough, isn't too different from what you talked about in the video, making it have a proper implementation to take into account the system correctly. lol
@SuperShortAndSweet
@SuperShortAndSweet Жыл бұрын
I use delta time as well, you ever run into the problems of grabbing window (grab like when you move a window) the delta time gets all fucked up
@SuperShortAndSweet
@SuperShortAndSweet Жыл бұрын
I fixed it once , so I get what going on
@Chillaxowo
@Chillaxowo Жыл бұрын
@@SuperShortAndSweet Yeah, that happens since windows, normally, just stop rendering and stop "thinking" completely when you move them around (to save on resources I guess). Applying the fix I mentioned helps with that, but of course it isn't perfect. One method that I saw to fix it from the root is to fake the window itself; basically making the app borderless but rendering the window with the engine, and adding all the functionalities real windows have, making it look exactly like the normal window but it isn't, and you can move it around without causing issues (since engine window movement doesn't really freeze the game when doing it).
@SuperShortAndSweet
@SuperShortAndSweet Жыл бұрын
​@@Chillaxowo i think what is happening is windows grab event is constanstly beening called, and there is speed or something tied to the handle event function, you making boarderless is smart fix, i think thats why it works, another thing, ive heard filtering out the event completely also works
@npc_blob1609
@npc_blob1609 2 ай бұрын
The issue with simply relying on deltatime, even failsafed implementations, is that the physics will be non deterministic. For example collision will be checked more frequently so interactions will still play out differently on different hardware.
@Yveldi
@Yveldi Жыл бұрын
This leads me to believe that using ticks almost singlehandedly futureproofed most Valve titles. It works unbelievably well with high FPS, and if the game was like CSGO where the devs intended the users to be able to switch tickrates, it also scales very well with higher tickrates, essentially being objectively superior to the frametime-based method most other games use. I think it "starts" to break when you get really close to 1000 FPS, such as your movement speed becoming out of sync with server in CSGO and your movement will get stuttery due to the game cosntantly fixing the desyncronization between client and the server. However, such high FPS isn't something any player is realistically going to be unable to live without, and it probably can be fixed as well if the devs cared about it. I wonder what causes THAT bug, but I guess it isn't easy to tell as CSGO's source code has never become available. By the way, as a competent CSGO player who happens to understand the basics of programming, I always knew what ticks were and how tickrates worked, but I never connected the dots and figured out that they were meant to seperate game logic from FPS. Thanks for the video!
@bunslinger
@bunslinger Жыл бұрын
what bethesda games do is tie framerate to game logic. essentially the higher the framerate, the faster the game thinks, and the lower the slower, or framerate = tickrate. they actually fixed this problem in fallout 76, most likely using a separate parameter similar to valve's tickrate parameter in order to prevent people from getting free speedhacks via uncapping their framerate and looking at the ground, like goldeneye except to an extreme degree
@udese730
@udese730 Жыл бұрын
didn't they just fix it by adding more preset framerates?
@jorymo4964
@jorymo4964 Жыл бұрын
I remember not being able to play Skyrim because my frame rate was too high and the horse would always go way off course in the beginning
@engi6297
@engi6297 Жыл бұрын
When you turn off the fps limit in Skyrim the game just goes mad
@Vixeneye1
@Vixeneye1 Жыл бұрын
I can finally show this to people so they understand why a tick is the way it is! I'm so happy you made this
@simonhxd
@simonhxd Жыл бұрын
I really liked this video! It was well edited and very entertaining! good job!
@KoziLord
@KoziLord Жыл бұрын
You don't need to know how long a frame will take when using delta time, you only need to know the time that the previous frame started processing at and the current time at which the current frame is starting processing, this doesn't cause any instability by itself. It also means that what you see on the screen is actually X milliseconds in the past, where X is the time it took to process and display the frame (you COULD try compensating for it by guesstimating the time it will take to process the frame, but that's not mandatory and I frankly have no idea how well that works). The main sources of instability afaik is the delta time being too low (tickrate too high) causing floating point inaccuracies, or the delta being too high (tickrate too low) causing stuff like physics engines to freak out as object start moving such large distances per frame that they can phase through one another without technically colliding.
@killingtimeitself
@killingtimeitself Жыл бұрын
found this channel on a whim randomly and its quickly become one of my favorites!
@alexgravitos
@alexgravitos Жыл бұрын
this guy, never fails to amaze me
@SkylorBeck
@SkylorBeck Жыл бұрын
This was a well made explanation of game ticks in general, not just for source engines. Well done!
@orthal298
@orthal298 Жыл бұрын
As always I really enjoyed the video. Can't wait for more content.
@beatoid1006
@beatoid1006 Жыл бұрын
insanely good video as always
@olegmoki
@olegmoki Жыл бұрын
Damn this is a whole programming lesson... I like it, do more technical stuff explanation
@Buffalen
@Buffalen Жыл бұрын
I feel like using a tick rate probably worked it’s way up from Quake to GoldSource to Source
@fargone1878
@fargone1878 Жыл бұрын
I was expecting a classic "pls fix" under the valve logo at the end. I love gamedev topics. Good job!
@snarkbaited
@snarkbaited Жыл бұрын
Super interesting video, I've always wondered what the purpose of a tick system is after I saw your previous videos on it :)
@Johnwalter1044
@Johnwalter1044 Жыл бұрын
I love these technical videos, with a touch of humor.
@strawberrylemonadelioness
@strawberrylemonadelioness Жыл бұрын
This is actually pretty cool, thanks for explaining it!
@jazzling
@jazzling Жыл бұрын
wow! this is a super crazy, great video that is changing the way I view reality itself! I love it a lot!
@fabio-vb7xu
@fabio-vb7xu Жыл бұрын
awesome video, this felt like that final piece of the puzzle that helped me, a complete noob, understand tickrates. the audio sounds lovely, your voice is soothing, and im looking forward to more technical videos in the future! just one small thing, the narration pace feels a touch too fast, relax the speed a little, and make the stops a tad longer, it will make the information more digestible, especially for non-native speakers :)
@kingding9542
@kingding9542 Жыл бұрын
I enjoy the way you explain things
@CoolJosh3k
@CoolJosh3k Жыл бұрын
Time to resubscribe. I pretty much know all this stuff, but I enjoy the this kind of content.
@capscaps04
@capscaps04 Жыл бұрын
Well, this was very interesting. I'm getting and studying programation and I love to watch context lile this.
@GolfinhoVoador
@GolfinhoVoador Жыл бұрын
I like how most bugs are narrowed down to the programmer forgetting something..
@redy55
@redy55 Жыл бұрын
Delta timing is actually perfect system if devs dont fuck up math (which they always do)
@Nuculer9001
@Nuculer9001 29 күн бұрын
I love that you used KQ3 in this video. I put a lot of time into KQ3 on my 286 in the 80s lol
@zorunus6061
@zorunus6061 Жыл бұрын
Please make more of these types of videos!
@robinrai4973
@robinrai4973 Жыл бұрын
Great explanation
@azrieljale
@azrieljale Жыл бұрын
4:22 - I love that no more needs to be said here xD
@Expensivepasta666
@Expensivepasta666 Жыл бұрын
it was interesting watching it. Good job
@linuxrant
@linuxrant Жыл бұрын
Cool video, very educating and entertaining
@novelezra
@novelezra Жыл бұрын
"I like speedrunning" *>Has a creepy yet incredibly soothing voice and makes videos that explains tiny game mechanics in a granular style; whilst also ensuring the video has an eerie vibe* Nooooooo you don't say.
@arthurghahramanyan3279
@arthurghahramanyan3279 Жыл бұрын
The thumbnail to this video is just epic.
@Ghozer
@Ghozer Жыл бұрын
The tick rate on the original HL1 engine was interesting, and caused some interesting issues with some popular mods of the time (CS springs to mind) (similar to the airboat) Unreal Tournament also kinda used tickrate, but it was more tied to the FPS, but not limited by it (i'm not exactly sure) but striving for a higher Tick/FPS in either HL1 or Unreal Tournament when running a Server actually made the server run better, for obvious reasons :D there was a small app I had once called mmtimer.exe that I used to run to 'unlock' the "multimedia timer" on windows to allow the fps to max out ;)
@MightyEFX
@MightyEFX Жыл бұрын
great work
@kipchickensout
@kipchickensout Жыл бұрын
good video, basically the same explanation that everyone else gave as well, i thought you'd go into detail of how it is processed using which functions and INetworkable etc. they did it better in csgo
@coregod109
@coregod109 Жыл бұрын
Great video i would love to see more stuff like this on the source engine and half-life a bit like shounic with tf2
@Deagle195
@Deagle195 Жыл бұрын
Have you thought of researching how save/load system works? I'm personally curious how Source manages to preserve the entire state of the game
@twitchizle
@twitchizle Жыл бұрын
Who said they save entire state of the game
@hermitgreenn
@hermitgreenn Жыл бұрын
It takes a snapshot of whatever the server state was during that tick.
@g_freakman
@g_freakman 8 ай бұрын
(afaik, i might be wrong) Source saves specific variables defined in the game code named "DATADESC" for the server. When loading the save, Source restores the datadesc, and calls every entity's (Restore()) function.
@MajorFleshbang
@MajorFleshbang Жыл бұрын
Doom 1 & 2 ran with 35 gameticks (which means a tickrate of 35 i guess, not a programmer in any way) and AFAIK this idea was carried over to later itterations of id's engines. Given that Valve's Goldscource engine is a heavily modified quake engine (not sure which id Tech specificaly), me thinks they used ticks because they were already there? Btw. the whole 35 gameticks thing is actually important for DOOM speedrunning. Just saying since you're interessted in both. ;) Also, savage Bethesda burn 😂
@Spartan322
@Spartan322 Жыл бұрын
A lot of game engines implement both delta time and physics tick frames. (sometimes with a delta to double check the work of the physics process loop)
@reNINTENDO
@reNINTENDO Жыл бұрын
I've written a few engines (well it's more like one that was heavily reworked) with the first using deltaT and the second using a tickrate style system. I haven't bothered to introduced deltaT into the game logic since the plan is to never modify the number of times the game updates in a second, which in turn makes so many things _vastly_ simpler to program. Collisions being a prime example, and anything else where differences in rounding can have large impacts in determinism. This system also has the added benefit of being bananas crazy more performant. If you only ever update game logic 60 times a second, no matter how fast your computer is running the game, that game logic overhead doesn't change. It effectively means under most circumstances the game becomes very GPU bound, and it can kind of just crank out interpolated frames like crazy. It's been very satisfying getting a still somewhat unoptimized engine running at 100s of fps to well over 1000 fps.
@EnjoyCocaColaLight
@EnjoyCocaColaLight Жыл бұрын
2:49 That was so beautiful.
@Underqualified_Gunman
@Underqualified_Gunman Жыл бұрын
If i recall right i quake 1 is where the tick system for source/gold source started.
@meloncat1997
@meloncat1997 Жыл бұрын
Great video.
@8stormy5
@8stormy5 Жыл бұрын
Reminds me of the guide that used the source code leaks to show in painstaking detail why bunnyhopping and airstrafing work
@terrawest9500
@terrawest9500 4 ай бұрын
In the Godot Engine, there is the process function (used to update every frame) for physics itself, this runs on a specific framerate the developer can choose, and will always stay there, no matter what fps the player has. That makes delta time for code in the physics process more stable. So bugs like the one in gta shouldn’t happen afaik.
@infamoushacker4chan883
@infamoushacker4chan883 Жыл бұрын
I played with tickspeed in Minecraft and got some amusing results. Setting the randomtickspeed to a high value will cause anything that relies on random ticks to happen _very_ quickly. I watched an automatic sugarcane farm begin to push out thousands of sugarcane every minute.
@fitmotheyap
@fitmotheyap Жыл бұрын
Pretty sure this isn't talking about that, I play minecraft after all :P randomTickSpeed is simply the amount of block updates(plants, liquids etc) per an ACTUAL tick The minecraft equivalent is the carpet mod
@j.j.maverick9252
@j.j.maverick9252 Жыл бұрын
for deltatime games I usually have a rolling average of the last 4 or 8 frames. It smooths spikes and keeps systems more stable. Not perfect but it helps if tick or framerate have fluctuations
@DaveyL2013
@DaveyL2013 7 ай бұрын
Yeah, I always thought tickrate was just framerate but for the physics simulation instead of graphics when the two are decoupled. Also time is actually probably also quantized in real life too
@Marco-yj6gg
@Marco-yj6gg Жыл бұрын
We do experience the world in intervals too - think about the maximum framerate an eye can perceive!
@no-ld3hz
@no-ld3hz Жыл бұрын
Correct me if I am wrong. Delta timing is usually implemented by setting the last_time (at the start of the program) to the posix function clock(), then setting current_time to clock() every frame. Delta then calculated by doing (current_time - last_time) / 1000, then at the end of the frame setting last_time to current_time. unsigned long long current_time = 0; unsigned long long last_time = clock(); double delta_time = 0; for(;;) { current_time = clock(); delta_time = (current_time - last_time) / 1000.0f frame_begin() frame_end(); last_time = current_time; } this is how i'd implement it in my own game engine.
@starmantheblaziken1453
@starmantheblaziken1453 Жыл бұрын
Usually when I think of interpolation I think of Quake 1 models basically have the option to do so instead of the frame by frame model animation it was developed with so it animates and moves between frames and makes characters kind of wobbly to look at.
@asteroidrules
@asteroidrules 7 ай бұрын
As far as I'm aware, the use of ticks is something Source inherited from Quake. Id Software used ticks in Doom and Quake, so Valve used them in Goldsrc and then Source.
@michaelwesten4624
@michaelwesten4624 Жыл бұрын
man, I should be studying and writing my sh*t. 3 in the morning: "oh look, sauce engine shenanigans"
@kornsuwin
@kornsuwin Жыл бұрын
i don't even know where the channel is going anymore and i don't think that that's a bad thing
@Roach1
@Roach1 2 ай бұрын
"somebody had surely thought of this before and i just don't know them" i mean to be honest if you knew john carmack personally you'd be like, a legend by association
@Sockren
@Sockren Жыл бұрын
pretty cool to see that you also know a couple things about goldeneye for a (primarily) source channel.
@TarenGarond
@TarenGarond Жыл бұрын
I mean he seem to basically know nothing about it as his explanation why you go faster with higher fps is totally wrong XD
@Sockren
@Sockren Жыл бұрын
@@TarenGarond its not totally wrong, but to say his explanation was oversimplified to the point of being maybe wrong is true
@TarenGarond
@TarenGarond Жыл бұрын
​@@Sockren I disagree! He talk about the developers needing to know the hardware and extremely strongly insinuate that the frames/game-logic would "run away uncontrollably" as in old IBM-PC games if the game would run on faster hardware, this is not true as game-logic/frames is limited by being "v-synced"(Quite sure max FPS is half console frame output frequency). FPS limiting is talked about right after the GoldenEye "explanation" as "another solution"... And "delta time" is mentioned later which GoldenEye also uses and he didn't mention anything about it!!! As I'm a GoldenEye n00b I don't know the exact reason why you run faster with higher FPS but it seems to be some rounding error or some oversight(Or simply not caring about small differences) thingie going on, It is very very clearly not the same reason old IBM-PC games runs fast!
@Sockren
@Sockren Жыл бұрын
well sadly thats what people in the goldeneye speedrunning community think is happening. the game is rendering less triangles which means more frames. and because of how the game works it makes you move faster. its not a big difference but its big enough to be a speedrun strat.
@spaghetto181
@spaghetto181 Жыл бұрын
nice explanation
@ceoofonionincorperated418
@ceoofonionincorperated418 Жыл бұрын
4:22 underrated joke of the century
@himynameisben95
@himynameisben95 Жыл бұрын
Doom has a tick system, so I assume that's yet another thing that carried over from Quake to Half-Life
@bloodycop7
@bloodycop7 Жыл бұрын
The highest the buggier, the lowier the worse.
@romanm.3529
@romanm.3529 Жыл бұрын
0:35 Are you sure? It seems we are in a simulation here too!
@SianaGearz
@SianaGearz Жыл бұрын
Funny thing, while Golden Eye is largely tickless, it actually attempts framerate compensation with delta timing. But doesn't get it quite right, the character controller acceleration logic is quite complex and doesn't quite align across the range of achievable framerates, which causes character to run slightly faster at increased framerate, but not to the same extent that the framerate is increased. You get on the order of a few percent speed difference in spite of framerate difference being much much larger, which is why this trait went unnoticed for years. Physics is normally extremely tickrate dependent even with delta-timing due to sigma sensitivity; but third party middleware is just fixed at whatever tickrate you set it at during initialisation and can be fed asynchronously, it has its own interpolation logic for the interface to the game code.
@TarenGarond
@TarenGarond Жыл бұрын
Do you know more precisely what happens in this "quite complex acceleration logic" , or know somewhere one can read about it? I've wondered about this stuff for some while now, I've searched a bit on Google in the past but haven't found anything(Might just be a search n00b though XD).
@SomeRandomPiggo
@SomeRandomPiggo 20 күн бұрын
I've been trying to come up with a good game engine architecture for ages now and the tick system seems like the obvious choice but I'm not sure how to separate view changes from mouse movements from the rest of the tick system. In Source you can still look around when disconnected, but of course the camera rotation still has to be sent to the server
@flourek1546
@flourek1546 Жыл бұрын
awesome thumbnail
@SuspiciousAppleJuice
@SuspiciousAppleJuice Жыл бұрын
"did you know that i like speedruns" came out of nowhere
@antonaparin
@antonaparin Жыл бұрын
I guess I am the hypothetical viewer because that's exactly the question I asked myself even before the video
@kobrakon47
@kobrakon47 Жыл бұрын
I've worked with deltatime for positioning vectors and the such, I've never had any issues with it, it's good enough and any issues that may be caused by it are not too hard to circumvent
@Octal_Covers
@Octal_Covers Жыл бұрын
Doom and Quake also use ticks - Source probably originally used them because it was licensed off of Quake's code
@editdev
@editdev Жыл бұрын
shoutout to ticks
@Notllamalord
@Notllamalord 8 ай бұрын
I remember playing Danganronpa 1 on game pass and my pc ran it at like 1200 fps, it was so funny watching how fast it moved. It’s a lot less funny and more embarrassing when it’s done by a triple A company in the modern age (Bethesda)
@lenadams854
@lenadams854 Жыл бұрын
Dear Pinsplash, could you let me know if you will try to take a look at RPG Maker games like Corpse Party, with technical videos on it? Thanks
@Hypernova559x
@Hypernova559x Жыл бұрын
So I wonder if it is possible to crouch in the air (c-tap) so fast in source that you can just float or fly away by simply crouching.
@tommig3
@tommig3 Жыл бұрын
One issue with high tick rates is that the values being added to position or velocity variables get smaller so floating point errors start occuring. FP multiplication is fine however if you add a very small FP number to a large FP number it will get lost in the mix. I have wondered about the best way of handling this when dealing with large distances, velocities and accelerations.
@garylau3096
@garylau3096 5 ай бұрын
You are gold
@j0nnyism
@j0nnyism 7 ай бұрын
I may not understand ticks but I understand tucks. Let’s just say I had an unusual one night stand experience
@averagejoe605
@averagejoe605 3 ай бұрын
fun fact: DooM (1993) and DooM 2 uses tics for it's logic, and they are 1/35th of a second, as the framerate cap _was_ 35
@MrMasterKeyboard
@MrMasterKeyboard Жыл бұрын
The only thing that we care about is how far we can push the tick rate and see if crazy crap happens!
@AshleyFoxo
@AshleyFoxo Жыл бұрын
Older PC's had to have "turbo" buttons that'd limit the processor to 4.77Mhz which is the same as the original 8086 PC. Not only for games but software in general suffered issues from things not being at that speed. 3Kliksphillip did a video recently on getting over 1000fps in CSGO. With more than 1000fps, the game would stutter and teleport you around if you were on a server despite the tickrate. God knows why that happens.
@thealandude9146
@thealandude9146 Жыл бұрын
I've always heard about ticks and this video really cleared what it means for me, awesome
@corvax8644
@corvax8644 14 күн бұрын
3:57 THATS WHY THAT HAPPENS??? holy shit that was so annoying wondering wtf I was doing wrong and eventually just had to skip that section
Dumbest Source Engine Arguments
19:12
Pinsplash
Рет қаралды 121 М.
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 13 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:26
CRAZY GREAPA
Рет қаралды 6 МЛН
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН
How I beat Half-Life with no mouse movement
30:50
Pinsplash
Рет қаралды 148 М.
Unity: Good Enough for Bad Games
8:22
2kliksphilip
Рет қаралды 1,9 МЛН
How I Created a Voxel Raycaster in Python...
5:47
Gpopcorn
Рет қаралды 6 М.
Investigating ways to Crash Half-Life 2
7:48
Pinsplash
Рет қаралды 190 М.
10 Other ways to Speedrun Half-Life 2
14:44
Pinsplash
Рет қаралды 80 М.
What does a Game Engine actually do?
16:45
Ellie Rasmussen
Рет қаралды 143 М.
CS:GO - 64 VS 128 Tick
12:14
3kliksphilip
Рет қаралды 1,2 МЛН
Valve's Catwalk Conspiracy
9:38
PurpleColonel
Рет қаралды 730 М.
Every Game Engine Explained In 9 Minutes (Part 1)
9:10
Stopshut
Рет қаралды 336 М.
КОНЕЦ АЛЬЯНСА | Сюжет skibidi toilet 76 (part 2)
10:13