Search Unity

[RELEASED] RPG Map Editor

Discussion in 'Assets and Asset Store' started by CreativeSpore, Nov 6, 2014.

  1. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Hi there,
    The tilemap editors in both assets have similarities but they work differently. In this case, the framework in RPG Map Editor is designed for the tilemaps used by the same asset. But I made all the framework easy to be adapted to other systems with minor changes.
    For example for the MapPathFinding.cs class you should change only when a grid position is considered passable or not passable. In Super Tilemap Editor it could be checking a tile parameter or simply checking if the tile contains any collider, for example.
    Other scripts like CompanionAI are prepared to work using unity colliders like the ones created by STE.
    Vehicles are more complex, but they should be easy to adapt as well.
    So they are not 100% compatible but easy to adapt.
     
  2. lightningGamer

    lightningGamer

    Joined:
    Feb 19, 2013
    Posts:
    52
    Ok thanks for the quick reply!
     
  3. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I would like to see some additions to this great plugin :)
    - Example of player and ennemy using a melee attack animation
    - Ennemy with a range detection circle
    - Ennemy alert system, one type of ennemy can push a scream or use an object to alert all ennemies around some distance
    -Interactable animated objects with loot, you open a chest it plays an animation and display in a po pup what loot you found.
    - Basic tree dialog system
    - Basic quest system , Npc have some star icon upon them indicating they have a quest, you can enter dialog to aceept the quest, and they have "!" icon once you have completed the quest. Some quest don't need you to return to the NPC and reward you as sonn as the quest is complete.
    -Swimming on water with swimming animation
     
    rrahim likes this.
  4. Sky1988

    Sky1988

    Joined:
    Aug 25, 2016
    Posts:
    9
    the game doesn't have sound and after i build it as windows game, the editor was inside the game, how to delete the editor? and how to fix the sound error? I'm a beginner. pls help me
     
  5. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Hi there,

    To remove the editor in game, uncheck this option:
    upload_2016-9-19_13-6-45.png

    There are no sounds included with the package, so it would be weird if you hear something.
     
  6. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Hi there,

    Thanks for your requests list, I answer you below:

    - Example of player and ennemy using a melee attack animation
    I will add this to my list
    - Ennemy with a range detection circle
    You have this already in the FolloweAI component. It's called Sight Distance and you can decide if the blocked areas block the sight vision.
    upload_2016-9-19_13-13-43.png
    - Ennemy alert system, one type of ennemy can push a scream or use an object to alert all ennemies around some distance
    Maybe this is more specific and not a generic feature at the moment. But I can help you with this.
    If you add a gameobject target to follow in FollowerAI when the player is seen, this target property could be set also for neighbor FollowerAI close enough to the one that saw the player.

    -Interactable animated objects with loot, you open a chest it plays an animation and display in a po pup what loot you found.
    Maybe I could add a container with a list of prefab items to be instantiated when the chest is open instead.
    - Basic tree dialog system
    This is in my list and at some point I would like to include this.
    - Basic quest system , Npc have some star icon upon them indicating they have a quest, you can enter dialog to aceept the quest, and they have "!" icon once you have completed the quest. Some quest don't need you to return to the NPC and reward you as sonn as the quest is complete.
    With time this could be added as well, but this is complex enough to require some time.
    -Swimming on water with swimming animation
    This is too specific, but you could use the boat as reference to create this ability.
     
  7. bpleffner

    bpleffner

    Joined:
    Jun 16, 2013
    Posts:
    10
    Few questions regarding this asset and your other asset Super TileMap Editor.

    I am building a turn based Rogue, similar to Nethack/Dungeon Crawl Stone Soup variety but with persistent maps and ability to quest.

    Does RPG Map Editor's character controllers, pathfinding, etc. support turn based movement?

    Are each of the tiles accessible in code through a coordinate system. What is the ease of access to the tile at position 3, 5 and getting parameters of the tile? Or is there an API for your asset so I can find everything that is at coordinate 3, 5 on the map?

    I will have actors for quest givers, traps, items on the grounds, doors that open/close, and other interactable actors. What is the easy of creating an actor in code and then saving custom generated actor(s) along with a map generated in your asset.

    I have been using SpriteTile in the past but the problem is their tilemaps are only vieweable in the SpriteTile Editor not the Unity Editor, so it is time consuming when deciding where to place my own actors and having to have two different save files for every level.

    Thanks!
     
  8. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Hi there,
    I added a tile to tile movement for the player and vehicles. The enemies are almost moving from tile to tile, because the pathfinding is creating a path along the tiles, but I don't move them in a turn-based way. Anyway I think it should be very easy to adapt.
    About accessing custom tile parameters, this is only possible in Super Tilemap Editor (STE) but the properties belong to the tileset tile, not to the grid position in the tilemap.
    To access a tile in RPG Map Editor you can use:
    AutoTileMap.Instance.GetAutoTile(int gridX, int gridY, int layer)
    This will return null if there is no tile in the grid position and layer or an instance of AutoTile with information about the type of the tile and other properties.
    You can also access using the helper class RpgMapHelper, with methods to get/set a tile with world position instead of grid position.

    To access a tile using STE you can use:
    Tilemap.GetTile(int gridX, int GridY)
    In this case, each tilemap is a layer (you can use tilemapGroups to group tilemaps like layers).
    This method will return null if no tile is set at that position or a Tile instance, with properties like the type of colliders, custom parameters, etc.

    I have attached the documentation of both assets so you can have a look into the API.

    To create and save actors along with the map:
    In STE you can attach prefabs to the tiles, so you can use tiles as icons for placeables or actors to be instantiated in the map when it is instantiated.
    I RPG Map Editor you have to place the actors in the scene but cannot be attached to a certain tile.
     

    Attached Files:

  9. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    @CreativeSpore
    It is possible to use 3D characters models instead of sprites on top of the map level ?
    Perhaps using a blank character sprite and display on top of it some 3D model, but how to avoid Z issues display ?
     
    Last edited: Oct 14, 2016
  10. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Yes, you can use 3D characters.
    The characters are sorted by Z dividing the distance in Z from the last Ground layer to the Overlay Layer by the size in pixels from top to bottom of the map.
    So basically, when using 3D models with depth you need to set the Z value of the Overlay Layer or the Ground Layer so the distance is big enough to avoid two models to overlap each other.
    If you change the ground, you have to increase the Z for all ground layers, for example, Ground Overlay to 1000 and Gound to 1001.
    If you change the Overlay layer, you have to set a more negative number, like -1000, but remember to change the camera as well ( normally the camera is at Z = -10 )
    If you find any issue let me know.
    upload_2016-10-15_11-4-6.png
     
    zenGarden likes this.
  11. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This is a good news :) I'll try that.
     
  12. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    Hi, I just bought RPG Map Editor (1.5.2), and none of the demo scenes are working. The characters/animals/vehicles all show up, but there is no map. I'm getting an error in AutoTileMapSerializeData, line 31:

    Code (CSharp):
    1.                     if (System.Convert.ToInt32(curVersion[i]) < System.Convert.ToInt32(compareVersion[i]))
    2.  
    The problem is curVersion is messed up - for some reason, while "k_version" looks correct, "version" is 312e322e34. I'm using Unity 5.4.2p2, standard Windows/x86 platform.

    Also, I changed it to check for k_version instead of version, and that fixed the error message - but the maps have tile errors on them, and when I run a scene I am immediately getting this error:
    "Scene '64656d6f31202d20426967204d6170' (-1) couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded." from DemoGUI line 109, called by DemoGUI line 160.
     
    Last edited: Oct 30, 2016
  13. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Just to inform other people reading the forum. I fixed this issue responding by email, but I forgot to replay here as well. So here is my answer to solve the issue.

    It looks like late versions of Unity have problems with asset serialization. It happens when the project use serialization mode Force Text instead of Mixed.
    Changing it to Mixed before importing the project should fix these issues.

    About the problem with DemoGUI, it looks like there is corruption data because of the serialization issue, but also, to load an scene, the scene should be added to the build settings:
    upload_2016-11-16_11-2-29.png
     
  14. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    @CreativeSpore we're making a Harvest Moon and your asset looks the closest to what we need.
    I have a few questions:

    CHARACTERS
    1. Can the animation of the characters be made of more than 3-4 poses for walk?
    2. How are action animations handled?
    3. How would this be used for a Harvest Moon type game? plants on Layer 2 and plant logic by hand? How do I then trigger a character animation for picking up, using a shovel, cutting a tree, emoting while talking with NPC etc...
    4. Let's say I want to use segmented animation instead of keyframe sprites, how would I interface that with your system?
    5. Is there a way to use mecanim animator instead of CharAnimatorController? How is that done?
    6. You example is pixel art, what if we do very highres art instead? How do we do that?
    7. Can individual images be used instead of sprite sheet? It's easier to handle for the artist and also unity has a 2d packer.
    ENVIRONMENT
    1. we need tiles that are 512 pixel, not 32, how can this be done?
    2. I read that autotiles is hardcoded at 32 pix per tile, hardcoded??
    3. can smart brush be defined to make a house where the roof is above, floor below, walls etc... and trees to the corners and windows appear when it's above 20 tiles wide... you get the picture. basically can we define complex smart brushes or do buildings have to be made tile by tile by hand?
    thanks.
     
    Last edited: Nov 18, 2016
  15. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Hi there!

    I answer you below;
    CHARACTERS
    1. Can the animation of the characters be made of more than 3-4 poses for walk?
    If you mean frames, yes, you can set the number of frames per animation. The DirectionalAnimation system allow you to change the frames per direction and you can have 1, 2, 4 & 8 directions per animation.
    1. How are action animations handled?
    You can create an animation per each action and later play the right animation using the SetAnim method.
    You can find more information in the online manual

    1. How would this be used for a Harvest Moon type game? plants on Layer 2 and plant logic by hand? How do I then trigger a character animation for picking up, using a shovel, cutting a tree, emoting while talking with NPC etc...
    I've been playing Stardew Valley recently and according to that, I could say for the different actions like cutting a tree, using a shovel, etc you can have different animation sprite sheets. You could place all of them if the same texture to save drawcalls and use the DirectionAnimationController to slice them all so later you only need to set the current direction (you can even use a vector for that) and the right animation. In some cases you need to place an item at a position depending on the direction, like when holding an item or picking them up. I have an example of that with the pisto item in the sample.
    And for planting, I would create the plants using the tiles when there didn't grow up and use gameobjects when they grow up. You can use the script IsoSpriteController to sort them by Y position.

    1. Let's say I want to use segmented animation instead of keyframe sprites, how would I interface that with your system?
    What do you mean with segmented animation? Different parts being animated separately?
    1. Is there a way to use mecanim animator instead of CharAnimatorController? How is that done?
    Yes, you can use a mecanim animator. You would need to remove few lines calling the CharAnimatorController in case you don't want to use it. Or disable it when needed and make the animation using mecanim. Or use mecanim to set the animation and direction of the CharAnimatorController.
    1. You example is pixel art, what if we do very highres art instead? How do we do that?
    The only limitation here is the size of the texture. You can only use a texture for the tilemap and there is a limit of 8192x8192 but this size depend on the target platform.
    1. Can individual images be used instead of sprite sheet? It's easier to handle for the artist and also unity has a 2d packer.
    No, the Unity sprite packed is transparent to the project and will mesh the sprites positions. But you can use a custom sprite packer to create the final atlas and overwrite it.
    ENVIRONMENT
    1. we need tiles that are 512 pixel, not 32, how can this be done?
    You can change the size of the tile, but 512 is too big. There is a technical limit in the tile size of 256.
    1. I read that autotiles is hardcoded at 32 pix per tile, hardcoded??
    Where did you read that? As I said before, you can change the tile size and it's not hardcoded.
    1. can smart brush be defined to make a house where the roof is above, floor below, walls etc... and trees to the corners and windows appear when it's above 20 tiles wide... you get the picture. basically can we define complex smart brushes or do buildings have to be made tile by tile by hand?
    You can create your own brush but that kind of brush would be complex to be created. Right now it's not implemented in the way it can be modified without modifying the asset code.
     
  16. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    Thanks @CreativeSpore (and don't you wish Spore the game was better :)

    I see in your tileset tutorial that the ground tile is of fixed size - can you explain why this contraint exists?
    What if I only want to have 512x512 (4 tiles) for ground? It seems from the UI that the layers are fixed also: there is a ground, there is an animated etc... please explain this constraint. Is this legacy or something that comes from another software?

    What is a normal tileset, what is an autotileset, what is a ground tileset, wall fence etc... I can't see any detail on that.

    In cell animation, we hold certain cells of animation for 2,3,4 frames to give a nice snappy feeling when we releaase the hold, and economize drawing. This allows to make very good animation with 4 cells.
    I understand from the doc that DirectionalAnimation holds each cell for the same amount of time. Is this something you could do? Moving holds?
    This is the only reason why we'd use the Animator and we'd rather not :)
    https://www.siggraph.org/education/..._animation/principles/lasseter_s94.htm#moving holds

    In a farming game like Harvest Moon where you interact with trees, would the tree be gameobjects or can they be ground tile overlay with special properties? Do tiles have metadata you can add to? How does the coordinate system work?

    How are ground overlay handled in term of their data structure? Big 3D array? [layer, x,y]
    can we overlay ground tiles.jpg
     
    Last edited: Nov 19, 2016
  17. RaiuLyn

    RaiuLyn

    Joined:
    Sep 14, 2014
    Posts:
    39
    I had a go at making an oldschool Harvest Moon type of game(GBA ones) with RPG Map Editor and ORKframework. How I did it is create two separate layers called 'ground layer' and 'overlay layer'. If plow action, check tile id at tile position. If tile id is dirt tile, set tile in 'overlay layer' to plowed tile. So basically like your picture above. Something like trees that takes up 2 tiles can be tricky but possible.

    I don't know how your Harvest Moon game will look like but what I did should be enough to serve as an idea. As to the ground overlay data structure, I think it was 'selectedTile = Layer.GetTileposition[x,y]'. I have not looked at my Harvest Moon project for quite a while now and it was complete with actions and everything.
     
    CreativeSpore and laurentlavigne like this.
  18. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    I bought it, love the character framework esp the pathing, the map painting is solid.
    That said, the tileset creator is bad. With modern packers you shouldn't force users hardcoded png size. I'm seeing that with a tile size set to 128, the png required for ground is 2048x1546 and you say that 512 is too much -- WTF! we're not in 1992 and not everyone wants to make retro pixel art. You're probably hard coding this because your atlasing is also hardcoded, fix this by using the unity packer, it will create your atlas and return tile position that you can then store in the tileset asset. This way you can handle any modulo <tile size> textures and modernize tileset to match how cool character animation component is.
    In the meantime I log these as bugs:
    1. The tileset creator cancel button gets cropped (see picture)
    2. setting the ground to a 256x256 texture returns an error - how do I set it to whatever modulo 128 I want? (128 is the size of one tile)
    3. When tile size is 128, there are only 1x1 slots available and no possibility to add an overlay slot
    4. documentation is not good: what is auto tileset, normal tileset, smart brush... search returns no explanation or tuto on how to make a smart tile
    5. the tileset png is made of 7 128x tiles but the RPG tileset shows only 4. why? Screen Shot 2016-11-18 at 11.33.27 PM.png Screen Shot 2016-11-18 at 11.33.10 PM.png
    6. the collision icon is white so when you prorotype your work with white paper, you can't see them - you're probably using GUI.Label to display those, maybe you can chose a different color or resource icons with outlines.
     

    Attached Files:

    Last edited: Nov 19, 2016
  19. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Hi there,

    I will try to explain everything you asked, but please, let me know if I missed something or if you need a better explanation.

    The Autotileset and the Normal Tileset
    When I created the tile editor, I created it to give support to RPG Maker VX tilesets. They have a different types of autotiles (ground, animated, wall, building and normal). Normal are just tiles with no autotiling (called Object in the next screenshot).
    upload_2016-11-19_9-46-38.png

    This was the first setup for a tileset, but by request, I extended it to create a bigger tileset. And I did it by separating the Autotilesets from NormalTilesets.
    The autotileset is on the left (including the tile previews) and the Normal Tileset is on the right.
    So, when you create a tileset now, you can choose how many slots it will contain and each slot will be a square portion of the atlas that will contain a Autotileset or a Normal tileset.
    In both cases, each slot have a size of 32x32 tiles, so depending of the tile size, the slot will have a size of 32xTileSize X 32xTileSize.
    upload_2016-11-19_9-56-18.png
    If you have a limit of 8192 in the size of a texture: 8192/32 tiles = 256. So here is the limit to the tile size based on this configuration. Even the Unity Texture packer has a limit of 2048x2048 in the atlas size. It is because of technical limitations, not all systems support big textures.

    About the Unity Packer, as far as I know, it works transparent to the project. It creates the atlas in the cache "Project\Library\AtlasCache" not inside the project. Also the tiles for autotiling needs to be in a layout and not in any random position.

    About the bugs:

    • The tileset creator cancel button gets cropped (see picture)
    Thanks for telling me. I will fix that.
    • setting the ground to a 256x256 texture returns an error - how do I set it to whatever modulo 128 I want? (128 is the size of one tile)
    Gound A2 is expecting a texture like this:
    macks_A2.png
    This is intended for ground autotiles. If you only want to use tiles as normal tiles, you should create a slot with a Normal Tileset. Otherwise, you need a texture like this. And for a tile size of 128, it request a texture of 2048x1536.
    • When tile size is 128, there are only 1x1 slots available and no possibility to add an overlay slot
    I've seen the texture limit in Unity 4.6 is 4096 (in Unity 5 it's 8192) and the slots take the 4096 limit into account. It can be changed in AutoTileset.cs line 55:
    public const int k_MaxTextureSize = 4096;
    Anyway, when you say overlay slot, I don't know what you mean. You don't need an extra slot for overlay tiles. The overlay tiles will be placed on a top layer in the tilemap.
    • documentation is not good: what is auto tileset, normal tileset, smart brush... search returns no explanation or tuto on how to make a smart tile
    Auto tileset and normal tileset has been explained above. About the smart brush, it is an option for the painting brush to work in a smart way and it's explained in the inspector view when you check or uncheck it:
    upload_2016-11-19_10-33-40.png

    It depends on how you created the tileset. Could you show me the tileset window? I think you created an Autotileset and probably set the Animated texture. Try creating a Normal Tileset in the tileset slot instead.
    • the collision icon is white so when you prorotype your work with white paper, you can't see them - you're probably using GUI.Label to display those, maybe you can chose a different color or resource icons with outlines.
    You are right. I will add a color selector for this icons.
     
  20. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    Ground needs to be flex9 (what you call autotileset) that's good to know and where is this information in the interface?
    And what does ground A2 mean anyway? Seems you're using rpgmaker linguo and with zero lexicon (preferably better ui) there is no way to know.

    I wasn't following the flex9 constraint.

    overlay = translucent tile that's on top of tiles below, for example a wet spot which modulates the color below to make it darker.

    here is the tileset
    HM ground.jpg
     
    Last edited: Nov 19, 2016
  21. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    2 bugs:
    clear layer has no cancel button
    Screen Shot 2016-11-19 at 3.59.55 AM.png
    and doesn't even clear anything, spamming the console with this when clearing
    NullReferenceException: Object reference not set to an instance of an object
    CreativeSpore.RpgMapEditor.TileChunkPool+<UpdateChunksAsync>c__Iterator5.MoveNext () (at Assets/CreativeSpore/RpgMapEditor/Scripts/AutoTileMap/TileChunkPool.cs:126)
    CreativeSpore.RpgMapEditor.TileChunkPool.UpdateChunks () (at Assets/CreativeSpore/RpgMapEditor/Scripts/AutoTileMap/TileChunkPool.cs:116)
    CreativeSpore.RpgMapEditor.AutoTileMap.UpdateChunks () (at Assets/CreativeSpore/RpgMapEditor/Scripts/AutoTileMap/AutoTileMap.cs:311)
    CreativeSpore.RpgMapEditor.AutoTileMapEditor.DrawPaintTab () (at Assets/CreativeSpore/RpgMapEditor/Scripts/Editor/AutoTileMapEditor.cs:489)
    CreativeSpore.RpgMapEditor.AutoTileMapEditor.OnInspectorGUI () (at Assets/CreativeSpore/RpgMapEditor/Scripts/Editor/AutoTileMapEditor.cs:260)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1231)
    UnityEditor.DockArea:OnGUI()
    then can't paing, spams the console with
    NullReferenceException: Object reference not set to an instance of an object
    CreativeSpore.RpgMapEditor.TileChunkPool+<UpdateChunksAsync>c__Iterator5.MoveNext () (at Assets/CreativeSpore/RpgMapEditor/Scripts/AutoTileMap/TileChunkPool.cs:126)
    CreativeSpore.RpgMapEditor.TileChunkPool.UpdateChunks () (at Assets/CreativeSpore/RpgMapEditor/Scripts/AutoTileMap/TileChunkPool.cs:116)
    CreativeSpore.RpgMapEditor.AutoTileMap.UpdateChunks () (at Assets/CreativeSpore/RpgMapEditor/Scripts/AutoTileMap/AutoTileMap.cs:311)
    CreativeSpore.RpgMapEditor.AutoTileBrush+TileAction.DoAction (CreativeSpore.RpgMapEditor.AutoTileMap _autoTileMap) (at Assets/CreativeSpore/RpgMapEditor/Scripts/AutoTileMap/AutoTileBrush.cs:108)
    CreativeSpore.RpgMapEditor.AutoTileBrush.PerformAction (CreativeSpore.RpgMapEditor.TileAction _action) (at Assets/CreativeSpore/RpgMapEditor/Scripts/AutoTileMap/AutoTileBrush.cs:178)
    CreativeSpore.RpgMapEditor.TilesetComponent.OnSceneGUI () (at Assets/CreativeSpore/RpgMapEditor/Scripts/Editor/TilesetComponent.cs:150)
    CreativeSpore.RpgMapEditor.AutoTileMapEditor.OnSceneGUI () (at Assets/CreativeSpore/RpgMapEditor/Scripts/Editor/AutoTileMapEditor.cs:178)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.SceneView.CallOnSceneGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2056)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1405)
    UnityEditor.SceneView.OnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1242)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    And after I flex9-ned the ground tiles and moved the tilling and plants in the "normal" tileset it's working and then something happened and now the map is all white, the atlas isn't.
    I included the atlas as a package so you can look at the settings
     

    Attached Files:

    Last edited: Nov 19, 2016
  22. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    Maybe each plant can all be a normal tile set on an extra layer above overlay, and swap tile as the plant grows, keeping an array of plants instead of the unity way of having a component per plant.

     
  23. RaiuLyn

    RaiuLyn

    Joined:
    Sep 14, 2014
    Posts:
    39
    Yep. That's pretty much how I would do it. Swap sprout tiles based on tile IDs to a grown tile on another separate layer above accordingly. It also saves you from making tiles of watered versions of the plants in the process. Though you have to call the grow function on each plant when going next day.
     
    laurentlavigne likes this.
  24. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    @CreativeSpore I spoke with my artist and yes he needs animation hold timing, like in traditional animtion.
    I emailed you the gif he made, import it in photoshop and you'll see that the timing is different for each cell.
    An option to enter an array of timing for each frame, can you do that?
    Screen Shot 2016-11-20 at 12.06.11 AM.png
     
    Last edited: Nov 20, 2016
  25. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    Can animation tileset sheet be used for plant growth? ie: instead of automatic animation speed for the tile, control over which of the animation tile is displayed.
     
  26. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I have fixed that.
    It was due an optimization made to remove chunks with no tiles.
    Checking for null before calling RefreshTileData will fix the issue. And probably the issues coming after this exception.
    Code (CSharp):
    1.        
    2. public IEnumerator UpdateChunksAsync()
    3.         {
    4.             while (m_tileChunkToBeUpdated.Count > 0)
    5.             {
    6.                 if (m_tileChunkToBeUpdated[0])
    7.                     m_tileChunkToBeUpdated[0].RefreshTileData();
    8.                 m_tileChunkToBeUpdated.RemoveAt(0);
    9.                 yield return null;
    10.             }
    11.         }
    12.  
    I have also added a cancel option in all dialogs were there was only an affirmative button. The reason of not adding the cancel button was the popup window has a close icon in windows, but I guess in IOS it's different.
     
    laurentlavigne likes this.
  27. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    About the overlay question, you can use transparency in the atlas texture, and layer place the tiles in a layer over the ground to achieve that.

    To make plants growing, I recommend you add a gameobject to change the tile were it is using a timer. But it depends if you want something to grow, like corn, you should use a gameobject with a SpriteRenderer and the IsoSpriteController component to sort it by y axis. Changing the tile will work only during the first stages were it is at the ground level.
    For example, you could create a gameobject, with a SpriteRenderer and and the IsoSpriteController, and disable the SpriteRenderer during the first stages, changing the tile where it is over instead, using the methods:
    RpgMapHelper.SetAutoTileByPosition passing the trasform.position as argument to change the tile under it.
    Then, when the plant has grown, enable the SpriteRenderer to render the plant.
     
    laurentlavigne likes this.
  28. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I will check this. But I think it could be possible.
     
  29. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    Got it but I have a problem: the sprite with IsoSpriteController is always behind the translucent overlay.
    Screen Shot 2016-11-20 at 8.10.24 PM.png

    I need to assign behavior to tiles so the player can cut trees, till the earth, plant tilled area, the goat can mow the lawnetc...

    We need tile tag, here is how this would work:
    Click on a tile and a string field appears, the user can type a tag name (any string).
    Then
    Code (CSharp):
    1. var tile = GetAutoTileByPosition(position,0);
    2. if (tile.tag=="well")
    That's all I need to detect the function of a tile.

    Super simple to implement, you add a string tag to your tile struct. Can you add that along the animation hold?

     
    Last edited: Nov 21, 2016
  30. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I will add the tag to the tiles as well. I will send you a version when it's done.
    About the IsoSpriteController, it changes the Z position in a range between the first ground layer and the last overlay layer. The tiles in the overlay layer are always on top of gameobject with the IsoSpriteController component.
    To create interactive elements it's better to create gameobjects, for example for trees that you can cut.
     
  31. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    Great.

    The artists is in fact considering not using tiles because he's far more familiar with sketching and we're worried that changed over large section is unmanageable with the map editor.
    Do you have cut/move/copy/paste of large section of the map?
     
  32. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    You hold right mouse button and drag to select a rectangle of tiles and paste them by clicking over other position.
    Check the manual, section Drawing Tiles to know more about tile painting.
     
  33. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Is there a character control with the mouse? Or just the keyboard?
     
  34. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Yes, you can use the PlayerTouch prefab. This is using the TouchFollowBehaviour to create a route between the player and the clicked or touched position using path finding to avoid the obstacles.
     
  35. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Thank you! Another question - if I clicked on an area that is inaccessible (eg hill without stairs) the character is still going, then gets stuck, but the animation is running. How can it be fixed?
     
  36. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I found a problem in the code while testing. I have attached a modified script with this issue fixed.
    Now the player won't move if the target position is not reachable.
     

    Attached Files:

  37. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Good. Thanks!
     
  38. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    You are welcome ;)
     
  39. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Important notification if you are using Unity 5.5

    I found a bug when dragging a character sprite sheet into an animation controller.
    You need to apply the fix attached to this message to fix the issue.
    Sorry for the inconvenience. A new version has been released and will be soon available in the Asset Store.
     

    Attached Files:

  40. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    I find three new bugs for Touch control.
    1. When moving at 90 degrees has a bug in animation
    3cab0-clip-325kb.png

    2. I can click to border passable area. Player move and loop animation
    Clip2net_161222130515.png

    3. Player somewhere to go and push the unattainable tile, the player continues to move but with a bug and speed without endpoint
     
    Last edited: Dec 22, 2016
  41. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I've been revising this and improving some scripts. Try applying the attached patch and let me know if you find any more issues.
     

    Attached Files:

  42. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Bug 2 and 3 fixed!
    Bug 1 remained.
     
  43. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Could you describe the Bug 1 in the animation? I am not sure what it is.
     
  44. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
  45. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Thanks for the video.
    I wasn't sure if the problem was with the animation or the movement. I guess you mean the player is turning 90º too soon before reaching the corner. Is that right?
    This is happening because the PathFindingBehaviour is always targeting the next tile as soon as it enters the target tile.
    This could be easily changed in the code, but could you confirm if this is the issue you were talking about?
     
  46. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    If I place the player manually into a custom place on startup scene, sometimes it turns out:
    video_gif6.gif
     
  47. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Yes. I think it is similar to what you said. How can I fix it?
     
  48. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I wasn't able to replicate the issue because it's related with a high FPS rate.
    I have changed the quality to Fast and being able to find and fix the issue.
    Here is the last updated patch for the current version.
    Let me know if you find any other issue.
     

    Attached Files:

  49. OccularMalice

    OccularMalice

    Joined:
    Sep 8, 2014
    Posts:
    169
    Does anyone have an idea how you could do dynamic lights with this toolkit? There doesn't seem to be any built-in lighting (I think it was mentioned in this thread early on). Would you need to buy another package to make it work or would it be easy to code in this one?
     
  50. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Hi there,
    I'm working on a lighting system but it's still in beta and I cannot tell you an estimation about how long it will take to include it. But it won't be soon.
    But you can use Unity lights if you change the material of the tileset to Sprite/Diffuse.
    upload_2016-12-30_10-51-15.png