A guide to level creation with Tiled [ + how to use it with pygame ]

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • A video about Tiled, including terrains, isometric tiles, exporting and objects. I also cover how to import the resulting data into Pygame.
    If you want to support me: / clearcode
    (You also get lots of perks)
    Social stuff:
    Twitter - / clear_coder
    Discord - / discord
    Related videos:
    Introduction to Pygame: • The ultimate introduct...
    Using Tiled with CSV: • Creating a Mario style...
    Cameras in Pygame: • Cameras in Pygame
    Timestamps
    0:00:00 - Intro
    0:02:31 - Fundamentals of Tiled
    0:38:57 - Terrains
    1:11:04 - Isometric tiles
    1:17:27 - Pytmx and Pygame
    Github:
    github.com/clear-code-project...
    Pastebin:
    pastebin.com/dEUVdNip

ความคิดเห็น • 129

  • @KwBeee
    @KwBeee 2 ปีที่แล้ว +68

    You read my mind. I spent hours this past week researching tiled and looking for isometric Python tutorials but couldn't find much in regards to logic behind character collision etc. It is tough to figure out. This is one of the better Tiled guides out there so thanks

  • @kartavianmacrath7219
    @kartavianmacrath7219 2 ปีที่แล้ว +4

    Awesome vid! I learned about the functionality of Tiled, which I have only played with, learned a new module to bring my tmx files over, saving a lot of work later on in the game I am making; and I logical way of thinking to bring the map to the game... Thanks for all the tutorials!

  • @the_foliot
    @the_foliot 2 ปีที่แล้ว +3

    YES. Just the tutorial I needed. Thank you so much. You are my favorite channel on TH-cam.

  • @rianrafsan950
    @rianrafsan950 2 ปีที่แล้ว +16

    Man truly amazing work...you explain to the point...no fuss...just precise programming

  • @vaibhavkrkm
    @vaibhavkrkm 2 ปีที่แล้ว

    Wow! I was really looking to use it in some of my future projects (also in Pygame)! And, I got your tutorials... the best and clearest tutorials! Thankssss!

  • @user-vt9gs6lk5i
    @user-vt9gs6lk5i 2 ปีที่แล้ว +4

    Super excited to watch yet another great tutorial!
    Just want to suggest you to cover tile-based movement design (how games like Baba Is You, Helltaker, Crypt of the Necromancer etc are working).

  • @taunhawk9888
    @taunhawk9888 ปีที่แล้ว

    Great tutorial! Thanks for taking the time to share your experience

  • @cbmeeks
    @cbmeeks ปีที่แล้ว +1

    I sponsored the Tiled project for about two years. Finally starting to use it. LOL. Great tutorial.

  • @mixlaproduction
    @mixlaproduction 2 ปีที่แล้ว +10

    Amazing man.

  • @DYNAMAX_D
    @DYNAMAX_D 2 หลายเดือนก่อน

    thankuo sir , completed the whole tutorial , completed it till the last second , not in one go but still , managed to complete it
    thankyou for posting such informative video

  • @raizenradeonovich1570
    @raizenradeonovich1570 2 ปีที่แล้ว +1

    Thanks for this guide, i have just watched a first video about mario platformer and want to learning Tiled! Thanks, really

  • @bonsaipropaganda
    @bonsaipropaganda ปีที่แล้ว +1

    thank you so much for your free and super high quality tutorials as always. you are helping me learn to program. I'm having trouble finishing this video. when I tryto get the object's type rather than showing the type (for example: 'shape') python is just prints it out as 'None'. I assume this is something I did wrong inside of Tiled. thanks for your videos again and thanks in advance to anyone who might help

  • @gianlucagiuman6132
    @gianlucagiuman6132 2 ปีที่แล้ว

    Really amazing !!! best and clear tutorial :)

  • @stardustmotion
    @stardustmotion 3 หลายเดือนก่อน +1

    edge set feel more like for 2D view/platformers while corner is more for "view from above" / RPG like.
    also super clear tutorial thanks

  • @SWE-from-Sweden
    @SWE-from-Sweden ปีที่แล้ว

    beautiful video, thank you for your time

  • @mohammedmahairy9235
    @mohammedmahairy9235 ปีที่แล้ว

    Great video, the menu works great

  • @Andyyy3
    @Andyyy3 2 ปีที่แล้ว

    i needed this so much .. thank you ♥️

  • @LesFere
    @LesFere 3 หลายเดือนก่อน

    Superb video, thank you for this. You can use isinstance() to determine if a layer is a tilelayer:
    from pytmx import *
    ...
    layer = tmx_data.get_layer_by_name("Water")
    print(isinstance(layer,pytmx.TiledTileLayer ) )

  • @elisasilva2268
    @elisasilva2268 2 หลายเดือนก่อน

    Salvou minha vida moço, vc não é um youtuber, é um pai💪

  • @louisdaza1923
    @louisdaza1923 10 หลายเดือนก่อน

    Thank you for everything you do

  • @_ipsissimus_
    @_ipsissimus_ 8 หลายเดือนก่อน

    I love it. excellent work.

  • @potatocat6855
    @potatocat6855 2 ปีที่แล้ว +2

    again THE FINE EXAMPLE OF THE BEST TUTORIAL
    👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍

  • @jonaspetty8767
    @jonaspetty8767 2 ปีที่แล้ว

    Your channel is amazing!

  • @Impexiya
    @Impexiya ปีที่แล้ว

    THANKS FOR THIS IV BEEN SEARCHING FO SOOO LONG

  • @3d_block408
    @3d_block408 8 หลายเดือนก่อน

    Thank you so much for the video ❤

  • @hsh1957
    @hsh1957 ปีที่แล้ว

    You really make good videos, i am not a engish speaker but i understand almost everything so good job

  • @gawan3390
    @gawan3390 2 ปีที่แล้ว

    really nice video!

  • @howezae6338
    @howezae6338 ปีที่แล้ว +1

    may I ask on 1:20:54 why you're using forward slash instead of backslash? does the path string for pytmx work different compared to pygame.image.load?

  • @alzidaanlimited9082
    @alzidaanlimited9082 ปีที่แล้ว

    I like your tutorials Very much

  • @mirage3dee
    @mirage3dee 2 ปีที่แล้ว

    Wonderful. Thank you very much for your time and effort. You made it so easy to understand Tiled. Great tutorial and very well-prepared presentation.

  • @rajivjha47
    @rajivjha47 ปีที่แล้ว

    Frrrrr tNice tutorials man just straight forward !

  • @albertsun8725
    @albertsun8725 ปีที่แล้ว

    this video is amazing

  • @MagicByIzzy
    @MagicByIzzy 2 ปีที่แล้ว

    Thanks for the vid! it's super helpful!! One question though, where did you get the tileset from?

  • @servantofourlordjesuschris6456
    @servantofourlordjesuschris6456 5 หลายเดือนก่อน

    Thank you!

  • @E_lec
    @E_lec ปีที่แล้ว

    I realized that the object layers did not export, when you used the .csv option? Anyway to fix that so you can export the object layers as a .csv file?

  • @lsf3og
    @lsf3og ปีที่แล้ว

    Thanks very much.

  • @oppio1981
    @oppio1981 ปีที่แล้ว

    OMG OMG OMG!!! U RE THE BEST!!!!!! THX U for this video!!!!

  • @GabrielCasote
    @GabrielCasote 2 ปีที่แล้ว

    amazing russ

  • @toall_stone740
    @toall_stone740 3 หลายเดือนก่อน

    thank you

  • @raiseyoureyes70
    @raiseyoureyes70 ปีที่แล้ว

    Very detailed video🔥, but I still got the problem. I can't draw. Just a transparent blue square running after the cursor even though the Tileset has loaded. Please tell me what could be the problem?

  • @ivanyosifov2629
    @ivanyosifov2629 2 ปีที่แล้ว +2

    Hello Clear Code. You mentioned a while ago you'll be doing DOOM with pygame after Zelda. When could we expect this course to come out?

  • @jafarrafiq444
    @jafarrafiq444 ปีที่แล้ว

    Nice man ty

  • @shaivamuthaiya2015
    @shaivamuthaiya2015 2 หลายเดือนก่อน

    I tried to import one of those png with multiple images inside it and when i import it it is all clumped together in a 64 x 64 tile size. How do i work around that.

  • @uniquebeat
    @uniquebeat 2 ปีที่แล้ว

    Legend

  • @AlesdairProductions
    @AlesdairProductions ปีที่แล้ว

    Other than making the graphics myself, where can I find the graphics for tiled?

  • @joseleal8634
    @joseleal8634 5 หลายเดือนก่อน

    there is no way to make a tile go to certain layer automatically? like grass will be always layer0 while stones will be on layer1
    so if I pick stones they get setted on layer1

  • @RinGoGuntheR
    @RinGoGuntheR ปีที่แล้ว

    And how do you tackle the terrain problem? Nothing was said about that :(

  • @mate8465
    @mate8465 5 หลายเดือนก่อน

    Not sure if anyone can help me, but im getting a ValueError after trying to add the tmx file to my pygame, for some reason it says : ValueError invalid literal for int() with bas 10: '3.63636'. Even though there shouldnt be any numbers or integers

  • @DavidLatham-productiondave
    @DavidLatham-productiondave 2 ปีที่แล้ว

    Hey Chris, is it possible to use tiled to auto tile the top and bottom tiles of platforms in a 2d platformer type game?

    • @ClearCode
      @ClearCode  2 ปีที่แล้ว +1

      yes, totally

  • @Shodan130
    @Shodan130 ปีที่แล้ว

    i don't have the tilesets section under layers. and none of the UI options i tried restore it

  • @OneMilian
    @OneMilian 2 ปีที่แล้ว

    When i print tmx_data.layers it says cant find Sprite sheet :(

  • @windgod9442
    @windgod9442 ปีที่แล้ว +1

    how to check collision in Tiled?

  • @isamedelberg59
    @isamedelberg59 6 หลายเดือนก่อน

    Hello, good tutorial!! I just need help with something and idk if anyone here can help me but i have a problem. Im at 1:48:33 and im getting that sprite_group isint defined. Does anyone know what k can be doing wrong? Its the sprite_group.draw(screen) thats worng for me. Do i need this part of the code or can i remove it?

  • @littleredrose
    @littleredrose ปีที่แล้ว +1

    how can I get the tileset to show up on the side on the same window as the game map? I accidentally crossed it and I don't know how to get it back. the tile sets keep opening in a new window so I cant use them

    • @420phoebe
      @420phoebe ปีที่แล้ว

      did you ever figure it out, i’m here for the same reason

  • @greenin5537
    @greenin5537 ปีที่แล้ว

    anyone knows how to get the terrain to work with a platformer/sidescroller tileset?

  • @emanuelericci8686
    @emanuelericci8686 ปีที่แล้ว

    is there a setting Called Program*, its default is set to *Agressive TEwNice tutorialch is making that sNice tutorialtty static soft, change that one, once to

  • @saiphanie
    @saiphanie 8 หลายเดือนก่อน

    This has been suuuper helpful! The only remaining question I have about this program is, am I able to select a chunk of tiles and drag them to a new position? (As opposed to manually erasing and re-stamping a section) The selection tool works a bit differently than I'm used to and I only seem to be able to drag the entire layer.

    • @ClearCode
      @ClearCode  8 หลายเดือนก่อน

      you can totally do that, there is a select tool at the top, or the hotkey r (I think) to select an area. Then you can cut it out and paste it with Ctrl + x and Ctrl + v

  • @annwitbrock9112
    @annwitbrock9112 6 หลายเดือนก่อน

    Came back to this a year later to solve a bug that meant only Objects and Floor showed up.
    Floor, Ground, Plant and rocks, Pipes layers are render order dependent, so the Floor needs to happen first and the hasattr is not as good as selecting the layer names individually, because of the Floor overwriting things.
    I removed 'Floor' from the tuple and everything turned up.
    Having now got the ground, vegetation, pipes and objects to appear in the top corner, I still have to figure out why the floor is rendered in grey rather than brown. I think it is processing but not rendering, but I'd expect to see black in that case, but commenting out the floor loop is also grey. So more debugging, but at least progress.
    Also found the continuous path thing seems to not be working now - maybe something in Tiled 10.2? Maybe I overlooked something. It worked fine a year ago, but I updated the Tiled version.
    So did some manual placement to get a few pipes into the top corner.

  • @solholden1719
    @solholden1719 4 หลายเดือนก่อน

    Great tutorial but something is wrong with the module for me. It's found my tmx file but it's giving me a bunch of errors from within the module itself instead of my code

  • @rannoely8757
    @rannoely8757 ปีที่แล้ว

    Take ti, enjoy it most of all and results will follow

  • @dragon._.9646
    @dragon._.9646 ปีที่แล้ว

    Everything's amazing except that when i load my 2d tile map, its small. I have no idea how to make it bigger so it could be full screen. Is there a way to make the map bigger using the pygame or pytmx modules???

    • @dragon._.9646
      @dragon._.9646 ปีที่แล้ว

      Btw, I also cant get the objects in my game, they wont pop up, only the tiles layers.

    • @theonlydhruv7888
      @theonlydhruv7888 ปีที่แล้ว +1

      @@dragon._.9646 maybe try to blit the map onto a different surface and then scale that surface to the full window size?

  • @SkyFly19853
    @SkyFly19853 2 ปีที่แล้ว

    You are truly great.
    Btw, do you use tiled map editor app?

    • @kiyu3229
      @kiyu3229 ปีที่แล้ว +1

      yes

    • @SkyFly19853
      @SkyFly19853 ปีที่แล้ว

      @@kiyu3229
      You use that?

    • @kiyu3229
      @kiyu3229 ปีที่แล้ว

      @@SkyFly19853 yes

    • @SkyFly19853
      @SkyFly19853 ปีที่แล้ว

      @@kiyu3229
      Oh, I see.

  • @walkercitodt
    @walkercitodt ปีที่แล้ว

    Hello! I'm having an error with the PyTMX module, when I install it (with pip ir even pip3) and wanna call it in the code I get an error: NoModuleName 'pytmx'
    Heelp :/

    • @ninjaboyjames
      @ninjaboyjames ปีที่แล้ว

      if you are on mac i think the pip install is different i could be wrong tho

  • @Hiramale
    @Hiramale ปีที่แล้ว +2

    Hi! I have a problem, when using the TMX file on python, I cant get the object type, on tiled it says class insted of type, so python returns None :(

    • @PSMaster1991
      @PSMaster1991 ปีที่แล้ว +1

      I have the same problem. There were update of Tiled program and it doesn't work as in tutorail anymore. I can't figure it out how to make it work. Did you find solution allready? @ClearCode mayby you can help with that?

    • @Hiramale
      @Hiramale ปีที่แล้ว +1

      @@PSMaster1991
      Hi I tryed to solve it too, but I can only figure out one solution to make more or less something like on the tutorial:
      for obj in self.tmxData.objects:
      position = obj.x, obj.y
      if obj.__getattribute__("class") in "Building":
      Building(position, obj.image, self.all_sprites, self.collision_sprites, z=LAYERS["BUILDING"])
      I used the obj.__getattribute__("class") to use the class attribute from the object, I dont know if this works for you, I hope it is.

    • @viniciocrc14
      @viniciocrc14 ปีที่แล้ว +1

      Hi there! I was just facing the same issue and on Tiled forum I found this solution: discourse.mapeditor.org/t/the-atribute-class-of-my-objects-are-none/5772/2
      Basically if you setup a project, and go to Project -> Project Properties and change Compatibility version to Tiled 1.8, then the class property in Tiled will be accessed in Python through pytmx object.type! It worked for me, hope it works as well!

  • @aleksy920
    @aleksy920 5 หลายเดือนก่อน

    how to copy and pased tiles? ctrl c v don't work

  • @frostbite561
    @frostbite561 ปีที่แล้ว

    working bro! Thanks a lot, +sub +like

  • @angeperez3906
    @angeperez3906 9 หลายเดือนก่อน +1

    Thank you for this video, it is very helpful, but I have a question, how could the shapes created in the object layer be used for things like collisions or detecting elements in that area? Because I would like to use them that way but I don't know whether to do so that this shape like a sprite is the most recommended

    • @pastafacker338
      @pastafacker338 9 หลายเดือนก่อน +1

      I have the same question, and I also create my objects layer but after that I try to export it as a csv file but it does not work for me...

  • @strogole
    @strogole หลายเดือนก่อน

    Thanks for VERY usefull tutorial!!! But, I can't undersand how to import animated tiles. Please help!)

  • @SlowPersuit
    @SlowPersuit ปีที่แล้ว

    sorry for a sad question, but you state you have used CSV import (yep done that) but also the other method (pytmx) & have an example of using this. I can only find the CSV used & don't quite understand the pytmx thingy- can someone point me at this please? Cheers!

    • @ClearCode
      @ClearCode  ปีที่แล้ว

      the second half of the video is about using pytmx in pygame, did you watch that?

    • @SlowPersuit
      @SlowPersuit ปีที่แล้ว

      @@ClearCode Yes. it game a concise explanation of the various attributes & stuff you can pull out, but I couldn't see how to use this to import graphic to position other than in the same way one would for a CSV (which you said was tedious).
      I may be having a dense moment though! ;-)

  • @basicallybrand
    @basicallybrand ปีที่แล้ว

    what is load pygame?

  • @andre0000000007
    @andre0000000007 ปีที่แล้ว

    ? so where's the playing of the map that was created in tiled?

  • @darwishtnt3031
    @darwishtnt3031 ปีที่แล้ว

    please make a video on how to scroll tmx file maps

  • @theonlydhruv7888
    @theonlydhruv7888 ปีที่แล้ว

    Question, can you make fake tiles? when I say fake tiles I mean tiles that are like in the background(behind he terrain tiles), are slightly dimmed and you cant collide with them?

    • @ClearCode
      @ClearCode  ปีที่แล้ว

      sure, when you import them to pygame just make sure to not add any collision logic and you can also control the alpha values of any surface.

  • @darwishtnt3031
    @darwishtnt3031 ปีที่แล้ว

    how to scroll through the thing

  • @maciejtomaszgross8699
    @maciejtomaszgross8699 2 ปีที่แล้ว

    If you have problem loading infinite map please consider that pygame is not compatible with infonite map, just resize them and change the infinite property on the map and dont wase 1,5h of your life as i did :D

  • @jstro-hobbytech
    @jstro-hobbytech ปีที่แล้ว

    I will never afford a keysight dishclothe but I don't let that get me down or have gear envy haha

  • @umardaha692
    @umardaha692 7 วันที่ผ่านมา

    Please if possible can you make a tutorial on importing isometric data from tiled to pygame as there is not much information on how to go about it. Thanks

  • @user-zw4pj7gz9o
    @user-zw4pj7gz9o 2 ปีที่แล้ว

    Nice thumbnail. Xd

  • @NAVANITHKRISHNA-fo8ez
    @NAVANITHKRISHNA-fo8ez วันที่ผ่านมา

    Bro similarly, can you make a tutorial for importing isometric tilemap in python. It's really difficult 😔

  • @rod0fdiscord
    @rod0fdiscord ปีที่แล้ว

    getting the error: No module named 'pytmx'
    i have installed pytmx

    • @rod0fdiscord
      @rod0fdiscord ปีที่แล้ว

      nvm i was using the wrong interpreter

  • @paulpaul1613
    @paulpaul1613 ปีที่แล้ว

    wow

  • @Shadowthevampire
    @Shadowthevampire 6 หลายเดือนก่อน

    I desperately need something like this but for the ipad :(

  • @PeterRichardsandYoureNot
    @PeterRichardsandYoureNot 6 หลายเดือนก่อน

    tryingt o follo your tutorial, which has been great....until.....Tiled. Downloaded latest version for Mac OS and went to give it a spin and it literally dies constantly. just flat out freezes, or ui fails to respond or it just locks up and crashes. Very frustrating piece of software.

  • @acabtitano4631
    @acabtitano4631 ปีที่แล้ว

    (Lo-Fi, Trapsoul, CNice tutorialllstep, Trip Hop, Rap, Trap, Nice tutorialp Hop)

  • @deactivatedHonda
    @deactivatedHonda ปีที่แล้ว

    1:48:24

  • @lilking350m6
    @lilking350m6 ปีที่แล้ว

    Word

  • @theignoredguy4772
    @theignoredguy4772 2 ปีที่แล้ว +2

    52:14 "That's what she said"

    • @bxstiii
      @bxstiii 2 ปีที่แล้ว

      xD

  • @Swedishfishtank
    @Swedishfishtank ปีที่แล้ว

    i love you other tutorials but this one is very confusing. it is soooo strung out and a bit all over the place. can you make a more structured of this is how you do it step 1, 2, 3? more planned out?

  • @misterdneh
    @misterdneh ปีที่แล้ว

    New tileset button doesn't exist this program is so annoying to use with not enough straight forward guides

  • @ThantiK
    @ThantiK 2 ปีที่แล้ว

    I love that you're doing these tutorials, but could you do some of this stuff through Godot engine, or something where -- we might actually be able to publish to a platform such as Android/iOS? PyGame is really nice and all, but using it in Mobile -- which is the largest gaming industry right now, is neigh impossible.

  • @TestyCool
    @TestyCool 4 หลายเดือนก่อน

    Bro nothing on making a 2d platforming map but you touch on iso.

  • @amburger1984
    @amburger1984 2 ปีที่แล้ว

    first yay

  • @Pandraman
    @Pandraman 2 ปีที่แล้ว

    second

  • @kernelgm
    @kernelgm 2 ปีที่แล้ว

    Show to us how make one "mario style" in rust. xD

  • @edrisbajbaa4712
    @edrisbajbaa4712 2 ปีที่แล้ว +1

    Make video talk about 'ursina' 3d how to make animation in blender and make game and thankkkkkkkkks

  • @allanbenesa3280
    @allanbenesa3280 ปีที่แล้ว

    "So tNice tutorials is our channel rack..."

  • @user-fc8cq5vx8m
    @user-fc8cq5vx8m ปีที่แล้ว

    soft... isn't it much harder to hear everytNice tutorialng as you go tNice tutorials way?

  • @JonelKingas
    @JonelKingas 6 หลายเดือนก่อน +1

    Im pretty sure example unity, especially Godot has everything needed for tiling making this program useless, in 2024 i dont really see why i should use this...

    • @solholden1719
      @solholden1719 4 หลายเดือนก่อน

      It's great for me, because my course doesn't allow usage of drag and drop features, so using something like unity for tiles is the same as using tiled, plus I don't run the risk of accidentally losing marks

  • @shanks7283
    @shanks7283 ปีที่แล้ว

    Sa

  • @ayoub6418
    @ayoub6418 ปีที่แล้ว

    , during the second wave..