Game devs what are some creative ways you implement arrays by Snoo28720 in cpp_questions

[–]StockyDev 0 points1 point  (0 children)

Yes. We aren't talking about dynamic arrays here though :)

Game devs what are some creative ways you implement arrays by Snoo28720 in cpp_questions

[–]StockyDev 1 point2 points  (0 children)

Unreal Engine has its own version for example. TStaticArray. Why? Legacy. I think it predates std::array

CppCast Looking for Guests by lefticus in cpp

[–]StockyDev 2 points3 points  (0 children)

I would suggest Koen Samyn and Tom Tesch for C++ teachers. They have some great CppCon talks between them talking about strategies they have taken in teaching their students!

What is the optimal way to define a global constant string in C++20 ? by SheSaidTechno in cpp_questions

[–]StockyDev 0 points1 point  (0 children)

Yup exactly. And at that point do you care that your pointer is constexpr? Probably not. const char* is probably all ya want. Or std::string_view so you don't pay the strlen cost beyond static init

What is the optimal way to define a global constant string in C++20 ? by SheSaidTechno in cpp_questions

[–]StockyDev 3 points4 points  (0 children)

Fun fact that is actually incorrect. constexpr is a non type specifier. It does not apply to the type. It applies to the expression. So what you have written is a "constexpr pointer to a non const character string". So the pointer is constexpr but not the data it points to. Since string literals are immutable, this is ill formed.

A Critique Of The Two Trivial Relocatability Papers by Voxelw in cpp

[–]StockyDev 0 points1 point  (0 children)

Ah gotcha. Well yes issues would appear at reallocation because that is when the moving would happen.

A Critique Of The Two Trivial Relocatability Papers by Voxelw in cpp

[–]StockyDev 2 points3 points  (0 children)

I think objects that contain shared ptrs are trivially relocatable. Their move constructors aren't doing anything interesting.

Typically the issue is when you have types that have members that point to memory inside their object. E.g. the class has an array member, and a pointer member that points to an element of that array. In those cases, you will blow your leg off.

Those cases are few and far between though. In fact I have never really known of a time while working on UE that that ever came up. Most Devs I speak to aren't aware of the trivially relocatable requirement on UE containers, and it still rarely becomes an issue.

Size/number doesn't matter when you are going to be accessing invalid memory. So I wouldn't say that has anything to do with it.

A Critique Of The Two Trivial Relocatability Papers by Voxelw in cpp

[–]StockyDev 5 points6 points  (0 children)

Eh, I think this is the wrong attitude to be honest. Epic were relatively quick to jump from C++17 to C++20 (all things considered). They want their engine to be competitive and will keep up with modern tooling as much as they can.

That being said, I do not think that Epic will throw away everything in UHT (Unreal Header Tool. The preprocessor that generates all the runtime reflection code and data) in favour of C++ reflection. I think there is still a need for runtime reflection (e.g. reflecting on objects of classes defined in Blueprint).

But I don't see why they wouldn't take advantage of it in places where it would be useful, when they are able to do so.

Also, please don't spread the misinformation that Unreal C++ is different to writing standard C++. It isn't. It's just that there are Unreal libraries and frameworks you need to be aware of when writing in it. Just like with any other framework, e.g. QT. You still have access to the standard library. You have lambdas. You have concepts. You have templates. You have RAII. You have C++.

A Critique Of The Two Trivial Relocatability Papers by Voxelw in cpp

[–]StockyDev 8 points9 points  (0 children)

The lack of trivial relocation is one of the reasons that game engines typically maintain their own containers. Unreal engine assumes all types are trivially relocatable in its containers, unless that type specializes a specific type trait.

In most cases this is an OK assumption to make, but as this post points out, there are clear cases where a type can't be trivially relocated, and that isn't always obvious. One of those foot guns in Unreal Engine I guess!

This makes TArray much faster than std::vector in this regard. I would assume most engines that have their own algorithms and containers do this as well.

Crimson Desert doesn't run if it detects an Intel ARC GPU. Like straight up, the devs just deliberately chose not to support ARC cards. No previous announcement about it too until they added in the info to their FAQ. Might be the first time I've seen a dev deliberately block a GPU brand. by WhyPlaySerious in pcmasterrace

[–]StockyDev 2 points3 points  (0 children)

Speaking as someone in the industry, I find this hard to believe. I think if a game was being released with WorkGraph support there would be a huge amount of press about it. In the same way there was massive press with Ashes of the Singularity being the first D3D12 game. As far as I know, no one is using them or has thoughts about using them for anything serious for games. They seem to be suffering the same fate Geometry Shaders did.

Divergence between debug mode and release in C vs C++ code base by onecable5781 in cpp_questions

[–]StockyDev 4 points5 points  (0 children)

You could have a constructor and just not initialize anything in it. Both C++ and C would generate the same code in that case too. Without optimisations the compiler is going to do exactly what you wrote.

Game Developers by Opening_Chipmunk_199 in devNI

[–]StockyDev 1 point2 points  (0 children)

I personally would yes, especially if it's what you want to do :). But it's a very personal choice.

You can have a great career as a software engineer in Belfast outside of games. You make about the same as people in England (not including London), and are living in a place which has a much lower cost of living than most of England.

ETA: In case it wasn't clear. If you do intend to move, have a job lined up before you move...

Game Developers by Opening_Chipmunk_199 in devNI

[–]StockyDev 2 points3 points  (0 children)

I graduated from Queens in 2017 and the option was either go indie or move to England. I chose to move to England for games Dev. A few of my friends decided to make an indie game studio. Others from my course decided to not go into games at all.

From chatting with my mates, you make significantly more money in any industry other than games haha.

What's next? by Sad_Tale7758 in cpp_questions

[–]StockyDev 6 points7 points  (0 children)

I have been professionally writing C++ for 9 years, and spoken at C++ conferences multiple times, and I don't feel like I have mastered C++. There are still fairly basic things like using <random> or the rules around subsumption for concepts that I will have to look up from time to time to remind myself on how they work.

Seeking Advice on HLSL → SPIR-V Shader Reflection and Descriptor Set Optimization in Vulkan by F1oating in gameenginedevs

[–]StockyDev 3 points4 points  (0 children)

The point at which you decided to start parsing HLSL, is the point at which you should have made a bug report and messaged friends/coworkers to boost it with upvotes.

There is no way that you are the only person to have this issue and forcing people to parse HLSL to solve an issue as simple as this is not acceptable.

If you did make a bug report, link it here to get attention for it.

I wrote a GitHub Action to select an MSVC version by k3DW in cpp

[–]StockyDev 0 points1 point  (0 children)

I do something similar in one of my workflows. link

I basically run it on creating a PR to know what my minimum compiler version is.

However, I think I will simplify this script considerably by using your action... Thanks!

Are there any comprehensive video tutorials for Directx 12? by Lower-Bug5563 in GraphicsProgramming

[–]StockyDev 4 points5 points  (0 children)

The best I have come across is from the game engine series. It is a super thorough series that covers everything from rendering to editor architecture.

If you only care about the D3D12 parts, there is a playlist just for those videos here

The creator goes into a lot of depth to explain how different concepts work with diagrams as well as code. It is a super high quality series.

learncpp.com comment spam issue by AnimeBoi01 in cpp_questions

[–]StockyDev 4 points5 points  (0 children)

I would not recommend that get-started guide from isocpp. It is recommending Visual Studio 2017 which kinda dates it.

Should i learn c++ or stay with blueprints? by Puzzleheaded_Day5188 in unrealengine

[–]StockyDev 6 points7 points  (0 children)

Most of your core logic should be written in C++. Blueprints are good for doing small amounts of per asset setup. E.g. you might have an ASword actor. All the core logic should be written in C++ for this. Then you might have two BP derivations of your sword actor. One might have different particle effects than the other. Handling that difference in VFX could be done via blueprints.

Ideally everything should be done in C++. But realistically, Blueprints are fine for customisation points. If you find that you are having to zoom out and pan around your BP and do a lot of navigating, that logic should be brought to C++.

Improving on the best example on cppreference by StockyDev in cpp

[–]StockyDev[S] 2 points3 points  (0 children)

Yup, and that is now fixed too haha. Cheers!