Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  
  Entity Component Systems  (Read 1013 times)
0 Members and 1 Guest are viewing this topic.
Offline Tyecon

Senior Newbie





« Posted 2013-04-04 19:55:50 »

Ok so I'm trying to create a entity component system to store general game objects.
I created my abstract entity class that has parent/children/name variables and basic methods for managing hierarchy models.
Then I have my abstract updatable class which when update() is called will call update of it's children, and their children, down the model.
Then I tried making an Asset class, of which some classes (Mesh, Shader, Image, UITheme) will extend but it has been a over all messy pain.

I'm going to redesign the entire thing, as it's just not flexible enough.
MasterEntity(Will have name/children but no parent) {
  Input
  UI
  Scene(Will store entities)
  Entity(Will have parent) {
    Asset(Will be a actual file) {
      Shaders, Meshes, Images, UIThemes
    }
    GameObject(Adds update() and tranforms) {
       Components {Matter, Cameras, Particle Emitter, Ridgidbody, etc}
    }
  }
}

Anyone have any good links?
How does the diamond operator work, and should I use it?
Should I make these extend, or make interfaces, or what?

Please have a baggy ready before looking at my code.
Online actual

JGO Coder


Medals: 23



« Reply #1 - Posted 2013-04-04 20:27:30 »

The diamond operator is just a convenience so you can write List<GameObject> myList = new ArrayList<>(); instead of List<GameObject> myList= new ArrayList<GameObject>();.

Typical EC systems have very little to no hierarchical structure. . They are rarely tied in parent/child relationships and are almost never used with inheritance. Although Assets may be stored by components, usually the Assets (as well as the UI, Input, and the Scene) are not Entities themselves.

This is a pretty good discussion about Components.
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #2 - Posted 2013-04-04 21:40:03 »

You could look at this framework:
http://gamadu.com/apollo/


or another paradigm:
http://gamadu.com/artemis/

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline matheus23

JGO Kernel


Medals: 108
Projects: 3


You think about my Avatar right now!


« Reply #3 - Posted 2013-04-04 22:00:24 »

You could look at this framework:
http://gamadu.com/apollo/


or another paradigm:
http://gamadu.com/artemis/

Which one would you describe as being better? And why Annotation injections? They seem to be some kind of hacky...

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline vbrain
« Reply #4 - Posted 2013-04-04 22:37:57 »

You could look at this framework:
http://gamadu.com/apollo/


or another paradigm:
http://gamadu.com/artemis/

Which one would you describe as being better? And why Annotation injections? They seem to be some kind of hacky...

I've used Artemis, and it's really efficient. Just because it seems hacky doesn't make it bad. You also don't have to use any annotations in Artemis.
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #5 - Posted 2013-04-04 23:01:57 »

You could look at this framework:
http://gamadu.com/apollo/


or another paradigm:
http://gamadu.com/artemis/

Which one would you describe as being better? And why Annotation injections? They seem to be some kind of hacky...

I added annotations for one purpose only: clean code and convenience.

Using them is up to you.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
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.

Pippogeek (37 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (42 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (61 views)
2014-09-21 02:42:18

BurntPizza (30 views)
2014-09-21 01:30:30

moogie (36 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (52 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!