r/howdidtheycodeit • • 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

15 comments sorted by

View all comments

Show parent comment

1

u/WombatHat42 Jun 02 '21

So could something someone coded be used in conjunction with an engine like unreal? For instance i have an AI that calls offensive/defensive plays. But it is all text based. How hard would it be to use an engine to get a visual with the plays?

2

u/djgreedo Jun 02 '21

could something someone coded be used in conjunction with an engine like unreal?

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.

How hard would it be to use an engine to get a visual with the plays?

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.

1

u/WombatHat42 Jun 02 '21

It is coded in python. The single image would work since it is just 9 and 12 plays for the defensive and offensive playbooks. though at some point I want to expand that playbook but for now am working on another AI for my project. Not sure if I am going to use tkinter for some of it or if I will want to do it all in an engine, for now just researching options. Thanks for the response