15,014 reputation
22871
bio website code.google.com/p/disjunction
location Everywhere
age 36
visits member for 3 years, 9 months
seen 16 hours ago

Arcane Ingenuity. On Twitter.

Disjunction - a realtime MVC framework for C & JS.

For now, arcaneingenuity at gmail.

  • App architecture
  • Algorithm design
  • Procedural world generation
  • Dynamic narrative
  • Rendering & Computational geometry
  • Tech: OpenGL, WebGL, C, JS, HTML5, Unity, C#, C++, Java, Flash, Box2D, PhysX, sockets, node.js.

Nov
12
awarded  Self-Learner
Nov
11
awarded  Good Answer
Nov
10
comment Trouble Using Component Base Pattern
@crancran No, that's not what I was suggesting -- I explicitly said to avoid subclassing. @Ello Give it an id, type, set up as you wish, but don't lock into anything by inheritance. You may keep a separate list of Entitys that represent players so that top level logic can access these quickly from time to time, but keep all entities generic enough to be processed from a single list by any part of your game logic, special cases to be handled inline through (non-reflective) conditionals. This avoids restrictive hierarchies and costly class reflection. If at all, inherit at component level.
Nov
10
comment Trouble Using Component Base Pattern
@Ello Your UML has a couple of mistakes: your RenderManager should reference one more more lists of Entity. Likewise should not be inheriting Player from Entity -- this is the whole point of CBEs -- no inheritance! You want generic lists of Entitys that are processed selectively based on their properties. So compose a player given the Entity structure, don't inherit to create one. What composes a player different from an AI? It replaces an AI control module with a human control module that interfaces with input devices, instead. Other components are as an AI Entitys might be.
Nov
10
comment Trouble Using Component Base Pattern
@Ello Yes, You have it. There is nothing wrong with keeping functions / logic on the entity itself (as then you have the benefit of accessing local data using this, but this approach is only appropriate where you do not need batch processing / overarching context as in the example I described above.
Nov
10
revised Trouble Using Component Base Pattern
added 19 characters in body
Nov
10
revised Trouble Using Component Base Pattern
added 19 characters in body
Nov
10
answered Trouble Using Component Base Pattern
Nov
6
awarded  Enlightened
Nov
6
awarded  Nice Answer
Oct
7
awarded  Popular Question
Oct
4
revised Best Practices for combining animation and logic
added 28 characters in body
Oct
4
revised Best Practices for combining animation and logic
deleted 3 characters in body
Oct
4
revised Best Practices for combining animation and logic
edited title
Oct
4
revised Best Practices for combining animation and logic
added 7 characters in body
Oct
4
revised Best Practices for combining animation and logic
deleted 789 characters in body
Oct
4
comment Best Practices for combining animation and logic
TLDR; in native-coded engines, it's best to use the approach given above to keep things clean, decoupled and well-ordered. In Unity or Flash where rendering and game logic are inherently mixed, best stick with the approach that is most commonly used, by chaining render logic back to game logic using an event.
Oct
4
comment Best Practices for combining animation and logic
@user1090755 It's not possible to answer this question generally because it's approached differently based on loop vs. event based models in different programming platforms / architectures. I would ordinarily recommend a best-practice approach as above, but Unity does not typically follow that and instead commingles game and render logic (unfortunately). So with Unity, I would strongly suggest you simply let the animation completion fire an event to notify game logic; this may result in an immediate sequence of function calls, or it may simply set a flag to be acted upon in the next update.
Oct
4
revised Best Practices for combining animation and logic
added 16 characters in body
Oct
4
revised Best Practices for combining animation and logic
added 203 characters in body