Sure. You can do enough with the map engine to make random maps, or to generate and expand it forevermore. In fact, I remember seeing a demo of random map generation a few years ago, though that was an example of pre-generated stuff, not procedurally generated stuff. Not sure where it (or the person who made it) went.
Use these functions to your advantage (
check the wiki for usage instructions):
- Add new layers: GetMapEngine().layerAppend()
- Change a layer's size: SetLayerWidth(), SetLayerHeight()
- Edit the tiles on a layer: SetTile()
- Change the tile graphics: SetTileImage()
- Re-save an existing map as another one: GetMapEngine().save()
- Edit most things about a sprite (including directions and graphics).
Also use an UpdateScript that keeps track of where you are so you can start expanding and generating the map when necessary.
Also, here are some things you simply
cannot do and need a workaround for:
- You cannot generate a brand new map file; you need to have one. (Unless you're painstakingly reimplementing the map file format using the RawFile functions.) Recommended is that you already have a single small empty map.
- You cannot edit maps when the map engine isn't open. It needs to be open.
- You cannot set the tile size. Better have made up beforehand how big you want your tiles to be.
- I'm pretty sure you can't generate new persons on a map, but you'll have to experiment with CreatePerson() and
- You might not be able to create new directions in a spriteset. (Those apparently require a SpritesetDirection object of which there is no constructor provided in JS...)
As for good algorithms to generate the landscape, I have never dabbled in that so I don't know.