Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (407)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Efficient entity system?  (Read 1835 times)
0 Members and 1 Guest are viewing this topic.
Offline SkyAphid

Senior Member


Medals: 3
Projects: 1



« Posted 2012-05-17 05:30:52 »

I'm remodeling my entity engine. My old one was just an ArrayList of entity inheriting objects, but it got real messy, real fast.

How do you guys go about it?

I saw something about hierarchies on the interwebz but I don't know how they work or what they are for :p

Give me long detailed opinions! Thank you Smiley

“Life is pretty simple: You do some stuff. Most fails. Some works. You do more of what works. If it works big, others quickly copy it. Then you do something else. The trick is the doing something else.” ~Leonardo da Vinci
Offline ReBirth
« Reply #1 - Posted 2012-05-17 06:19:13 »

My entity system even varies between projects :O

Offline theagentd
« Reply #2 - Posted 2012-05-17 06:31:42 »

I usually don't even get that far. xd I'm using Artemis for one of my projects and that's working really well for me. Its site seems to be down though...

Myomyomyo.
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline lhkbob

JGO Knight


Medals: 32



« Reply #3 - Posted 2012-05-17 07:08:40 »

I use this one: http://bitbucket.org/mludwig/entreri

It has a little more overhead as far as defining components, but it scales better and is more performant.

Offline Danny02

JGO Knight


Medals: 36



« Reply #4 - Posted 2012-05-17 18:43:50 »

cause performance should not matter that much for an entity system I prefer a less verbose and bloated system then entreri.
I took a look at the sources and it was just to much of configuration and setup.

One should perhaps write an entity system in an own DSL with scala, because I think one could come up with a lot of syntax sugar and it is then also easily integratable to the other game code in java
Offline Eli Delventhal
« League of Dukes »

JGO Kernel


Medals: 39
Projects: 12


Game Engineer


« Reply #5 - Posted 2012-05-18 19:33:40 »

I mostly use component systems these days.

See my work:
OTC Software
Offline matheus23

JGO Wizard


Medals: 72
Projects: 3


You think about my Avatar right now!


« Reply #6 - Posted 2012-05-18 19:38:20 »

I mostly use component systems these days.

Could you please explain, what that is? Cheesy I'm intrested...

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline iamtommo

Senior Newbie





« Reply #7 - Posted 2012-06-15 19:04:33 »

As opposed to an entity system which forces you to branch of entities which could have similar properties, a component based entity system allows an entity to implements certain functionality instead of everything above in the hierarchichal ladder.

for example a monster could implement this functionality: attackable, interactable, living.
instead of just branching down through: entity>living>attackable>monster etcetera.
Offline Roquen

JGO Ninja


Medals: 66



« Reply #8 - Posted 2012-06-15 19:13:05 »

Component based is one composition design model of which there are as many as you're brain can come up which has become a fad.
Offline actual

JGO Coder


Medals: 19



« Reply #9 - Posted 2012-06-15 21:00:18 »

There's been a fair bit of discussion of the Component model on these boards, most of it negative. Although I had a lot of initial enthusiasm for them early on, the more I worked with them the less that I had. Although there are many flavors of Component systems most involve a system where you have a GameEntity which has no functionality other than to add/remove components. All  Entity behavior resides in Components which can be dynamically added/removed as the game runs.

My main issues are that this provides far, far more flexibility than I need (and that most hobby game devs need I suspect). This flexibility requires more complexity and makes things more difficult to reason about.

An approach I prefer is just have entity behavior within in entity specific classes (FighterJet, Missile, etc) and to use the Strategy Pattern for cases where I have related and/or shared functionality.

You are giving up some of the "dynamicity" of the E/C model (which I don't need any how) while still getting the benefits of a favoring aggregation over inheritance while working with a simpler set of code over all.
Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Online sproingie
« Reply #10 - Posted 2012-06-16 01:43:46 »

It's worth noting the difference between "component-based programming", which is simply composition within in an otherwise static object model, and "component systems" which assemble components at runtime.  Unless you're writing some kind of engine, you probably don't need to even consider the latter.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (88 views)
2013-05-17 21:29:12

alaslipknot (96 views)
2013-05-16 21:24:48

gouessej (128 views)
2013-05-16 00:53:38

gouessej (123 views)
2013-05-16 00:17:58

theagentd (131 views)
2013-05-15 15:01:13

theagentd (119 views)
2013-05-15 15:00:54

StreetDoggy (161 views)
2013-05-14 15:56:26

kutucuk (184 views)
2013-05-12 17:10:36

kutucuk (185 views)
2013-05-12 15:36:09

UnluckyDevil (191 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.111 seconds with 21 queries.