Aller au contenu

Photo

How frame rate affects game difficulty [UPDATE 13/03/2013]


  • Veuillez vous connecter pour répondre
412 réponses à ce sujet

#351
cgtrfghj7

cgtrfghj7
  • Members
  • 958 messages

Caratinoid wrote...

Ok, I just took a quick peek at the source code, there are rounding errors all over the place. Most variables are floating point numbers but the programmers are working with functions like Max, Min, Clamp etc which can only work with integers. When passing float parameters to those functions, they are automatically typecasted to integer (rounded down). If you don't want this you should use the FMin, FMax, FClamp ... functions instead which they still don't use even in last DLC.
So if you write something like "Clamp(factor, 0.5, 1.0)" the result will always be 0.

What's affected? So far found these things:

Shield recharge times (see OP)
Some aspects of schield gates are affected (for example it was not intended for asari's dodge to remove shield gate if you use up all your shields)
Enemy spawn penalty calculations (yeah, I said it)
Projectile movement (direction change)
Player position tracking is probably due to this as well

This can not be fixed with a patch because those functions are used everywhere, you would need to replace almost all files to fix it, no wonder there have been no response. If basic functions like this are used incorrectly then I'm afraid to dig any further.

The only chance to fix those bugs would be to make a custom patcher to replace those function calls in all files with the correct ones by manipulation uscript byte codes.

Now that I can read the source code (the process is not perfect yet) I can probably answer questions about other aspects of the game mechanics without having to do memory tests.


Aha, I feel smarter having understood everything you just said. :happy:

But that being said, it's sad to hear that that's the truth behind all this. 

#352
Shampoohorn

Shampoohorn
  • Members
  • 5 861 messages
It's great that Caratinoid has uncovered this. I'm full of hope that Bioware at least reads about it and makes real improvements to the way they execute ME4 MP.

#353
Dunvi

Dunvi
  • Members
  • 4 841 messages

Shampoohorn wrote...


It's great that Caratinoid has uncovered this. I'm full of hope that Bioware at least reads about it and makes real improvements to the way they execute ME4 MP.


Like hiring me with 100k starting salary?

*i wish :crying:*

Seriously, though. That's... a fairly basic programming error. And sure it's the kind of stupid mistake everyone makes when they're just hashing out an algorithm, but don't they at least have unit tests to catch those kinds of oversights?

#354
BridgeBurner

BridgeBurner
  • Members
  • 7 317 messages
Hopefully with them using Frostbite next time around they won't make this mistake again.

Also, I might as well ask here...

With pay day coming up soon, I will have da monies. I'm out of the loop when it comes to graphics cards, etc, but I'm looking to upgrade to a card that isn't necessarily "top range" and too expensive, but will get the mileage with games.

#355
ZiRK

ZiRK
  • Members
  • 1 022 messages
So artificially lag switching enemies? lol banned.

#356
Shampoohorn

Shampoohorn
  • Members
  • 5 861 messages

Dunvi wrote...

Shampoohorn wrote...


It's great that Caratinoid has uncovered this. I'm full of hope that Bioware at least reads about it and makes real improvements to the way they execute ME4 MP.


Like hiring me with 100k starting salary?

*i wish :crying:*

Seriously, though. That's... a fairly basic programming error. And sure it's the kind of stupid mistake everyone makes when they're just hashing out an algorithm, but don't they at least have unit tests to catch those kinds of oversights?


Well I'm not a programmer, but I can see these types of errors actually being related to the transition of the game from a single player RPG to a simple 3P MP experience.  Difficulty in the single player game is low and shortcut mechanics would probably be quite forgiving.  Multiplayer combat is constant and the difficulty is tuned way up.  Split second actions, reactions and performance are more important and more likely to reveal these flaws.

I'm not trying to make an excuse.  But I think it's important to put it in the context of Bioware's MP experience.  It's my understanding that they very much tried to make their own way with MP instead of just importing a team from another game studio.  Whatever warts may have resulted from that have been more than made up for by the overall experience -- at least for me.

#357
Dunvi

Dunvi
  • Members
  • 4 841 messages

Annomander wrote...

Hopefully with them using Frostbite next time around they won't make this mistake again.

Also, I might as well ask here...

With pay day coming up soon, I will have da monies. I'm out of the loop when it comes to graphics cards, etc, but I'm looking to upgrade to a card that isn't necessarily "top range" and too expensive, but will get the mileage with games.


Unfortunately, this sounds like a basic C programming error, not an engine utilization error. Same problem can happen easy.

Regarding video cards, I only know nVidia cards. I'm running a 660Ti and I'm pleased. x70+ enters the ridiculous price range, don't go below x40. If you run dual HDMI monitors like I do you probably want to get the 660, otherwise you can get away with a 650 or 650Ti. 640 is a little lower than I'd want to go. I don't find there's much to any price benefit for dropping one to two generations (you can get approximately equivalent power by going down one generation and up one series number, and accordingly you end up with the same price <_<), and more than that you definitely start losing power.

#358
Dunvi

Dunvi
  • Members
  • 4 841 messages

Shampoohorn wrote...

Dunvi wrote...

Shampoohorn wrote...


It's great that Caratinoid has uncovered this. I'm full of hope that Bioware at least reads about it and makes real improvements to the way they execute ME4 MP.


Like hiring me with 100k starting salary?

*i wish :crying:*

Seriously, though. That's... a fairly basic programming error. And sure it's the kind of stupid mistake everyone makes when they're just hashing out an algorithm, but don't they at least have unit tests to catch those kinds of oversights?


Well I'm not a programmer, but I can see these types of errors actually being related to the transition of the game from a single player RPG to a simple 3P MP experience.  Difficulty in the single player game is low and shortcut mechanics would probably be quite forgiving.  Multiplayer combat is constant and the difficulty is tuned way up.  Split second actions, reactions and performance are more important and more likely to reveal these flaws.

I'm not trying to make an excuse.  But I think it's important to put it in the context of Bioware's MP experience.  It's my understanding that they very much tried to make their own way with MP instead of just importing a team from another game studio.  Whatever warts may have resulted from that have been more than made up for by the overall experience -- at least for me.


But that's not an MP issue. That's a basic programming error - not checking input types to basic function calls. It's one of the first things we teach our students in their first C/C++ based class is that floats and ints are very, very different, and have different functions as a result.

If you did that in our 70 class, I would ding you so hard. I would bring the wrath of unix down on you and/or make fun of you through out the entire grader meeting. If you did that in 105... well, I'm not sure you're passing the class :P

ETA: Let me provide an example. It's akin to not proofreading your documents before sending them out. Doesn't matter if it's your first time writing a press release, you should know better than to send out any document as final without checking for basic spelling errors.

Modifié par Dunvi, 04 mars 2013 - 11:50 .


#359
BridgeBurner

BridgeBurner
  • Members
  • 7 317 messages

Dunvi wrote...

Annomander wrote...

Hopefully with them using Frostbite next time around they won't make this mistake again.

Also, I might as well ask here...

With pay day coming up soon, I will have da monies. I'm out of the loop when it comes to graphics cards, etc, but I'm looking to upgrade to a card that isn't necessarily "top range" and too expensive, but will get the mileage with games.


Unfortunately, this sounds like a basic C programming error, not an engine utilization error. Same problem can happen easy.

Regarding video cards, I only know nVidia cards. I'm running a 660Ti and I'm pleased. x70+ enters the ridiculous price range, don't go below x40. If you run dual HDMI monitors like I do you probably want to get the 660, otherwise you can get away with a 650 or 650Ti. 640 is a little lower than I'd want to go. I don't find there's much to any price benefit for dropping one to two generations (you can get approximately equivalent power by going down one generation and up one series number, and accordingly you end up with the same price <_<), and more than that you definitely start losing power.


GTX 670, looks ok.

Only problem is I need other new stuff too, acquisition of hardware always takes sooo long :(

#360
Dunvi

Dunvi
  • Members
  • 4 841 messages

Annomander wrote...

Dunvi wrote...

Annomander wrote...

Hopefully with them using Frostbite next time around they won't make this mistake again.

Also, I might as well ask here...

With pay day coming up soon, I will have da monies. I'm out of the loop when it comes to graphics cards, etc, but I'm looking to upgrade to a card that isn't necessarily "top range" and too expensive, but will get the mileage with games.


Unfortunately, this sounds like a basic C programming error, not an engine utilization error. Same problem can happen easy.

Regarding video cards, I only know nVidia cards. I'm running a 660Ti and I'm pleased. x70+ enters the ridiculous price range, don't go below x40. If you run dual HDMI monitors like I do you probably want to get the 660, otherwise you can get away with a 650 or 650Ti. 640 is a little lower than I'd want to go. I don't find there's much to any price benefit for dropping one to two generations (you can get approximately equivalent power by going down one generation and up one series number, and accordingly you end up with the same price <_<), and more than that you definitely start losing power.


GTX 670, looks ok.

Only problem is I need other new stuff too, acquisition of hardware always takes sooo long :(


Eh... 660Ti. Significantly cheaper, I believe, or at least it was when I was researching for my card :?. 660Ti is a 670 that didn't quite make the cut, is almost certainly good enough for your purposes. In America, the price difference is almost $100, I don't know what it would be for you but if anything I believe it's usually even more ridiculous?

#361
Capt_Kangaroo

Capt_Kangaroo
  • Members
  • 214 messages
Going to try it tomorrow, I have over 40000N7 points and STILL can't do the gold solo. i get to level 6 and just continously get killed. Shot/ grabbed/stabbed/whipped/bombed, I've had it all, and its not from a lack of trying. This is the first game EVER that I have not been able to beat on insanity.
Thanks Gary

#362
Caratinoid

Caratinoid
  • Members
  • 982 messages
Ok, I made some improvements to the way I read the code, looks like I made it sound much worse than it was. While I was correct about the rounding error thing, not all the functions are incorrect like I thought, I was just lucky enough to stumble in to the buggy parts in a very short time span. What it means is that you only need to replace them in a few places to fix some things. I will probably be able to fix shield recharge bug and asari evade breaking the shieldgate myself when I have better tools to make sure that it will not affect anything else.

And yeah there are litteraly millions lines of code so I guess it's normal to have bugs here and there. I wonder if we get one last patch.

#363
TheThirdRace

TheThirdRace
  • Members
  • 1 511 messages

Caratinoid wrote...

Ok, I made some improvements to the way I read the code, looks like I made it sound much worse than it was. While I was correct about the rounding error thing, not all the functions are incorrect like I thought, I was just lucky enough to stumble in to the buggy parts in a very short time span. What it means is that you only need to replace them in a few places to fix some things. I will probably be able to fix shield recharge bug and asari evade breaking the shieldgate myself when I have better tools to make sure that it will not affect anything else.

And yeah there are litteraly millions lines of code so I guess it's normal to have bugs here and there. I wonder if we get one last patch.


It would be nice to have a patch at least for PC because:
1- The problems you found concerns framerate and is basically only PC related
2- EA owns Origin so it's not as expansive as for consoles to push a quick fix

If they go ahead with a PC patch, I would like them to fix everything they can that is only related to PC. The Shockwave Radius evo is one of those things...

I know you stated you sent a PM to Bioware about this, but do you keep them updated with your new findings? I guess you do, but I needed to ask...

If you are successful in fixing those problems, would you be kind enough to seek authorisation from Bioware to allow us to use the fix? Or maybe try to convince them to include the fix in their next patch?

Modifié par TheThirdRace, 05 mars 2013 - 07:09 .


#364
Caratinoid

Caratinoid
  • Members
  • 982 messages

TheThirdRace wrote...

Caratinoid wrote...

Ok,
I made some improvements to the way I read the code, looks like I made it sound much worse than it was. While I was correct about the rounding error thing, not all the functions are incorrect like I thought, I was just lucky enough to stumble in to the buggy parts in a very short time span. What it means is that you only need to replace them in a few places to fix some things. I will probably be able to fix shield recharge bug and asari evade breaking the shieldgate myself when I have better tools to make sure that it will not affect anything else.

Andyeah there are litteraly millions lines of code so I guess it's normal to have bugs here and there. I wonder if we get one last patch.


It would be nice to have a patch at least for PC because:
1- The problems you found concerns framerate and is basically only PC related
2- EA owns Origin so it's not as expansive as for consoles to push a quick fix

If they go ahead with a PC patch, I would like them to fix everything they can that is only related to PC. The Shockwave Radius evo is one of those things...

Yeah, I don't play characters with shockwave because of that, it stops working after wave 3 for me if not sooner. I will look in to that as well.

TheThirdRace wrote...

I know you stated you sent a PM to Bioware about this, but do you keep them updated with your new findings? I guess you do, but I needed to ask...

I haven't received any answer yet so I'll wait a bit and send them PM when I can confirm that the fix is working and not breaking anything else.

TheThirdRace wrote...

If you are successful in fixing those
problems, would you be kind enough to seek authorisation from Bioware to allow us to use the fix? Or maybe try to convince them to include the fix in their next patch?

I'm modifying files directly, you would simply need to replace some files to apply the fix. Bioware does not support mods, any modifications you do no matter how small are at your own risk, they don't have time to check these things.

Modifié par Caratinoid, 05 mars 2013 - 08:47 .


#365
Deerber

Deerber
  • Members
  • 16 836 messages

Caratinoid wrote...

I'm modifying files directly, you would simply need to replace some files to apply the fix. Bioware does not support mods, any modifications you do no matter how small are at your own risk, they don't have time to check these things.


So long as I don't get banned for doing it, I really don't care if they support it or not...

#366
Caratinoid

Caratinoid
  • Members
  • 982 messages

Deerber wrote...

Caratinoid wrote...

I'm modifying files directly, you would simply need to replace some files to apply the fix. Bioware does not support mods, any modifications you do no matter how small are at your own risk, they don't have time to check these things.


So long as I don't get banned for doing it, I really don't care if they support it or not...

It will be undetectable, it doesn't affect how the game calculates things but simply eliminates some rounding errors. At this point I know which things can get you banned anyway, so you are safe.

#367
UnknownMercenary

UnknownMercenary
  • Members
  • 5 547 messages

Dunvi wrote...

ETA: Let me provide an example. It's akin to not proofreading your documents before sending them out. Doesn't matter if it's your first time writing a press release, you should know better than to send out any document as final without checking for basic spelling errors.


I don't do this on 90% of my writing assignments >_>

Something that would be published though... yeah, damn right I'm checking everything, which is why such a basic mistake like this persisting for so long is completely baffling.

#368
Commander_Rafael

Commander_Rafael
  • Members
  • 47 messages
Are you planning to create a fix for the rounding erros only or would it also normalize the AI "skill" level to the 30fps standard? I mean, the rounding errors would be really sweet, but I wanted to know if I can dream on playing with the normalized AI behavior too :D when a friend with a more modest pc hosts and he can't sustain the 60 fps is such a relief to play in a more dynamic style having the ability to dodge things. :)

#369
Qui-Gon Glenn

Qui-Gon Glenn
  • Members
  • 2 108 messages
Too funny. I relearned how to properly use float v int years ago, debugging and modding Bioware code on the original KotOR. Preston did much of the scripting then, and I do not recall him making these sorts of 101 mistakes. The bugs in KotOR (and its successor TSL (by Obsidian but recycling a lot of BW code)) were subtle but not game-breaking in most cases, and generally were related to other simple things like incorrect filenames.

QA seems to not be involved in the programming side of things. I am a little slack-jawed reading that this is the base error behind many of our complaints - it is really so simple and basic it is a little gross.

#370
Mindfane

Mindfane
  • Members
  • 759 messages

Dunvi wrote...

Annomander wrote...

Hopefully with them using Frostbite next time around they won't make this mistake again.

Also, I might as well ask here...

With pay day coming up soon, I will have da monies. I'm out of the loop when it comes to graphics cards, etc, but I'm looking to upgrade to a card that isn't necessarily "top range" and too expensive, but will get the mileage with games.


Unfortunately, this sounds like a basic C programming error, not an engine utilization error. Same problem can happen easy.

Regarding video cards, I only know nVidia cards. I'm running a 660Ti and I'm pleased. x70+ enters the ridiculous price range, don't go below x40. If you run dual HDMI monitors like I do you probably want to get the 660, otherwise you can get away with a 650 or 650Ti. 640 is a little lower than I'd want to go. I don't find there's much to any price benefit for dropping one to two generations (you can get approximately equivalent power by going down one generation and up one series number, and accordingly you end up with the same price <_<), and more than that you definitely start losing power.


Actually it is not a c/c++ problem. The problem is with unrealscript. Unlike C/C++, in Unrealscript min, max... work only on integers. If you pass floats as paramerts, you will not get any warnings either. You have to use FMax and FMin to be safe. A programmer who used work in C/C++ would expect min or max to work the same way. 

#371
Dunvi

Dunvi
  • Members
  • 4 841 messages

Mindfane wrote...

Dunvi wrote...

Annomander wrote...

Hopefully with them using Frostbite next time around they won't make this mistake again.

Also, I might as well ask here...

With pay day coming up soon, I will have da monies. I'm out of the loop when it comes to graphics cards, etc, but I'm looking to upgrade to a card that isn't necessarily "top range" and too expensive, but will get the mileage with games.


Unfortunately, this sounds like a basic C programming error, not an engine utilization error. Same problem can happen easy.

Regarding video cards, I only know nVidia cards. I'm running a 660Ti and I'm pleased. x70+ enters the ridiculous price range, don't go below x40. If you run dual HDMI monitors like I do you probably want to get the 660, otherwise you can get away with a 650 or 650Ti. 640 is a little lower than I'd want to go. I don't find there's much to any price benefit for dropping one to two generations (you can get approximately equivalent power by going down one generation and up one series number, and accordingly you end up with the same price <_<), and more than that you definitely start losing power.


Actually it is not a c/c++ problem. The problem is with unrealscript. Unlike C/C++, in Unrealscript min, max... work only on integers. If you pass floats as paramerts, you will not get any warnings either. You have to use FMax and FMin to be safe. A programmer who used work in C/C++ would expect min or max to work the same way. 


I think C uses a different library for floats? I might be wrong, though, I'll admit that I haven't worked with floats really at all.

However, I believe you :)

#372
SavagelyEpic

SavagelyEpic
  • Members
  • 3 734 messages
This fix you're working on - would it only make shield recharge & associated bugs work properly or would it also address enemy behaviour?

I'm getting real tired of fighting superhuman supersoldiers disguised as mass effect enemies.

#373
Mindfane

Mindfane
  • Members
  • 759 messages

Dunvi wrote...

Mindfane wrote...

Actually it is not a c/c++ problem. The problem is with unrealscript. Unlike C/C++, in Unrealscript min, max... work only on integers. If you pass floats as paramerts, you will not get any warnings either. You have to use FMax and FMin to be safe. A programmer who used work in C/C++ would expect min or max to work the same way. 


I think C uses a different library for floats? I might be wrong, though, I'll admit that I haven't worked with floats really at all.

However, I believe you :)


In c++98, the max function is defined for template class and it will work for many datatypes:
template <class T> const T& max (const T& a, const T& b) {
  return (a<b)?b:a;     
}
So it will work correctly for
max(1, 2) will return 2
max('a', 'b') will return b
max(3.14, 2.34) will return 3.14

But iN Unrealscript, Max() function expects two integers as input. If you dont provide integers, they are  silently rounded down and no warnings are given.
So Max(0.75, 0.25) will return 0!

So you will have to use FMax(0.75, 0.25) which will give the correct output of 0.75
http://udn.epicgames...teger functions

While I was creating some mods for Unreal Tournament, I lost almost a week becuase of this.

PS: I dont think C has min() and max() defined by default. Atleast they are not in stdlib.h. Havent worked in C for a while. I could be wrong.

Modifié par Mindfane, 11 mars 2013 - 05:31 .


#374
Dunvi

Dunvi
  • Members
  • 4 841 messages
I ran a quick man check on fmin when I wrote my previous post, which is why I assumed min would only work on ints in C. :P

#375
Deerber

Deerber
  • Members
  • 16 836 messages

Caratinoid wrote...

Deerber wrote...

Caratinoid wrote...

I'm modifying files directly, you would simply need to replace some files to apply the fix. Bioware does not support mods, any modifications you do no matter how small are at your own risk, they don't have time to check these things.


So long as I don't get banned for doing it, I really don't care if they support it or not...

It will be undetectable, it doesn't affect how the game calculates things but simply eliminates some rounding errors. At this point I know which things can get you banned anyway, so you are safe.


Awesome! Then I'm looking forward to it! ;)