Tag Info

New answers tagged

0

I don't think there is any reason for an entity to be a class in the first place. It could be represented by an index number unique to that entity. Components can then have a member named entity_id with that index. There is no need for any inheritance or classes to represent entities. Components could and would possibly use classes and inheritance. Using ...


2

Yes! No! Maybe! To 1: No, your understanding of the Component-Entity-Model is not fully correct. If you had a "superclass" than you did something wrong in the first place. You will gain much if you resolve that issue first before chopping up your code into components. As a basic rule of thumb favor composition over inheritance. This does not necessarily ...


0

Basically I'd have 2 ways of querying info. when the AIState changes because you detected a collision or whatever cache a reference to whatever object is important. That way you know what reference you need. When have other systems having to run large searches every frame i'd recommend piggy backing off them so you don't have to perform multiple searches. ...


4

What you describe is a classic "pull" model of querying the world. Most of the time, this works pretty well, especially for games with basic AI (which is most). However, there are a couple of points you should consider that might be downsides: You probably want to double buffer. See game programming patterns on the subject. By always requesting the data ...


4

AI being costly, performance is often the driving factor in architecture. To ease your concerns around data access models, let's consider a few different AI examples both in- and outside of the games industry, working from that which is furthest from human navigation to that which is most familiar to us. (Each example assumes a single, global logic ...


1

Certainly you could just wrap your D3D usage up into a namespace containing free functions and that would be fine. It's not wrong, per se, but it does have limitations. D3D is inherently object-based, and those objects store state. By hiding it behind a free-function façade you'd actually remove flexibility (you could create more D3D devices but you can't ...


1

Game engines often provide an interface for their renderer. This hides specific implementations for Direct3D/OpenGL/GCM render code. The main advantage to this is that you can have classes/wrappers for each graphics API but you only ever use the same renderer interface regardless of the target platform. Classes are generally used for their polymorphism ...


1

I'm not sure if this is new since the answers in 2012, but Unity actually does have support for timeline control via the (Legacy) Animation Editor. Although this feature is intended mainly for animating object parameters with curves, it includes the ability to trigger scripts on Animation Events. These scripts could drive your graphics and audio.


0

A small hack would be to set enemy to not visible on collision, and when the explosion finishes then remove it. But then you need to have a callback that is triggered when explosion finishes.


2

Do not have a client talk to a database server. The client talks only to the frontend game server, and nothing else. That server then distributes client requests to the appropriate backend server. The frontend servers and (most) of all the other servers are distributed geographically. Not distributing the front-end server as in your diagram defeats almost ...


4

The particles themselves associated with a particular effect shouldn't be tied directly to the object. While there is never a 100% use-case scenario, this still applies to most situations. Your object itself shouldn't be managing the life-cycle of a particle effect, though it may be the instigator for spawning particular effects in the world. So, in your ...


1

It's not very clever—basically you update the data in memory and then call direct3d/openGL/whatever to do a new render at each update. A single rendered image is called a frame. So in a video game, you render like 50 frames in a second (written 50 FPS). As Raxvan, I suggest you to read a book about computer graphics as the subject is vast and cannot be ...


3

The draw order often implied by tutorials, where you do something like this: for each object: for each pass: apply pass state draw object is actually backwards from how it makes sense to do it in a "real game" context. Rather, you'd be more likely to do something like: for each pass: apply pass state for each object (grouped ...


2

Yes. It is a very efficient way for game systems to communicate with each other. Events help you decouple many systems and make it possible to even compile things separately without knowing of each others' existence. This means your classes can be more easily prototyped and the compilation times are faster. More importantly, you end up with a flat code ...



Top 50 recent answers are included