DISQUS

Building Browsergames: Designing a flexible items system

  • sepp · 1 year ago
    For item.type I would use an enum.

    http://dev.mysql.com/doc/refman/5.1/en/enum.html
  • Sunchaser · 1 year ago
    Nice article...

    Do you plan to write some articles on a quest system editable by users or a system where players can move in a map?
  • Luke · 1 year ago
    Hi Sunchaser,

    There aren't really any plans on building a quest system or a map-based movement system - but I'll do my best to research it and write something on it once I've figured out how to build one.

    sepp: using an enum for item type is a great idea - thanks for pointing that out.
  • MrLollige · 8 months ago
    Enum looks good. But google cant tell me how to add a possible value.
    For example, if I have a row:
    type ENUM('Weapon','Armor','Usable'),
    And I want to add 'Shines' and 'Tradeable' to it later on. How do I do that?
  • Val · 8 months ago
    If you want to add more enums, you need to redefine the table using the MODIFY TABLE syntax.
  • keilaniswk · 6 days ago
    What happens when you enter an item type that is not on the list?

    Its value will be left blank on the type column.
  • Luke · 6 days ago
    Because it's only you(the developer) adding items, this isn't really an
    issue - you just redefine your enum and go from there.

    While this isn't the best way to lay out an items table(and future tutorials
    will be doing it differently), it was the best at the time in terms of
    allowing us to be flexible with our items and stats when we weren't sure how
    our idea was going to grow and change.