What′s C++ like in gamedev?

9 months ago by CodyIT to c/gamedev

We invite you to read an article on how C++ is used in modern game development and why the industry is still not ready to move away from it. The author explores how C++ works at different levels of...
load all comments
blazebra 5 points 9 months ago

I would still prefer Rust over C++ even in GamrDev.

path: 0 21540957, hotness: undefined, score: 5, children: 7
SleeplessCityLights 2 points 9 months ago

Rust is a poor language for Game dev. Games and a borrow checker don't work together. You will end up using unsafe mode most of the time. Making a game revolves around doing the hackiest shit and making something cool work. Every function has side effects and variables will need to be modified in multiple places in the same frame. Don't get me wrong I like Rust but I need a language I can abuse, not the other way around, when I am making a game.

path: 0 21540957 21542829, hotness: undefined, score: 2, children: 6
StrikeForceZero 5 points 9 months ago

Rust is a fantastic language for game dev. It just requires you to think completely differently if you want to have a good time. You can totally write the traditional game loop or my preference ECS (bevy as one example). ECS still let's you do the crazy mutations without having to worry about ownership. Each system can focus on the components they care about and you can specify the order they run. If you want to be reckless and mutate global state, then you need to explicitly decide between things like RwLock<T> and RefCell<T> for example. I'm not saying everyone should drop whatever they prefer to instead use rust. It's ok to stick with what you know or enjoy. Good games are agnostic to the tools used to make them. I just don’t think Rust deserves to be dismissed the way your statement does.

path: 0 21540957 21542829 21548133, hotness: undefined, score: 5, children: 0
soulsource 2 points 9 months ago

Every function has side effects and variables will need to be modified in multiple places in the same frame

We try to avoid exactly that, because it is what caused us man-years of bug-hunting and bug-fixing over our past projects. Our end-goal (that is still very far away...) would be to have the state from the previous frame and the user inputs, do only pure computations based on this data, and write out a new state before rendering the current frame.

We do use C++ though (because Unreal, and console platforms), what makes this extra hard, because C++ is a language for writing bugs, not for writing software.

path: 0 21540957 21542829 21549914, hotness: undefined, score: 2, children: 4
gamedev
gamedev

@programming.dev

login for more options
6443
732
338

Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.

Community Wiki

go to feed...