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

Game idea: pet racing #102

Open
tk3369 opened this issue Jul 18, 2021 · 0 comments
Open

Game idea: pet racing #102

tk3369 opened this issue Jul 18, 2021 · 0 comments

Comments

@tk3369
Copy link
Member

tk3369 commented Jul 18, 2021

I forgot where I saw a similar functionality :-) Just writing down some thoughts:

Game play

> race chicken @joe @bob 
Hey Joe, Bob:
@tk3369 is challenging you to a chicken race. Do you want to accept?
In the next 60 seconds, please choose 👍🏼  to accept, and 👎🏼  to decline.

So let's say both users accepted. The bot runs a simulation and then says:

Here's the chicken race result:
1. Bob finished in 25.87s 
2. Tom Kwong finished in 30.23s
3. Joe finished in 39.66s

This result has been recorded. Type `race rank` to see the leaderboard.

Ok, people get curious:

> race rank
Alright, the monthly pet race leaderboard is as follows:
1. Joe: 10 
2. Bob: 8 
3. Alice: 7 

The champion of the month will receive a Pet Race Champion role 🥇 🤸🏼‍♂️ 

And wants to see own history:

> race history
You past 5 races were:
1. [chicken] lost to Joe(along with Bob)
2. [pig] won against Joe
3. [pig] won against Bob, Alice
...

How does the simulation work?

Each animal has a default speed in a race, and the race track distance is standard:

Animal Normal speed Race track distance Normal elapsed time
Turtle 0.05 m/s 5 m 100 s
Chicken 0.5 m/s 50 m 100 s
Pig 1 m/s 100 m 100 s

By default, everyone owns one chicken, one turtle, and one pig. Each of your pets has two characteristics:

  1. Speed. This is a floating point value in the unit of m/s. See above table for the default speed.
  2. Age factor. This is a percentage that handicap speed. Starting at 0%, it grows 1% every week until it reaches 10%.

Every race improves your pet's speed by 0.2%. In addition, you can train your pet for an additional 0.2% per day.

> race train chicken
Great! Your chicken's speed has improved by 0.2% and now it can run at 0.7 m/s.

> race train chicken
Sorry, you can only train your pet once a day.

Now, the actual speed of your pet in a race is calculated as:

     ActualSpeed = Speed * (1 - AgeFactor + PerformFactor)

where PerformFactor is a random number in the range of [-3%, 3%].

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

No branches or pull requests

1 participant