1. Announcing Mekorama on the Web!

    Now anyone can play levels from the forum online, with one click!

    Dismiss Notice
  2. Psst! If you're new here, welcome! Please visit these pages first for information about the forum and Mekorama:

    Welcome! ¡Bienvenido! Selamat datang! Добро пожаловать! Willkommen!
    Everything you want to know about Mekorama
    Frequently Asked Questions

    Dismiss Notice

MekoLab - Mekorama Level Editor

Discussion in 'General (Issues, Help, Discussions)' started by Labyrenight, Aug 18, 2025.

  1. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    Hello everyone!

    I'd like to share a new web-based application I've been working on called MekoLab.
    It's a simple tool that allows you to quickly replace blocks in Mekorama levels by editing the QR code data.

    This project would not have been possible without the amazing research and reverse engineering work done by this community.
    A huge thank you to everyone who contributed to the reverse engineering thread, especially the original poster, @QuantumForce .
    Your research was the foundation that allowed this web app to be built.

    I would also like to express my gratitude to @Gepeto who generously shared parts of the source code from Mekostudio. His code served as a reference and guide during the development of MekoLab.
    If you are looking for a powerful, 3D level editor, I highly recommend visiting Mekostudio.

    A special thank you to @EL797 and @Denis Nazin for their valuable help in testing earlier versions of this application.
    Their feedback was essential for making improvements and fixing bugs.

    A quick note of caution:
    Please be careful when using this tool with unreleased block types.
    The logic for some blocks, particularly the wheel block, has not been fully implemented.
    Using it might cause the Mekorama game to behave unstably or even crash.

    For more information about the web app, its features, and the libraries it uses, you can visit the official GitHub repository:
    https://github.com/nurularifin04/mekolab

    I hope you find this tool useful.

    Thank you all.

    This text was generated with assistance from Gemini AI :oops:
     
    Gepeto, ohmytian, Rush and 4 others like this.
  2. oiiiriei

    oiiiriei Member

    Messages:
    3
    Levels:
    11
    Albums:
    1
    Likes Received:
    41
    Joined:
    Aug 7, 2025
    It's cool! Now I can make levels with non-strandard blocks easily!
     
  3. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    I added code so we can input the same image when a block has been changed.
    Code:
    event.target.value = '';
    Please clear the cache for this to work, or open this and refresh.
     
    Last edited: Aug 20, 2025
    MekaSage and oiiiriei like this.
  4. MekaSage

    MekaSage Famous Member

    Messages:
    251
    Levels:
    51
    Albums:
    4
    Likes Received:
    1,430
    Joined:
    Oct 27, 2020
    @Labyrenight - in the "New Orientation" menu, is there an easy way to interpret what is meant by "head" and "body" for a block? I understand that there are 24 possible orientations for a block, but due to the symmetry of certain pieces, many of the positions are equivalent to each other.
    But I'm having a hard time understanding what the various position combinations mean.
    Screenshot_20250820_130601_Chrome.jpg
     
    oiiiriei likes this.
  5. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    Orientation 0: Imagine robot B in its normal position. Its head (eyes) is up, and its body faces forward (z+ axis). [head = up, body = front]

    Orientation 1: Robot B is rotated 90 degrees ccw on the y-axis, which means its body now faces left (x+ axis) while its head remains up (y+ axis). [head = up, body = left]

    What if [head = down, body = right]?
    The head is down and the body faces right. From its normal position, this means the block has been rotated 180 degrees on the x-axis and then rotated another 90 degrees ccw on the y-axis.

    look at the rotation on the metal wedge below. the metal cube is used as a marker.
    Screenshot_20250822-185655.png
     
    MekaSage and oiiiriei like this.
  6. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    There's an issue with the jsQR library, which can't read QR Code version 23. I've found the error:
    Code:
    alignmentPatternCenters: [6, 30, 54, 74, 102]
    The correct one should be:
    Code:
    alignmentPatternCenters: [6, 30, 54, 78, 102]
    But I can't just modify the library; I have to fork or self-host it and include the license. So it takes time.
     
    oiiiriei likes this.
  7. MekaSage

    MekaSage Famous Member

    Messages:
    251
    Levels:
    51
    Albums:
    4
    Likes Received:
    1,430
    Joined:
    Oct 27, 2020
    Thank you for the explanation, @Labyrenight. And thanks for building Mekolab!
     
  8. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    jsQR has been modified, please clear your cache.
     
    oiiiriei likes this.
  9. Kanchan yadav

    Kanchan yadav Well-Known Member

    Messages:
    20
    Levels:
    92
    Albums:
    5
    Likes Received:
    558
    Joined:
    Jul 3, 2023
    This was amazing, I used it
     
  10. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
  11. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
  12. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    Sorry, there was a wrong font on the Fake Motor block. I've fixed it, if there's anything else wrong please let me know.
     
    MekaSage and EL797 like this.
  13. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    I'm currently working on a new code. Hopefully, it'll be completed successfully.

    Screenshot_20251102-170527.png
     
    MekaSage and Kanchan yadav like this.
  14. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    Back to Python to make it easier to create tensor/ndarray logic. The goal is to rotate all blocks.
    Code:
    def index_to_coord(index, size):
        sss = size * size * size
        if index >= sss:
          print(f"!!! Index ({index}) may not equal or more than Dimension ({sss}).\n")
          return
        
        ss = size * size
        x = index % size
        y = int((index % ss) / size)
        z = int(index / ss)
        return (x, y, z)
     
    def coord_to_index(coord, size):
        if coord:
            x, y, z = coord
            ss = size * size
            index = x + (y * size) + (z * ss)
            return index
    
    def transpose(coord, index_axis):
        # Default index [x, y, z] => [0, 1, 2]
        # index_axis in Array
        if coord:
            x, y, z = index_axis
            newx = coord[x]
            newy = coord[y]
            newz = coord[z]
            return newx, newy, newz
    
    def reverse(coord, size, index_axis):
        # Default index [x, y, z] => [0, 1, 2]
        # index_axis one of them
        if coord:
            x, y, z = coord
            if index_axis == 0:
                x = size - 1 - x
            elif index_axis == 1:
                y = size - 1 - y
            elif index_axis == 2:
                z = size - 1 - z
            else:
                return
            return x, y, z
    
    # Dimension
    dim = 4
    
    # Index in 1D Array
    idx = 0
    
    # Transpose x <--> z
    tpose = [2, 1, 0]
    
    # Reverse at x, y, z axis
    xrev, yrev, zrev = [0, 1, 2]
    
    coord = index_to_coord(idx, dim)
    index = coord_to_index(coord, dim)
    new_coord = transpose(coord, tpose)
    new_index = coord_to_index(new_coord, dim)
    yrev_coord = reverse(new_coord, dim, yrev)
    
    print(f"Dimension = {dim}x{dim}x{dim}")
    print(f"Input Index = {idx}")
    
    print(f"\n# Coord = {coord}")
    print(f"# Output Index = {index}")
    
    print(f"\nIn/Out isEqual = {idx == index}")
    
    print(f"\nTranspose = {tpose}")
    print(f"# New Coord = {new_coord}")
    print(f"# New Index = {new_index}")
    
    print(f"\nReverse ({yrev}) y axis")
    print(f"# New Rev Coord = {yrev_coord}")
    
    # Rotation y axis
    rot_90 = reverse(transpose(coord, tpose), dim, xrev)
    rot_180 = reverse(reverse(coord, dim, xrev), dim, zrev)
    rot_270 = reverse(transpose(coord, tpose), dim, zrev)
    
    print("\nRotation 90")
    print(f"# New Coord 90 = {rot_90}")
    
    print("\nRotation 180")
    print(f"# New Coord 180 = {rot_180}")
    
    print("\nRotation 270")
    print(f"# New Coord 270 = {rot_270}")
    
    By the way, I'm having trouble designing a good editor interface.

    The first version didn't have complete visual blocks. But I also couldn't create a 3D model yet.

    I was thinking of creating a 2D visual in layers. The layers would contain 16 x 16 blocks, but the layout would be very long considering there are 16 layers.

    If you have any ideas, please let me know.

    List of features we'll try to include:
    1. Rotate all blocks.
    2. Direct link to play at play.mekorama.com
    3. Merge two or more levels (as long as the author name is the same).
     
    Kanchan yadav and EL797 like this.
  15. MekaSage

    MekaSage Famous Member

    Messages:
    251
    Levels:
    51
    Albums:
    4
    Likes Received:
    1,430
    Joined:
    Oct 27, 2020
    The new feature ideas sound great.

    For the editor interface, maybe the user would start out seeing the entire 3D model, but have the option to select one horizontal or vertical layer at a time. The selected layer would remain fully visible, and the neighboring layers on either side would become semi-transparent. The rest of the layers would be fully invisible. Then you could rotate or replace individual blocks, but still be able to see how it connects to the neighboring blocks (the semi-transparent ones).

    I don't know enough about programming to know how feasible this would be.
     
    Labyrenight and Kanchan yadav like this.
  16. Labyrenight

    Labyrenight Famous Member

    Messages:
    383
    Levels:
    196
    Albums:
    3
    Likes Received:
    2,363
    Joined:
    Jan 22, 2021
    Thanks for the idea.
    Unfortunately, I can't implement it right now.
    Even the code above is a mess after I implement it :rotf: :cry:

    For 3D model, I think Mekostudio is excellent, and of course, the Mekorama application itself. MekoLab is currently intended to replace blocks that aren't available in either application.

    But I don't know what the future holds.

    Rotation Results, excluding orientation.
    mekorama.png mekorama.png mekorama.png
     
    Last edited: Nov 17, 2025 at 9:43 AM
    MekaSage likes this.

Share This Page