Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>C++ isn't naturally suited for FRP; any libraries you use (<a href="http://www.boost.org/doc/libs/1_48_0/libs/phoenix/doc/html/index.html" rel="noreferrer">Boost.Phoenix</a> is a good one) will carry some overhead that you most likely don't want to deal with in a commercial 3D game.</p> <p>Not only that, but FRP isn't a very well developed technique for games, not even in Haskell, afaik; do you want to make a game or do you want to develop a technique for making games?</p> <p>Component-based entity systems have been around for quite a while and are a proven concept. They do have their limitations, most notably, how do components communicate with each other? &mdash; one solution is to have two types of components, attributes and behaviours; the latter can access any attribute, but they cannot access each other.</p> <p>If you want to make a game, go with CBS. If you want to help develop FRP in games, then do that.</p> <p>Btw, you're so very wrong to say that 2D games have simple engines. :)</p> <hr> <p><strong>2014 Update</strong></p> <p>A new language has since appeared that make extensive use of functional reactive techniques and is aimed at web development, called <a href="http://elm-lang.org/" rel="noreferrer">Elm</a>. It is very similar to Haskell and is supported by <a href="http://prezi.com" rel="noreferrer">Prezi</a>, afaik. The language designer had a pretty good <a href="http://www.infoq.com/presentations/elm-reactive-programming" rel="noreferrer">presentation</a> in which he made a small game using FRP. Anyone interested in how FRP should be handled might want to look at that video.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COOh I see. Thanks for your help. I want to develop a 3D game, but also want to get into core engine "mechanics" (or whatever name you give to it), analyzing all the possible solutions when it comes to architecture design. About 2D engines, I've said that they are simpler not simple, but yeah still not a proper affirmation ;) Btw, do you know any book, article, etc. talking about proper construction of a CBS, in terms of performance? I read sending messages over components is expensive, and in some cases it's "better" (when it comes to overhead cost) to pass pointers to those components.
      singulars
    2. CO@frarees Messaging systems are for things that happen 'rarely' (like a key being pressed, someone dying) ('rarely' means not every frame). Components communicate with each other a few time per frame, so messaging systems are not good. How would you efficiently notify each interested component of the entity's position every single frame, by using messages? • One thing you could do is establish dependencies between components when they are constructed (pass the other components they communicate with to the constructor).
      singulars
    3. CO@frarees [cont'd] But then the problem is, how can you ensure that when you create a new component, all the components it needs have already been created? What if two components need each other? This is where the attribute/behavior separation becomes useful: you first create all needed attributes, then you create behaviors and pass them (in the constructor) the attributes they need. Behaviors never interact directly with one another, they only modify the attributes' values. And attributes do nothing; they are just containers for data.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload