| bio | website | |
|---|---|---|
| location | Australia | |
| age | 21 | |
| visits | member for | 2 years, 11 months |
| seen | 11 hours ago | |
| stats | profile views | 3 |
I am a student at the University of Newcastle (Australia) studying Software Engineering
I also work at Macquarie Generation as a Software Engineer using .NET based technologies to provide software solutions.
|
11h |
awarded | Caucus |
|
11h |
awarded | Constituent |
|
Feb 3 |
revised |
How can I remove enemies from my ArrayList after they have died? Fixed grammar |
|
Jan 5 |
awarded | Yearling |
|
Jan 4 |
awarded | Commentator |
|
Jan 4 |
comment |
How can I remove enemies from my ArrayList after they have died? @Liosan that's a good point, the swap trick is certainly useful if removing is too slow. I still think you shouldn't bother with that until performance becomes an issue (or if the container naturally supports it) but it's very useful to know about. |
|
Jan 3 |
revised |
How can I remove enemies from my ArrayList after they have died? added 2 characters in body |
|
Jan 3 |
answered | How can I remove enemies from my ArrayList after they have died? |
|
Oct 3 |
comment |
Entity System and rendering @snake5 Ah that makes sense, what about the case where two systems have equal claim to a component, for example a Powerup and Death system, Powerup monitors health for full health in order to give some bonus and Death monitors health in order to execute death logic. |
|
Oct 3 |
comment |
Entity System and rendering @snake5 how do you solve the issue where it's necessary for a system to know about two or more components? Such as a combat system that might monitor enemies health and change their sprite on death. |
|
Oct 3 |
comment |
Entity System and rendering @snake5 You aren't recalculating data every frame, getComponents returns a vector owned by m_manager that is already known and only changes when you add/remove components. It's an advantage when you have a system that wants to use multiple components of the same entity, for example a PhysicsSystem that wants to use PositionComponent and PhysicsComponent. Other systems will probably want the position and by having a PositionComponent you don't have duplicate data. Primarily it solves the problem of how do components communicate. |
|
Oct 3 |
comment |
Entity System and rendering This example is using a system similar to one described in the articles I linked. The basic idea is multiple systems can reference the same components. m_manager.getComponents<RenderComponent>(); is implemented such that it only retrieves from a vector of RenderComponents and as such there is only a minor (single pointer indirection) change in performance with the advantage of allowing multiple systems to access components. |
|
Oct 3 |
comment |
Entity System and rendering @snake5 you are correct on both counts. I typed the code off the top of my head and there were some problems, thanks for pointing them out. I've fixed the affected code to be less slow and to correctly use entity system idioms. |
|
Oct 3 |
revised |
Entity System and rendering deleted 117 characters in body |
|
Oct 3 |
answered | Entity System and rendering |
|
Jul 7 |
awarded | Teacher |
|
Jul 7 |
awarded | Editor |
|
Jan 20 |
comment |
“The Game Object” - and component-based design As far as I understand it all entities do not share the same component, each entity can have N component instances attached to them. A System then queries the game for a list of all entities that have component instances they care about attached to them and then does whatever processing on those |
|
Jul 16 |
awarded | Supporter |
|
Jul 16 |
comment |
How should I get started on this very simple game? Another option to SDL is Simple Fast Multimedia Library. It provides similar capabilities to SDL but is Object Oriented and fairly useful. The tutorials on the website are fairly comprehensive much like the lazyfoo tutorials. sfml-dev.org |