r/howdidtheycodeit • u/MK-Gaming-YT • May 24 '21
Game coding
Hey everyone , hope everyone doing good. I have a little question. Which is how developpers code their games ? Do they use a programming language and Unreal Engine ? (sorry im a newbie btw)
0
Upvotes
View all comments
Show parent comment
2
u/djgreedo Jun 02 '21
Yes, you can do that (though your code would have to be in a language the engine understands - C++ for Unreal, C# for Unity, for example). You'd need some understanding of the engine's way of doing things (e.g. the engine's APIs for doing various things, the update/frame-based way a game engine typically works).
You'd probably need to change certain code (e.g. getting input and outputting to the screen), but the general code would work.
It depends on a lot of things, but assuming your code is pretty easy to get into the engine, you would be able to control visuals pretty easily.
In the most simple example where each play corresponds to a single image, you would just display the image corresponding to what the AI chose. In Unity you could just have a SpriteRenderer component and set its image in code to whichever is selected with a single line of code. I'm not sure about Unreal specifically, but I would expect it's similar. Assuming your code was already in the correct language and your needs were as simple as my example, it would be very easy for someone with experience in the engine to implement that quite quickly.