Sharing custom levels.

Ive started work on porting my tile based puzzle game to java, targeting desktop and android. The game has a built in level editor and I want to work out a system for people to be able to share their custom levels/level-sets. If I set up a website to host the files, perhaps the game could upload/download with FTP. The individual level files are less than 8kb, so they will be easy to quickly transfer.

It would be nice to have a method of users rating the levels on the website and being able to search for particular things, I’m sure thats easy to do in a browser but it would be better to have that functionality built into the game particularly so that it would be simple to get new levels for the android version.

Does anyone have any experience with this idea, or some pointers to useful articles?

-edit: Im using libgdx if thats any help.

I have absolutely no experience with this what so ever, but if you actually get this working, it be bad azz!

You can load your levels from images. I don’t know the size of your maps, but even big maps (200 x 200 tiles) can be stored inside one small image (200x200 pixels image = 505 bytes).
Images are easy to share and easy to download. You can also load them inside your android game and save the map information with Shared-preferences (for example).
For computer you can create one folder called “maps” or “levels” and store all images there.

Just my opinion, not sure if this is what you wanted (one way to save/share levels).

[quote]You can load your levels from images
[/quote]
I have my levels stored in a plain data file, it stores more complicated information than an image file would allow. What I want to work out is methods of actually sharing those files with other players.

I use hybrid.

Image for tile data, text files extra metadata.

Works well for tile-based games.

My first thought is: youre going to build a simple web service. Why not avoid doing many things double and go for a great ready-made implementation of a webserver with REST framework, see for example:
http://restx.io/ or http://restlet.org/.

This web service would then offer a back end (retrieving levels, adding levels to the level repository) that would be both useable by a website (if you like) and from within the game itself, be it android or desktop.

For example a HTTP GET from:

<myserver>/levels/newest     returns the 100 newest level ids (and name, creator etc)     
<myserver>/levels/best                    returns the 100 best level ids etc
<myserver>/levels/56634                 returns a specific level

HTTP POST to:

<myserver>                           would allow adding new levels (youd need checks for security and to avoid spam though)

I dont think FTP will be particularly suitable for this sort of thing, but I’m not too sure. If you know some web service development this would get you going and conform to many best practices quickly. Otherwise it may be a bit of learning to understand how web services and RESTful services work. Good luck!

I would use a php server and put the levels into a database (in my case I would use mysql) :slight_smile:

I like to encode levels as text which can be shared on forums. All you have to do is watch out for characters that forums use like ‘[’ or white-space characters. Levels larger than 20kb start to pose a problem though because of the post length limitations.