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 8023575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:35:56+00:00 2026-06-04T22:35:56+00:00

I am starting to think about a basic database driven game(rpg). I am having

  • 0

I am starting to think about a basic database driven game(rpg).
I am having trouble sorting out how to save the character, his attributes and his items. For most things where there is only one of them static is fine, but when there are mulitple objects like an inventory for example I am at a bit of a loss.

I decided to put items into a bag object. the bag object can have any where from 5 – 20 slots, each of these slots will reference an item based on unique database ID. So how do I design the bag table.

BagID | Owner | Slot1 | Slot2 | Slot3 | Slot4 ……

or

BagID | Owner | Contents <-varbinary

Any suggestions? I was told once that when database programming, one column one data, but I don’t like the idea of Slot1 | Slot2 etc… it just doesn’t seem right.

Edit

Did I miss this altogether, and it is rightfully the item that should be referencing the Bag.

ItemID | BagID | Slot | Name | …..

Then when you want to find out what is in a bag you would

Select * from Items where BagID=10  
  • 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-06-04T22:35:57+00:00Added an answer on June 4, 2026 at 10:35 pm

    Any suggestions?

    STANDARD approach since the invention of relational databases way back in the 60ies by cobb is normalization.

    BadId, SlotNr, ItemRef

    Finished.

    Another table has the items.

    Note that OwnerId is missing – this is the BagItemMap table. THe BagTable has BagId, OwnerId and possibly other items (total weight etc.)

    This is a standard m:n relationshit. WHen you materialize the objects you ahve a Bag object that has the Items as collection.

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

Sidebar

Related Questions

I'm starting to think about protecting my inputs from SQL injection. I've read about
I am implementing new Balanced API for the payment, and starting to think about
Good afternoon, I am currently starting to think & prototype about a (.net based)
I am just starting to think about how api keys and secret keys work.
I’m starting to think about and develop an architecture for a big web application,
I think about starting from scratch building a small application fullfilling two technical requirements:
We're starting to think about the next stage of our company information strategy. At
I think I'm starting to understand python, but I still have trouble with a
I have a C++/wxWidgets codebase and I'm starting to think about porting it across
Heads starting to hurt. I think I dropped into this too fast... Perhaps someone

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.