The Car [Mod idea discussion]

On the PC it leads to all sorts of weird issues though and doesn't make any sense really - none that I know about.

It's not really that much of an issue. It only affects physics performance if you have very high framerates, beyond 100fps. So you might have issues if you have a 144Hz monitor, but the game's shoddy optimisation stops the framerate from getting too high anyway.
 
Google Skyrim 100 FPS :P

The question is this, what is the REASON behind locking the physics of your game to the FPS on the PC? What do you gain from it in the end?
 
Google Skyrim 100 FPS :P

The question is this, what is the REASON behind locking the physics of your game to the FPS on the PC? What do you gain from it in the end?
By running the physics and game logic in the same loop as the graphics you can skip factoring in the time passed since the last frame. This saves a lot of floating point multiplication, which again results in more leftover performance that you can use for other things (such as graphics porn). The crux is that this requires a pretty much constant framerate, otherwise you will see wildly fluctuating object movement, ballistics behavior, etc etc.

I don't believe that this is actually what they're doing, otherwise the effect that we're seeing now would be much more pronounced and render the game pretty much unplayable. I speculate that they've chosen somewhat of a middle ground, which is to do it the normal way (loops are separate) but use a low precision datatype for storing the delta time.
 
*shrugs*

Alright... So you might have seen me around a few threads here that mention the perspective of developers on The Framerate Police. While the discussion here was mostly civil and reasonable, on other sites people often try to deceive others by spreading misinformation about 30 FPS. And even innocent posts can cause can misguide people, because of a lack of context. So I've decided to take on the task of explaining everything I can about what the lock is, why people use it, how hard it is to work around and how to not get fooled by people saying scary technical words.
I don't want anyone to get the wrong impression about my experience so here are the basic facts about my background. 4 years of study in software engineering, 1.5 years of work in a big software company, worked on projects for substaintial clients (can't disclose the names), fields of work include CAD and e-government. Haven't actually released a game, gamedev is only my hobby. Currently I am working on a simple engine from scratch. While that may seem wasteful seeing how easily accessible things like Unity or UDK are, I do believe that knowing the inner workings of an engine is a requirement for someone who wants to be a skilled gamedev.
(This is not bragging. The point of this paragraph is to show that while I am a somewhat competent developer I am not yet a gamedev)
The Main Loop and the Frame Dependence Problem
So every developer (assuming he's not using an existing engine) begins his first game with something called The Main Loop, a series of actions which are repeated over and over again; basically this loop is the game in its purest form. If you simplify everything it comes down to three actions:
1) Get and process input.
2) Update game state.
3) Render the frame.
Unfortunately, if you try to write code following those three steps you will get a game that runs at different speeds depending on how high your FPS goes. This creates many obvious and less obvious problems, which are not as important for the discussion. Let's take a look at some solutions.
Solution #1: FPS lock.
This is the easiest and probably the worst solution. You can lock your FPS and make everything run at the same speed. Simply do the three actions and let your program sleep or gather input until the next frame needs to be drawn. This approach is the usual reason for the 30 FPS lock.
Good: extremely easy to code.
Bad: the framerate is locked, any slow down in framerate will lead to the game going into slow motion and may require any time based input to be slow motion too (something like holding down the button for a set period of time).
Very bad: Ties your rendering to pretty much all other logic, which breaks many principles of good design, which in turn will make the code more difficult to write as the time goes on; can cause big problems with the multiplayer if one of the players starts dropping the framerate.
Solution #2: Delta time.
This solution is also quite simple. Don't lock the framerate, just measure how much time passed since the last frame and operate based on that. Let's say a car has a value of speed, then you can multiply that speed by the time that passed since the last frame and find how much distance the car made. Simple, right? Not quite.
Good: Your framerate is no longer locked. The solution is still mostly simple. You will always get the best performance possible on the machine.
Bad: Rendering and logic are still somewhat tied, the time of the frame is a variable through all of your calculations.
Very bad: Well, first of all, calculation takes time. It takes time to calculate the position of every moving object in the game and do other updates too. That time is not included anywhere so while your car will move by (speed * frameTime) meters, it should've actually moved by (speed * (frameTime + calculationTime)) meters. In addition to that floating point numbers are unreliable. Every time you add, multiply or subtract two of the same floating point numbers the result will not be the same by a very small margin. Usually this is not a problem, but if your framerate climbs high enough the numbers will start getting smaller and smaller, which will mean that the error will become more and more substantial. All of that may lead to the developer once again locking the framerate. However, this approach can usually maintain a higher lock (for example 60 FPS) and will not cause the game to completely break if someone messes around with the ini files.
Solution #3: A double loop.
This is the approach that most modern engines take. Basically it comes down to making two loops. One of them is run every X milliseconds, the other one runs every frame. The first one updates the logic, the second one renders your game. There are different ways to achieve this. Some developers might tell you that this requires multithreading (a technique which causes the computer to quickly switch back and forth between different tasks to make it seem like they are run simultaneously), some may even say that you need multiple cores (which actually allows to run two tasks completely simultaneously) to do something like that. They will then go on to tell you how difficult multithreading code is to debug, which is true. The truth is, you don't need any of that. Unity, for example, runs both loops in the same thread, no multithreading, no multicore shenanigans.
Good: Best approach in terms of design. Your logic has no longer anything to do with your FPS.
Bad: The two loops are usually set to different refresh rates. This means that your game may still only take input 30 times per second even if the framerate is 60. Also this approach is not easy to code if you are a starting developer.
Very bad: You need to very carefully consider how often you run the frame independent loop. If you set it to something like 240 Hz and it can only manage 60 then a lot of your logic may break.
So there you have it. Everything about how framerate and update rate can be related (or unrelated). My personal message to all the devs out there: "Do not compromise!" Don't settle for the lock, nor for the delta time, aim for total frame independence. If you can't manage that then you won't be able to manage much more difficult tasks in the future. Listen to what code guidelines tell you and learn from everyone who struggled with these problems in the past.
And now for the final part.
The Great List of Bullshit:
1) Optimization is very difficult and some devs just don't have the time and resources to make sure their game maintains a stable 60 FPS.
As with many statements on this list, this one is technically true, but has nothing to do with FPS locking. If my PC can't run your game at higher than 30, that's an optimization problem. If your game is locked at 30, that's a design problem. There is no reason not to provide the end user at least an option to unlock framerate or set a higher cap if your only concern is optimization.
2) Because of certain early design decisions sometimes 60 FPS is not achievable.
Technically true. Only here in software engineering we don't call those things just "design decisions", we call them design mistakes. Basically when people say this they are referring to everything I've described above.
3) Not all engines have the capabilities to unlock FPS.
First of all, an engine is not a sealed box, at least most of them aren't. If you need some piece of functionality, write it. It can be difficult to do, but still not as difficult as doing it from scratch. Secondly, if there is absolutely no way you can incorporate unlocked framerate into an engine, why are you using that engine to begin with? Thirdly, most modern engines have tools for this. The most famous one is Unity; it basically has the double loop set up already (functions Update and FixedUpdate).
4) There are artistic reasons to locking a game at 30 FPS.
Okay, I'm not going to argue that there aren't any reasons for that. I'm not much of an art person. However, there is one thing that I know for sure. If your game is designed in a proper way, providing an option to unlock framerate or at least switch to a 60 FPS lock should be trivial. Even if you expect your game to only run at 30 FPS, the lock is still a bad idea.
5) All of this is super difficult and costly.
It's not that costly, but it's difficult. Which is why game engines like Unity implemented it for you ages ago.
And there you have it. I don't expect most people to care about this. In the end, everything that doesn't affect the user doesn't exist for the user. However, some of you may have thought something like "Should we really expect 60 FPS from small development teams? How much money would it cost? Will we make good indie devs leave by wanting higher framerate?" Hopefully now you have the answers to at least some of your questions.
EDIT: Alright, this got a lot of attention and many people are saying the same things, so I feel like I have to clear a few things up:
1) I was a bit unfair to the delta time method. It can work and it can work almost flawlessly. The example I've given is just describing a very trivial implementation of delta time. That implementation may lead to a soft lock in the future. I just felt like providing the proper implementation was way too technical. But you are right that I should have at least mentioned that it exists.
2) The double loop is not described fully. The physics loop still needs to either be locked at a certain refresh rate or have its own delta time.
3) There are often more than two loops in the "double loop" method and they all may have different refresh rates.
4) This is not a complete explanation of a game engine!!! Please understand this. I was never trying to give a complete picture. Hell, this is not even a complete explanation of the main loop. My goal from the start was just to give people the information to fight those who spout technical bullshit. I was aggrevated by people who didn't make any sort of sense, but tried to hide behind smart words they were using incorrectly.
https://www.reddit.com/r/Cynicalbri..._fps_lock_what_it_is_why_should_you_avoid_it/

Even more reason to change to new engine I guess.
 
Changing the engine would be a terrible idea. For one you'd lose the quite frankly unparallelled modding support it has, as well as the entire codebase for the script extender which has taken years to accomplish, and there wouldn't be much to gain from it. Unity3d has its own host of problems (The guy you quoted may not be a game developer, but I am), especially when used to create huge open worlds like Bethesda's (look at the Rust devblog for a first impression). UnrealEngine would be a sensible choice, but again, no modding. They're constantly improving the engine to the point where it's now completely different from when I started working with it (when Oblivion came out), and I think they've done a fine job with it.

It's their games I have issues with, not the engine.
 
Last edited:
*shrugs* at some point you have though, there is no way around it, just postponing it. And when I am looking at how much modders sometimes complain about Bethesda and gamebyro and now bugs from previous games are STILL even in Fallout 4, I would say they have a lot to gain here. Again, experience with gamebyro can't be much of an argument, simply because I don't see any. They still release the same bug infested content as they did 15 years ago with Morrowind ... and each game is seeing patches, fixes and changes by the community via mods. So I question this years of experience and accomplishments a little here.

I am not saying that it doesn't come with it's own issues if you change to a new engine, that's why you should not do it every 2 years or so. But, how long can you continue to use the same framework over and over again for your game? It kinda makes it hard to work on progress and get any evolution going on, not to mention utilizing new features correctly.

No one's expecting that every game out there, leave alone a Fallout game has to done in the best possible graphic out there. As soon as a game is released it might be already outdated anyway. But Bethesda is working with an nearly 20 year old framework, and it really shows. A lot. And I feel the criticism regarding the visuals, are somewhat justified. It really starts to get in the way of making decently looking visuals and even game design at this point.

The change doesnt have to be the unity engine, but it's simply like with any old car or software, no matter how much you love it, there comes a moment where you HAVE to decide to get something new. Time's moving forward and new progress is made each year. Can't be to much to ask for to get updated every 10 years or so ... I mean if you call your self a game developer, and I assume the people at Bethesda do, than you should not have a problem with learning the ropes of new engines, codes and languages anyway. That's pretty much part of your job. Or we would be still using the same machines like 40 years ago to playing nothing but the same iteration of Pong and Tetris.

I do get the fact that there is a huge focus on visuals these days, and that's wrong, yes. But seriously, there is no reason to expect an tripe A developer like Bethesda to not improve on their visuals. Particularly animations, face generation, lyp sinc, and all the other stuff that many other games do a lot better these days.
 
Last edited:
You say these things, but I have a friend who drives a 1934 ford pickup.....proving that you dont HAVE to go get something new, but you do have to properly maintain it :P
 
Yeah, I gotcha! I like them oldtimers a lot as well. :grin:

But we are talking about a company and products ;), go try runing a whole trucking company with nothing but 1934 ford pickups, because that is pretty much what Bethesda is doing here.

I think it's fair to expect upgrades once in a while.
 
Yeah, I gotcha! I like them oldtimers a lot as well. :grin:

But we are talking about a company and products ;), go try runing a whole trucking company with nothing but 1934 ford pickups, because that is pretty much what Bethesda is doing here.

I think it's fair to expect upgrades once in a while.

I still think you're being unreasonable. They have animations for running in all directions now, turning around, even using stimpaks and drugs. It's the first Bethesda game where I've felt comfortable playing in thirdperson. The graphics are vastly improved, the Papyrus scripting performs better and allows for more highlevel scripting... I honestly don't see what they could have done differently on the technical side of things (designwise it's a whole different beast).
 
The ease of modding makes keeping the engine a worthy cause. I just wish the games didn't rely on modding to make them enjoyable :/
 
Good luck to you. I can forsee the Commonwealth itself being an issue though, lots of rubble and cliffs. Not much pure empty space to drive around in.
 
Back
Top