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

Add way to access engine configuration #109

Open
collinsmith opened this issue Aug 30, 2020 · 1 comment
Open

Add way to access engine configuration #109

collinsmith opened this issue Aug 30, 2020 · 1 comment
Labels

Comments

@collinsmith
Copy link
Owner

Data such as difficulty needs to be made available to multiple systems, such as those creating monsters. This should be injected into systems. I don't know if artemis provides some kind of config properties map, or if the go to solution is to just create a new passive system with accessors. Unsure if any of these configs should be allowed to change during runtime, I think not though.

@collinsmith
Copy link
Owner Author

I've settled on creating EngineConfig class which is manually injected into my artemis World. This class consists of final fields for seed and difficulty for the time being. I decided against a PassiveSystem because it just doesn't fit the theme of a passive system (or system in general). I think the benefit of this approach is that I can pass it as a dependency to Map or other objects which require some Riiablo configuration.

This may require a separate issue, but I'd also like to allow access to engine state, e.g., the time of day in the level. This is used for day/night cycles, but also practical uses like the time of day attributes. I don't think this really fits within EngineConfig, so I may need to implement an additional class. This one may actually be a System implementation because I'm assuming time of day will be a float from [0..1] or byte from [0..255] or even a standard unix time (which would be interesting), but this time would need to be updates using the system update function to increment the time delay by the world delta and then perform some time dilation to speed it up by some factor.

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

No branches or pull requests

1 participant