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

Max stat points (general strategy creation UX thread) #6

Open
rand0musername opened this issue Dec 14, 2018 · 6 comments
Open

Max stat points (general strategy creation UX thread) #6

rand0musername opened this issue Dec 14, 2018 · 6 comments
Labels
question Further information is requested

Comments

@rand0musername
Copy link
Member

We should definitely document the health+points+2strength+2defence+2special == 100 somewhere. Just a reminder so we don't forget. Could cause random disqualifications.

@rand0musername rand0musername added the question Further information is requested label Dec 14, 2018
@rand0musername
Copy link
Member Author

In general, let's enable them to focus on writing the core logic with clear instructions and understandable examples. Issue #4 is also relevant here.

@rand0musername
Copy link
Member Author

rand0musername commented Dec 14, 2018

Unrelated to this issue but maybe we should use some reflection and import os magic to fetch all python files in a folder called strategies/ from run.py. This way the flow is:

  1. The competitor clones this repo.
  2. The competitor copies one of the files from strategies/, renames it to '__strategy.py' and renames the class inside to 'Strategy'.
  3. The competitor rewrites the logic and it all seamlessly works with run.py, no other code changes are needed.
  4. For submission, the competitor sends only their python file.
  5. We put all received python files in our strategies/ folder (we could do strategies/dayN or something and publish all of them later instead of overwriting).
  6. We run the tournament, no other changes are needed. Maybe now we need a way to exclude example strategies but we could hack that up in the import os magic code.

If you already have better ideas and a submission pipeline set in stone disregard this, just rambling.

@rand0musername rand0musername changed the title Max stat points Max stat points (general strategy creation UX thread) Dec 14, 2018
@Dreian
Copy link
Member

Dreian commented Dec 14, 2018

We should definitely document the health+points+2strength+2defence+2special == 100 somewhere. Just a reminder so we don't forget. Could cause random disqualifications.

Agreed. Already have a draft doc. Should discuss whether there should be a "level up" system that raises this max.

@Dreian
Copy link
Member

Dreian commented Dec 14, 2018

In general, let's enable them to focus on writing the core logic with clear instructions and understandable examples. Issue #4 is also relevant here.

Will document.

@Dreian
Copy link
Member

Dreian commented Dec 14, 2018

Unrelated to this issue but maybe we should use some reflection and import os magic to fetch all python files in a folder called strategies/ from run.py. This way the flow is:

1. The competitor clones this repo.

2. The competitor copies one of the files from `strategies/`, renames it to '__strategy.py' and renames the class inside to 'Strategy'.

3. The competitor rewrites the logic and it all seamlessly works with `run.py`, no other code changes are needed.

4. For submission, the competitor sends only their python file.

5. We put all received python files in our `strategies/` folder (we could do `strategies/dayN` or something and publish all of them later instead of overwriting).

6. We run the tournament, no other changes are needed. Maybe now we need a way to exclude example strategies but we could hack that up in the `import os` magic code.

If you already have better ideas and a submission pipeline set in stone disregard this, just rambling.

The pipeline does make sense and is what I had in mind. Someone will need to look at Python reflection capabilities. I'd keep the random strategies as our bots that also participate and provide easy victories.

@rand0musername
Copy link
Member Author

rand0musername commented Dec 14, 2018

Easy victories make sense 👍
Regarding Python reflection, maybe something like this to find all python files in strategies/):
onlyfiles = [f for f in listdir(dir) if isfile(join(dir, f)) and f.endswith('.py')]
Then somethig like this to generate class names from each filename:
class_name = ''.join([w.title() for w in filename[:-3].split('_')])
And then we can do:
globals()[class_name]
Of course we need to from strategies include * or something similar before.

Definitely ugly but if should work 90% of the time if competitors name their files correctly :)
I just really like the idea of not having to change the engine to include a new strategy. Maybe finding a way to include all classes from a file given filename would be less hacky. Just some ideas if anyone wants to tackle this.

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

No branches or pull requests

2 participants