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

Modularity for non essential features #79

Closed
Darkhax opened this issue Oct 5, 2016 · 3 comments
Closed

Modularity for non essential features #79

Darkhax opened this issue Oct 5, 2016 · 3 comments
Assignees
Milestone

Comments

@Darkhax
Copy link
Contributor

Darkhax commented Oct 5, 2016

While the engine has a lot of cool features built in, there are some things like the entity and scene system which are not ideal for every game type. It would be useful to add an option system to the project creation tool to allow certain modules to be disabled/removed from the engine. This would also be useful when an entity API system is finally implemented.

@sriharshachilakapati
Copy link
Owner

I do have this in my plans, like implementing an extension mechanism. Some of my plans are to implement Box2D and Bullet3D extensions to enable physics based games. This is a great idea.

However, I do think that entity and scene system is an essential component. Any game (even card games for example) needs entities, and scenes are like levels. Do you have anything against it or want to implement one yourself? In that case, please create a specific issue on the entity and scene system.

@Darkhax
Copy link
Contributor Author

Darkhax commented Oct 5, 2016

The reason why I feel said systems should be optional, is that they don't work in ways that are beneficial to every game. Rather than forcing the extra dead weight for those games, you could just uncheck the box in the creator and not have them included.

@sriharshachilakapati
Copy link
Owner

This is now done, I've added a method SilenceEngine.runOnInit() which takes callbacks and runs them in the order of addition after the engine has been initialized.

This method adds a callback to be run after the engine is initialized. There can be many callbacks added via this method, and it is guaranteed that they will be called in the order they are added.

SilenceEngine.runOnInit((next) ->
{
    // Do the task here. After the task is done, invoke next,
    // which tells SilenceEngine that this is done successfully
    // and SilenceEngine can call the next on-init callback

    next.invoke();
});

Note that this only works if called before the platform specific Runtime is started. To make sure these gets called always, keep the calls to this method in the class initializer or the game's constructor.

Placing these calls in the static constructor will not work on Android, since the activity might not be destroyed from previous run and can cause issues.

I still think that entity and scene system needs to be in the core, and that is how everything (rendering and collision systems) are designed to work with. They are even the same for the card-like games and also dynamic games.

The tiled map package will be moved into a separate extension of course, in the next scheduled release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.1.1
POSTPONED
1.2.1
DONE
Development

No branches or pull requests

2 participants