The Daily Click ::. Forums ::. Klik Coding Help ::. Background weirdness
 

Post Reply  Post Oekaki 
 

Posted By Message

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
10th December, 2008 at 09:19:34 -

I'm making a new platformish type game and it's using a scrolling method similar to Knytt, by which I mean the screen is perfectly still until the player starts to leave it and then the screen snaps to the next veiw/location.

The weird thing is, when the screen snaps to the new location, some of the backdrop objects flash for a millisecond...

Another strange problem that's similar is when I snap from one side of the frame to the other (about 2000 pixels) some objects from random parts of the level flash really quickly and then the correct thing is displayed.

Not sure what's causing this.. :S It seems to happen more to light or vibrant backdrop objects that are ontop of dark objects...

 
n/a ...

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
10th December, 2008 at 12:57:02 -

Sounds pretty strange, have you tried fiddling with the objects settings, such as "Destroy if too far from frame" or "Inactivate if too far from window" .. are you using ink effects etc etc?

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14456

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
10th December, 2008 at 20:54:15 -

I don't think that should happen to background objects. Active objects, yes but not background objects.

Is everything in your frame at once or do you load each screen separately?

 
.

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
11th December, 2008 at 04:59:03 -

Everything is at once. The backdrop objects don't have those properties Jthongbai, but thanks anyway.

It's really odd, I will give you an example:

There's a fridge in the middle of my frame as an active object. I'm at the right side of the entire frame (2000), and upon pressing "enter" I snap to the left side of the frame. But when I press enter, an image of the fridge flashes for a tiny microsecond before it shows the left side of the frame. It does happen mostly with backdrops, but it does with a few actives too...

I have no idea what's causing this It's like the frame is, instead of snapping to the right location, zooming there in an insant and showing flashes of everything it goes past :S

 
n/a ...

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
11th December, 2008 at 09:57:37 -

how are you actually doing the scrolling?

 
n/a

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
11th December, 2008 at 11:55:00 -

This is how I'm doing the scrolling:

The character is 20 pixels wide and the screen in 400 pixels wide btw...

- X position of "player" >= X Right Frame-10
> Centre display at X=X Right Frame+200


- X position of "player" <= X Left Frame-10
> Centre display at X=X Left Frame-200


This only does side-scrolling as I havn't yet added the vertical scrolling feature yet. It snaps the frame 400 pixels in either direction, depending on which direction the character leaves the window...

 
n/a ...

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
11th December, 2008 at 16:20:19 -

@ Julian & AndyUK: My mistake, I did not read the first post carefully

 
n/a

RedEnchilada

formerly RedEchidna

Registered
  01/08/2008
Points
  301

VIP MemberWii OwnerThe Cake is a LiePicture Me This Round 24 Winner!
12th December, 2008 at 02:46:18 -


Originally Posted by -Julian-
This is how I'm doing the scrolling:

The character is 20 pixels wide and the screen in 400 pixels wide btw...

- X position of "player" >= X Right Frame-10
> Centre display at X=X Right Frame+200


- X position of "player" <= X Left Frame-10
> Centre display at X=X Left Frame-200


This only does side-scrolling as I havn't yet added the vertical scrolling feature yet. It snaps the frame 400 pixels in either direction, depending on which direction the character leaves the window...



That's your problem. When you do it that way, it shows each screen it goes past for one frame (About 1/50 of a second). You could use a value for the camera position and use it for the scrolling. (Or something like that. I'm unfocused right now, so this is coming out like mush.)

 
http://www.youtube.com/watch?v=WYrSD35vHo4
woooooooooooooooooaah maaaaaaaaaaaaaaaaaaaaan

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
12th December, 2008 at 06:20:55 -

I'm thinking of just using an active object as a camera and setting it's coordinates when I need to. Of course, the frame position will always be set to look at it so yeah maybe that will work :S


---Edit---
Well I managed to get the scrolling working with only one event and no camera object (I used a value called "camera" instead, suggested by RedEchinda) and now I can snap from one side to the other without any display problems.

There's still some slight background object graphical problems though when scrolling 400 pixels at a time. The frame is 400 pixels wide and the "player"'s Hot Spot is centered.

Always
>Set Camera to: Ceil(X( "Player" )/400)*400+200
>Center display at X: Camera

It sort of looks like the backdrop objects are only loading when they are in the visible window, but that shouldn't be the case.. :S

Edited by -J-

 
n/a ...

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
12th December, 2008 at 08:13:56 -

just use this

i dont know how tall your frames are but assuming its 4:3

Always
>center display at x: (X("player") / 400) * 400 + 200
>center display at y: (Y("player") / 300) * 300 + 150

 
n/a

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
12th December, 2008 at 10:17:21 -

That's like the formula I was using in my last post (Just without the Y dimension), this is helpful but I still can't understand why the graphics are behaving strange... After a few tries I managed to capture one in a screen shot:
Image

The big piece of wall down the middle and the blue tiles aren't supposed to be there. They flash for a second and then the screen goes to normal like this:

Image




Edited by -J-

 
n/a ...

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
12th December, 2008 at 12:28:10 -

hmmm. that code shouldnt make it do that. it might be computer related? do you have the latest mmf2 build (r24? have you compiled it and run it on other computers?

ive never had this problem before.

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
12th December, 2008 at 13:10:37 -

EDIT: Nevermind lol, just read it again and I misunderstood.

Edited by Del Duio

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
13th December, 2008 at 03:08:51 -

Yep, I'm using build R248 and nothing like this has ever happened before :S

This is a screen capture, just as the screen changes from one side of the room (Picture in last post) to the other side, which is only 400 pixels to the left.

Image

As you can see, this is when the lights are off. There's red carpet on the side, and a few other graphical errors. The thing is, all the graphical errors are in the correct place as if you were looking at the last screen, like on the other side of the room there is carpet in the bottom-left and a wall on the right etc...

Edited by -J-

 
n/a ...
   

Post Reply



 



Advertisement

Worth A Click