Inside The Game – Game vs. Software
Hey Guys!!! Once again I am back after very busy days. So, today I am starting a series called as Inside The Game. In this series, I will write the mechanism and architectures, which fills the architectural part of the game. The architectural part means here is that how a developer or computer programmer thinks behind the game. In this series, there will be also some example games, which will show and apply the tactics to be learnt in this series.
Enough talking, lets start the series. So, in the first article of Inside The Game series, I will tell you the differences between game and software. During my student age, I was taught in a way that i couldn’t find the difference between game and software before starting game development. All I learnt was that game is a graphical software. Well, you can say that this definition is correct in many ways. Hold on!!!! I think I forgot something important to mention here. I am writing this article from coding, programming, or development perspective view. Okay, let’s come back to what I was saying. So, I learnt that game is a graphical software. Well, you can say that, but when I started game development, so in my first game, I sat at compiler and started coding, and oooops, I was writing game like I was writing a software. And after 5 months of working hard, I got to know some major differences between software and games. Thus, its time to start discussion on the differences rather than discussion on inspiration and motivation.
Seriously, what’s a game?
There are thousands of books written on game development by hundreds of authors. Some authors defined the game like this:
A game is a closed, formal system, that engages players in structured conflict, and resolves in an unequal outcome.
This definition is a good one, and explains almost everything for a game. Also, this is very general definition. If we define the game in programming terms, then game is a graphical software with many other things. And, games can be compared with software as well, but it can also be compared with animations and simulations.
Game vs. Software
Phhheewwwwww……. Software is compared to game. One thing should be cleared is software keyword in this article means any application performing any specific task like utility etc. Generally, in computer science the piece of code is called software. So, according to this definition, game is also a piece of code, thus game is a software. Now, conceptually, game is very different than software. It has been clearly shown that software is an event-based program. We add event listeners and dispatch events in the program to run the application. The application becomes dependent on the user like if user clicks on this button, then application will do this. What if user doesn’t click the button, then software will be paused and will go to idle state(if any). However, game’s mechanism is much different than the event-based approach. It is not like this that games do not use events or do not dispatch events, rather games also use events. The mechanism behind any game is game loop. There is a loop in the game, which runs infinite times, and when the loop breaks it means its game over or game completed. Game is not fully dependent on user. For example, in software, application waits for the user input, while in games application just continues to the next iteration of the game loop and again it waits for a while. If user doesn’t provide input, it just continues to next iteration of the game loop and so on. Following figure shows general game loop of any game.
So, in the figure above, the game starts from starting game engine, then it loads all the required resources such as images, sounds etc. Then there starts a game loop. Game loop performs many different tasks. If we see the games generally, then each game performs these four tasks directly or indirectly. First is to process inputs. The game engine processes inputs i-e it checks whether any user input has come or not. The next step is to simulate the game world. So, in this step game engine performs all the necessary calculations to update the world and game values, it also includes user input values in the game world, and sends it to the next step, which is to render the world. This step displays and renders the game world on the screen of the device. Finally, the last step is to check shutdown conditions. Shutdown conditions tells the game engine whether to stop the game loop or continue to the next iteration. In case of continue, all steps are performed again. However, in the stop case, game engine unloads all the resources and exits the game.
In the nutshell, if we see a software and game from programming or coding perspective, then both are very different than each other. In the conclusion, I would like to say a word of advise to you that when you sit to write a game in compiler, then the first and most important task to you is to write the game loop. Thanks for reading the article and please give your valuable suggestions, comments, and ideas, I would love to hear from you.
So, we compared the game with software and saw some basic mechanism behind a game and a software. In the next part, Inside The Game - Animation, Simulation, and Game , we will see some differences between animations, simulation and the game and we will learn how to make a game from any animation or simulation. To read the next part, click here.
How was this article? (Rate It)
Posted on July 13, 2012, in Game Engine, Games, GamyGuru, Inside The Game, Technology and tagged Chris Swain, Computer, Game, Game Engine, Game Loop, Game World, Games, GamyGuru, Inside The Game, Programming, Software, Software vs. Game, Tracy Fullerton, Video game, Video game development. Bookmark the permalink. 14 Comments.