Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 305897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:24:59+00:00 2026-05-12T07:24:59+00:00

Does anyone know where I can find examples of class diagrams for RP game

  • 0

Does anyone know where I can find examples of class diagrams for RP game development? Something similar to here would be quite useful. I’m not looking for things I can slavishly copy, but just for different examples that diagram various solutions to the problems I’m discovering as I try and pencil down my own classes.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:25:00+00:00Added an answer on May 12, 2026 at 7:25 am

    I know Emmanuel Deloget from GameDev.net but I’m not sure I would choose to use the hierarchy he’s got there! Too much inheritance, not enough flexibility.

    If I was writing a text-based RPG (as I have done in the past) it would look a bit like this (though I’ve no time to draw up a diagram for it, sadly):

    • Creatures, Rooms, and Items derived
      from WorldEntity, with WorldEntity
      objects arranged in a Composite
      structure, so items can live within
      other items, carried by creatures,
      who exist within rooms. Implementing
      the Visitor pattern for WorldEntities
      might work well.
    • CreatureType and ItemType classes
      which contain the ‘class’ data for
      individual Creature and Item
      instances, which refer back to their
      corresponding ‘type’ object. (eg. base
      hitpoints and stats in the former,
      current hitpoints and transient effects
      in the latter). I might implement these as
      prototypical lists of properties that get
      copied to Creature or Item instances when
      they are created. You can implement property
      inheritance via a ‘parent’ property so that
      a specific goblin Creature instance may relate to the
      ‘warrior goblin’ CreatureType, which contains a
      parent reference to the ‘generic goblin’ CreatureType. And so on.
    • Exits that are owned by their Room, and are
      one way, and which detail the direction of
      travel, various conditions of passage, etc.
    • Areas, that contain groups of rooms connected
      by some logical organisation.
    • A Spawn class to dictate where Creature
      and Item instances are created (eg. which room,
      or at what coordinates), when they are created and
      with what frequency, and from
      which CreatureTypes and ItemTypes. You may have
      some logic in here to randomise things a bit.
    • Spells, skills, abilities, etc.
      all derived from a base Action class
      or interface that specifies prerequisites
      (eg. current position, mana points, some
      degree of learning of a skill, etc). Normal
      commands and actions can go here too since they
      often have some sort of requirements too
      (eg. a ‘sleep’ command requires that you’re not
      already sleeping.)
    • A FutureEvent class which is essentially a
      callback that you push onto a priority queue
      to execute in the future. You can use these to
      schedule combat rounds, spell cool-down times,
      night/day cycles, whatever you like.
    • A hash/map/dictionary of name->value pairs for
      player and item statistics. Not type-safe but
      you’ll appreciate the flexibility later. In my
      experience making stats member variables is
      workable but inflexible, and having specialise
      ‘attribute’ classes becomes a convoluted
      nightmare when debugging.
    • A Modifier type which contains a stat name
      and a modifier value (eg. +10, +15%). These
      get added to your creatures as they are used
      (eg. through a spell effect, or by wielding
      an enchanted weapon) and get stripped off later
      by a timed FutureEvent or some other event such
      as a command being executed.
    • Game-specific classes such as PlayerClass or
      PlayerRace, each of which describe a player’s class
      (eg. warrior, wizard, thief) or race (human, elf,
      dwarf) and set starting stat values and limits,
      skill availability lists, special powers, etc.
    • Basic player interface classes which will vary
      depending on your actual game type. You might
      have a rendering classes for a graphical game, or
      in a MUD you might have a Connection class
      reflecting the TCP connection to the player’s client.
      Try to keep all game logic out of these.
    • A scripting interface. Most of your commands, spells,
      and creature AI can be realised more quickly with
      a decent scripting interface and it keeps compile times
      down too. It also allows for some great in-game debugging
      and diagnostic capabilities.

    That would be the basic high level structure I’d use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know where can I find recent data on PHP4 vs PHP5 market
Does anyone know where I can find a good explanation/tutorial of what and how
Does anyone know if I can find an emacs color syntax configuration which resembles
Does anyone know where I can find a good video to explain version control
Does anyone know where i can find such a AMI? Oracle database Enterprise Edition
Does anyone know where I can find that algorithm? It takes a double and
Does anyone know of a tool that I can use to find explicit C-style
Does anyone know if this is possible? I can't see to find much info
Does anyone know where I can find some example code for implementing ajax tabs
Does anyone know how to generate an XSD using LinqToXml? I can't find any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.