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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:22:47+00:00 2026-06-11T09:22:47+00:00

Background I have written a simple WebGL puzzle game and I want to allow

  • 0

Background

I have written a simple WebGL puzzle game and I want to allow people to design and share their own levels.

My idea was to store the level data in the query string of a URL. This would then let people simply share the URL if they wanted a friend to try the level.

What is a good way to store game data in a query string?

What I’ve tried

Currently I generate a URL via

"penguins.html?data="+encodeURIComponent(JSON.stringify([X,P]));

This first converts the data to JSON:

[[[[3,-1,0,0,0],[4,-1,0,0,0]]],[{"x":20,"y":20,"dx":0,"dy":0,"vy":2.9999999871229686,"vx":0.0002779607689814708,"thetaf":180,"speed":3,"type":0,"state":6,"steps":0,"numfish":0,"d":4,"size":8},{"x":60,"y":60,"dx":20,"dy":100,"vy":97.51615330485151,"vx":-78.06665276994102,"thetaf":0,"speed":3,"type":17,"state":0,"steps":0,"numfish":0,"d":15,"size":89.00000012433019}]]

and then escapes it to become:

[[[[3%2C-1%2C0%2C0%2C0]%2C[4%2C-1%2C0%2C0%2C0]]]%2C[{%22x%22%3A20%2C%22y%22%3A20%2C%22dx%22%3A0%2C%22dy%22%3A0%2C%22vy%22%3A2.9999999871229686%2C%22vx%22%3A0.0002779607689814708%2C%22thetaf%22%3A180%2C%22speed%22%3A3%2C%22type%22%3A0%2C%22state%22%3A6%2C%22steps%22%3A0%2C%22numfish%22%3A0%2C%22d%22%3A4%2C%22size%22%3A8}%2C{%22x%22%3A60%2C%22y%22%3A60%2C%22dx%22%3A20%2C%22dy%22%3A100%2C%22vy%22%3A97.51615330485151%2C%22vx%22%3A-78.06665276994102%2C%22thetaf%22%3A0%2C%22speed%22%3A3%2C%22type%22%3A17%2C%22state%22%3A0%2C%22steps%22%3A0%2C%22numfish%22%3A0%2C%22d%22%3A15%2C%22size%22%3A89.00000012433019}]]

Drawback of current approach

This approach works fine for small levels, but for bigger levels I get the error:

414. That’s an error.

The requested URL /penguins.html... is too large to process.

It seems that my current host (Google Appengine) has a limit on the length of the URL.

Question

Is there a better way in Javascript to store my game data (i.e. which would result in a shorter URI)?

  • 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-11T09:22:48+00:00Added an answer on June 11, 2026 at 9:22 am

    I’ve done something similar where I make a POST to GAE with the JSON data and store it in the datastore with a generated key and return a url based on that key for the user to share.

    So you make your post of the JSON data. You store that data in an object like:

    /* Annotations ommitted */
    public class GameInfo {
        public JSONObject gameData;
        public Integer key;
    }
    

    The key is an auto generated int. Then you return to the user a url like: http://www.mygameurl.com/games?id=1234 with id corresponding to the generated key. Then you can let the user share that url to get the game data back from the datastore. It shortens the url that the user is sharing and prevents them from messing with the url and breaking the game data.

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

Sidebar

Related Questions

I have written a application which runs in the background. I want to write
Background I have written very simple BBCode parser using C# which transforms BBCode to
I have written a simple class to play audio files in a simple game.
I have written a very simple Chrome extension. It consists of this background page:
Background: I have written a java swing based client server application. The server is
I have written an app which can talk to server via background service to
I've written this fiddle to demo the problem. I have a simple form. When
i have a simple question. for a website, i want to create an info
First, a little background : I have written a little application in python with
Background: I recently completed a tic-tac-toe game in AS3, using some simple function-based code

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.