Gateway
Isolate database changes for index and/or client/server synchronization.
[size="5"]Intent
[size="5"]Also called
[size="5"]Problem
This pattern gets its name from the way that all insertions and deletions are limited to one place like a physical gateway where all people must move through it to get in or out which allows you to control flow.[/bquote]
There are three basic operations:
- When an object moves, it pushes itself into the void, updates its position, then pops itself back into the world.
- When an object is created, it is created in the void then popped into the world.
- When an object is destroyed, it is pushed into the void first, then destroyed.
It should also be noted that having one gateway of change allows multiple changes to be made simultaneously with minimal synchronization effect. For example, push(); move(); changeSize(); pop(); prevents an unnecessary update from happening around the changeSize() call.[/bquote]
[size="5"]Examples
[bquote]Some games have different world or index states. For example:
- An object may be allowed to be placed inside of another object (a container).
- An object may be attached to another object (a weapon, armor, etc.)In these cases, there may be more than one implementation of pop(). For example:
- popIntoWorld( int x, int y); // pop into world
- popIntoContainer( Model &container ); // pop into container
- popOnto( Model &parent, Matrix4X4 &orient ); // pop onto another model.[/bquote][size="5"]
Issues and Risks
[bquote]none[/bquote]
[size="5"]Related Patterns
[bquote]A Gateway simplifies the synchronization of a Spatial Index with a Model Database.[size="5"]Uses and References
Gateways are often implemented inside of Model Database code.[/bquote]
[bquote]Thanks to Herman Miller and Tony Zurovec.[/bquote]
Related Tutorials
Balancing Game Development and Creative Direction in Indie Production
A practical look at how indie developers can balance creative direction with hands-on game development. This article co…
My Unreal Engine Development Process: From Core Idea to Playable Build
A practical overview of my Unreal Engine development process, covering how I move from a core game idea to a playable b…
Introducing LaneGraph: The Ultimate Road Network Solution for Unity
Discover the power of LaneGraph, a lightweight and flexible lane-based navigation system for Unity. LaneGraph makes it…
Retargeting Mixamo Characters with Root Motion In Unreal Engine 5.4.
I have always found Retargeting Mixamo Characters To have Root Motion is a serious lengthy Tast, Recently I stumbled up…
How To Make A SIMPLE Main Menu In Unity
In this tutorial for unity, i go over how to make a simple main menu for unity, it's an unlisted video because i do not…
Guide to Gameplay Balance
A perspective on competitive gameplay balance, from a background of "shooter" sandbox design.
Discussion
More from Zachary Booth Simpson
Comparing Shadow Mapping Techniques with Shadow Explorer
New Incentives and a Whole New Platform From The Intel AppUp developer program
The final installment in this series on Intel's AppUp program details additional incentives and opportunities for devel…
The Game Maker
This book excerpt contains the first chapter of the book that introduces beginning game developers to the Game Maker pr…
Discussion