I am in the process of making a top-down 2d rpg, and was wondering how should I save the map as. At the moment I am just using a 1d int array, but would quite like to have more info, like solid etc. I read somewhere that xml is quite good?

Storing a tile-based map? XML is not ideal for this, no. It might be good for map metadata, but you're going to want to come up with a more compact format for the tile data itself. If you're streaming in the map data in chunks, that's also going to affect your format, so there's no hard and fast answer that works for every map type.

Just a simple txt file is a good 1st step. Just write your array into your file element with a loop, and separate them with a comma (,). When you read in your map data, just read in the entire line and use String's split to get your map in one go. Then you can loop through and for each one, use Integer.parseInt(splitArray);

Of course, ideally it would be better to make a map editor that saves it in the right format.

I can recommend to take a good look at Tiled, which is a general 2D map editor that can store map data with XML and JSON. The data format of the grid can be plain or compressed.There are at least 2 implementations in Java for reading this format as well.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org