• 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
BlueSin

Is my Game Engine right?

2 posts in this topic

So I know there are alot of game engines out there, but still for educational purposes I want to try my hand at making my own.  Truth be told, I have been remaking virtual the same one for quite some time now and they work fabulously but I always quit out of fear that I am maybe doing something wrong.  I don't want to build my game on corrupted framework, but I want to actually move forward in creating a game!  So if you could please just read this over, and I know it is somewhat lengthy, but your patience and input is appreciated.

 
For my engine, what is the difference between a State and a Screen?  A State tells us where we are in the game. (i.e.- main menu, credits, etc.) Only one state can be active at a time.  A State can contain one or more active screens.  (i.e.- background screen, foreground screen, etc.) Each screen is made up of Components.  A Component is anything interacting with it's parent screen or being drawn to the screen. (i.e.- player, enemies, fps count, etc.)
 
Static GameEngine Class
Static StateManager Class
Static ScreenManager Class
 
Abstract State Class
Abstract Screen Class
Abstract Component Class
 
Game Class calls GameEngine.Update().  GameEngine.Update() calls StateManager.Update().  StateManager.Update() calls CurrentState.Update().  CurrentState.Update() calls ScreenManager.Update().  ScreenManager.Update() calls Screen.Update() on all active screens.  Screen.Update() calls Component.Update() on all components in it's component list.
 
Game Class calls GameEngine.Draw().  GameEngine.Draw() calls StateManager.Draw().  StateManager.Draw() calls CurrentState.Draw().  CurrentState.Draw() calls ScreenManager.Draw().  ScreenManager.Draw() calls Screen.Draw() on all active screens.  Screen.Draw() calls Component.Draw() on all components in it's component list.
 
My fear is that there are unnecessary steps in there, but at the same time isn't the object of the OOM to define objects?  Each of these classes plays a unique role within the structure, and are organized in an obvious hierarchy.  Once the GameEngine has been initialized and loaded, other than to call Update & Draw, the GameClass has no other interaction with the game other than to exit.  It is very streamlined, and the process can quite literally play itself.
 
From here, Screens can make requests to their parent State for a state change.  The state then requests an active state change from the state manager.  The state manager will call for an unload down the hiearchy, then change the active state and call a Load() down the hierarchy.  Then the Update/Draw cycles continue.
 
Components can remove themselves from a screen's component list by calling their parent screen's RemoveComponent() method.
 
StateManager keeps a list of all the states passed to it during game initialization.  Likewise, the screen manager keeps a copy of the list of screens for the active state, so that the active state doesn't manage them, the ScreenManager does.
0

Share this post


Link to post
Share on other sites

So I know there are alot of game engines out there, but still for educational purposes I want to try my hand at making my own.  Truth be told, I have been remaking virtual the same one for quite some time now and they work fabulously but I always quit out of fear that I am maybe doing something wrong.  I don't want to build my game on corrupted framework, but I want to actually move forward in creating a game!  So if you could please just read this over, and I know it is somewhat lengthy, but your patience and input is appreciated.

 

Your engine doesn't have to be AAA Standard, or finished for you to write a game. I am doing something similar, i have written an engine to handle game screens and states, but it wont stop me making a game, the engine is constantly changing. I am writing new things and thinking "Wait, why did i write this like this?" or "How on earth does this actually work" and going back, redesigning it on top of the game i am currently building.

 

There is no "Proper" way of building an "engine" because most of the time, it has to suit your needs, which change depending on the game your writing.

 

By Reading through the calls above, we cannot say "yep that's right" or "No, your doing it all wrong". If it works for you, it works for you.

 

Personally, i wouldnt have a CurrentState i Have a ScreenManager which handles the states, which is defined as an Enum. The Engine doesn't know what states your game needs, other than "Splash Screens" / "Menus / Game" So, leave gamestate up to whoever writes the game to decide. so your screenmanager only needs (in my eyes) to Screen.Update() or Screen.Draw()

0

Share this post


Link to post
Share on other sites

I can understand how you feel about the basic framework of the engine being 'perfect'. A couple of years before today, if you would have asked me, I would say the same thing. Basically you have to think of a perfect engine as a goal, and to achieve it you have to make mistakes with your engine and build it again and again. I am too in the process of making an engine.

 

From what you typed, I can tell you have a good idea of what you want to do. If the engine is functional enough to make a game on it, then just do it and keep updating and optimising the engine as time goes; as Andy474 said it doesn't have to be AAA standard or completely finished.

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