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

Formula Format #506

Closed
boredom101 opened this issue Feb 3, 2019 · 3 comments · Fixed by #529
Closed

Formula Format #506

boredom101 opened this issue Feb 3, 2019 · 3 comments · Fixed by #529

Comments

@boredom101
Copy link
Contributor

I think there should be a formula format so that a specific equation isn't tied to the engine. This will be useful to damage calculations, gained experience, cost at shops, etc, It will maybe be expressed in JSON, or a python function. What do people think?

@bitcraft
Copy link
Collaborator

bitcraft commented Feb 4, 2019

Its not a bad idea. I think the problem I see is that the effort to abstract the equations "in JSON" would create a maintenance burden. Most (all?) of the math for combat, status effects, etc takes more than a few lines of code, so trying to express the code in JSON seems like a lot of effort.

However, I do fully support a cleanup of the calculation code and consolidating it into a python module.

@boredom101
Copy link
Contributor Author

Alright, so should I make a system similar to the AI system?

@bitcraft
Copy link
Collaborator

bitcraft commented Feb 4, 2019

Most of the formulas that you would likely be interested in are in https://github.com/Tuxemon/Tuxemon/blob/development/tuxemon/core/components/technique.py

As for organization, you could start with writing out the equations in python, then wrapping them in functions. Document the functions and put them in a module. Where ever they are used, modify the existing functions to call the new functions you are writing. Then document all of them with type docstrings and a line or two about how they work.

Feel free to ping me @bitcraft on the discord if you have questions.

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

Successfully merging a pull request may close this issue.

2 participants