Jump to content

Implementing new feature into D2kEditor: A Random Map Generator


Recommended Posts

9 hours ago, Klofkac said:


Oh damn, man! I like that idea, integrating the random map generator.

Designing very large maps from scratch can be pretty difficult for newcomers and veterans alike. It's easy to leave a lot of empty space in a map, but ya know we gotta put a base here, a base there, and then what's in the middle? Although it would be awfully lax to use the RMG exclusively to create a new campaign, it would be incredibly useful as a base to work off of. Please do continue work on this!

As for the existing templates, things look rather square. Not uncool, I mean literally square-shaped. :P If the edges could be made less harsh, that alone could improve the visual quality. Like so:

Otherwise... hmm, how about a "minimum rock tiles" parameter? Either a number of tiles for the average auto-generated rock island to have, or... the number of rock tiles arranged in formation if you want it to be really wide? For instance, if you set it to 4x4, the auto-generated rock island will look really square but there will ALWAYS be enough room for a 4x4 object. It would prevent stuff like this:

And ensure that the rock island could always be built upon. What do you think, is that possible or feasible?

Link to comment
Share on other sites

Wow nice work! Please keep us updated.

Random path finding walk algorithm thing? :)

I once tried it with Perlin (Noise) and Simplex Noise from Eliot Eshelman to get that more islands effect.



Link to comment
Share on other sites

On 3/18/2019 at 11:19 AM, D2k Sardaukar said:

Random path finding walk algorithm thing?

Oh yes, that's exactly it! I even did not know it's called like this or did not read any theory before implementing it. I came up with all the ideas myself.

And yes, I already saw your attempt for a random map generator.

On 3/17/2019 at 2:54 AM, Fey said:


I agree with you. But as I said, I still have plenty of ideas how to improve it, so it will hopefully get much better. This is just the first version I came up with which is creating valid terrain (by valid terrain I mean that all areas - sand, rock - are properly enclosed and there are no tile errors). It just generates the terrain in blind way, not considering anything like size of rock area and other things. This is purely random, only based on fixed probability weight of certain block types (i.e. straight rock cliff block has 10 times more chance to generate than rock-to-sand cliff transition block, but there is no context and surrounding tiles considered).

Anyway, I will provide a preview version of the editor, so you can look how exactly it works and better understand the algorithm and possibly give some suggestions:


Copy BLOXBGBS.ini into Tilesets folder before starting the program. Then create a new empty map and make sure to select BLOXBGBS tileset. Go to terrain editing mode and select any block preset (for example some rock cliff block). Place the block on map. By placing the block you place a "seed" block, which will then extend to more terrain in next steps. You can run manual single step by pressing "Num +" key. You can forcefully undo last step by pressing "Num -", then next step will generate a different block.

If you place a block while holding Shift key, it will automatically run until it ends up by generating whole terrain. Press "Num *" to reset internal structures, so that clean map will be rendered without those crosses and marks.

Have fun!

  • Upvote 1
Link to comment
Share on other sites

Wow, really nice. It is a lot of fun to play with it. Just using the + and - keys you can kinda steer the direction of the 'line'. Just pressing shift and seeing a big map part being filled is also cool, however often it's too wiggly (too random?). On smaller maps it seems to generate slightly better rock area's, not sure.

Some kind of layer on top of the map where you can paint on that gives higher priority to how the random walk should go could be nice.

I'm sure you are aware, but an undoing of the shift-auto-run feature would be useful.

Edited by D2k Sardaukar
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...