Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Levels system #17

Open
conaticus opened this issue Apr 18, 2022 · 8 comments
Open

Levels system #17

conaticus opened this issue Apr 18, 2022 · 8 comments
Assignees
Labels
claimed enhancement New feature or request

Comments

@conaticus
Copy link
Owner

A levels system assigning new roles and permissions as the user levels up.

@conaticus conaticus added claimed enhancement New feature or request and removed claimed labels Apr 18, 2022
@HTGAzureX1212
Copy link

HTGAzureX1212 commented Apr 19, 2022

Raising several questions / ideas I have currently:

  • How are we going to store the level data?
    • Use a JSON file?
    • Use a database?
  • Implement commands to:
    • get current level and XP of a user
      • additional thinking: draw an image for the reply? or use an embed?
    • get the server leaderboard (maybe top 10 only on Discord)
      • additional thinking: a website to display the full leaderboard?
    • add XP or remove XP from users
      • additional thinking: do we really need this?

@xhayper
Copy link
Contributor

xhayper commented Apr 19, 2022

JSON database is a very VERY bad idea

@flaxaurial
Copy link

In order to add XP to a user, use the messageCreate event and either program the level components inside or have a separate file with a function inside of a module.exports.
Store XP data inside of a collection via MongoDB. Update the user's document every time their XP updates. You can also use Canvas to create an image with the user's profile picture and XP level.

@HTGAzureX1212
Copy link

In order to add XP to a user, use the messageCreate event and either program the level components inside or have a separate file with a function inside of a module.exports. Store XP data inside of a collection via MongoDB. Update the user's document every time their XP updates. You can also use Canvas to create an image with the user's profile picture and XP level.

That first part is quite obvious.

However we should decide how should XP be added, and how to determine the required XP to acquire a new level.

@conaticus
Copy link
Owner Author

Raising several questions / ideas I have currently:

* [ ]  How are we going to store the level data?
  
  * Use a JSON file?
  * Use a database?

* [ ]  Implement commands to:
  
  * [ ]  get current level and XP of a user
    
    * additional thinking: draw an image for the reply? or use an embed?
  * [ ]  get the server leaderboard (maybe top 10 only on Discord)
    
    * additional thinking: a website to display the full leaderboard?
  * [ ]  add XP or remove XP from users
    
    * additional thinking: do we _really_ need this?

MongoDB or SQLite3 are fine - make sure you switch from the data.json to one of these though.
What you have listed is good, but I agree that adding and removing XP is not neccesary - so we won't be adding that.

@LeoCatsune
Copy link
Contributor

Echoing this, opened #46 for specific focus on database implementation.

@HTGAzureX1212
Copy link

HTGAzureX1212 commented Apr 20, 2022

In order to add XP to a user, use the messageCreate event and either program the level components inside or have a separate file with a function inside of a module.exports. Store XP data inside of a collection via MongoDB. Update the user's document every time their XP updates. You can also use Canvas to create an image with the user's profile picture and XP level.

That first part is quite obvious.

However we should decide how should XP be added, and how to determine the required XP to acquire a new level.

Prior Art: MEE6 uses a quadratic function to calculate the XP required to advance a level.
$$5x^2 + 50x + 100$$

Where x is the current level.

MEE6 only awards XP once per minute in order to circumvent spamming. Every minute a user is given random XP in the range of 15 to 25.

@conaticus
Copy link
Owner Author

In order to add XP to a user, use the messageCreate event and either program the level components inside or have a separate file with a function inside of a module.exports. Store XP data inside of a collection via MongoDB. Update the user's document every time their XP updates. You can also use Canvas to create an image with the user's profile picture and XP level.

That first part is quite obvious.

However we should decide how should XP be added, and how to determine the required XP to acquire a new level.

Prior Art: MEE6 uses a quadratic function to calculate the XP required to advance a level.
image

Where x is the current level.

MEE6 only awards XP once per minute in order to circumvent spamming. Every minute a user is given random XP in the range of 15 to 25.

Yes this seems good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
claimed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants