• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OpenTibia OT map generator

For generated map in game this is not an issue, I've tested it with your script (i had very bad map generator before) and it worked just fine. No idea how hard it would be for .otbm map
Probably there is need to implement a way to append existing spawn file (if user wants to do it of course) or generate a new spawn xml file, in case of CLI. I will add this to my todos list.
 
## [0.0.8] - 2025-02-07

### Added:
  • Support for the multi-floor feature:
    • Introduced basic multi-level map support using rope ladders or desert ramps as elevation transition elements.
    • Currently, multi-floor is implemented only for the test40 and test30 generation scripts.
  • Added tableMode support to all generation scripts.
  • Added basic generation script and schema file for jungle cave 100x100
  • Added possibility to erase generated map and in the result possibility to generate multiple maps in running TFS, without a need to restart it (usage desc in readme)
  • Created new tomb test script for 200x200 area.
  • Updated the README file.
  • There is no longer need to have map pre-filled with void / water / whatever ground, to be able to generate a map (tool creates tiles, if they dont exist)

### Fixed:
  • Incorrect order of carpet brush creation under borders: Fixed the sequence of carpet brush placement to ensure correct rendering above borders.
  • Incorrect RETURNVALUE_NOERROR value in tableMode flow Fixed the return value of RETURNVALUE_NOERROR, which was incorrectly set to 1 in tableMode, while in TFS, it should be 0. Maybe that was a legacy from TFS 0.3.x / 0.4.x, dont know at this moment.
    • Changes were applied in functions.lua and mockFunctions.lua.
    • Adjusted the unit test testMockOperations.lua to reflect the corrected value.
  • Some minor fixes
 
Last edited:
Thats amazing, thanks! Making it non-developer friendly would be insane (e.g. simple interface to use, idk)
 

[0.1.0] - 2025-02-10

Added:

  • Multi-floor support improvements:
    • Adapted the following generation scripts for multi-floor support:
      • darkWallTomb100: Adjusted for multi-floor compatibility, fixed archway creation, and implemented minor improvements.
      • greyWallTomb40: Adjusted for multi-floor compatibility.
      • jungleCave100, sandCave100: Integrated multi-floor support
      • fixed unwalkable items
      • improved ramps data and added rope spot elevation data.
      • sandTomb70: now compatible with multi-floor generation.
    • Improved elevation function with various fixes and enhancements.
  • Additional background support:
    • Added the ability to use a secondary ground background, e.g., placing red mountains over grey mountains (gen script test70 - sandstone as 2nd main ground).

Fixed:

  • Repeating staircases on consecutive floors:
    • Resolved an issue where stairs were placed at the same position between consecutive floors (e.g., between floors 5, 6, and 7).
  • Autobordering corrections:
    • Fixed issues related to border creation, ensuring more consistent results.
  • Random elevator elements:
    • Corrected the direction of random elevator elements.
  • Unwalkable items and elevation transitions in caves:
    • Fixed issues with ramp data and unwalkable elements, mostly for jungle and sand caves.
    • Added cave rope spot elevation data.
    • Known issue: creation of paths between rooms for caves can go outside the map area.

I would say multi-floor is quite ready, just please dont waste your time and do not generate multi-floor maps without tableMode in TFS ^^

Little teaser:

1739148629646.webp
 

[0.1.1] - 2025-02-16​

Added:

  • Map saving in JSON format feature:
    • Introduced the ability to save generated maps as JSON files, making it easier for further processing and reuse.
    • Added the MapJsonSaver class responsible for serializing map data and saving it in JSON format. This opens up possibilities such as storing maps in a database (likely requiring longtext).
    • Introduced the MapJsonReader class, allowing the loading of maps from JSON files, making it easy to restore previously generated maps.
  • JSON map saving support in CLI mode:
    • Extended the main script functionality to enable saving maps in JSON format while working in CLI mode, increasing the tool's flexibility.
  • Update of map generation scripts:
    • Adjusted existing map generation scripts to support the new JSON map saving and loading functionality, ensuring consistency and compatibility.
  • Code cleanup in main.lua:
    • Refactored the main script file to improve readability.

Fixed:

  • Stability improvements in the small grey tomb generation script:
    • Modified script parameters responsible for generating the small grey tomb, improving its stability and reliability in producing correct generations.
  • Documentation updates:
    • Updated the README file with information about new JSON map saving and loading functionality, along with instructions on how to use it.
These changes introduce new possibilities for managing generated maps, enabling easy saving, loading, and integration with other tools and processes (e.g., a cron job responsible for generating maps as JSON files as separate process, outside running TFS).
 
Last edited:
It's possible from technical perspective, but I will not help with that - no time :/
I couldn't make it good enough so I left this project on hold for now, but when it becomes active, I'll make 1 map per day on my ot tibinha.online AHAHAHAHAHAHA
 
Hi, thanks for sharing this, impressive.

I'm trying to tweak it to make it work with 740-760

the error I get when I try to open it is..Signatures are incorrect.Metadata signature 439D5A33 Sprites signature 349852BE

I've changed inside

LUA:
function MapSaver:saveMap(filename, fromPos, toPos, name)
    local f = assert(io.open(filename, "wb"))

    self:startNode(f, OTBM_ROOTV1)
    self:addU32(f, 3)  -- version
    self:addU16(f, 1)  -- OTBM version
    self:addU16(f, 760)  -- client version (760)

What;s the correct approach here?
 
Back
Top