Game engine architecture state-of-the-art
I have been reading a lot about game engine architectures, and would like to know the following: what is (are?) the currently considered best architecture for a game engine?
开发者_Python百科I would be very grateful if we could find some academic resources (such as papers or similar) rather than anecdotal experience from isolated developers.
Thanks
"Best" is quite subjective. Not being a professional game developer, I can't answer your question entirely rigorously, but I've heard about component-based game engines and (functional-)reactive engines. There's also the option of using a hierarchy of entities, as described in, for instance, "Evolve Your Hierarchy", but from what I've seen, that's being dropped in favor of component-based engines.
Hierarchical: Use inheritance to provide functionality ("Evolve Your Hierarchy" shows an example of a Car
subclassing Vehicle
which subclasses Moveable
with subclasses Entity
). As described, the problem is deciding where functionality should be put: if put higher in the inheritance tree, it burdens subclasses with functionality that may not be used; put it too low, and you end up duplicating/refactoring code to get the functionality to where it's needed.
Component-based: Each game object/entity is a composition of "components" that provide reusable, specific functionality, such as animation/movement, react to physics, be activated by the player, etc. "Component based game engine design", another SO question, describes it in detail and provides links to papers, etc., which should help.
(Functional) reactive: Often studied in the context of functional languages such as Haskell. As I understand it, the central concept is first-class time-varying values, with behavior being described in terms of these values and other building blocks, such as events to represent discrete events. "What is functional reactive programming" provides a better description than I can. I believe .NET's WPF data binding is an example of the concepts. As far as I know, this is still being experimented with/researched, but the Wikipedia article for reactive programming (not FRP, mind you) links to libraries written for Lisp, Python, Java, and other languages.
精彩评论