Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wiki] New Example Project! #40

Closed
JamesMcMahon opened this issue Sep 11, 2015 · 4 comments
Closed

[Wiki] New Example Project! #40

JamesMcMahon opened this issue Sep 11, 2015 · 4 comments

Comments

@JamesMcMahon
Copy link
Contributor

Hey guys,

I just recently got finished converting the Unity 2d roguelike example over to Entitas.

screenshot

The game is fairly simple but more involved than any of the current example projects. I've open sourced it at https://github.com/JamesMcMahon/entitas-2d-roguelike.

I'd love to get feedback on my implementation as this is the first time using both Entitas and the Entity Component System style of design. Please don't hesitate to open issues to point out anything that can be improved.

If the project looks good to you guys it would be great to get it added to the Wiki so that there is another example project for people to look at.

@sschmid
Copy link
Owner

sschmid commented Sep 11, 2015

Awesome, I'll take a look at the code when I find some time!
I added it to the wiki
Games and Examples

@sschmid sschmid closed this as completed Sep 11, 2015
@sschmid
Copy link
Owner

sschmid commented Sep 11, 2015

I just looked at the code. You grouped the components and systems by feature and you have separate folders for MonoBehaviours and entitas sources - that's how I like it :) Looks pretty good! Great job! I'm happy to have it in the wiki now so others can learn from it!

@JamesMcMahon
Copy link
Contributor Author

Yeah I followed the other examples and it seemed like a good way to do it. I've seen a lot of ECS projects use just a single directory for systems and then a separate directory for components and I was initially going to do that but grouping by features seemed like a better granularity for organization.

Separating in the MonoBehaviors from the Entitas just made sense. I wish I could have gotten rid of all using UnityEngine; dependencies in the Entitas sources, but that involved duplicating code and was impossible for the GameObject view stuff. It would be great if you guys had a few examples with unit tests because I'd love to see how that works with Entitas.

In the case of this game it was really easy to encapsulate all the simulation logic in Entitas. I'd like to know what to do when I need to use Unity features beyond a view capacity, such as collisions, pathfinding, etc. I have a rough idea but didn't get to experiment with it much in this project.

One thing I'd like to see in the Entitas project is more documentation around the various classes and interfaces. I think I was able to figure out everything but the startup cost was larger if there had just been some class docs.

In general though using Entitas was a blast, I think I am going to adopt it for my prototyping going forward. It was so easy to add new features once I got everything up and running. Also the Unity editor widgets you built out are really helpful and impressive.

@sschmid
Copy link
Owner

sschmid commented Sep 11, 2015

Grouping classes by feature is great for organization and prevents unused files in the project. I try to put not only components and systems in the same folder, but also extensions, utils, enums, unit test, etc. When you want to remove a feature you simply delete the folder and the feature incl. unit tests is gone.

@mzaks and me will eventually start on a small series where we build a game from scratch including unit tests, level design and maybe physics. I hope that helps answering most questions.

Currently the lack of documentation is intentional. I'm not a very big fan of documenting code because I think good code should reveal its intend by just reading the class and method names. Maybe I didn't do a great job then ;) But I agree, it might help to get started. I'll think about to add some documentation at some selected places ;)

I'm glad you had fun using Entitas. You did a great job! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants