Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: How to design DB schema for multiplayer exp/level system?
1 point by hnroo99 18 hours ago | hide | past | favorite | 1 comment
I'm building a turn based multiplayer game where players can earn exp from playing matches and level up (levels will mainly be used for aesthetic purposes, although I might add restrictions such as "you must be level x to edit room names").

This is my first time designing an exp/leveling system though so I'm not 100% sure how to approach the database design. Is it best practice to store both exp and level? Or is it better to store only exp and derive level?

The latter sounds potentially nicer if I want to adjust the level curve later, although that implies that all users could see their level change hm...





I'd store levels anyways, because each time tables change, you're going to have to determine what to store so you are writing the calculation code anyways in case it turns out storing wasn't a good idea, so you can fall back to deriving. either way you have to code the derivative value calculator. the reason I'd store tho, is that once someone levels up, I think it's be an odd expectation to be demoted somehow but then again depends on the game I guess. I get demoted back to moron often when I'm playing chess haha still they're not going to derive my rating each time so they store it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: