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 - dbanfield

Pages: [1] 2
1
Support / Re: Spotlights at chunk borders on tilemap
« on: July 02, 2014, 09:31:17 am »
Meh. Except when I deployed to android, the problem returns. I have read up about it and it seems there are various optimisation problems for spotlights on android. I could set the spotlights to "important" but FPS drops drastically.

Anyone have any suggestions?

2
Support / Re: Spotlights at chunk borders on tilemap
« on: July 02, 2014, 09:07:24 am »
Aaannnnd.... Solved within 10 minutes of posting this  ::)


I had to go into project settings -> Quality -> Pixel Light Count to bump up that value to something more sensible (default 2!). Working fine now  ;D

3
Support / Spotlights at chunk borders on tilemap
« on: July 02, 2014, 08:54:48 am »
Hi
I decided to incorporate some spotlight lighting effects into my tilemap. I have everything set up (normals enabled, LitBlendVertextColor shader). Everything seemed to be working fine, but when I added more than 1 spotlight that were close to each other around a chunk border, the attached was happening.

I tried messing around with the spotlights to see if different angles affected it, but it didn't really change the problem. It seems also the spotlights don't necessarily need to be right next to each other, but at some point there is a cut off where if one spotlight is moved sufficiently far away from the other, the problem goes away. This distance is pretty far though, and far greater than the distance I need between the spotlights (each one represents a lamp post).

Any ideas what could be causing this?

Thanks
Dan

4
Support / Moving objects and moving cameras with pixel perfection
« on: March 16, 2014, 10:46:49 am »
Hi,
Recently I submitted a problem that came down to solving the issue of pixel perfection from a moving camera.
http://2dtoolkit.com/forum/index.php/topic,3607.msg17372.html#msg17372

I thought starting a new thread would make sense to keep this as a distinct subject matter.

I wanted to clarify something in regards to pixel perfection. The toolkit has the ability to make a sprite pixel perfect. You set up your camera, be it orthographic or perspective, hit the 1:1 ratio button and hey presto, you have a pixel perfect sprite.

In relation to the problem in the other thread, it seems to me that as soon as you move an object, or the camera, pixel perfection basically goes out the window when sprites are next to each other. UNLESS you specifically move your game objects or your camera by 1 pixel.

In the documentation I do recall it saying about setting up the camera so that 1 unit = 1 pixel, which would make this easier. Only move your game objects or your camera by 1 unit and you will maintain pixel perfection.

But if you want to move objects or your camera not by 1 unit, which is pretty much a given if you're using physics or requiring tweening or lerping of your camera, there doesn't seem to be a solution out of the box.


Is this correct? It seems to me it would be nice to have some script which would give the same ease-of-use of the 1:1 button. You could attach a script to the camera, to ensure that it is always snapped to pixel perfection for a given sprite ratio, and a second script that can be attached to game objects that make sure that they are always snapped to a pixel perfect position.



Does this makes sense, or I just talking crazy? I feel like I'm missing something in regards to this pixel perfection malarkey. I would be happy to go and write the scripts myself, but I just want to make sure I'm not missing anything and that the above is accurate.

Thanks
Dan

5
Support / Re: Bug for TileMap: gap in between tiles
« on: March 05, 2014, 09:34:30 pm »
ahhhh. yep makes sense - in my game where I first saw the error I was lerping the camera so would explain that too.
Solutions make sense too.

Thanks for taking the time to get to the bottom of this!!

6
Support / Re: Bug for TileMap: gap in between tiles
« on: February 28, 2014, 09:33:52 am »
So I verified

All chunk positions are 0
The tile map is the exact scale of the 1:1 Sprite
All objects are snapped to a pixel
I am using a camera view that keeps tkdCamera happy (no warning notifications in the component that I'm not using an unrecognised resolution)

Still seeing the bug. (this version including the zoffset hack attached)

Thinking about this some more, wouldn't this be something to do with the tile map? You say that "you're either not pixel perfect, or snapped correctly to a pixel". The tile map is snapped to a pixel since it is at 0, 0, and at the right scale according to a pixel perfect single tile that is also snapped correctly. But this doesn't necessarily imply that tile X, Y is perfectly snapped to a pixel. I'm relying on the tile map code to ensure that, and maybe somewhere along the way the precision isn't enough. Just a thought, I've no idea really!

For example the 1:1 scale is at 5dp. Maybe this isn't enough when you're talking about packing 100s of tiles next to each other.


Just as an aside, before I started using the tile map, I had my own similar (and far less sophisticated) editor script that would let you define a large box collider, and clicking a button on the component would create a bunch of tiles that would fill up the collider
i.e.
place tile at 0, 0
get width of tile
move along x by Value
place another tile
etc (repeat for y axis)

I actually found this same bug would appear, so rather than increasing by the perfect width I would increase by width to something like 4dp. Maybe there was an imperceptible overlap in the tiles but at least there were no unsightly gaps.

7
Support / Re: Bug for TileMap: gap in between tiles
« on: February 23, 2014, 01:22:06 pm »
Sorry for the delayed reply, it's been a busy couple of weeks.

This must be a perspective camera issue then. I tried using an orthographic camera, and I don't seem to have the issue, as far as I could notice.
Even with the z offset modification though, I am still seeing the bug in perspective camera mode.

I'd really like to be able to use perspective camera as I will be using some decorative environment objects at different distances and didn't want to have to write my own parallax scrolling code.

Maybe it is something to do with my tile map scaling. In perspective camera mode, the technique I use is

  • Create a sprite
  • make it pixel perfect by hitting 1:1
  • This gives me the right scaling ratio to apply to the tile map so that it is pixel perfect for the current camera
  • Apply this scale to the tile map

This makes the tile map the perfect size. However maybe there is a better way should do this, or this is maybe where the rounding error comes from.

**EDIT** I've just tried rounding the scaling factor down to 2dp also, and it makes no difference. The bug still appears (this is still using the zoffset mod)

8
Support / Re: Bug for TileMap: gap in between tiles
« on: February 09, 2014, 07:48:38 pm »
Thanks for trying kurayami88, but using point made still didn't fix it.

I also tried point mode without "Extend" on the Sprite, no difference.
Also tried changing the wrap mode, but still nothing.


9
Support / Re: Bug for TileMap: gap in between tiles
« on: February 08, 2014, 05:37:58 pm »
Thanks for taking a look.

Unity version: 4.3.2f1
tk2d: 2.3.3
platform: Windows 8
DirectX: 9 (I presume, dx11 check box is not enabled)
graphics card: Nvidia GT 740M


I've attached a different variation of the bug example. I've now changed the update functions to simply slowly scroll along the x-axis. Reason being that a strange thing happened: the camera position I had in the previous project didn't show the bug after I performed a build.

However I found the same problem was now at 51.85 (instead of 51.75). Weird.

Basically, press play and watch the camera slowly pan in the game view. Sorry, know it's boring, but within the space of a minute or two you will see a flicker of one of these gaps as it scrolls over the problem coordinate, wherever that may be (this is how I always notice it when I'm test playing my game).


Just to add more weight to the problem, I have deployed this scrolling example to my Nexus 7 and Nexus 5, and both will show the bug occurring at some point.


I think some kind of rounding problem is still the suspect, but no idea how this might be fixed  :'(


* edit * yep, just tested it on my nexus 7 again. Ater about 35s of scrolling I see one, and then there's another 3 or 4 occurrences over the next 20 seconds of scrolling or so.

10
Support / Bug for TileMap: gap in between tiles
« on: February 08, 2014, 10:42:05 am »
Hi,
A while ago I posted a problem with small lines in between my tiles when I was using individual sprites and the unity built-in snap to function.

http://2dtoolkit.com/forum/index.php/topic,2368.msg12142.html#msg12142


Since then I've grown older and wiser in the ways of TK2D, and started using the TileMap feature for my game. Everything is going well and I am now enjoying all the advantages of TileMap like easily creating a level rather than labouriously placing sprites, excellent support for colliders, and most importantly no frame rate drops when my levels get big.

Only problem is...


The dreaded lines in between tiles problem has returned  :(

Or rather it never went away. I did notice it when I first started using the tile maps but was hoping some setting would fix it, or that since it was indicated in my previous post it may have been a rounding error, was hoping perhaps rounding the camera position to 2dp would help. No joy.


Attached is an example project where I have managed to narrow down the exact camera position that creates a problem, at a 2dp camera position with the tile map at 0,0,0. I've messed around with settings with no success. 2dp position seems a pretty reasonable accuracy to not expect problems.


I would really appreciate a fix for this since it is pretty much one my last remaining problem in a production worthy build.

Thanks
Dan

12
Support / Re: Unity 2D OnCollisionStay2D bug found?
« on: November 17, 2013, 08:39:08 pm »
Thanks for the confirmation. Took your advice and modified the project to not include 2dtoolkit. Bug submitted - was expecting a confirmation email with a link to the issue as the FAQ describes but nothing yet. Will post it here when it comes through in case anyone's interested.

13
Support / Unity 2D OnCollisionStay2D bug found?
« on: November 17, 2013, 06:55:29 pm »
Hi,
I'm pretty sure I found a bug in the new unity 2d collision system. Posting here first though to clarify, as I found it using the 2d toolkit tile map system.

To reproduce:

  • Open up the attached project
  • press play
  • Debug lines will indicate that the player is currently on a vertical normal
  • press the left key to walk up against the wall on the left. Stop there.
  • hold down space for a short while
  • the debug lines will stop - obviously, you are off the ground  ;)
  • when you land again, still no debug lines
  • walk a little to the right, continue walking on this chunk, still no vertical normal. Huh?
  • With further debugging you will find there are no registered contact points with a vertical normal. This is surely incorrect since you are quite clearly standing on the platform


If you could please take a look and clarify whether or not I'm missing some blindingly obvious thing, but it seems pretty clear cut. If there is a problem, can file a bug with unity.

Thanks
Dan

Edit: Removed attachment, please only post attachments in the private support forums.

14
Ok I see what you mean. I was thinking most of the environment would be taken care of by large blocks (eg a big ground platform that was say 6x32 could just be one collider). It depends how irregular the environment was e.g. lots of individual floating tiles would add up quick.

Point taken on the new 2d physics though. Will wait patiently for U4.3!
Thanks

15
I created a scene with 1024 convex cylinders and still got 60fps on my nexus 7 (which is capped anyway AFAIK - it seemed to spike occasionally to 75fps or so). I can't imagine a level needing more than that.

Anyway, will be waiting for Unity 4.3 since I'll prolly find I'll have to rewrite everything again (for the 2nd time this year. Sigh).

Pages: [1] 2