How the hell do video games work?

333 views

I just don’t understand any of it, I play them all day yet I have no understanding of what it is or how it works. The people that make these things must be the smartest people.

In: 0

7 Answers

Anonymous 0 Comments

They are computer programs that combine several fields of art: 2D/3D graphics, animation, audio design, music, UX design, and of course game design. All of these are joined together using computer programming to make the experience you interact with.

Programming can also consist of many different types such as game/physics engine development, event scripting, networking, UI programming, etc. These types all are built on top of other programming frameworks and libraries, and those are built on top of other programming, and so on, all the way down to code that specifically tells each part of the computer what to do.

It really is a very multi-disciplinary industry and every one of the things I mentioned deserves it’s own ELI5.

Anonymous 0 Comments

Typically there’s a ‘game loop’ where a computer program will check everything going on and update the screen accordingly.

So, let’s say you’re playing pong. First it looks at the controllers, if they’re being pressed, it moves the paddles.

Then it checks to see if the ball is hitting any walls or a paddle. If not, it updates the position based on what direction it was moving. If it is hitting a paddle, it just reverses the direction and updates it. If it is behind a paddle, it removes the ball and prints ‘game over’ on the screen.

If loops through those checks/updates very quickly. At about 60 times a second, human eyes see that as ‘fluid motion’.

Every game you’ve ever played is doing a version of that. There’s a game loop where it checks your controls, checks the objects on the screen, then updates them.

Anonymous 0 Comments

It’s not as hard as you would think. But it does require plenty of skill. The work all depends on the type of game, but in general they aren’t starting from scratch and writing out code per se. They use tools like “unreal engine” and other animating and game design specific tools to craft the characters, settings, animations, dialogues, and unique game mechanics.

Think of it like building a modern house. You’re not starting from scratch. Someone else made your tools and sold them to you. someone else cut the lumber and sold it to you. Someone else mixed the concrete and sold it to you. The final shape is up to you, but the pieces are made by other people to sell to you.

Anonymous 0 Comments

Really simply:
1: Get input from user
2: Update game model based on input and other physics/commands going on in the background
3: Draw it to the screen
4: Go back to 1

Anonymous 0 Comments

Anything you don’t understand seems like “magic”, but in reality there’s nothing all that complicated going on. These days a game will have dozens or even hundreds of contributors. None of them could make the whole game alone, but each one has a very manageable piece of the puzzle.

Anonymous 0 Comments

Embedded SE and hobbiest game dev.

Games are hard to make from scratch, and most don’t go through the trouble of doing so.(Some do)
There are tools that simplify things to let game devs focus on smaller parts of making their games or spreading work over multiple teams of developers.
You would usually have to combine several projects or libraries(coding toolboxes) to make a game.
Games follow a specific workflow in operation:
Initialization
Game Loop(most focused on)
Resource release and cleanup

During Initialization: you get everything you need ready, and that is a lot of things but is too varied to cover.

During Game Loop: you take into account user input and “game logic” to update the state of the game, and you do the cosmetic side of playing sounds and drawing on the screen.
Game logic is a name for everything the non-player side of the game is responsible for: updating positions of objects, handling collisions, physics, AI, etc.

During Resource Release and Cleanup: The resources used by the game are released back to the OS, like RAM and processing thread assignments. Basically, allowing the system to use what the game has previously taken over.

It’s not that complicated if you study it and learn how to do it. It’s just a lot of work to get started because it’s a conglomeration of multiple fields: graphical arts, animation, music, User Interface and Experience(UI/UX), physics, algorithm design, behavioral logic(game AI), data science, etc.

Anonymous 0 Comments

A video game is just a computer program that shows pretty colors on the screen when you press the right buttons. Did you press the first button at the right time? If you did, it shows one set of pretty colors. If you did not, it shows a different set of colors, and those are not as pretty.

You have a controller with a certain number of buttons on it. The computer follows a set of instructions. It shows some images on the screen, then it waits for you to hit a button. After a certain amount of time, it moves on to the next set of images. The next set is determined by whether you hit the right button or not.

As computers became more powerful, the complexity of the images they show can increase. Also the amount of stuff the computer keeps track of can increase. Maybe you pushed a particular button 10 minutes ago and the computer remembers that, and is waiting for that part of the game to come up.

Each game builds on games people made before it. You couldn’t create a 2023-era video game from scratch today by yourself. There’s too much stuff in it for one person to do. But if you had thousands people working on it for 50 years, you could do it. Then realize that we *have* had thousands of people working on it for 50 years. They didn’t all work for the same company, and they didn’t work on the same games, but we know what the previous set of guys did, and it’s easy to copy them. Each new generation of game takes what they did before, and makes small changes.