Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: What are scenes as described by this article?  (Read 2150 times)

0 Members and 1 Guest are viewing this topic.

Sixoul

  • Newbie
  • *
  • Posts: 17
    • View Profile
What are scenes as described by this article?
« on: January 25, 2014, 12:01:28 pm »
So I knew about game objects, game loop, and cohesion I think. But I didn't know about scenes and I don't quite understand what they are or how they interact with everything based on the article. Could anyone help me understand what scenes are?

http://www.gamedev.net/page/resources/_/technical/game-programming/making-a-game-engine-core-design-principles-r3210

To me it sounds like it has a list of all the game objects that interact with each other. But it doesn't really describe how it does that I think, maybe I'm just missing something in the code excerpt.

Does SFML handle scenes or how would I implement scenes with sfml?


Lignum

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: What are scenes as described by this article?
« Reply #1 on: January 25, 2014, 12:40:07 pm »
A scene is well... a scene. A game's main menu is a scene, the settings screen, even the gameplay itself is a scene.

It contains the objects shown on it and handles basic events like rendering and updating.

This allows for code like this to be written:
if (playGameClicked)
{
     changeScene(new GameScene); // In real code the passed parameter should be
                                       // wrapped into a smart pointer by the changeScene method.
}

SFML does not handle scenes, so you're going to have to implement them yourself.
« Last Edit: January 25, 2014, 12:43:15 pm by Lignum »

Sixoul

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: What are scenes as described by this article?
« Reply #2 on: February 01, 2014, 05:53:21 am »
Do you have any resources on scenes? I understand the idea, I think, it handles and contains what it's given so that things outside the scene don't interact with things. So the menu won't interfere with the game or something.

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: What are scenes as described by this article?
« Reply #3 on: February 01, 2014, 09:07:47 am »
You might also find them defined as "game states". That might help you find some stuff.

There's a tutorial on the SFML github wiki that calls them scenes.

There's also a tutorial there that guides you through the coding of a simple engine here. I linked to the Game State part of the tutorial.

And yes, it does sound like you understand the basic idea. If anything, take what you understand and experiment! That'd be the best way to understand it even more.

Hmmz

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: What are scenes as described by this article?
« Reply #4 on: February 01, 2014, 10:59:04 am »
I'd go with the term "game state," rather than "scene." You may want to give 'SFML Game Development' a read since it provides an in-depth explanation of how to create and manage game states.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: What are scenes as described by this article?
« Reply #5 on: February 01, 2014, 01:15:16 pm »
A scene is well... a scene. A game's main menu is a scene, the settings screen, even the gameplay itself is a scene.
I agree with Hmmz, I wouldn't mix the terms "game state" (like main menu, options menu, game) and "scene" (the in-game world with its characters, scenery, etc.).

When talking about scenes, people often have spatial scene organization (through scene graph data structures) in mind.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: