Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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 2552 times)
0 Members and 1 Guest are viewing this topic.
Offline SkyAphid
« 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!
Legends of Yore - The Casual Retro Roguelike
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
« 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

JGO Kernel


Medals: 42
Projects: 11


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 Kernel


Medals: 106
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.
Online Roquen
« 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: 23



« 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!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie

JGO Kernel


Medals: 201



« 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.

 

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

The first screenshot will be displayed as a thumbnail.

pw (22 views)
2014-07-24 01:59:36

Riven (20 views)
2014-07-23 21:16:32

Riven (17 views)
2014-07-23 21:07:15

Riven (20 views)
2014-07-23 20:56:16

ctomni231 (48 views)
2014-07-18 06:55:21

Zero Volt (44 views)
2014-07-17 23:47:54

danieldean (35 views)
2014-07-17 23:41:23

MustardPeter (38 views)
2014-07-16 23:30:00

Cero (53 views)
2014-07-16 00:42:17

Riven (52 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!