RiotTony

RiotTony



29 Sep

Comment

Originally posted by claptrap23

No word on the FPS drops again? Lol

Hey Everyone. I'm a senior engineer at Riot and I specialise in performance issues.

Lets see if we can't get this fixed once and for all.

Most of the reports I've seen seem to be AMD related (some are Intel, but they may be different issues). The data I've seen from bad games looks to be independent of the game mode (happens in TFT and League) and isn't affecting just one portion of the game loop. This indicates that it's probably not due to Riot code.

Searching around even Fortnite seemed to be experiencing issues with a couple of drivers and Epic recommended rolling back to version 22.2.2 (https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-2-2) (This was from 22.5.1 and 22.6.1).

So, if you are experiencing the issue where the game s...

Read more

16 Oct

Comment

Originally posted by Poluact

How is going the work on optimizing the game engine to using multiple cpu cores (if you're still working on it)? I've seen couple of years ago a post on boards noting that there was some work done on multi-core renderer but it wasn't released because it was kinda prone to freezes and lock-ups.

Also, regarding to previous question: there recently was a post on engineering blog about moving League on engine-heavy side. How will it impact multi-threaded performance and do you consider it when you move parts of the game from scripts to engine?

We do run a few third party libraries on other threads and do small amounts of work there already. The most work done on different threads is the particle simulation - that's pretty good, but we can still do a bit better there. As for porting game logic to more threads, that's quite tricky but definitely something we're thinking about for the future. As for multithreading the renderer, as we're still Dx9, that's not really an option.

The other thing we need to consider is min and mid spec support. There is no point making the game require 16 threads as we'd make the game run too slow on the lower spec machines. As 8 core machines become more popular, we'll be able to utilise them more, but for now we need to build for our player base.


03 May

Comment

Originally posted by Spooky_Thresh

What the f**k, Tony

Yeah. Sorry - ATM LoL was my favourite type of LoL too.

Comment

Originally posted by alrightrb

no support =/= wont work.

unless riot intentionally locks out xp and vista it is unlikely to break as soon as 9.10 is released (provided they are not releasing something at the same time as 9.10 which doesn't work on vista and xp)

Sorry - it does mean that LoL won't work on Vista and XP. You'll need to upgrade your OS in order to keep playing.

And yes, this does mean that you'll no longer be able to play League on an ATM.


08 Aug

Comment

Originally posted by thiswasonceeasy

I would be interested in knowing a little more about the game engine itself. I remember reading in the past that it doesn't use a major engine such as Unreal, Cryengine, or Unity and that it was developed in-house. Is this true? And if so, I'd be interested in how the dev tools were developed and what features they have.

You are correct. We don't use one of the major commercial engines, we've rolled our own. This allows us to be more flexible - if we need something we can add it. We get to decide what the most important features are and what needs support. We also have had to build all of our tools (the game related ones at least. We still use 3rd party tools like Maya etc for art and audio and whatnot) - so our tools are customised to do what League needs: Creating particle effects, linking them to spells, dealing with game logic to name just a couple.

We are constantly iterating on our engine and tools so that we can more quickly and efficiently add new content. Of course, adding new content and features has a cost in terms of performance and memory, hence this eternal battle for framerate.

Comment

Originally posted by VisAnalysis

This is interesting content (that Riot doesn’t have to publish) so it’s weird to me that so far these comments are just complaining about things.

It’s cool that they clearly take a lot of time to tell us anecdotes about things that happen under the hood, and as a coding hobbyist it’s fun to hear about some unexpected challenges, since anyone who codes, even as a team with QA, has done things than this or worse.

Kudos to the writer — this was written in a grear ELI5 sort of way. Could you (Or anyone) comment on why the Swain problem showed on a mid-spec machine but not the low-spec ones you tested on?

We don't test every skin of every champion on every spec machine on every game map or game type. There are just too many combinations there to do in a reasonable time with QA team. Even PBE doesn't catch every combination, which is why we need to keep an eye on live games and player reports for outliers. In this case, the Swain slow down wasn't flagged as an issue with our internal testing, or even on PBE. Either it wasn't noticeable enough (the impact would depend on screen resolution as well as GPU type and even the CPU could mitigate the GPU slowdown if it was slow enough) or it was deemed within the acceptible bounds of perf degradation or it wasn't seen.

So, to your question, it should have showed up in testing. If I was able to test on a min spec machine myself, it would have shown up. But my development machine is not min-spec (I do need to be able to compile the game), its more mid-spec and even on that machine it only showed up when I was running two game clients t...

Read more

05 Jul

Comment

Originally posted by RabblerouserGT

If I may ask, why is it that PBE plays so much more smoother to me than Live? I play one a somewhat crappy PC and it sucks to feel these random frame stutters on live.

In Live, I usually hover around my 60FPS cap, but very sporadically, it dips down to 47fps or in some cases, down to 30-something fps. In PBE, it feels like I can even play on highest settings and it's a lot smoother, albeit with some hiccups.

It seems to happen sometimes when there's a change in the fog of war.

There shouldn’t be any difference between a version on PBE and that same version on Live. If you are interested in figuring out why, there are some things we can do. Just PM me.


02 Jul

Comment

Thanks for noticing! We rolled out a nice optimisation with 8.13, so you should have noticed a good improvement in fps, particularly if your frame rate was already up around 80+fps.

We're constantly monitoring frame rates with each patch, and always looking for ways to speed up the slow parts of the code, and making sure we've not made things worse - hopefully we'll be able to roll out a few more optimisations that'll help even more over the coming patches.


14 Apr

Comment

Originally posted by TopTierTopLane

Okay, good info. So if I'm running a Ryzen 3 1200, it'd be normal to see all my cores around 50%? And if I went to say, an R5 1600, it'd look something like 33% on all cores, disregarding the slightly faster speed?

Regardless, it sounds like faster cores are determinant of FPS currently, regardless of how few cores there are. Is that correct?

Yup. That's pretty much it. As long as you have at least 2 cores, running 4 hyperthreads, CPU speed is the determinant factor. At the moment.

Comment

Originally posted by TopTierTopLane

These all sound like legitimate barriers, but why did league previously hit high framerates on systems far weaker than the ones struggling to push 144 capped now? If it's graphical, I think I speak for a lot of the community when I say not worth. I suspect it's more complex though?

There is a lot more stuff in League now - not just graphical. We're dealing with entirely new systems - new abilities require new code and data. If you could run an old version of League you'd see the difference. It's come a long way.


13 Apr

Comment

Originally posted by TopTierTopLane

You're correct, it's probably not on your end. Try installing MSI afterburner and toggle the on screen display to show GPU and CPU usage (make sure to show CPU usage on a core-by-core basis). You'll probably notice that nothing is at 100%, yet you're not able to hit an fps cap. That isn't supposed to happen.

Support is another big issue, I changed my CPU because they told me they had issues with my old CPU and didn't know when they fixed it- I waited over a year and they never did, so I figured they never would. Spent $300 upgrading my CPU, mobo, and RAM to find that there's a new issue and it plagues everyone. Figured since it effected more people they'd actually fix it, and well, you see what's going on. I submitted a ticket asking specifically if League had an issue with it, but it took almost a week of submitting logs etc before they'd just tell me that there was an issue on their end.

You'll probably notice that nothing is at 100%, yet you're not able to hit an fps cap. That isn't supposed to happen.

Yeah, it is. A single thread doesn't lock to a single core - it will run on whatever core the system deems appropriate. If you run a single thread flat out, constantly, it will not use up one Core 100%, it will spread across all the available cores. If you have 8 cores, you'll see 12.5% utilisation.

I think the underlying concern here is that League isn't "Multi-threaded" enough. That we should be able to use 100% of all the available cores to maintain 144fps. And that is a fair concern - League does run on multiple threads and also uses multiple threads indirectly, but the core gameplay is mainly run on a single thread.

Now, one of the issues with multi threading is that it can increase latency - we're doing more at once, but all those things that are happening at once cannot be dependent on each other. We can't ...

Read more
Comment

Originally posted by _AN0N_

Yea, my fps has been declining with almost every patch since january. After 20 mins in a game my FPS is dropping to around 100-110 which feels awful on a 144hz monitor.

I thought it was something wrong with my computer but I play fortnite on 144fps (capped), Overwatch on 200+ fps and R6S on 144fps (capped). League shouldn't be more demanding than these games right?

I contacted the support asking about this and they just told me to install League on my C: drive.. it didn't change anything.

Hi, I'm Tony and I'm a Rioter and I care about your FPS.

This is something we are working on and will continue to. We are constantly improving and updating League and a side effect of that is that things slow down as more things get added to the game. As we detect these slowdowns (ideally we catch these problems before they go live), we fix them, but sometimes the changes are so small, no one notices them. And when we have 100s of changes going in and some of them are imperceptibly slower, we can end up with a noticeable slow down with no obvious cause. It's death by a thousand paper cuts. These are hard to fix. All we can do is look at the performance of the game and look at the slowest parts, then try and optimise them. And we've already fixed all the low hanging fruit.

To optimise something, we first need to measure it. We've been sneakily adding in a lot of new performance measuring capabilities into the LIVE game so that we can accurately measure the performa...

Read more
Comment

Originally posted by TopTierTopLane

Okay, but none of the individual cores are reaching 100%. Ergo, no CPU throttling. I specifically said core in my original post. Am I still missing something?

He's right. That's not the way that Multi core CPUs work. A single thread will not run on just one core - it will jump across different cores, one at a time. On an 8 core system, one thread running at 100% can and probably will) look like 12.5% of your entire system. One individual core will not run flat out while the others are idling.

Comment

Originally posted by TopTierTopLane

Thanks for the response! It really means a lot to see this acknowledged.

I believe consistent is more important than high, sure. However, if it bounces between 150 and 10,000 I don't care- if it's above my monitor refresh rate all is well. It bounces between 70-150 for me, with some dips below but not many. This is noticeable.

Do you have any clue what's causing the problems? Is it CPU optimization as I expected, or something else? The more details the better, for my own curiosity. Any idea why some people are reporting 500fps on a 7700k/1080 while others may get ~150 on a similarly specced CPU/GPU?

If you are bouncing between 70fps and 150fps, do you have "Wait For Vertical Sync" on? That can cause the game to drop from the monitor's frame rate to half that whenever the CPU dips even slightly below the monitors frame rate.


14 Mar

Comment

Originally posted by LoLFirestorm

Will league ever get multithreaded without a complete game and graphics engine rework?
I'm no programmer but I believe the stuff like UI which is not super time sensitive down to tenths of a milisecond could be executed on a separate core just fine with some work and as far as I'm aware this doesn't take place right now.
My current system is very much an edge case but it's absolutely hilarious to me that I can run Doom 2016 at ultra settings and get 100-120FPS with dips to 80 and on the very same machine league will hover in 60-80 range after leaving the fountain and dip as low as 30 in super lategame teamfights. This is at a mix of medium and high settings btw but these seem to make basically no difference when the bottleneck is on the CPU side like in my case (I'm still running a Phenom II after all these years but I got myself an RX 480 before the mining boom).
I don't think it's alright that even proffesional streamers running pretty beastly builds and encoding o...

Read more

League is already partially multithreaded, although I'll be the first to admit that it could make far better use of more threads. It is something that we are working on - engine rework is ongoing, but with the game changing constantly, this is like rebuilding an airplane engine while its flying. We have to be very careful that we don't break anything as we go.

You have correctly surmised that the main performance issue is a CPU bottleneck - in a team fight we're dealing with a lot of particles, and this can be costly. In fact, there is a break down of the rendering pipeline here which will g...

Read more
Comment

Originally posted by C0ldSn4p

/u/RiotTony : Actually you can inline virtual function if you statically force the call of a precise function implementation

Here is a code sample:

// Compile with: icpc -std=c++11 -O2 main.cpp 
#include <stdio.h>

class Base {
  public:
    virtual int foo() {return 42;}
};


class Child : public Base {
  public:
    int foo() {return 69;}
};

void bar(Child c) {
  printf("%d", c.Child::foo());
}

void bar2(Child c) {
  printf("%d", c.Base::foo());
}

int main(){
  Child c;
  bar(c);
  bar2(c);
}

If you run it you will get the output 6942 showing that first foo from the child was called and the foo from the base (despite using a child object). Also if you look at the assembly (-S option at compilation) you can see in the method bar and bar2 that the values 42 and 69 are hardcoded proving that the correct foo methods were inlined despite being virtual one.

Ofc this is a very specific use case but still, vir...

Read more

Yeah, there are ways around the virtual overhead, but the benefit of virtuals are that you don't need to know what it is that you're calling a given function on. Most use cases are just that - a collection of objects that are similar, but different enough to warrant different implementations of some of their parts. Another way to mitigate the cost of virtuals is to sort them by type. In that case you have far fewer I and D cache misses as you're usually calling the same functions. Modern HW is smart enough to predict the repeated branches.

Comment

Originally posted by [deleted]

If Im looking to work for Riot someday, how much of this sort of thing should I know, as far as this sort of code optimization and assembly? Im a CS major but honestly it feels like they never teach anything about practical real world software development :/

Depends on what you want to do there. If you want to do performance optimisation, then yeah, you'll should know it or be able to learn it on the job. But most of an engineers work is much higher level than this. Having said that, every engineer should be able to measure the performance of their code and understand how to speed it up if needed.

If your CS major isn't teaching yourself anything useful, you can always teach yourself. There is so much information out there for budding programmers and the best way to learn is to do. Build systems, write code for yourself. The more you code, the better you get.

Comment

Originally posted by velrak

Am i understanding that image right and rendering the HUD takes about the same amount of time as the entire rest of the graphics? That seems crazy

There is a surprising amount of work going on in there: scaling, compositing, updating, animating - lots of triangles, lots of textures. That was not a release build either, so there is some extra work going on in there that doesn't happen in LIVE builds.

I agree though, it is a considerable portion of the frame and while some work has been done since that screen shot to improve that, there is more that we should be able to do to in the future.


13 Mar

Comment

Originally posted by trc1234

It's C++, but I don't think any programmer should limit what jobs they can take by the languages they know. Languages are syntactically different, but the underlying concepts and design patterns are identical so new languages should be pretty easy to pick up (unless they are in a completely different paradigm of course). Especially since the field is changing so fast and many languages are no longer being used (for example VB6 is basically dead except a few crazy excel programmers use it) and many new languages are appearing.

This kind of assembly level optimisation the article was talking about is particularly niche topic which most programmers do not need to be too concerned about (this is probably true at Riot too). And I'm sure at Riot they use many different languages as well as hiring many different programming roles.

I totally agree that a programmer shouldn't limit themselves to a single language - the more you know, the more you know. And yes, Riot does use other languages in different roles.

The assembly is there to illustrate the cause of the slowdowns - you very rarely (if ever) need to drop down the assembly on modern HW, but it does help to understand what is going on under the hood which can in turn help you to write more performant code at the top level.


10 Aug

Comment

Are you playing fullscreen, windowed or borderless? And at what resolution and quality?