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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:43:11+00:00 2026-05-23T15:43:11+00:00

I am writing a game for iOS that uses .tmx map files. I am

  • 0

I am writing a game for iOS that uses .tmx map files. I am creating the maps in the application ‘Tiled’ and then at some point before they get to iOS, I’m parsing them with Perl.

When I save the files as straight XML, it’s a cinch for perl to parse them. However, cocos2d insists that the files be base64-encoded. The ‘Tiled’ map editor has no problem saving files with this encoding scheme, and iOS reads them just fine, but it’s presenting problems for my perl code.

For some reason, the standard MIME::Base64 decode_base64() method in perl is not cutting the mustard here- when I decode the strings, I get one or two binary characters– question marks in diamond boxes and such.

And the vague documentation for the TMX file format makes it unclear if there is some other encoding going on before or after the base64 encoding which might be causing this problems. I looked at the cpp source for the encoder, and I saw lots of references to Latin1, but I couldn’t decipher what’s going on in detail.

I noticed that when I tried doing my own tests with MIME::Base64, encoding and then decoding a test string, the encoded text looks dramatically different than that which I see coming out of the TMX files– for instance, my base64-encoded text for a short string looks like this:

aGVyZSBpcyBhIHNlbnRlbmNl

But the base64-encoded text coming from the TMX files looks like this:

9QAAAAABAAANAQAAGAEAAA==

Any suggestions on what else I might try in attempts to decode a string that looks like that?

  • 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-23T15:43:12+00:00Added an answer on May 23, 2026 at 3:43 pm

    I think this page might be what you’re looking for. It suggests that first you decode_base64, then (if the compression="gzip" attribute is present) use gunzip to uncompress it, and finally use unpack('V*', $data) to extract the list of 4-byte little-endian integers.

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

Sidebar

Related Questions

I'm writing a game in Android that uses a custom XML format to describe
I'm writing an iOS game that draws many cubes on screen, but I have
I'm writing a game for iOS. It has a game map, and I'm using
I'm writing a game which uses a border layout with a JPanel using BorderLayout.CENTER.
I'm writing an iOS game (Using UIView), which has a randomly generated 2D city.
I'm writing an OpenGL ES 2.0 game (on iOS). How can I create a
I am writing a simple soccer game in cocos2d-x and recently found out that
I'm writing a game in Java and this is the first one that I'm
I am writing a game in Python (with pygame) that requires me to generate
I'm writing a little cross platform game engine for iOS, Android and BADA. I

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.