• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Procedural map generation

139
Posts
8
Years
  • Hi all!

    I've been tinkering with a pokemon project written in Java for a long time (I often lose motivation for months and come back to it, so it may never truly be 'finished'). The main thing I'm doing differently (aside from coding the game engine from scratch...) is to generate the game map randomly - just wanted to share some screenshots I took with the camera zoomed way out to showcase some generated regions!

    OjcumLA.png


    Sv9rrvT.png


    aItMjMs.png


    In these screenshots, each pixel is 1 map tile - you can kind of make out the paths through the towns/routes, and the distinct red and blue roofs of the pokemon centers & pokemarts. I had been wanting a better way to visualize the map features apart from the in-game Town Map, so I just tweaked some variables to take these and thought they looked kind of cool.

    I put this in 'discussion' instead of 'developing projects' as I'm not sure I want to take the time to compile all the details of the project, but wouldn't mind talking about it if anyone is curious. I did make a post about the project several years (yikes!) ago, but it's pretty outdated - although probably not as outdated as you might expect for that length of time.
     

    DarkDoom3000

    Super Pokemon Eevee Edition
    1,715
    Posts
    19
    Years
  • Wow... I must say that's kinda amazing.

    Could you post a zoomed in version of a portion of one of those maps? I'd like to see what it looks like up close.

    I've tried making procedural general systems in the past (for unrelated games) but they never really turned out well.
    your ones look amazing, especially how "realistic" the region itself looks.

    Are you attempting to do a fully procedurally generated game where each time you start a new game, you get a new region?
    I always throught it would be cool to play a rouge-like pokemon game.

    Especially seeing how popular nuz-locke runs are.
     
    Last edited:
    139
    Posts
    8
    Years
  • Hey thanks! Yes - the idea is the whole region is procedurally generated. It's actually well on it's way to being that (the game is playable, just there are bugs and a lot of missing features). I was thinking maybe at some point adding some options for nuzlocke or other types of runs, but nothing like that exists yet.

    I got a few screenshots for you - these are from a slightly more recent build. In the original ones I posted you might be able to barely tell that all the walkable areas are totally flat - recently, I tried adding ridges that extend through the map areas for a little more variety, but it's been very challenging to get working right without blocking off areas. I added left/right stairs and even stairs that can descend from south -> north to alleviate some of the connectivity problems but it's still resulting in blockage pretty often. Plus it looks quite ugly lol.

    Here's an example of a route with no ridges going through it:

    https://i.imgur.com/dqFPVCu.png

    And here's one which does have some:

    https://i.imgur.com/fHPTYOC.png

    Here's an example of a town, which also has a Jungle biome route north of it:

    https://i.imgur.com/8yfZjMh.png

    And here's another town that's bordering the ocean (but no ocean route), which also shows a desert nearby:
    (this one you can really see how much of a mess the ridges are at times)

    https://i.imgur.com/oBL47hA.png

    Also here's what the Town Map looks like (the dimensions are off because of how I zoomed the camera out, normally the corner of the screen is just past where it says "Route 1" and you can pan the map around):

    https://i.imgur.com/ykMhYHG.png

    So yeah, basically you could technically play through the game in it's current state, assuming the ridges play nice and don't block your progress. There are 8 gyms, and trainers, the routes are assigned levels increasing from the starting area (though nothing stops you from entering a higher level area than you're ready for)

    It's just kind of boring at the moment! I've been stuck on this ridge problem for a while - I might just remove them or heavily simplify it somehow. Open to suggestions tbh, it feels like I can't really add anything while they are sorta game breaking!
     
    139
    Posts
    8
    Years
  • I thought I would do a small update on this. I mostly fixed the issues with ridges blocking off areas by preventing any sharp increases in terrain height, while also constraining increased elevations to regular sized 4x4 areas of tiles (this prevents a problem where you can get long zig-zags of ridges where stairs aren't placeable, effectively blocking off areas). It looks a little bit less natural, but I think it's a decent compromise.

    On top of that, I also spent some time to add sandy beaches & the animated waves on the shoreline! Doesn't add much in the way of gameplay, but it looks more interesting!

    J0vgX4n.png
     
    28
    Posts
    7
    Years
  • Hey, this looks so amazing! Is it possible to do this with other tileset styles e.g. Gen 4?

    I know that this is supposed to be a game on its own, but I think this can be a tool for fan-game developers as well, sort of like a starter kit like Essentials. Basically, the procedural map, trainers, and gym acts as game foundation and developers can edit it manually to create custom content. That way, we can know what features can be added and/or improved~

    I'd like to hear your future plan with this engine. Will be delighted to see more progress~

    (There are many potential area to be explored tbh. Cave, aquatic route, Icy area with that sliding ice puzzles, weather system, procedurally generated gym puzzles. If you have story idea you can even take it even further to procedurally generated narrative/quest)
     
    Last edited:
    139
    Posts
    8
    Years
  • Hey, this looks so amazing! Is it possible to do this with other tileset styles e.g. Gen 4?

    I know that this is supposed to be a game on its own, but I think this can be a tool for fan-game developers as well, sort of like a starter kit like Essentials. Basically, the procedural map, trainers, and gym acts as game foundation and developers can edit it manually to create custom content. That way, we can know what features can be added and/or improved~

    I'd like to hear your future plan with this engine. Will be delighted to see more progress~

    (There are many potential area to be explored tbh. Cave, aquatic route, Icy area with that sliding ice puzzles, weather system, procedurally generated gym puzzles. If you have story idea you can even take it even further to procedurally generated narrative/quest)

    Hi! Thanks for your interest :)

    I've been making this as it's own engine partly just so I have the most control of it, but also because I previously thought it would be difficult to integrate with an existing toolset (kind of a bad assumption tbh - I started this project years ago). I recently learned Essentials/RPGMaker just uses a .json format for map data, so it's probably within the realm of possibility to have my existing code modified to output to this format with some work. I am not sure how hard it would be to also output trainers, items, or scripts in this way as well - but, I have at least a basic framework for these things in my own engine, so the procedural part is definitely doable. I have a lot of ideas but not that much time to implement them, lol. But I do plan to add more "biomes" for more diverse environments, as well as side areas such as caves and perhaps a very basic plot. I don't "officially" have support for alternate tilesets, but with a bit of grunt work you could just copy in textures with the same names in the resources folder.

    I think a big advantage to switching gears and making it output stuff for use with Essentials would be saving me the work of trying to re-code all the battle mechanics and such. I still only have a fairly basic version of this in my game (no abilities, no held items, lots of missing moves that do specific things like weather, or Transform for example). It's kind of fun to recreate it, but also it's been done before and probably better, so idk if it's worth it. I suppose my engine might have the advantage of being better performance than essentials in it's current state, just because it doesn't have the overhead of RPGMaker that needs to support many different kinds of RPG games. For now, I'm going to keep working in my own engine as I don't own RPGMaker, but definitely will be receptive to what other people think.

    Progress is pretty slow since I work full time and do other things, but I will keep updating here as I add new stuff!
     
    22
    Posts
    5
    Years
    • Seen Sep 8, 2023
    Looks really good maybe talk to Kingcoin on the Pokemon Reborn site because he was working on something like this.
     
    2
    Posts
    5
    Years
    • Seen Dec 19, 2019
    Dang, this is some great work. Like DarkDoom said, a rogue-like Pokemon game would be incredible with this kind of tool, and I don't know what kind of magic you did to make all these routes look so natural and detailed, but it looks amazing. Personally, I love writing and lore, and I can see this tool being a way to iterate quickly on ideas or make the foundation of them. The maps you posted look entirely like they could almost be taken directly from these pictures and rebuilt in other programs - who cares about porting them when you've made a one-to-one tile/pixel image; that's already the most time consuming and difficult part of ROM hacking taken care of.

    This kind of tool is exactly what is needed for ROM hacking in the future, and it leads the way for more interesting mechanics since there's less time pressure on worldbuilding. Being able to generate regions like that, I can see projects down the line making the systems that innovate on the Pokemon series that people have been waiting for from the real games for a decade. I hope other people jump on this line of thought and make similar tools as well.

    To clarify, are you going to make a game from a generated map? Or is the random generation part of the game (i.e. rouge-like)? Or is it just a tool you're making?

    This is insanely cool, keep it up!
     
    139
    Posts
    8
    Years
  • Hey! So to answer your question, I wouldn't call it a roguelike in it's current form, although you could certainly repurpose it for that type of thing. You could also use it to just output maps and then edit/recreate them manually somewhere else, I suppose - but, the original plan was to get a new region generated when you launch the game: fully playable with routes, cities, wild pokemon, trainers, gyms, items, etc. So, all the map generation happens on startup and not during runtime, and it does not produce infinite sized maps like Minecraft, for example. I think the kind of vague vision for it I had, was that you could launch and play a new region which more or less acted like a standard Pokemon game, but with the exploration aspect being fresh each time since the map would always be different. And, as a bonus, you could share world seeds with people and try to race to completion on the same region or do various challenges like nuzlocke, etc.

    It has taken a long time to get it to look the way it does, and when I look at the zones myself I still see a lot of glaring features that expose the underlying generation logic, but overall I'm pleased with the progress of the results. Basically, there's several layers of generation that control different aspects of the map - it's a bit involved to go into every detail, but not horribly complex at its core. Mostly, I'm making use of a combination of already used procedural map generation methods including noise functions, cellular automata, and binary space partitioning in some cases. Then the texturing has it's own logic to make it look more seamless.

    I'm kind of torn at the moment because I really don't think I want to rewrite the compexities of the battle system, even though I have a basic one working in my engine. I'm certain that existing engines have probably done it better so was looking at ways of possibly exporting the generated maps, but certain shortcuts I did which are handy in my engine are not friendly to direct conversion to a tileset without a rework, among other problems :)
     
    115
    Posts
    11
    Years
    • Seen May 17, 2023
    the beach map looks great ^^
    can I download this somewhere? I'm doing a quick pokemon hack, and this would save me time trying to design maps.
     
    23
    Posts
    9
    Years
    • Seen Apr 10, 2024
    i second the request for the a download link if you are willing to share? I'm not very good at map making and would love to use your tool.
     
    139
    Posts
    8
    Years
  • Hi guys! I don't have a download to share at the moment - not because I'm not willing to share, I just don't think it's really in a "usable" state yet for the purposes of just generating maps to use in rom hacks/RPGMaker projects. However, I do have an update to share!

    I was able to tinker around and output my current algorithm's maps into RPGMaker XP .yaml files for all the maps in a region, as well as the MapInfos.yaml entries needed to open them in the map editor there. It's still a manual process to convert the .yaml back into .rxdata files (using a neat Ruby gem I found called rvpacker), but the results are promising so far! The only issue is it pretty much needs to be hard-coded to work for a specific tileset, here I'm just using the default outdoor tileset:

    8vSMgbL.png


    All the maps you see listed in the corner (City 1, Route 1, etc) are the full region, just missing the connection data and currently there are no items, trainers or scripts or anything. Some textures are still a little janky due to some shortcuts I used in my own code that aren't available in RPGMaker, but I've been able to polish up a lot of them already, going to keep working on it in the coming days.
     
    139
    Posts
    8
    Years
  • Looks really good maybe talk to Kingcoin on the Pokemon Reborn site because he was working on something like this.

    You know what, I didn't think about it but I actually spoke to him briefly way back in 2017, his project seems really cool. I don't see anything from him posted newer than 2018, but curious how far he managed to get with it.

    In other news, I'm now able to export all my map data into RMXP along with working connection data, wild encounters, and also items on the map. I think it should be possible to add trainers as well, but would probably just give them all some default dialog to say which you'd have to go and edit. I have procedural dialog in my own engine but since there isn't that much of it written, most of them use placeholder anyway.

    I haven't exported building interiors or their door "events" yet, since then I'd be working with multiple tilesets which could get tedious, but it's definitely possible to do. But tilesets in general needing to be specifically coded for kind of raises some questions about what I should do going forward, because I ideally would like to create a lot more biome types which may necessitate one or multiple custom tilesets if I were to export them.

    So, I am kind of at a crossroads and taking feedback on where to go with this, there are a lot of possibilities.

    For starters, I think I will at least take the parts I have been able to export and make a very simple front end for it so people can get their hands on it and mess around with generating maps for RMXP. It isn't super dynamic or robust, and some maps will need manual edits to be fully traversable due to the lack of left/right stairs, or texturing fixes (particularly for desert maps), but hopefully will be enough to kind of gauge the interest in such a tool. As far as I know, you would also need rvpacker to convert the .yaml files my code outputs into .rxdata, so not sure if I should just include setup instructions for that or if people have another way of doing it that's better.

    Apart from that, I personally still like the idea of a whole random region ready-to-play, but others might be more interested in a more customizable tool that just generates individual routes or towns, with some sort of preview, that you could then export.

    I think I'm leaning towards sidelining the engine part of my java project and focusing more on the procedural generation (you know, the actual fun stuff), and plan on exporting to RMXP. Maybe alongside that, I could also create a tool for individual maps.
     
    32
    Posts
    8
    Years
    • Seen May 6, 2020
    I probably have never seen an idea with more potential for making pokemon games. Ever.

    I am going to bookmark this until later, maybe for my "next" project when I understand coding better.
     
    77
    Posts
    4
    Years
  • This is a fantastic idea! This could turn into the world's first rogue-like main-series style Pokémon game! Every time the player starts the game, you could give them a random starter, random map, random gym leaders, etc. If you are defeated in battle, you will lose all your current progress, but perhaps save some of the major items/achievements/etc. that you found on that play through. Endless replay value!
     
    10
    Posts
    5
    Years
    • Seen Jun 17, 2023
    The idea of procedural generation does have some merit. It makes the game more replayable which is cool, but it also makes a bunch of your maps incredibly boring and redundant. Make sure that you're using this to create content for your game and not reuse content. I would probably try creating as many great route "sections" as you can and then composing routes randomly of those sections. This way they're random but you'll have better control over the quality that way.
     
    Back
    Top