Search Unity

UNITMX, A Tiled Map editor TMX Importer for Unity [RELEASED]

Discussion in 'Assets and Asset Store' started by PolCPP, Aug 17, 2012.

  1. PolCPP

    PolCPP

    Joined:
    May 4, 2012
    Posts:
    7
    Basically, i needed an open source way to do tiled maps with collisions in unity for my open game (more info about it here here and here), and since there were none i made one from scratch.

    There are some things that could be improved (like removing doubles) but overall i feel like it's mostly ready for production.

    Check Chaoseiro's repo for now too since it has more updates that i haven't merged yet: https://bitbucket.org/Chaoseiro/x-unitmx

    You can download it (It's Free/libre) and check more details/guide/etc on the project repo

    And since this post looks pretty empty with this, a lil image on how an imported mesh looks in the editor.



    Update: fixed the repo link.
     
    Last edited: Oct 21, 2013
  2. badkenny

    badkenny

    Joined:
    Jun 7, 2012
    Posts:
    7
    Im checking this out, thanks.
     
  3. badkenny

    badkenny

    Joined:
    Jun 7, 2012
    Posts:
    7
    Just a quick comment after getting this set up. It would help to have the package as a unity package so all of the example assets don't lose their references to each other.

    I'll have more feedback after I get a chance to try it out.

    cheers
     
  4. badkenny

    badkenny

    Joined:
    Jun 7, 2012
    Posts:
    7
    Great tool. I added square collision and I am using this in my project now. Thumbs up.
     
  5. PolCPP

    PolCPP

    Joined:
    May 4, 2012
    Posts:
    7
    Thanks, i'll build a unity package once i fix a bug i found (last column items seem to have an incorrect index).
     
  6. Chaoseiro

    Chaoseiro

    Joined:
    Aug 28, 2013
    Posts:
    40
    Hey guys!

    I've forked this project and extended its features. You can grab it here! I'm also uploading it to the Asset Store, let's see if it gets approved :p
     
  7. PolCPP

    PolCPP

    Joined:
    May 4, 2012
    Posts:
    7
    I'll take a look, do you want to merge it with the main branch? While i haven't commited much recently i'm pretty active.
     
  8. Chaoseiro

    Chaoseiro

    Joined:
    Aug 28, 2013
    Posts:
    40
    Sorry didn't see your post :X

    Of course you can merge it :p
    I'll keep developing it, and, at least for now, new features will be added if I need them, as i'm actively using this code, but you are free to suggest or report any bug/error :)
     
  9. PolCPP

    PolCPP

    Joined:
    May 4, 2012
    Posts:
    7
    I should be actively using it when i get some time since i have the project i created this for on pause due to lack of time. So you can expect some feedback from me :)
     
  10. doananhtai

    doananhtai

    Joined:
    Oct 7, 2013
    Posts:
    2
    in Layer.cs
    PosY should be changed as below...


    public List<Vector2> renderUv ()
    {

    List<Vector2> uv = new List<Vector2> ();
    int horizontalCellCount = _tileset.materialWidth / (_tileset.width + _tileset.tileBorder);
    int verticalCellCount = _tileset.materialHeight / (_tileset.height + _tileset.tileBorder);
    float cellWidth = ((float)_tileset.width / _tileset.materialWidth);
    float cellHeight = ((float)_tileset.height / _tileset.materialHeight);
    float borderWidth = ((float)_tileset.tileBorder / _tileset.materialWidth);
    float borderHeight = ((float)_tileset.tileBorder / _tileset.materialHeight);
    int totalCells = _width * _height;
    int dataValue;
    for (int i = 0; i < totalCells; i++) {
    dataValue = int.Parse(_data .ToString ().Trim ());
    if (dataValue != 0) {
    dataValue = dataValue - _tileset.firstGID;
    // int posY = dataValue / verticalCellCount;
    int posY = dataValue / horizontalCellCount;
    int posX = dataValue % horizontalCellCount;

    float u = ((cellWidth + borderWidth) * posX) + borderWidth/2;
    float v = 1.0f - ((cellHeight + borderHeight) * posY) - borderHeight/2;
    uv.AddRange (new Vector2[] {
    new Vector2 (u + cellWidth, v),
    new Vector2 (u + cellWidth, v - cellHeight),
    new Vector2 (u, v),
    new Vector2 (u, v - cellHeight),
    });
    }
    }
    return uv;
    }
     
    Last edited: Oct 21, 2013
  11. PolCPP

    PolCPP

    Joined:
    May 4, 2012
    Posts:
    7
    On mine or Chaoseiro fork? I haven't merged the code yet (lack of time) so i'm not sure if he fixed whatever was broken in there.
     
    Last edited: Oct 21, 2013
  12. doananhtai

    doananhtai

    Joined:
    Oct 7, 2013
    Posts:
    2
    on your "PolCPP-unitmx-2dfc2daa10bd.zip"
    PoxY should be = dataValue / horizontalCellCount; (not = dataValue / verticalCellCount;)

    in any way thanks for your open source code. :)
     
  13. leonardozimbres

    leonardozimbres

    Joined:
    Jul 9, 2012
    Posts:
    29
    Thanks for the open source!
     
  14. Sokken

    Sokken

    Joined:
    Oct 9, 2013
    Posts:
    1
    First of all this is absolutely awesome work.

    I do however have a problem that I am hoping to solve. When the camera moves I am getting a lot of flickering between each tile.
    Does anybody have an idea of what could be done to solve this?
     
  15. haan

    haan

    Joined:
    Oct 20, 2014
    Posts:
    9
    I have one question to ask. I am a beginner to game programming. I wonder that if it is possible not to render whole map but only few tiles of map around player's current position. Because in my race game road is formed doughnut. there is no need to render some parts of map. Especially center of the map.

    Thank you in advance
     
  16. haan

    haan

    Joined:
    Oct 20, 2014
    Posts:
    9
    First of all thank you very much for making it open source. I believe this tool will help me.

    I have one question to ask. I am a beginner to game programming. I wonder that if it is possible not to render whole map but only few tiles of map around player's current position. Because in my race game road is formed doughnut. there is no need to render some parts of map. Especially center of the map.


    Thank you in advance
     
unityunity