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

  • Home
  • SEARCH
  • 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 1064231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:54:04+00:00 2026-05-16T18:54:04+00:00

I’m coming from a background developing business applications so am used to MVC/n-Tier development.

  • 0

I’m coming from a background developing business applications so am used to MVC/n-Tier development.

Most of my applications have an architecture something like this:

GUI -> BL (which deals with entities) -> DAL (SQL DB)

Now, I’d like to write something which is a cross between an interactive story and a simulation – There is a persistent “world” which allows you to affect objects/NPCs. The state of objects/NPCs changes over time (sometimes as a result of your actions) which affects options later on. Think Oblivion but on a far smaller scale with no combat

I know that this is a massive project and I’m aware that I won’t be able to achieve anything like modern game complexity by myself – But that doesn’t mean I shouldn’t try 🙂

My question is this: What sort of architecture should I use?

I’m going to need a library of story elements – Characters (NPCs), locations, transportation mechanisms, objects, quests, etc. etc.

I’d naturally tend to store these in a SQL database and access them using the entity framework.

I then need to be able to perform actions/events against these elements. This is where I get unclear. My usual method would be to have (say) an NPCManager which would have methods to manipulate NPC entities – But this doesn’t work well with polymorphism.

I imagine that I;m going to need to use inheritance (an interfaces) to handle all the functionality that each element will have. eg:

  • Element (Base object for story elements – equivalent to Object in .Net)
  • NPC (Inherits Element)
  • Guard (Inherits NPC)
  • MountedGuard (Inherits Guard)
  • etc…

I can then say:

  • All elements would have an id
  • All NPCs would have an id and a name
  • All Guards would have an id, name and allegiance
  • All MountedGuards would have an id, name, allegiance and mount

This doesn’t seem to mesh well with the EF – eg I can’t have a method of NPCManager.GiveClothing(NPC as NPC, ClothingItem as Clothing) – because passing it a MountedGuard will fail (specifically, the class will be treated as an NPC which has no meaning in terms of a database…)

It also feels like I should be having methods to deal with MountedGuards specifically on the MountedGuard object – not on a Guard or NPC manager.

Should I have a set of entities for storing information and a completely separate set of classes to represent the object data stored by the entities. eg:

Entities.MountedGuard
Elements.MountedGuard - same properties as Entities.MountedGuard but also has a `Dismount()` method which affects the associated entity?

so should I be using non-POCO entities? or no entities at all (in which case, how do I define the “world”? I definitely don’t want to have to do it all in code)

At present, I’m not even considering how these elements will be displayed to the user – for the time being, simple text seems likely

If someone could please point me at an appropriate architecture or some good resources.

Many thanks

  • 1 1 Answer
  • 0 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-16T18:54:05+00:00Added an answer on May 16, 2026 at 6:54 pm

    My $0.02: you can have multiple inheritance strategies in entity framework, see here; this would allow you to model your domain pretty much however you want – I see especially Table-Per-Type (as opposed to table-per-concrete-type) being useful to you; this would mean that the inheritance structure in your code would be closely mirrored by the database in a pretty self-explanatory structure. Where you take it from there is up to you, but the point is you can then use pretty much the same strategies as you would with any object-oriented code.

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

Sidebar

Related Questions

No related questions found

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.