• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
SonicD007

Unity 2D tiled maps

4 posts in this topic

Is there any easy way to create tiled maps in unity 2D?  If not, I would like to use tiled to create a map in the tmx file format to then import that tmx file into unity.  I realize I'll probably have to create an importer for unity to be able to understand the file but I'm not sure how to create custom importers for unity 2D.  Is it only available in the Pro version?

0

Share this post


Link to post
Share on other sites

There are already a bunch of tools that can import from Tiled to Unity listed HERE :

Unity 3D
  • Orthello Pro (2D framework) offers Tiled map support.
  • Tiled Tilemaps library by Karnak Games adds support for Orthogonal TMX maps to Unity, with automatic collision detection.
  • Tiled To Unity is a 3D pipeline for Tiled maps. It uses prefabs as tiles, and can place decorations dynamically on tiles. Supports multiple layers (including object layers).
  • Tiled2Unity exports TMX files to Unity with support for (non-simple) collisions.
  • UniTMX imports TMX files into a mesh.
Edited by metaldev
2

Share this post


Link to post
Share on other sites

Hi Sonic, if you're working in Windows then I think Tiled2Unity is the only Tiled-to-Unity pipeline utility that easily allows you to add complex colllisions to your maps. That's why I wrote it. :)

 

I've made it easy to use and I've got more tutorials coming soon to my blog. In any case, give it a try and let me know what you think.

 

http://www.seanba.com/introtiled2unity.html

1

Share this post


Link to post
Share on other sites

Making a tile engine in 2D is very easy, especially  using unity. (: 
Basicly you only need 3 main functions. 

generateTileMap() {

    This Function is gonna "generate" the values, to fill into a 2D array (public int[][] foo = .....). so basicly the information you need for the different block types.

 

}

 

buildTileMap () {

    in here you are gonna go through your 2d array "foo" and place a different texture, decided by the value at it's cords in the 2d array. 

 

}

 

generateCollision() {

    This is basicly where you make the collisions, also decided by the value value at it's cords in the 2d array. for example. 

    

    for (int x = 0; x < blocksX.length(); x++) {

         for ( int y = 0; y < blocksY.length(); y++) {

               

               if (Block[x][y] == 1 ) { // Dirst Maybe

                   Collider();

               } else if (Block[x][y] == 2) { // Water maybe

                  then execute whatever you want to happen when in the water. 

 

               }

         }

    }

   

}

 

And just so it is said!! d: 
The code above is NOT! working code. it is only for example purpose, i'm not really sure if it is half java and half c++, havent really written in c in a while. So dont copy paste any of the code, it surely wont work. (: 

Hope you make it work, if not i think i have an old project laying around, where i build a 2D tile engine you could take a look at. you can just pm me. 
Sincerly WunderStrudel.

1

Share this post


Link to post
Share on other sites

Do you want to do anything specific with your tile map? Are these tiled sprites used for animation? Are these terrain? Different types of tile maps *should* be implemented differently... Here is a sprite tile map example from an old C# project of mine.

private Bitmap SelectSprite(string imageloc, int x, int y)
        {
            // Create a Bitmap object from a file.
            Bitmap myBitmap = new Bitmap(imageloc);

            // Clone a portion of the Bitmap object.
            Rectangle cloneRect = new Rectangle(x * 32, y * 32, 32, 32);
            System.Drawing.Imaging.PixelFormat format = myBitmap.PixelFormat;
            Bitmap cloneBitmap = myBitmap.Clone(cloneRect, format);

            return cloneBitmap;
        }

Here is it's usage:

 public void DrawCharacter(PictureBox CharPictureBox, PictureBox MapPictureBox)
        {
            SetSpriteBMP(SelectSprite(GetSprite(), 1, Direction));
            CharPictureBox.Show();
            CharPictureBox.Location = new Point(X_Location * 32, Y_Location * 32);
            CharPictureBox.Parent = MapPictureBox;
            CharPictureBox.Image = GetSpriteBMP();
        }
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0