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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:49:30+00:00 2026-05-27T22:49:30+00:00

I have a game I am attempting to program but the initial data entry

  • 0

I have a game I am attempting to program but the initial data entry for it is just huge. The thing is all this data is read-only. So when the program runs, it is the same every time.

The reason I need to ask this question is because I think it would be inefficient to re-run the data through a class system each time the program is run. Initially I was using an XML setup:

XML Setup Example:

<?xml version="1.0"?>
<gameBoard>
    <!-- Area 1 -->
    <area name="Area 1">
        <arrows white="Area 2" black="Area 3" />
        <color>white</color>

        <location name="Area 1 Atrium" />
        <location name="Location 1.1">
            <attr1>foo</attr1>
            <attr2>bar</attr2>
            <attr3>foobar</attr3>
        </location>
        <location name="Location 1.2">
            <attr1>foo</attr1>
            <attr2>bar</attr2>
            <attr3>foobar</attr3>
        </location>
        <location name="Location 1.3">
            <attr1>foo</attr1>
            <attr2>bar</attr2>
            <attr3>foobar</attr3>
        </location>
    </area>
</gameBoard>

I chose this over JSON or YAML because the attributes on each the locations and area tags come in handy, plus I know XML best and I know how widely supported it is.

But, is this the best thing to do? Each time a player would move, I think it will have to iterate through this setup to find the specific location the player wanted to move to (technically it wouldn’t be iterating through the document as Java’s DOM parser loads the whole document into memory first, but either way).

My second thought was to make a class for each area that would have a method for each location and just set variables through the methods (for instance, playerLocation would get set to a location’s name, which could easily be done).

Additionally, this data by no means has to be human readable. I know that when data is byte-code it is generally much faster so that would work as well. Only the program needs to read it and even if a user were to change the XML/WhateverOtherConfig file, the additions would get ignored.

Thanks for the patience. If I need to clarify anything then let me know. This is very much in the alpha stages and I haven’t even gotten all my thoughts out of my head yet so I am just going as I think of it for much of this. Thanks again! Let me know if stuff needs clarifying.

  • 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-27T22:49:30+00:00Added an answer on May 27, 2026 at 10:49 pm

    There are two levels of optimisation that need to be considered.

    1. the overhead of parsing and constructing the the object graph
    2. the overhead of loading from disk

    For the first consider low overhead serialisation such as JSON (as @Perception has pointed out) but perhaps you should consider binary serialisation as this will load the quickest.

    For the second consider using OS technology such as memory mapped files to help you.

    But in all questions of optimisation I must say – first measure measure and measure again to determine where the real performance concerns are.

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

Sidebar

Related Questions

I am attempting to create a text-based adventure game for class, but I have
I have just started learning OpenGL and I am attempting to make a game
If have I have a game engine that has multiple threads that all work
I have this game where balloons are coming from bottom and player has to
I have this game with some variety of textures. Whenever I draw a texture
I'm attempting to implement a Save/Load feature into my small game. To accomplish this
I'm attempting to write a browser game using Django but I'm getting a bit
So, i'm attempting simple card game. I have player class with draw function, and
Does attempting to develop some sort of game, even just as a hobby during
I'm attempting to use Raphael to make a small game, and just want a

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.