[SOLVED] Black stripes from Tiled grid visible with camera

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Kymiko
Prole
Posts: 6
Joined: Wed Apr 13, 2016 8:48 pm

[SOLVED] Black stripes from Tiled grid visible with camera

Post by Kymiko »

Hello everyone,

I have been experiencing an issue when using hump.camera with STI. When the camera moves, sometimes some black stripes appear and disapear quickly on the screen (I think they correspond to the delimitations of the tiled map in Tiled). I have no idea what may be causing that.

Attached is love file of the game, you may need to move around a bit before expriencing the bug. I have had this problem on 2 computers, so I don't think hardware is the problem. You essentialy want to look at the game.lua and map.lua, that's where the main logic operates.

Thank you for any help ! Have a good day :)
Attachments
Problem_Tiled.love
(354.75 KiB) Downloaded 142 times
Last edited by Kymiko on Sun Jun 05, 2016 3:11 am, edited 2 times in total.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Black stripes from Tiled grid visible with camera

Post by pgimeno »

For the looks of it, it seems you're running into this problem: https://bitbucket.org/rude/love/issues/ ... ing-images

I'm not yet sure if it's a LÖVE bug or a GL bug, or whether it's fixable at all.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Black stripes from Tiled grid visible with camera

Post by s-ol »

Try math.floor'ing the camera coordinates before translating. There's other solutions with transparent borders between tiles in the tilemap, you should be able to find threads about it as it's a pretty common issue.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Kymiko
Prole
Posts: 6
Joined: Wed Apr 13, 2016 8:48 pm

Re: Black stripes from Tiled grid visible with camera

Post by Kymiko »

math.floor the camera coordinates made it, thank you very much, pretty simple in the end !
Saphiresurf
Prole
Posts: 14
Joined: Thu Mar 16, 2017 1:53 am

Re: [SOLVED] Black stripes from Tiled grid visible with camera

Post by Saphiresurf »

Hey! So I ended up math.floor'ing my coordinates and it worked fine, but once I enter in a zoom level for hump.camera these black lines are reintroduced. Two questions I have here, do you know why the zoom might be causing issues still even with the coordinates rounded? Then secondly, why does math.floor'ing the x, y coordinates work in the first place when my x, y coordinates are always integers anyways? Thank you for checking this out I appreciate it!
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: [SOLVED] Black stripes from Tiled grid visible with camera

Post by Jasoco »

Because the scaling is still decimal. You need to pad your tiles with extra repeated pixels at the edges to hide it.

Or not allow for decimal (Non-whole number) scaling.

Or do extra work and always draw to a large canvas at 1x scale and scale that instead.
Post Reply

Who is online

Users browsing this forum: No registered users and 51 guests