Slick Forums

Discuss the Slick 2D Library
It is currently Thu Jun 01, 2023 11:40 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Feb 27, 2013 2:30 am 
Offline

Joined: Wed Feb 27, 2013 2:11 am
Posts: 2
Hi, all!

I am new to the very concept of Entity Systems, but so far I find them intriguing. I've read the articles from T=Machine that Artemis is based on, and I would like to use it in the project I am currently working on if appropriate.

But the problem is, I don't know if Artemis (I.e. an Entity System) is appropriate for what I'd like to create.

Generally, the project is a space game where the user designs space ships in an editor, possibly creating his own parts as well. I am also thinking of letting the user create AI for his fleets either in Python (using Jython for interoperability) or in a simple graphical editor similar to Scratch.

Using OOP, the fleets would have a Component architecture, and ships would be instances of a Ship class with different collections of parts. The most complex part of the project would probably be the extensive message-passing between ships, units, and other game objects. In addition, the game space would be partitioned in a tree structure.

I understand how I would implement simple physics and collision detection (position and velocity components) in an ES project, but I am at a loss for how to implement anything else I need using ES. And if these requirements are usually separated from the ES, then I don't know how I would connect the various parts of my project together.

Any ideas about implementation to help me think about my problems more along the ES paradigm and less along OOP would be greatly appreciated.

Thanks!


Top
 Profile  
 
PostPosted: Thu Feb 28, 2013 10:20 pm 
Offline

Joined: Wed Feb 27, 2013 2:11 am
Posts: 2
It has occurred to me that individual parts of a Ship (i.e. guns, sensor packs, thrusters) should be their own entities. In that case, I would have to specify some sort of ownership, which leads me to two questions: 1) are entities (referenced by global identifier) valid data to store in a component, and 2) can one entity have more than one of the same type of component?

For example, assuming the answer to my first question is yes, Entity 1, which represents Ship A, has two Gun components, Gun A and Gun B. Gun A stores a reference to Entity 2, which represents the actual gun in the game, and Gun B stores a reference to Entity 3, which represents the other actual gun in the game. Is this a valid setup, and if not, how would this situation be properly implemented?

More generally, what type of data can Components store? can it be OOP data like an ArrayList? If so, the data would have functionality but the Component itself wouldn't. Or is data limited to immutable types? limited to 'numbers'?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group