Discussion Forums > Technology

Need some kind of constant motion.

<< < (2/4) > >>

nstgc:
Not exactly what I was asking for, but it provided exactly what I needed. Thanks!

Just to make sure, I have two questions.

1) It is suppose to be smooth
2) the block should not change shape

I'm pretty sure the answers are both yes, but I figure I'd ask anyway.

It definately seems as if there is a problem.

K7IA:
You are welcome :)

The code is very simple, as such, it can be configured very easily. (it seems I didn't include any comments for interpretation of code)

1) speed can be adjusted by decreasing/increasing interval and/or step

--- Code: ---
//just modify this line in the original code (interval in milliseconds, step in pixels)
var o = {interval: 20, step: 5}
--- End code ---

2) The block will never change shape.

nstgc:
By smooth I meant constant. I'm sure it is as that was what was requested.

ANyway, I'm hoping xShadow will run that. As mentioned he has the same monitor.

xShadow:
I'm not sure what you're trying to get out of this test, because I'm pretty sure that it's going to be a little jerky simply because of the way this is using a browser (as opposed to something made for 2d graphical movement...).


Anyway, mine moves across smoothly most of the time, but there are little jerks in between (in Chrome). It also depends on which browser I'm using. Chrome does small jerks every several seconds (a series of them) and then stays smooth the rest of the time, whereas Firefox has very tiny jerks with a big jerk every several seconds. In IE, it doesn't move at all. >_>;

As for the box shape, it depends on how quickly I make it move. Occasionally, the one of the sides (left and right, not up and down) seem to kind of "go inwards" for a bit (ie, the box looks rectangular-ish, since the sides go in a bit), but I think that's (again) simply because of how this is executing in a browser, and the movement isn't necessarily that smooth. Kind of reminds me of when I made some C code that went into a gameboy emulator. Basically, you had to clear off the screen once after every time the box moved, because otherwise it would leave a trail behind. I think there's a similar effect at work here, and that's what's causing the box to "change shape" as it moves. I also notice that there's a few "floors" included in there somewhere. I don't have time to trace the code, but I think that might affect its movement.

Edit: I think it would be more helpful if we did a test that was more easy to relate. If you want, you can download Wolfenstein ET (it's a free game), and then try playing with some people. Aside from obvious occasional FPS drops because of huge firefights in the engine (or internet lag), tell me if you notice anything strange. I can play that game without any problems...

nstgc:
As for this test, I think I see the problem. I turned off compositing which also turned off v-sync. in a one minute period it will "blink" (tear) 68 times (I used a stop watch and counted). This is the same frequency observed with the dropped frame (in another thread I said "every other frame" but that was wrong).

Considering the screen is set to  60hz and the GPU is sending data at 59hz. I guess that last frame each second is used as catch up or something. What is odd, however, is that I can't set it to 60hz when the resolution is set to 1680x1050.

In anycase, thank you xShadow and K71A.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version