AI performance (especially CPU) / Nords come

Discussion in 'Wish Lists' started by DrivingFast, Nov 17, 2018.

  1. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,638
    Likes Received:
    1,083
    The Nurburgring come.

    In 24H or Nordschliefe configuration, what is exciting for me in OFFLINE is to put in maximum of different cars, and to have the possibility to put a lot of classes (understand mods) different.....

    The condition for this is to be able to put a very large number of AI opponents on the track.

    Exept, RF2 currently has a major constraint :

    CPU usage is disproportionately important when one wants to put a lot of AI.

    In reality, there are sometimes well over 100 cars along ~25 km ..........

    So I ask you the following :

    Would it be possible that you optimize as much as possible the AI in performance term for the release of the Nurburgring ?

    This is possible because with the same computer if you create a LAN game with AI, the performance is much better than in the game.

    Moreover, even if it has nothing to do, the number of AI is the worst setting for FPS (also day/night transitions, rain, mirrors, shadows).
    It would be nice if you see if it is possible to do something.

    Thank you !
     
    Last edited: Nov 17, 2018
  2. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    This seems the easier option to me. Would be nice if they can do it on their side, but in the meantime just run a local server.
     
    Marcel Offermans likes this.
  3. Filip

    Filip Registered

    Joined:
    Feb 9, 2017
    Messages:
    1,208
    Likes Received:
    937
    Wait a minute...
    Are you guys saying there is fps gain in local server mode opposed to normal single player session with same number of AI cars? How much gain? Is it worth a hassle?

    Edit: Are you referring to situation with 2 computers and setting one as a server to move AI computations there and join that server from other one?
    I guess that's only helpful if cpu is bottlenecking but if gpu is bottleneck than this should not help?
    Is there any benefit of running the server on the same machine?
     
    Last edited: Dec 2, 2018
  4. Tnadz

    Tnadz Registered

    Joined:
    Nov 2, 2017
    Messages:
    227
    Likes Received:
    151
    That is correct. You get a performance gain if your CPU is bottlenecked. rF2 only uses a single core when running but if you host a local server it offloads a lot of the race hosting responsibilities to another core (AI, race session stuff, etc), freeing up the "driver" core to do regular physics calculations and everything else it needs to related to the single driver racing. i.e. Many race related functions will be run by the hosting DedicatedServer.exe while first person driving functions will be loaded to a different core under rfactor.exe. The improvements could be in the realm of a couple FPS to a couple dozen (depending on your core and race setup). It won't help much with graphics as you say. Only optimization, better drivers and a better graphics card will improve that significantly.
     
    Filip likes this.
  5. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,638
    Likes Received:
    1,083
    This method is very restrictive :

    The principle is that the purple bar (use of CPU resources) is relatively less important when playing LAN, using *1 PC*.

    This allows you to put a lot more AI than offline classic, without saturating your CPU.

    This allows me to put more than 100 AIs on the scanned laser nordschliefe, with at least 20 different classes (yes !).

    I should have been content with 80 AI in the best case in offline classic.

    ------------------------------------------------
    I hope for a significant optimization of the performance of the AI for the release of the Nordschliefe, because it is a particular circuit, on which it is ridiculous to put 30 AI (Nurburgring 24H, 25 km).
     
  6. Filip

    Filip Registered

    Joined:
    Feb 9, 2017
    Messages:
    1,208
    Likes Received:
    937
    @Tnadz thx

    I guess easy test is adding more AI cars while keeping visible opponents number the same. If FPS decrease cpu is bottlenecking or am I missing something?
     
  7. stonec

    stonec Registered

    Joined:
    Jun 19, 2012
    Messages:
    3,399
    Likes Received:
    1,489
    Yeah I guess it would only be relevant if you were CPU bottlenecked. More specifically, you need to be bottlenecked by the AI physics itself for this method to be of any use. You automatically get worse FPS when adding AI cars, but that's mostly from the rendering part. AI physics CPU requirement in rF2 is much lower than in many other sims as AI's use the old tire model from rF1.
     
  8. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    @Filip I wouldn't be so focused on FPS for normal use situations. Your CPU has to be pretty heavily used before offloading the AI to another core is beneficial. Simply having more AI, either within the game or via a local server, will affect FPS due to the graphics load as stonec says.

    The physics does play a role once you add quite a lot of AI cars, plus the 'logic' of making them drive around the track. If your CPU is borderline it may not take that many AI to cause an issue, but a modern intel CPU probably wouldn't see much difference on normal numbers of AI. And that's why I think the current solution for the OP is still the best - it's a bit of a special case scenario to go and spend dev time making the AI run on another thread, at least in the short term. That could be icing for later.

    @stonec Are other games noticeably heavier in this regard, and is that overall or in relation to player physics? rF2's AI does use 'simple' physics, but being nearly rF1 physics really puts them on a par with many other games' player physics :D (albeit at a lower update rate). I can imagine they seem less taxing in rF2 because the player physics are more demanding in comparison.

    The only other thing I'd correct above is rF2 uses two cores, plus a little extra since recently for some shadow drawing (and possibly some other 'minor' graphics stuff), but the physics side is all on one, so offloading some of that to a server can be helpful, sometimes.
     
  9. Filip

    Filip Registered

    Joined:
    Feb 9, 2017
    Messages:
    1,208
    Likes Received:
    937
    thx for your thorough answers
     
  10. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,638
    Likes Received:
    1,083
    Just to have a little idea :

    Just tested again the Norsdchliefe Laser, with 80 AI and mostly thirty different classes and almost 80 different cars for 80 cars in total.

    The purple graph was just over 90%.

    In the worst race conditions, minimum FPS 54 and 60 FPS almost all the time, and just a small LAG.

    HARDWARE: i7 4770K not OC, 16gb DDR3 1333mhz, GTX 1080.

    Assuming that S397 would optimize AI performance, for the Nordschliefe Realease, which I hope, I would hope that optimization would allow my system to put at least 100 AI minimum under the same performance conditions (ingame NOT LAN).

    For 25 km from Nurburgring 24h with less than 100 AI, for a run of one hour or more, it's really boring.

    I also hope that S397 will allow to associate more different mods for each race: there is currently a limit.
     
  11. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    They can't just choose to optimize something and make it more efficient. The AI code is probably quite complex and they already said they won't rewrite it, so I doubt there's much they can do. Running 80+ AI is not normal, and you can do it using a server.
     
    Filip likes this.
  12. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,638
    Likes Received:
    1,083
    On circuits of 4, 5, 6, 7 km, yes.

    But on a circuit 25 km reputed to host many multiclass cars, yes.

    The nurburgring arrives, it must be taken into account !
     
  13. stonec

    stonec Registered

    Joined:
    Jun 19, 2012
    Messages:
    3,399
    Likes Received:
    1,489
    By other games I should have written AC and ACC where the AI is running on player physics from my understanding and there is a hard limit of 24 or 30 AI cars. It will be interesting to see what iRacing does with its upcoming support for AI cars, but I doubt they can somehow make AI much more efficient.

    I think CPU's would need to develop more to get huge fields of cars since AI is limited by single-threaded CPU performance, which is more or less the same as five years ago.
     
  14. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,638
    Likes Received:
    1,083
    It would be nice for at least S397 to do an assessment of what they can improve and quantify.

    They could then determine whether it is worth the work to be done or not.
    @Marcel Offermans
     
  15. Filip

    Filip Registered

    Joined:
    Feb 9, 2017
    Messages:
    1,208
    Likes Received:
    937
    Hmmm they probably never thought of that.
    Luckily they have this forum and threads like this which are invaluable.
     
  16. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,638
    Likes Received:
    1,083
    Can you explore this option, @Marcel Offermans ?
     
  17. Tnadz

    Tnadz Registered

    Joined:
    Nov 2, 2017
    Messages:
    227
    Likes Received:
    151
    In general, most studios would like to be able to utilize multiple cores more as that is generally the direction of CPU manufacturers. The problem lies with the engine and software that has to hand off the info to the cores and stay in sync with itself. The CPU makers keep adding cores because computers generally are increasing the number of processes they are running. So it's easier to just add more cores of the same output to a chip than to make more powerful chips.

    With video games and simulations, so many variables are codependent on each other on any single power cycle of the core, it's very tricky to write code that can split processing off to different cores and still stay synched up with the output without having a major bottleneck, to say nothing of when you have to make changes/updates to said code how time consuming that is.

    This is one of the reasons why physics modeling is so intensive because the computer is trying to crunch a ton of calculations at once. Interestingly enough, companies like Toshiba are working on algorithms that could significantly reduce certain types of calculations by allowing chunks (block chain?) To be distributed across a network of processors. I think as we see more of this type of algorithm being developed at an industry level, there will be more, specialized processors that can be utilized by programmers to handle big data (I believe this was the initial thrust of Physx by nVidia which helps but I think is more akin to the way soundcards used to be separate from the motherboard and fell out of favor-it's also a software based engine, not hardware/firmware). Of course, we wouldn't see something like this for a while which is why we will likely get programming shortcuts for the next decade or so to handle big, consuming calculations.
     
    DrivingFast likes this.
  18. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,638
    Likes Received:
    1,083
    In VR :

    Even more than on screen, and even excessively more, playing with an AI number greater than 20 (depending on the hardware) is incredibly problematic in VR.

    I hope that @S397 plans to do something.

    I do not see myself racing on the Nurburgring with less than 40 cars, given the gigantic size of the track.

    But this problem exists well before the use of 40 AI.
     
  19. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    7,481
    Likes Received:
    4,395
    Perhaps S397 could get into selling hardware. Something like rF2/VR approved. CPU's that would melt a non-liquid heat sink. Vid cards that could collect enough bit-coin in an hour to finance an entire City for a day. Memory so fast(read hot) that requires it's own secondary box to prevent damage to other internals....yeah...that is all it will take. They have made attempts to upgrade VR and 2d performance with some success, but I don't think they can just wave a majik wand and find another 60fps improvement.
    My guess at what will be required is more and more memory, both system and video.
     
  20. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,638
    Likes Received:
    1,083
    Yes, but you forgot that I think :


    "And a way to use a fourth thread for AI cars is to run a dedicated server instance with AI's loaded there and then locally join that session." (Stonec)

    ----------------------------------------

    "What I really want, especially with the realization of the Nurburgring, is a strong optimization of rF2 when using a lot of AI.

    I do not have any special technical knowledge, but that seems really possible given what @stonec explained, see above, using a 4th thread for AI.

    By experience, the performance gain on the CPU side is very important." (me)
     

Share This Page