• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Nicholas Kong

Is the main game same thing as the game loop?

8 posts in this topic

Im not sure what you mean (clarify?) but the game loop is what calls the frame by frame update methods of your games systems (physics.update(), renderer.render(), input.process()...)

i think.


There could be multiple such high level loops or states that affect what the loop does (splash screen, main menu, editor)
0

Share this post


Link to post
Share on other sites

main is where you will find the start of your game.  This is where the program starts.  Inside main, you would typically have your game loop where all your logic, physics, rendering etc will happen.  Main could also spawn other threads so that you can process things in parallel if you need better performance.

0

Share this post


Link to post
Share on other sites

A game loop is a loop that repeatedly updates the core processes of your game—a cycle that repeats in order to continuously cause game logic and rendering to take place and to receive input and network events, etc.

 

 

The “main game” is a higher-level concept describing the main area of the game.  In a fighting game this would be the actual fighting part of the game.  In a top-down shooter this would be the area where you fly and shoot.  This contrasts with other parts of the game such as the main menu, credits screen, etc.

 

“Main game” is rarely or never used because it is very abstract and could refer to almost anything between different people, which is exactly why you are confused right now.

In general, never use the term “main game”.

 

 

L. Spiro

0

Share this post


Link to post
Share on other sites
Is the main game same thing as the game loop?

 

No, the main menu, the gameplay itself (which can be broken into various forms even in a single game), the in-game menu, and everything else are all inside the game loop. The game loop contains everything show to the player visually, and everything done logically, aside from the very initial initialization and the very end freeing of resources.

 

It various from game to game, what is done before and after the main loop, but the main menu should occur inside the game loop. The main menu just a different "game state" within the loop. 'Combat' may be a different game state,  'Exploring' may be a different state, same with 'Shopping', 'NPC Dialog', 'Loading screen', 'main menu', 'in-game microtransaction store', and more.

 

Even though you might be using a different API, or perhaps even an entirely different language, this article explains game loops decently well, and this article explains game states, and it applies to most APIs and most languages - though some APIs hide the game loop from you, depending on how high-level they are.

Edited by Servant of the Lord
0

Share this post


Link to post
Share on other sites

A game loop is a loop that repeatedly updates the core processes of your game—a cycle that repeats in order to continuously cause game logic and rendering to take place and to receive input and network events, etc.

 

 

The “main game” is a higher-level concept describing the main area of the game.  In a fighting game this would be the actual fighting part of the game.  In a top-down shooter this would be the area where you fly and shoot.  This contrasts with other parts of the game such as the main menu, credits screen, etc.

 

“Main game” is rarely or never used because it is very abstract and could refer to almost anything between different people, which is exactly why you are confused right now.

In general, never use the term “main game”.

 

 

L. Spiro

Hey L. Spiro!

 

I see. Okay I will not use the term again. I agree it is very vague and abstract.

 

Thanks for the knowledge on game loop!

 

Although I remember there was a site that has a term about main game loop. Is main loop and game loop and game main loop the same?

 

The source of my confusion is from this:

 

http://higherorderfun.com/blog/2010/08/17/understanding-the-game-main-loop/

Edited by warnexus
0

Share this post


Link to post
Share on other sites

Although I remember there was a site that has a term about main game loop. Is main loop and game loop and game main loop the same?

While there is no standard set-in-stone-definitions...

Main loop = The exterior-most loop that the game runs in.
Game loop = Technically, I guess this could be any loop within the game, but people using this probably mean the same as 'Main loop'.
Main game loop = Somewhat redundant
Game main loop = Silly

At least, that's my experience - I'm not in the game industry myself, just a hobbyist trying to go indie.

Notice that the terms "main game loop" and "game main loop" never appear in the article you linked to, except in the title.
The author was probably just typing "Understanding the game loop", then decided to change it to the more common "main loop", but accidentally wrote, "Understanding the game main loop". That's my theory.

It is possible to have more than one "main loop", but unusual. For example, you might have a "main loop" for your splash screen while the game is first starting up and still loading, before going into the super-duperly-for-real main loop.
It's also possible to have a 'main loop within a main loop', but that's unusual in games. For example, in desktop applications when you pop up a dialog box, you can no longer interact with any of the other windows, and one way that is implemented is to have the dialog box be it's own loop that you are stuck in until you close the dialog box.

So while there is no governing body that defines, under penalty of death, the real definitions of each term, "main loop" is the most common usage, from what I've encountered.

You could kinda think of it like this: (warning: pseudocode for illustration purposes only)
main() <- "Entrypoint"
{
   startup() <-- Game initialization

   while(gameIsStillRunning) <-- main loop
   {
      GameState &currentState = GetCurrentGameState()

      while(weHaveInput)
      {
         //Let the current gamestate manage the input
         currentState.handleInput(input)
      }

      //Update the game based on the amount of time that has passed,
      //or else based on a fixed timestep (which is what the article was promoting).
      currentState.update(timeThatHasElapsed)

      currentState.draw()
   }

   shutdown() <-- Game cleanup
}
0

Share this post


Link to post
Share on other sites

 

Is the main game same thing as the game loop?

 

No, the main menu, the gameplay itself (which can be broken into various forms even in a single game), the in-game menu, and everything else are all inside the game loop. The game loop contains everything show to the player visually, and everything done logically, aside from the very initial initialization and the very end freeing of resources.

 

It various from game to game, what is done before and after the main loop, but the main menu should occur inside the game loop. The main menu just a different "game state" within the loop. 'Combat' may be a different game state,  'Exploring' may be a different state, same with 'Shopping', 'NPC Dialog', 'Loading screen', 'main menu', 'in-game microtransaction store', and more.

 

Even though you might be using a different API, or perhaps even an entirely different language, this article explains game loops decently well, and this article explains game states, and it applies to most APIs and most languages - though some APIs hide the game loop from you, depending on how high-level they are.

 

Thanks for the articles! 

 

That reminds me I need to put the main menu in the game loop so I can actually go revisit the main menu for the game!

0

Share this post


Link to post
Share on other sites

 

Although I remember there was a site that has a term about main game loop. Is main loop and game loop and game main loop the same?

While there is no standard set-in-stone-definitions...

Main loop = The exterior-most loop that the game runs in.
Game loop = Technically, I guess this could be any loop within the game, but people using this probably mean the same as 'Main loop'.
Main game loop = Somewhat redundant
Game main loop = Silly

At least, that's my experience - I'm not in the game industry myself, just a hobbyist trying to go indie.

Notice that the terms "main game loop" and "game main loop" never appear in the article you linked to, except in the title.
The author was probably just typing "Understanding the game loop", then decided to change it to the more common "main loop", but accidentally wrote, "Understanding the game main loop". That's my theory.

It is possible to have more than one "main loop", but unusual. For example, you might have a "main loop" for your splash screen while the game is first starting up and still loading, before going into the super-duperly-for-real main loop.
It's also possible to have a 'main loop within a main loop', but that's unusual in games. For example, in desktop applications when you pop up a dialog box, you can no longer interact with any of the other windows, and one way that is implemented is to have the dialog box be it's own loop that you are stuck in until you close the dialog box.

So while there is no governing body that defines, under penalty of death, the real definitions of each term, "main loop" is the most common usage, from what I've encountered.

You could kinda think of it like this: (warning: pseudocode for illustration purposes only)
main() <- "Entrypoint"
{
   startup() <-- Game initialization

   while(gameIsStillRunning) <-- main loop
   {
      GameState &currentState = GetCurrentGameState()

      while(weHaveInput)
      {
         //Let the current gamestate manage the input
         currentState.handleInput(input)
      }

      //Update the game based on the amount of time that has passed,
      //or else based on a fixed timestep (which is what the article was promoting).
      currentState.update(timeThatHasElapsed)

      currentState.draw()
   }

   shutdown() <-- Game cleanup
}

Main loop is the same as game loop. Okay I understand. Thanks for the pseudo-code as an illustration. 

Edited by warnexus
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0