Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: what programming language does pcars2 use?

  1. #11
    Kart Driver
    Join Date
    Jul 2019
    Posts
    77
    Platform
    PC
    I would suggest you try Unreal Engine as it has just the tools you need and there are tons of tutorials out there. It uses C++ but the programming should not be too complicated. I think there are plugins for other languages as well.

  2. #12
    GT3 Pilot
    Join Date
    Jul 2017
    Posts
    3,745
    Platform
    PC
    Quote Originally Posted by Gregow View Post
    Modern compilers are much better at generating machine code than humans, so there’s no use for it in terms of performance.
    They are not and never will be. But for most cases the difference is negligible, so it is usually not worth it indeed, except where performance is extremely critical.

  3. #13
    Kart Driver
    Join Date
    Jul 2019
    Posts
    77
    Platform
    PC
    Quote Originally Posted by cpcdem View Post
    They are not and never will be. But for most cases the difference is negligible, so it is usually not worth it indeed, except where performance is extremely critical.
    That may have been the case in the past, but it's really not true anymore (at least not for x86 or ARM). It's only in special cases where there's an advantage to directly dealing with assembler code, but many of such cases are typically handled by intrinsics (like SSE/AVX or NEON)

    Writing in assembly is very difficult and the best optimizations can often be completely unintuitive. CPU's and compilers are, on the other hand, built for this. Especially more modern ISA's like Aarch64 which are designed to be as efficient as possible for compilers.

    Assembly blocks are treated as black boxes that can do whatever, preventing some optimizations and further reducing the likelihood of the code being faster.

    A good example of humans making slower code (good because it's been tested and replicated many times) is comparing -march=znver1 to -march=haswell on a Zen CPU, where the latter is 0-3% faster, There are also examples of -march=core2 being faster than -march=skylake on the Skylake architecture, though not as frequently as in the former example. These optimizations are made by humans.

    In the context of games like PC2 it might be worth mentioning that you don't write assembler for GPU's, and that's probably the most performance critical part.
    Last edited by Gregow; 24-08-2019 at 20:12.

  4. #14
    WMD Member Sampo's Avatar
    Join Date
    Jun 2012
    Location
    Finland
    Posts
    700
    Platform
    PC
    Quote Originally Posted by Gregow View Post
    ...
    Writing in assembly is very difficult and the best optimizations can often be completely unintuitive. CPU's and compilers are, on the other hand, built for this.
    ...
    These optimizations are made by humans.
    ...
    Humans make the compilers and the optimizations in them. Just saying.
    CPU Intel i7-9700K @ 4.8 GHz all cores | Motherboard Gigabyte Z390 Aorus Pro | RAM 16GB DDR4 3200MHz | GPU nVidia GTX980 4GB (431.68) | Audio Realtek 5.1 on MB | Screen AOC U3477PQU | OS Windows 10 Pro 64-bit | Wheel Logitech G27
    In-game settings: 2560x1080 | Texture Resolution HIGH | AF 16x | VSync ON (adaptive) | AA None | Reflections MED | Envmap MED | Vehicle HIGH | World HIGH | Shadows MED | Motion Blur NO | Render Frames Ahead 1 | Particles MED/MED/MED

    PC2Info, a PC program that shows most stats the game provides over UDP
    The following user likes this Post: cpcdem


  5. #15
    GT3 Pilot
    Join Date
    Jul 2017
    Posts
    3,745
    Platform
    PC
    Quote Originally Posted by Gregow View Post
    That may have been the case in the past, but it's really not true anymore (at least not for x86 or ARM). It's only in special cases where there's an advantage to directly dealing with assembler code, but many of such cases are typically handled by intrinsics (like SSE/AVX or NEON)

    Writing in assembly is very difficult and the best optimizations can often be completely unintuitive. CPU's and compilers are, on the other hand, built for this. Especially more modern ISA's like Aarch64 which are designed to be as efficient as possible for compilers.

    Assembly blocks are treated as black boxes that can do whatever, preventing some optimizations and further reducing the likelihood of the code being faster.

    A good example of humans making slower code (good because it's been tested and replicated many times) is comparing -march=znver1 to -march=haswell on a Zen CPU, where the latter is 0-3% faster, There are also examples of -march=core2 being faster than -march=skylake on the Skylake architecture, though not as frequently as in the former example. These optimizations are made by humans.

    In the context of games like PC2 it might be worth mentioning that you don't write assembler for GPU's, and that's probably the most performance critical part.
    PCARS2 uses dozens of CPU threads, and some of them cause all cores in a 6-core CPU to run at full throttle. Almost all physics run on the CPU and makes sense to write such stuff in assembly, but obviously only what's important, not the whole code. Writing assembly code may sound difficult, but it is not difficult for an experienced computer programmer. In the past it was very common to write complete programs in assembly, now this is not necessary anymore, but it can help greatly for smaller chunks of code where you need maximum performance.

  6. #16
    Kart Driver
    Join Date
    Jul 2019
    Posts
    77
    Platform
    PC
    Quote Originally Posted by cpcdem View Post
    PCARS2 uses dozens of CPU threads, and some of them cause all cores in a 6-core CPU to run at full throttle. Almost all physics run on the CPU and makes sense to write such stuff in assembly, but obviously only what's important, not the whole code. Writing assembly code may sound difficult, but it is not difficult for an experienced computer programmer. In the past it was very common to write complete programs in assembly, now this is not necessary anymore, but it can help greatly for smaller chunks of code where you need maximum performance.
    It only makes sense if you want to spend lots of resources for no gain and risk making things run slower. Writing assembly code does not sound difficult, it is difficult. You set the bar yourself, by saying it’s not difficult for an experienced programmer. On a large project, like a triple A game, it’s way beyond that though.
    Assembler is difficult because it’s just a semantic machine code. It’s barely readable by humans. To write good code you need an intimate knowledge of the hardware, OS and API’s you’re using. And then you need to do that for every platform you’re targeting (just because PS4, Xbox and PC are amd64 doesn’t mean, for example, that the same pipelining is best for all of them).
    Yes, it was common in the past. So was punch cards. That doesn’t mean anything. There are still uses for assembly, but not for performance optimization in games, unless you have some really fringe cases. Otherwise it can be useful to read assembler to debug and analyse.

  7. #17
    GT3 Pilot
    Join Date
    Jul 2017
    Posts
    3,745
    Platform
    PC
    Quote Originally Posted by Gregow View Post
    It only makes sense if you want to spend lots of resources for no gain and risk making things run slower. Writing assembly code does not sound difficult, it is difficult. You set the bar yourself, by saying it’s not difficult for an experienced programmer. On a large project, like a triple A game, it’s way beyond that though.
    Assembler is difficult because it’s just a semantic machine code. It’s barely readable by humans. To write good code you need an intimate knowledge of the hardware, OS and API’s you’re using. And then you need to do that for every platform you’re targeting (just because PS4, Xbox and PC are amd64 doesn’t mean, for example, that the same pipelining is best for all of them).
    Yes, it was common in the past. So was punch cards. That doesn’t mean anything. There are still uses for assembly, but not for performance optimization in games, unless you have some really fringe cases. Otherwise it can be useful to read assembler to debug and analyse.
    Well, I like to believe that it's experienced programmers that write the code for AAA games, not amateurs

    And no, you do not risk at all making things slower, you get things definitely faster and have a lot to gain in certain parts with assembly code, only risk is that it is easier to introduce bugs, and that's why you need experienced programmers to do this. And for certain things (like doing performance critical calculations inside tight loops), it's actually very easy writing them in assembly code.

  8. #18
    Superkart Pilot
    Join Date
    Jun 2015
    Posts
    489
    Platform
    PC
    Hey y'all

    So I'm starting to build the demo - building the art assets, gonna be animating it, faking a working UI in order to show my career mode idea. Here's progress so far. And yes I'm mimicking the look of the game thus far.

    Click image for larger version. 

Name:	Tiers_Background copy.jpg 
Views:	1 
Size:	146.8 KB 
ID:	273117

    So, I'm using the championship logos the game uses (Formula 1 is Formula A, the WEC is Endurance Series) in order to make the comparison one to one. However I need the rest of the logos the game uses. I found these in the game files in SteamLibrary\steamapps\common\Project CARS 2\GUI\MotorsportLogos. However, most of them are broken. Are they located elsewhere? Do you guys have a folder already I could use? I would also need the submenus for the categories.

    Inside the actual in-game GT4 one, for instance, are the world ones, the European, American, etc. I need to find those logos - can anyone help?
    The following user likes this Post: Stewy32


  9. #19
    GT3 Pilot
    Join Date
    Jul 2017
    Posts
    3,745
    Platform
    PC
    I suppose most of them are encrypted. Unless someone knows of a way to decrypt them, I would just take some screenshots while in game and the use a pic editing program to get the parts I want...
    The following 2 users likes this Post: Asturbo, Stewy32


Similar Threads

  1. The "art" of programming physics.
    By Twinz in forum General Discussion
    Replies: 10
    Last Post: 29-06-2018, 11:02
  2. Rust programming language shared memory api sample.
    By g1oomey in forum Third-Party Apps & API Discussion
    Replies: 0
    Last Post: 15-03-2018, 08:07
  3. Form a programming point of view ....
    By JAJP999 in forum General Discussion
    Replies: 1
    Last Post: 11-02-2018, 13:40
  4. learning swift programming and need a little guidance
    By jimmyb_84 in forum Off Topic Discussion
    Replies: 0
    Last Post: 24-02-2016, 19:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •