45° Straight Road Pieces for Tilemap

Not favoritedFavorited Favorited 0 favourites
  • 10 posts
From the Asset Store
Pixel Enemies for SHMUP consists of 45 enemy ship sprites to be used in your game.
  • I am attempting to develop a diverse set of road pieces for a tilemap in my game.

    The straight vertical and horizontal pieces are easy and done.

    The full 90° turns are also relatively easy and done.

    What I need help with is to draw 45° straight roads using the same width as the normal roads and connecting them to and from curved roads (which would just be the 90° roads cut in half).

    What I'm having trouble with is the positioning of the road pieces within the tilemap grid that (1) uses as few pieces as needed and (2) can be repeated as long as needed.

    Anyone with experience in drawing tilemap roads would be a great help.

    Thank you.

    Tagged:

  • I can't help directly, but on the Kenney.nl site is a "Racing Pack Asset" with road tiles with 45° roads, turns, curved roads etc.

    May be it is helpful for you to see how others have done it. Asset is free and CC0.

    https://kenney.nl/assets/racing-pack

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • With just straight and 90 degree turns and intersections I figure you’d need 18 unique tiles (or 6? if you eliminate the mirrored and rotated versions)

    For other angled roads with tile maps you’d usually do something like what asmodean suggested. However you do lose keeping the width of the road staying constant.

    For tiles that can have 45 degree roads with every combination of bend and intersection I figure you’d need 258 tiles before removing the rotated and mirrored versions. It would be way more but as a simplification you’d draw all the tiles within an octagon, and for the corners you’d have a separate tilemap with two tiles for the corners.

    It’d opt to generate all the tiles somehow, and take that opportunity to remove the rotated and mirrored varieties. You probably can get away with less tiles if you limited what intersections were allowed as well. Seems like a bit much to draw them all, and even then it seems like it may be a bit too many tiles to sort through to design levels with manually without some kind of auto tile assistance.

    Here’s a rough template I’d use to draw the tiles. The square is the tile size, and you’d draw the tiles in the octagon within that. The diamonds would be the separate tilemap that would handle connecting diagonals.

  • Uhh I don't think that pack actually has any 45 degree tiles, or I'm blind.

    Here's the filler pieces (on the right) I think you need, along with all their rotations and variations, if this is what you're looking for (example on the left). It's missing all the main turns and corners though, but I think you can figure those out yourself.

    Basically have attachment points for road pieces at each tile in thirds as shown on the bottom, and have all the variations needed for inside and outside road connections.

  • I can't help directly, but on the Kenney.nl site is a "Racing Pack Asset" with road tiles with 45° roads, turns, curved roads etc.

    May be it is helpful for you to see how others have done it. Asset is free and CC0.

    Thank you! And I love Kenney's work. I actually have that very asset pack. Unfortunately, two problems with his work:

    1. The angled roads are 26° and not 45°.

    2. Those same angled roads don't transition from curved into angled (and back). They go from horizontal to horizontal (or vertical to vertical).

    Thank you again for the suggestion, though!

  • With just straight and 90 degree turns and intersections I figure you’d need 18 unique tiles (or 6? if you eliminate the mirrored and rotated versions)

    [remainder of quote truncated for ease of reading]

    Interesting! I will try to apply that method.

    And, agreed, there's going to be a LOT of pieces. (I can use the rotate tool inside the tilemap drawing in the layout, so that'll minimize tiles.)

    I definitely planned on limiting intersection types. Right now, I just want to figure out the best way to transition from a 90° turn into a 45° straight and make the 45° straight repeatable before going back to a turn that resolves back to a vertical or horizontal straight. (Easy, right? LOL)

    I am grateful for your help as always!

  • Here's the filler pieces (on the right) I think you need, along with all their rotations and variations, if this is what you're looking for (example on the left). It's missing all the main turns and corners though, but I think you can figure those out yourself.

    Basically have attachment points for road pieces at each tile in thirds as shown on the bottom, and have all the variations needed for inside and outside road connections.

    I think you just nailed it! I'll let you know if that's the answer I'm looking for.

    THANK YOU!

  • Here's the filler pieces (on the right) I think you need...

    With your help, I successfully got just the right set of pieces. Two more than I thought I would need, but it's virtually perfect for my purposes! Thank you for your help!

  • If you're not tied to a tilemap you could do the roads with a few crafted overlapping sprites placed in a grid.

    Namely with these 5:

    You could do roads like this. Although making dedicated intersection could look cleaner.

    dropbox.com/scl/fi/eidz69wqyodpz52h2896d/road_pieces.capx

  • If you're not tied to a tilemap you could do the roads with a few crafted overlapping sprites placed in a grid.

    Honestly, I considered something like that...such as manipulating the sprite mesh. (Something I've toyed with only a little bit in times prior. So it would take some work...)

    The grid/tilemap option seemed best because it's consistent and easier to place the tiles once I have got them all drawn out. But if I could have even more variety in the road pieces? OH HECK, YEAH... But for now, optimization seemed best. I'm not out to make another Need For Speed: Most Wanted or Burnout Paradise open-world city...just something more simple (and still open-world).

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)