Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FRP on a game engine. Is it worth it?

Today, I've read about FRP (functional reactive programming). However, I don't know how much this fits in the engine itself.

After reading Gerold Meisinger's article, my question is, if it's worth it to use FRP instead of a component-based architecture. Is this the near future of game engine architecture design? It's just a simple approach on solving small problems component-based architectures do? I'd appreciate any article, explanation, personal opinion, etc.

Think about an engine for a commercial game, specially shooters or racing genres (3D games). Don't think about a 2D platformer or other simpler (talking about engine complexity) ones. I'd use C/C++ (I noticed people using FRP rely on Haskell, due to its nature. However, I saw this document and prefer to stand on C++, as the "industry standard").

like image 235
frarees Avatar asked Nov 30 '11 19:11

frarees


People also ask

Is it worth building a game engine?

Using your own engine won't make you sell more copies of your game automatically. And while you *can* save time in the long run, this usually means having your engine be good enough to carry you across multiple projects, while also providing you with significant workflow improvements compared to commercial engines.

Is it cheating to use a game engine?

This means cheating depends on their being established rules to break. But, it turns out that, in game development, there are no such rules. And so there can't be cheating. In consequence, engine-use can't be cheating either.

Do game designers use game engines?

Most professional game development studios build their own custom game engines and tools to produce their high quality games. Popular game engines are Unity, Unreal Engine, and Game Maker Studio and they each have online communities, abundant documentation, and resources to help you learn.


1 Answers

C++ isn't naturally suited for FRP; any libraries you use (Boost.Phoenix is a good one) will carry some overhead that you most likely don't want to deal with in a commercial 3D game.

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?

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? — one solution is to have two types of components, attributes and behaviours; the latter can access any attribute, but they cannot access each other.

If you want to make a game, go with CBS. If you want to help develop FRP in games, then do that.

Btw, you're so very wrong to say that 2D games have simple engines. :)


2014 Update

A new language has since appeared that make extensive use of functional reactive techniques and is aimed at web development, called Elm. It is very similar to Haskell and is supported by Prezi, afaik. The language designer had a pretty good presentation in which he made a small game using FRP. Anyone interested in how FRP should be handled might want to look at that video.

like image 139
Paul Manta Avatar answered Oct 03 '22 20:10

Paul Manta