New answers tagged

0

Short Answer ECS fundamentally takes into consideration how modern processors best manipulate data rather than how people think about data and this forces programmers to write more efficient code just because writing bad (slow) code isn't the path of least resistance anymore. One isn't inherently faster than the other but ECS is harder to make slow and ...


0

ECS is not OOP. It is data-driven. From an OO stand point ECS flips encapsulation on its head. However, you can build OOP on top of it. You can imagine a solution that lets you write a class - in a conventional fashion - but underneath it would be generating components and systems. The solution would enforce any accessibility rules necessary, and would ...


2

Strong "no" from me. The concept of what constitutes object-oriented design and programming is widely contested in my experience when it comes to the nuanced details among experts and pioneers who introduced object-oriented concepts to languages. Yet if there's anything that seems to be at the heart of the focus behind OOP, it's encapsulation: the ...


0

I managed to solve it with the help of the comments. It seems i needed a interface to copy the derived object's data. So Created a pure virtual function inside a base class Clone() Implemented that virtual function inside the derived class Code looks like this Base Element Class class RElementComponent { public: RElementComponent* RootGameElement; ...


1

I've encountered systems like this; hell, I've even written some when I was in a hurry during prototyping. It is not specifically wrong, it is just one way in which systems can evolve. Reasons systems evolve this way include: The root controller class / instance needs to be privy / proxy to much or all of what other actors in the system, are doing (perhaps ...


1

I think the most important question is: why are all your modules/systems accessing GameController? Are they interacting with GameController so that they can access data or functionality provided by this class? If that's the case, your GameController is probably accumulating too much responsibility and you might benefit from applying the single responsibility ...


1

I would solve this by creating click handler behaviors for everything which is clickable. But the primary purpose of that behavior would not be to actually act on the click event but rather find out what the users intention is, convert it into a command and then delegate the execution of that command to a central command handler. For example, the behavior I ...


2

Controls Games for PC are often develop with keyboard and mouse in mind. That is not the usual interface for VR games. Even if we treat a VR controller as a pointing device, the expectation is that you will have one on each hand, and you would use them to interact with the game world in a believable manner. For example, you may do a key-press to open a door ...


Top 50 recent answers are included