Upper Autotiles [no longer working since MV 1.4]

● ARCHIVED · READ-ONLY
Started by Shaz 20 posts View original ↗
  1. Upper Autotiles


    2016.08.06


    by Shaz


    Introduction


    This plugin allows you to use autotiles on the B-E tabs, and on the two upper mapping layers.


    How to use


    There are several steps required to create, add, set up, use and customize autotiles.  The following spoilers detail all steps.


    Step 1: Create your Autotiles

    Spoiler
    Create a folder under /img for your autotiles.  I don't recommend you put them in the img/tilesets folder (if you do, when you're creating tilesets, these will also be shown in the lists, making it harder to set up your tileset with real tilesheets).  Set the plugin parameter for the autotile folder.


    Each autotile will have its own image.  There is no combining lots of autotiles into a single sheet the way MV does by default.  This means your autotiles can be different shapes and sizes, and have different numbers of animation frames.


    Each autotile should follow the 2x2 or 2x3 standard layout for MV autotiles.  Animation is done by placing autotiles side by side for as many frames as needed.  Animation flows in a left to right direction, not a back and forth direction like the A1 tiles and spritesheets.  You can have as many frames as you want.


    Some examples of autotiles (I'm not providing the resources as they are not mine, and I'm not even sure if some of them are okay to share):


    AutotileLayout_zpswub2vdsx.jpg



    Step 2: Update B-E tilesheet image with autotile representation

    Spoiler
    Reduce your autotile to a 48x48 tile that can be added to the B-E tilesheet.


    This is easily done by grabbing the top left tile of a 2x3 autotile, or by grabbing the 24x24 chunk from the 4 corners of a 2x2 autotile and combining them.


    I suggest you consistently use some kind of marker to make it obvious in the editor that these will be turned into autotiles when playing the game.  I've been putting a bright yellow star in the lower right corner of my tiles.  Pick something and stick with it for all B-E autotiles - it'll make it easy for you to see what they do, and if you ever have to come to the forum to ask for help with something, this will help us recognize that you're using this plugin and might explain some weird things we might otherwise question.


    Copy this 48x48 image and pop it into the B-E tileset wherever you want the autotile to go.


    AutotileRepresentation_zps6vadceo0.jpg



    Step 3: Add notes to tileset to define B-E autotiles

    Spoiler
    Set up your autotile flags - whatever you use on the B-E tab is what will be used by the autotile.  Keep the passage setting to O, X or star if you don't want unexpected results.


    For each autotile you've added, add a new line to the Tileset notes box defining the autotile:


    <autotile: tileId size frames filename>


    where tileId is the id of the B-E tile (see below)


    size is either 2x2 or 2x3 and indicates how big the autotile is


    frames is how many frames of animation there are - for a single autotile with no animation, this will be 1


    filename is obviously the name of the image file - leave off the extension


    example:


    <autotile: 8 2x3 1 Leaves01> - tile 8 (first tile in the second row on B tab) is a 2x3 autotile with just 1 frame, using the Leaves01 image.


    <autotile: 16 2x2 4 Waterfall02> - tile 16 (first tile in the third row on B tab) is a 2x2 autotile with 4 frames of animation, using the Waterfall02 image.


    How do you find the tile Id easily?


    Do this BEFORE you add the <autotile> tag to the note!


    Create a new map and set your starting location.


    Use the B-E tile to draw on the map - just a single tile will do.


    Add the following event, run the game, walk onto the tile (you might need to use Control to override passability), and press space or enter.



    Spoiler



    TileIdEventSetup_zpsqq01jojy.jpg


    TileIdEventRunning_zps1zqaoohk.jpg



    If you've only drawn with one tile on the upper layer, it will be the 'Top' one.  If you've drawn with two different tiles, you'll have a 'Bottom' tile Id (the first tile you drew with) and a 'Top' tile Id (the second tile you drew with).






    Step 4: Mapping

    Spoiler
    Now just map with your tiles.  


    It'll look a little weird in the editor, as it's just going to put the same tile on all the squares you draw on, without reshaping them (remember, the editor doesn't do B-E autotiles - the magic only happens when you play the game).


    Because you've got two upper layers, you can draw two levels of tiles if you want to.  They can both be autotiles, or a mix of autotiles and regular tiles.


    Play the game and see how it looks.  



    Spoiler



    UpperAutotileMapping_zpsdy7pdwph.jpg

    The water here is from the A1 tile.  Everything else is from the B tab, set up for autotiles.


    And here's how it looks when playing.

    Spoiler
    UpperAutotileMappingResults_zpspwnw6jpn.jpg



    Now, there's some funky roof stuff going on there, and you should expect to see this when you use this plugin.  Don't panic - it's totally expected, and totally fix-able.


    What's happened here is that I drew the house at the back in full, and then drew the house at the front in full.  Those 4 roof tiles on the right side of the lower house have wall tiles behind them that belong to the back house.  At this stage, the autotile patterns are just being calculated automatically based on what's around them.  We need to do something to tell it those are two different houses, and the roof at the back and the front should be kept separate, as should the walls of the back house and the front house.  We'll take care of that in the next step.


    The waterfall looks a bit funky too - it's not tiling seamlessly.  That's okay - it's the autotile I used, not the script (it's one formatted for XP and slightly modified just so I could show some animation, so it doesn't tile seamlessly in MV).






    Step 5: Adjust (shift-map) using regions

    Spoiler
    So, we want to fix those weird-looking roof and wall tiles.


    Using regular autotiles, you'd just draw in an out-the-way spot and use shift-copy/shift-paste to grab the exact tiles you wanted and put them where they needed to go.  But MV doesn't do autotiles on the B-E tabs, so that's not an option available to us.  Instead, we can use regions to force a similar effect.


    Now, a 2x3 autotile can produce up to 48 different individual tiles, depending on what's on the surrounding tiles (a 2x2 autotile can give you up to 16).  If you have RMXP, it's easy to see this by double-clicking on the autotile on the palette.  To simulate XP's ability to select one of the 48 patterns, or MV's shift-mapping technique, we'll use regions (48 of them) to represent each of the possible patterns.


    Select a group of 6 full rows of regions, and put the starting region id into the plugin parameter.  6x8=48 regions, and each one will represent an individual tile pattern.  Drawing over the tiles with one of those region ids will force it to draw that particular pattern in the game rather than basing the pattern on the surrounding tiles.


    How do you determine the region id easily?


    Do this AFTER you add the <autotile> tag to the note!


    Create a new map and set your starting location.


    Use the B-E tile to draw on the map - a block of 8 columns x 6 rows.



    Spoiler



    RegionTileLayer_zpsr4ptnqmz.jpg



    Now grab that block of 6 rows of autotiles, and draw with them over the top of your tiles (gotta love how you can do that with just a couple of clicks rather than one-at-a-time!).

    Spoiler
    RegionLayer_zpsmgwije4u.jpg



    Add the following event, run the game, walk onto the tile (you might need to use Control to override passability), and press space or enter.

    Spoiler
    RegionEvent_zps4ikvhoe8.jpg



    Note how the 2x3 autotile produces more individual tile patterns than the 2x2 autotiles?

    Spoiler
    RegionInAction_zps2x6wjv3a.jpg





    Experimenting a bit (walking onto the tiles, checking the region id, and testing with that region id), it looks like the roof on the top house can be fixed using regions 209 for the corner and 208 for the next piece, and that both the roof and the wall of the bottom house can be fixed with region 206 on the corner and 202 beside it.  So popping those regions onto the tiles on our map and testing gives us some results.  Much nicer!

    Spoiler
    RegionsApplied_zpsrxztg3pr.png


    RegionsPostApplication_zpszrwbtl9v.png





    There is an alternative that might reduce the amount of mucking around you need to do with regions, but may not eliminate it entirely.  That is to define a second tile in the tileset for both the roof and the wall of the house - using exactly the same settings, but just a different tile Id.  Then map one house with one set of roof/tile pieces, and map the other house with the other set.  As long as the same B-E tile is not used side by side, the autotiles won't be joined.

    Spoiler
    RegionAlternative_zpsskdojntf.png








    Plugin


    Download from pastebin


    The plugin MUST be saved as UpperAutotiles.js


    Credit


    Shaz


    Terms


    Free for use in commercial games


    Compatibility


    This plugin overwrites the functions TileMap._paintTiles and TileMap._drawAutotile.  It will NOT be compatible with other plugins that overwrite either of these functions.  It MAY work with other plugins that alias these functions, if this plugin comes above them in the plugin list.


    Notes

    • Plugins do NOT affect the editor.  You can specify a B-E tile to behave as an autotile, but it will only do so while playing the game.  The editor will treat it as a regular B-E tile.
    • As the editor does not accommodate autotiles on the B-E layer, there is no shift-mapping.  The workaround is to use regions to override the default autotile pattern selection.
    • If using two B-E autotiles on the same tile, with a region id, the region id will affect both tiles (two upper tile layers but only one region id - can't tell which layer the region applies to)
    • You cannot draw A tiles (fences, long grass, etc) on top of B-E autotiles.  The B-E tiles will be replaced, just like any other B-E tile if you draw over them with an A tile.
    • All tile settings for the autotile will be exactly as for the original B-E tile.  Passage should be X, O or star.  Strange things will happen if you try to use 4-dir passage on B-E autotiles and fill an area with them.  



    Have fun!  Post if you run into trouble!
  2. Note: the plugin also updates itself with the list of autotile images you define in the tileset (it's not smart enough to go through and determine whether they're actually used or not) - so if you Deploy and check the box to exclude unused resources, your autotiles should still be taken across.  If they're not, it may be because you have previously deployed that project.  When this happened to me, I simply deleted the deployment folder and ran the process again, and it worked.


    -------------------------------------------------


    forgive me, please, mods for the double post - I am just trying to avoid editing that first post at all costs, due to the formatting & nested spoilers.  I'd hate to mess it up and have to do it all again.
  3. Woah I have to try/see that :D
  4. ....what kind of witchcraft did you done again shaz....wait this not witchcraft


    more likes 


    Squirrellcraft
  5. @Shaz: would it be possible to modify the plugin to allow the same override on A-Tiles?


    Because there is one part of this add-on that makes it better than the original autotiles: the option to use more than 3 frames of animation, and have more than a few tiles in A1 animated (especially as the A1-tiles are bound to vehicle passabilities and would be a bad choice to be changed for other animated uses than water)
  6. This plugin was written for a request by Sharm, and we took a bit of time to nut out that the B-E tiles would be the best way to go to meet her specific needs, and why using the A tiles would be a bad idea.  I briefly considered expanding it to the A tiles (and it might have worked for A5 without too much modification), but I didn't test it, and decided against it due to the rest of the A tiles already being autotiles and A1 already being automated and having more complex implications on passage settings.


    You're talking about using it for a different purpose though, to what was originally required, but it still has those extra complexities.  I'll take some time to think about how it might be achieved easily, but won't promise anything.
  7. This is an awesome plugin, It'll really help me.  I was missing the Square passibility for wall autotiles that RPG Maker 2000/2003/XP had. This is far better than that option as it allows me to configure the appearance of the secret areas better.  Now to start editing some tiles and re-building the walls of some buildings...
  8. I'm not sure if I would use this (mainly cuz I'm lazy... :p ) but WOW!! I'm glad it exists! Even though the engine can't do this on its own, it's awesome to know that with JS you can make your game do some awesome things you can't do with just the engine! XD 
  9. Pyrarrows said:
    This is an awesome plugin, It'll really help me.  I was missing the Square passibility for wall autotiles that RPG Maker 2000/2003/XP had. This is far better than that option as it allows me to configure the appearance of the secret areas better.  Now to start editing some tiles and re-building the walls of some buildings...



    That square passability was in the back of my mind the whole time I was working on this.  I'm not entirely happy with the way the passabilities work - I'd like it to be a bit more flexible (like the ceiling tiles on the A sheet, where you can walk around ON them, just not go from them to another tile, which is also similar to the square passibility you're talking about).  I thought I'd probably release it and see what people thought, what people said was missing, and see what could be done about it, and expected some passability changes to happen as part of that.
  10. I like this, but i can't help but sit back and go "shame the auto tiles can't be made to work more like the XP ones" the 3x3 squares style.


    Actually, some sort of plugin enhancing the auto tiles in MV would be awesome in general.
  11. Why would you want 3x3 autotiles?  Internally, both engines do pretty much the same thing - divide the tile on the map into quarters and build it from pieces of the autotile.
  12. Easier to to do more organic looking landscaping.


    Everything looks so squared as it is..


    I never been nuts about the changes they made to auto tiles after XP..


    Technically, it's still 3X3... but the outer tiles are now smaller than the center one.


    Center one in MV for instance is 48x48 tiles... the 2 side ones are 24x32 the top and bottom ones are 48x24... and the corner ones are 24x24..


    I just prefer something where all the tiles are 48X48.
  13. The squared look is due to the new visual design with VX/Ace/MV, not because the autotiles are made up of 2x2 rather than 3x3.  If they had wanted to, they could have made more rounded autotiles.  It was a design choice, not a technical issue.  Just like chibi characters was a design choice (the size/layout was determined by the style, not the other way around, and the same is true of autotiles).


    In fact, I'm sure some people released more rounded autotiles for engines later than XP for that very reason.


    Of course, the other issue is that Autotiles after XP did not generally have transparency.  THAT is more of a technical issue than the size.
  14. I never said it was a technical issue... just that i never liked the change and i preferred the old way it was handled.


    And like i said in my last post where i updated it ...


    "Technically, it's still 3x3 tiles... but the outer tiles are now smaller than the center one.


    Center one in MV for instance is 48x48 tiles... the 2 side ones are 24x48 the top and bottom ones are 48x24... and the corner ones are 24x24..


    I just prefer something where all the tiles are 48X48."
  15. But the center isn't used that way anymore - most of the tiles use only half of the center, which is why it is also divided into quarters of 24x24 each for internal handling.
  16. ~_~ i hope i'm not being a trouble maker...


    Usually when a Global Mod comes in... someone is doing something wrong...
  17. Only if they use mod voice, which he didn't.  If you look through the forums, you will see Andar offers a lot of help and takes part in discussions.  This has got nothing to do with modding.
  18. Sorry... i was not familiar with that...


    I thought i was in trouble..
  19. Hi Shaz,


    Thank you very much for creating this plugin! Autotiles with more frames of animation are something I've desperately wanted since Day 1, so I really appreciate it =)


    Unfortunately...I can't get it to work. I've got my 'autotiles' folder under img (and it's correct in the plugin settings), I have tried multiple graphics which have been correctly set up (it's set up exactly like the Water01.png example you provide above, just with 3 frames of animation instead of 4), and the details in my Tileset note are correct (<autotile: 1 2x3 3 Test01>). I've tested out different tileIDs in-case it didn't like me using 1 - no change. But obviously *something* happens, because whichever tile I choose to be the auto-tile, that tile doesn't show up in game; it's as if it's fully transparent.


    While I didn't think that any of the plugins I have would affect this, I tried disabling some of them, and even deleting all of them aside from Upper Autotiles - but it made absolutely no difference.


    So close and yet so far XD I don't suppose you have any ideas?
  20. @CriticalGames my first question would be if you gave the plugin the correct name when you saved it?  Just a single mistake on the name could make the project act as if the plugin isn't even there.


    If you're certain the name is correct, would you mind please providing a series of screenshots?  I would need to see:


    1. the plugin parameters


    2. the folder you have your autotiles in - if you could switch the view to Large or Medium Icons and ensure extensions are visible, that'd be great.  I need to see the address bar including the img folder and whatever comes after it, but you can obscure anything before it if you like (some people don't like to show their whole address bar as they like to keep their name or the project name private)


    3. your Tileset tab, with the tileset selected, and tab B selected (or whatever tab you've got the autotile rep on - I assume B as you've used id=1).  I would like the <autotile: ... notes visible


    4. your map, with the mapping layer selected


    5. your map, with the region layer selected (even if you're not using regions to override it - if I can't see the issue in any of the screenshots above, it may well come down to a bug with regions)


    put these in spoilers in your reply :)