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

Separating game logic from the game engine itself - data representation and connection

3 posts in this topic

Hi, folks! Welcome to the topic! smile.png

 

Since many hobbyists and professionals alike use scripting for their game logic and game engine to handle all that, I decided, if they can do it, maybe I can do it too! happy.png

 

So I got into it. By the help of the Lord, I managed to put up a nice little system to write and read simple game data. I used my very own file decryption and encryption methods, of which I'm not that sure how many people know about. huh.png  Anyway, tongue.png  I kept on going. cool.png Eventually, I was able to store simple data, like game name, window properties, amount of entities, images, 3D models and such. No worries this far! smile.png

 

To be honest, I don't use scripting (at least not yet). I basically want to separate game engine from the actual game logic. I want to create a game engine, which is flexible enough to support pretty much any type of 3D game, user simply defines the what kind of game my game engine is supposed to handle. Game logic/tools to game engine. That's what I want to do. But how exactly? Simple data can be easily stored, but how about the following data:

 

- AI (movable areas, path finding)

- actions (user defined functionality for character entities, for instance)

- levels (geometry, entity placements)

- menus (linking to other menus, etc.)

 

and so on. I hope I made myself clear. wink.png

 

What do you think? rolleyes.gif

1

Share this post


Link to post
Share on other sites

Might work. But in general, it is VERY difficult to make a general purpose game engine.

 

Instead, I recommend that you make a specific game. Please use the standard OO technologies to keep dependencies to a minimum. Follow the SOLID principles, which will make it easier in the end.

 

Next step, when you have the first game up and running, you use it as a base for the next game. That is when you see what methods and data that need to be generalized. Be prepared for a lot of refactoring. That may also be when you find where to use scripting as a method of decoupling logic.

1

Share this post


Link to post
Share on other sites

As for how to do it, I'm actually in the process of building a tutorial on doing exactly that.

 

It is in my developer journal.  

 

The data-driven part is Part 4, which I am planning on posting Wednesday, but the code in the package works for saving and loading a data-driven map system.

 

In actuality it is an entire text-based dungeon crawler game with maps, items, and commands, all of it data driven.  The entire series of 8 entries is already fleshed out on my machine but not published to my journal.  It will probably to be fully published of by the end of next week.

 

In this case it is a simple state-machine dungeon explorer.  It isn't a fancy game, but it does have a data-driven map and items system.

Edited by frob
1

Share this post


Link to post
Share on other sites

- AI (movable areas, path finding)

 

a generalized engine would generate a nav mesh or A* map once the user designed the game map(s). it would then use built-in AI to make all entities automatically use the nav mesh / A* map,and use A* when moving, or offer this functionality as an option. There's little or no path finding in an F-22 flight sim. 

 

 

- actions (user defined functionality for character entities, for instance)

 

this is where you create your own scripting language, and compiler, and an emulator built-in to the generalized engine. this allows the user to program custom behavior into the engine.

 

 

- levels (geometry, entity placements)

 

a generalized engine can't be locked into a single design paradigm such as level based design. the project I'm working on now is a 2500x2500 mile VR paleolithic world for a caveman rpg, and it doesn't have levels, or cells, or any of that "wolf3d is the only way to build a game" stuff. its more like a flight simulator. there's a huge world map, but not a huge world mesh. sections of the "world mesh" are drawn as needed. no loading levels. you can walk all the way from one end of the world to the other.

 

a generalized engine would need to be able to simulate controlling any type of vehicle, not just a person. so it would need to be able to do flight simulators, sub sims, racing car sims, space fighter sims, snowmobile sims, dragon sims (you're a dragon), etc, etc. this means being able to draw any type of environment, not just a doom level.

 

from my own work in this area, it seems that a library vs engine may be a more flexible approach. instead of building an engine, you build all the components for every type of game. so you have libraries for drawing ground and sky, and space and planets, water, etc. and you have some libraries for movement and collision detection, and some for path finding and AI, and so on. and all the low level tools like multi-mesh models, an animation system, timers, audio playback, etc.

 

the thing to do is make a list of all the different types of games you can think of, and what components they require. that's the feature list for your "engine". then you try to generalize the components as much as possible, without making them overly complex to use. in general, the whole point is to make things easier to use, so you have to design such an engine from the API point of view.

 

I actually did this once. it did a lot of stuff. lost the source code. it was good enough the non-coder artist on the team could build a game with it. now i use the libraries and boilerplate code approach.

 

 

- menus (linking to other menus, etc.)

 

menu text can be stored in data files. what menu picks trigger which sub-menus can also be stored. in the end, they must call some functionality provided by the engine (such as save game), or invoke code written by the user to provide custom functionality.

Edited by Norman Barrows
1

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