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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:11:35+00:00 2026-05-26T07:11:35+00:00

I am working on a Text-Based RPG for Android (just built around the default

  • 0

I am working on a Text-Based RPG for Android (just built around the default views and buttons) to get a handle on some things before I launch into a more graphically intensive game. There is a Player who moves around Locations, and each Location has a set of possible Actions. The Locations and Actions have Strings for name and description, which are displayed by textViews.

My question is how to store the multiple Locations and Actions for the game? In its current state, I’m just calling new Location() multiple times in onCreate(), but with the 50 or so I’m planning on, the code would be massive, and I’m sure there’s a better way to do it. I’ve thought about subclassing Location for each specific location, but that would be just as bad. I’ve also looked at JSON, and using an SQLite Database, and I’m sure there are other valid approaches as well.

Does anyone have any links, or suggesting for storing these “plot” related items?

  • 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-26T07:11:35+00:00Added an answer on May 26, 2026 at 7:11 am

    If I understand correctly, at this time, you have the Location object initialization code – and the required data hard coded – in the onCreate method. This is a fairly good solution for a prototype, but if you want more, you have to outsource the data and lazy-initialize the Location objects when required.

    If you are not planning on modifying the Locations, than I would suggest JSON, or even easier: an own text based protocol, that is easy to parse, and store it in files of the assets folder. For example like this:

    LOCATION 14 Kitchen
    LOACTION_DESCRIPTION Entering the kitchen you smell the freshly cut tomatos on the table…
    ACCESSABLE_LOCATIONS 13 10 24 54
    AVAILABLE_ITEMS 56 23 12 8
    …

    And you can parse the file line by line with a BufferedReader, building your object.

    If locations contain information that may be modified and the modifications should be stored persistently, then you have to use a database. There are lot’s of tutorials. This way you can save modifications.

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

Sidebar

Related Questions

I'm currently working through some exercises in a c++ book, which uses text based
I'm currently working on a programming assignment for school. It's a simple text-based RPG.
I am working on a cocoa-based text editor. Should I base it on NSTextView
This is driving me nuts. I have a working text based application. It has
I'm working on a text-based UI widget library, and have decided it's high time
I am working on a small project which involves a dictionary based text searching
I've been working on a text-based game in Python, and I've come across an
I am currently working on a text based web game, where in I simulate
All, Working on a custom TCP/IP server for a text-based multiplayer game, using Ruby.
I've been developing a text-based PHP/MySQL RPG Game Engine since early December last year,

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.