开发者

Suggestions for opening the Rails toolbox to design a challenge game?

How would you suggest designing a challenge system as part of a food-eating game so that it's automated as possible? All RoR tools, design patterns and logic are at your disposal (e.g., admin consoles, crontab, arch, etc.). Prize goes to whoever can suggest the simplest and most-automated design!

Here are the requirements:

  1. User has many challenges.

  2. Badge has many challenges. (A unique badge is awarded for each challenge won.)

  3. Only one challenge can run at a time.

  4. Each challenge has a limited number of days that it runs. For example, one challenge can run 3 days, while another runs 7 days.

  5. Challenges ca开发者_如何学JAVAn be seasonal. For example, "Eat 13 Pumpkins" only runs during the Fall.

  6. New challenges are added to the game on an ongoing basis. For example, a new challenge every week.

  7. Each challenge has a certain probability of being selected to run. For example, "Eat 10 Pies" challenge has 10% chance of being selected to run.

  8. As each new challenge is added to the database, I want the probabilities of running to change dynamically. I want to avoid the scenario where I'm manually updating a database field just to change the probability from 10% to 5%, for example.

  9. Challenges act like Easter eggs. Challenge icons pop-up at different places on the webpage.

  10. User is awarded a badge for successfully completing a challenge, but only when it's active.

  11. There is some wait time between each challenge. Between 1 and 7 days. Which wait time is random, but the probability of the wait time being short is high and the probability of it being a long wait time is low.


This is a big question.

  1. Use Rails as backend, rendering json data for front-end javascript to display the challenge icon pop-ups

  2. You seem to have the database schema down. It's not that complex.

  3. Calculate challenge probability dynamically every time a challenge is initiated (just do a random sort works too, since you seem to just want a random challenge every time)

  4. Each challenge maintains a text attribute that stores its restrictions in season

  5. Database constraint on making sure only one challenge per person at one time

  6. If database schema is set up correctly, challenges can simply be added with a Challenge.create call. The rest of the game will automate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜