Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ComputerNerd

Pages: [1] 2
1
Support / Re: Auto Tiling for my game
« on: July 22, 2018, 12:32:09 am »
Tiled supports flipping tiles. And 2d toolkit reads it perfectly.

2
Support / Sharing assets among multiple sprite collections
« on: May 11, 2018, 03:41:01 pm »
Hi,

I am building a moderately large game (think Secret of Mana-like). I am building my tile maps in Tiled, then importing them into the 2D Toolkit's Tilemap.

I have the sprite collections split up to one per area due to the sheer size of them and the large number of areas - it is simply impossible to combine them all into one. The issue I am having is my build size is getting too large due to the large number of duplicated tiles spanning across the different atlases. For example, most of the atlases have a copy of my water tile set. And my shadow tile set. And so forth. Tiled is ok with this structure, but the SpriteCollection's atlas always wants to duplicate the shared tiles since they are in a different SpriteCollection.

Is it possible for the tile map or sprite collection to reference shared atlases? Am I making sense?


Thank you,
Brian

3
Support / Re: NES Style Graphics Recommendation?
« on: May 11, 2018, 03:39:01 pm »
Don't scale things. Use an orthographic camera and change its size. https://docs.unity3d.com/ScriptReference/Camera-orthographicSize.html

Also make sure you are using point filtering on the sprite collection.

4
Support / Re: Sprite Collection corruption
« on: October 06, 2016, 02:00:09 am »
Mistake on my end.  It's fixed.

5
Support / Re: Sprite Collection corruption
« on: October 05, 2016, 11:59:38 pm »
I just created a new Sprite Collection fresh to try it again.

Added just three sprite sheets of two sprites each.  Committed.  Saved the scene.  Checked-in.

Went back to it and deleted just the first sprite sheet.  Committed.  Saved the scene.

And it broke.  Clicking in the red circle area does nothing.  If I hit Config/Apply, it will duplicate the sprites.


6
Support / Re: Sprite Collection corruption
« on: October 05, 2016, 10:40:39 pm »
Hi Unikron,

I've rolled back to a version that is working and have been able to recreate the problem.  I'll recreate the steps in picture form.

Normal sprite sheet, everything looks ok:


And it matches the sprite:


I Delete this sprite sheet because I do not need it anymore:


Now what was the normal sprite sheet is now broken:


The broken sprite:



You'll notice that the Sprite Id changed in both the Sprite as well as the sprite sheet, however they changed to different values.

This is in 2.5.4.

Thank you,
Brian

7
You'll likely be fudging with the internal data, but I don't know the exact process.

What I learned the hard way myself is to store the tile maps separately from Unity through an external 3rd party package.  Tiled, for example, can be easily imported into the 2D Toolkit's Tile Map.  This way in the future if the sprite collection ever becomes corrupted or changes in an unforseen way your tile map won't be lost.  The resulting build files will also be smaller if you load these tmx files at runtime since the data won't be stored in the scene.

8
Support / Sprite Collection corruption
« on: October 01, 2016, 12:58:46 am »
Hi,

Over time, my Sprite Collections become corrupted.  I am unsure how this happens as I do nothing extraordinary.  I don't even notice that something is wrong until I see that the sprite is no longer working so I can't pinpoint when and how it actually happens.  I was wondering if you had some ideas on this, why it may happen, and how to fix this without recreating the whole sprite collection and sprite animations.

It seems to gradually infest all of my sprite collections at some point.



As you can see, this sprite sheet frame is connected to the wrong sprite.  On most spritesheets in this corrupt collection I am unable to click on a frame at all in the Sheet's middle view where it groups them all.

If I click on Config->Apply, it creates a second set of sprites, as so:


This isn't ideal since I lose important data like anchor points.

Oh, the sprite animations connected to these corrupt sprite collections also become corrupt.



Any way to easily correct this?  Thanks!  I am using 2.5.4.

9
Support / Re: Animated Tilemap Script
« on: August 02, 2016, 05:50:57 am »
It basically comes down to this.  If you use the programmatic tile swapping method, you will need to have all of the frames of the animation inside of the sprite collection.  Whether that is ok or not is completely up to you and what your requirements are.

Another difference is the tile swapping is slightly more CPU intensive (since you have to call Build), while the shader method is slightly more GPU intensive.  You cannot use TileMap colliders with the tile swapping method due to the cost of rebuilding the colliders.  You cannot have dynamic actions take place on the shader method (an example being when the player steps on grass, switch the grass tile to "stepped").

From my experience, using the shader method, the GPU cost is negligible.  I am on a Surface 3 tablet and clock a very high FPS even with hundreds of animating tiles.

In the end, I use a mixture of both.  When the player steps on grass or cuts a bush, I use the tile swap.  When the animation is always running like fire or water, I use shaders.

10
Support / Re: Animated tiles and a suggestion
« on: August 02, 2016, 05:35:25 am »
Might be a version incompatibility.  I think I'm using a version that's about a year old.  I don't see any indication of which specific version I am on though.

11
Support / Re: TileMap high disk space usage
« on: August 02, 2016, 01:32:10 am »
Thanks for the quick reply!

I have tried reusing the same TileMapData object between scenes using the same Sprite Collection.  The Tile Map render ends up garbled in the second scene to load.  The layer ordering gets messed up.  I think it may  be due to the fact that I load the tmx files at runtime.  I'll play with it more.

The tmx files use different layer counts and different layer names.

12
Support / TileMap high disk space usage
« on: August 01, 2016, 01:08:00 am »
Hi,

I have a concern about disk space usage with the TileMap.  Specifically, it is with the TileMapData asset.  I am not using Prefab placeholders, but the 2D Toolkit fills in the prefab list anyway by default - with a lot of data.

http://imgur.com/a/T6ffN


As you can see, a list got generated by the TileMap with 2,444 empty game objects.  For one single scene.  This causes the asset to balloon 40 KB.  It may not sound like much, but my game will have north of 400 scenes.  It has now become a 16 MB problem.  Instead of defaulting this serialized field to max tile count, I was wondering if you could work in an update that would only populate this list as needed.


Thank you,
Brian

13
Support / Re: Animated Tilemap Script
« on: July 04, 2016, 05:43:56 pm »
That makes sense. Unless you use custom uv's like in my solution or something similar it will pass the original uv's for the Atlas to the shader.

14
Support / Re: Animated Tilemap Script
« on: June 29, 2016, 08:31:36 pm »
I am assuming your animations are inside of the tile set?  That's how this piece of code works.  You'd be pretty limited in options if that is the case.  Also keep in mind that the Build function will be slow if you are using tk2d colliders.

One way to skin this cat is to have the animation in a separate texture with its own material/shader, then reference the placeholder tile in the sprite collection with your new material.

An example and working shader you can use are here:
http://2dtoolkit.com/forum/index.php?topic=4529.0

You can also reference my topic here if you would like to use custom UV coordinates with that shader.

http://2dtoolkit.com/forum/index.php/topic,5362.0.html

15
Support / Re: Cost of multiple collections?
« on: June 22, 2016, 10:06:27 pm »
To expand on what Unikron said, I'd like to talk about why to set it up this way.

In the end it's all about graphic card round trips.  Unity does its best to combine items that use the same texture and batch them up into one call.  The reason for atlases in general is to get as many items into one texture as possible as to reduce the number of batches/draw calls done.

The 2D toolkit does a great job of packing things in tight, removing duplicates, etc. and is the way to go.

Pages: [1] 2