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

Omnipresent DAG scene graph - thoughts

2 posts in this topic

I've been thinking about ways to integrate features that traditionally require a flat list into a hierarchical scene graph structure, and improving upon the tree structure a scene graph uses.  My solution was to replace the simple tree with a directed acyclic graph, which allows nodes to have more than one entry point.  I also realized that generalizing the scene graph and allowing for more than one entry point per node would allow constructs for spatial partitioning and integration with a physics engine, among others.

 

The main inspiration for this came when I was trying to find a way for an object to be part of more than one partition, for example, when a character is standing in the doorway of a building.  It's simple when you can add another entry into the node, so both the "outside" and "building" partitions point to the character, and it can be rendered if either partition is visible.

 

Generalizing the graph would allow for more flexibility.  Typically, every node in a scene graph is associated with a transformation, but this is clunky when physics is put into the mix.  Say a character is holding a ball.  The "ball" node would be a child of the "hand bone" node.  When the character throws the ball, the "ball" node must be moved and its transform changed to keep the same world position.  It gets even worse when the character has to pick the ball up again.  My solution is to implement transformation nodes as physics constraints.  A typical transformation would be a weld joint.  Bones in skeletons could be implemented as ball and socket joints.  This works well with my engine where animations are all procedural and depend on the physics engine.

 

Why stop there?  The whole high-level rendering process could be implemented in the graph.  You could have a shader node, a texture node, and then a mesh node.  Because each node can have more than one entry point, you could create multiple passes by forking into two material groups and then joining at a mesh.  Instancing could be done automatically for rendering paths identical except for transformation.  Nodes could also be general-purpose programming constructs, like a condition (if condition, choose this path, else, choose another path), a random selector, and so on, like nodes in a behaviour tree.

 

What are your thoughts on this?  I want to get some feedback before I hunker down and code this.

0

Share this post


Link to post
Share on other sites

Why do you want one graph to rule them all?

 

Spatial relationships aren't hierarchical or directed. The relationships between the rooms of an office naturally form a cyclic graph.

Transformation hierarchies naturally form a tree structure, which doesn't require any knowledge or connection to a spatial structure.

Optimal rendering order cannot be determined by traversing a scene graph -- such structures usually have to be linearized and sorted to determine rendering order.

 

Often different middleware components will contain their own internal representation of your scene. E.g. a physics engine like Bullet or PhysX will contain a "scene graph" and transformation hierarchy internally, which you cannot access. This isn't a problem; there's no need for your visual representation of the scene to be tightly coupled with the physical representation. All you need is a way for the updated physics state (the transforms) to be reflected in the visual structure.

The physical representation does not need to perform tasks like view-frustum culling, or potential-visible set determination, or material sorting, so it's structure will not be optimized for these tasks -- the visual representation of the scene will be organized in a way that's conducive for these tasks though.

 

The optimal data structure depends entirely on the tasks that must be performed, and it's likely that each task will work optimally with a different data structure. So, forcing tight coupling of all data into an uber-structure is very counter productive.

Edited by Hodgman
2

Share this post


Link to post
Share on other sites
I used to use scene graphs but I've had to abandon the whole concept as a bad idea.

The gain in speed when you instead design data structures around the operations that need to happen is immense. It also leads to fewer dependencies and simpler code.

If the physics engine is handling relative transformations, why have transform nodes at all? You're just duplicating information and making it twice as complex as it needs to be.

You can represent rendering as a tree, but why? The process of rendering is the equivalent of flattening the tree. Why not flatten it in advance and save all that work?

Scene graphs have their place in tools, but they shouldn't make it to the run-time.
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