« first day (1189 days earlier)      last day (4128 days later) » 

22:00
I reached a playability point in my new game dl.dropboxusercontent.com/u/132671/RadStackingUnity/webbin.html
@IcyDefiance This is what my movement was liek before I started making it be more affected by delta.
perhaps your deltas are too big then
i would look at the time delta values for the frames and see if they are too small, making the position changes too small.
delta is 128
So... you're doing:
velocity.x (or y) += accelerationConstant * deltaTime; // where deltaTime is in fractional seconds
then:
position += velocity;
Right?
22:01
perhaps it should be .128
like, try using seconds
instead of milliseconds
if delta is 128, that implies 8 fps
* 1000, got it
because obviously velocity += acceleration * 128 is going to be huge if your units aren't properly adjusted
@IcyDefiance this
also to get .128 from 128, you divide by 1k
22:02
/ 1000 got it
deltaTime in seconds can be easier to work with because then all units like my accelerationConstant are in units / second
that's true as well
easier to think (even if the numbers are tiny)
right? thinking is already too hard. don't need to make it worse.
units per millisecond means your acceleration constants have to be scaled a million times smaller than you'd expect
22:04
It still feels blocky :(
@Jimmy actually, only a thousand times smaller
to be technical
acceleration is 1/t^2
@hasherr what is your calculated FPS?
velocity would be a thousand times
hovering around 62
which still doens't make sense
because i'm synced at 60
22:04
It can vary a bit from the 60
It's not perfect
No, it wasn't like that before
Before I started messing with the timing, it never went higher than 60
But if you have 62 fps then why do you have delta of 128
well you'd think it would vary equally in both directions from 60, but yes, the delta is the stranger part
God dammit.
your delta should be ~16 for 62 fps
22:06
If your deltaTime is in seconds, and you are getting ~60fps, your deltaTime should be about: 0.016666667
What the helll are we we doing wrong?
not thinking about the value of deltaTime
how about, just print the Sys.getTime(), and try manually computing the delta that you get, for few frames (not just 1) ?
and see if that matches what you are seeing as your computed delta time
what the actual fuck
Delta: 128.0
X: 735.5163865074893 Y: 135.61602228484028
Delta: 0.0
How did you get that output?
22:08
We never fixed it, it just went from .128 to 128
@Lasse printing during movement
did you replace all the floats to double?
Are you re-calculating the delta on each use?
if (dir == Direction.NORTH)
        {
            velocity.y += 60f * Game.delta / 1000;
            debugPos();
        }
        if (dir == Direction.SOUTH)
        {
            velocity.y += -60f * Game.delta / 1000;
            debugPos();
        }
        if (dir == Direction.EAST)
        {
            velocity.x += 60f* Game.delta / 1000;
            debugPos();
        }
        if (dir == Direction.WEST)
        {
            velocity.x += -60f* Game.delta / 1000;
            debugPos();
I don't see where the delta comes from
I want to see the Game.delta definition
22:10
time = getTime();
delta = time - lastFrame;
lastFrame = time;
The full definition
getting repository ready, hold on
delta is a double, if he changed the right things earlier
Delta: 128.0
Time: 1.215529984E9
lastFrame: 1215529984
22:11
can you actually just print the previous value of lastFrame instead of after you've already overwritten it
Pretty sure you are re-calculating the delta each time you use it, and that's wrong I stand corrected
return (Sys.getTime() * 1000.0f) / Sys.getTimerResolution();
take the f away
that defines it as a float, not sure what it does to the double values
@Lasse You just did somehting big
@Lasse there are no double values at that point
Delta: 17.0
X: 641.4981942348702 Y: 439.02538064695466
Delta: 17.0
X: 645.0030185058832 Y: 431.605730998175
Delta: 19.0
X: 647.3441945567388 Y: 424.2602777751238
Delta: 14.0
22:12
that's why I said 1000.0, not 1000.0f, though I should've emphasized that more
hey, that looks like 60 FPS >__>
I should've paid more attention faceplam
@hasherr lesson here: calculations are done one operator at a time. the first calculation was an integer * float, which means the best resolution you would get from the division or anything after that was a float's resolution
which rendered all your double typing useless
yes
Steady FPS: 60
and the f was my mistake, but we were working with floats there anyway
22:14
another lesson might be that you could do deltas in ticks and avoid this issue
Alright guys, thanks for all the help.
eh, maybe, but I'd do it in seconds instead
I'M LEAVING IT
right now it's in milliseconds
you could make one more simple change though and make everything much easier in the future
if you take the 1000 away (and cast it to double) then you get the delta in seconds
22:15
@Override
    public void move(Direction dir)
    {
        if (dir == Direction.NORTH)
        {
            velocity.y += 60f * Game.delta / 1000;
            debugPos();
        }
        if (dir == Direction.SOUTH)
        {
            velocity.y += -60f * Game.delta / 1000;
            debugPos();
        }
        if (dir == Direction.EAST)
        {
            velocity.x += 60f* Game.delta / 1000;
            debugPos();
        }
        if (dir == Direction.WEST)
        {
            velocity.x += -60f* Game.delta / 1000;
@IcyDefiance ++
Is there anything wrong with this?
just change "(Sys.getTime() * 1000.0f) / Sys.getTimerResolution()" to "(double)Sys.getTime() / Sys.getTimerResolution()"
@hasherr if it works as intended, then no
so simple, and actually might save a small amount of processor power too
22:16
It works great.
real small amount, but still
yeah. do what icy said and remove all the /1000 and you are all set
Alright, guys. Going for a victory run and then gonna make some food and read up on primitives.
aye
noooo, change thiiiiiings
change is good!
22:17
oooooohhhhhhmmmm. change is goooooooood...
Yeah, but it ain't easy.
pfft, this change is
I woke up in a new buggatti
@Override
    public void move(Direction dir)
    {
        if (dir == Direction.NORTH)
        {
            velocity.y += 0.07 * Game.delta;
            debugPos();
        }
        if (dir == Direction.SOUTH)
        {
            velocity.y += -0.07f * Game.delta;
            debugPos();
        }
        if (dir == Direction.EAST)
        {
            velocity.x += 0.07f* Game.delta;
            debugPos();
        }
        if (dir == Direction.WEST)
        {
            velocity.x += -0.07f* Game.delta;
@IcyDefiance Is this better?
that's part 1
why did you change the 60 to 0.07?
22:18
now do the other part
What other part
3 mins ago, by Icy Defiance
just change "(Sys.getTime() * 1000.0f) / Sys.getTimerResolution()" to "(double)Sys.getTime() / Sys.getTimerResolution()"
then your delta will be in seconds instead of ms
which makes a lot of calculations easier to think through
Oh, okay.
Yeah, that broke a bunch of shit.
Then you can think: "I'm accelerating at 0.07 units per second"
hmm
and 0.07 units per second is pretty slow, make that more like 20 or 100
how did they break?
22:21
but he's actually accelerating at 70 units per second
@Jimmy not anymore
@Lasse It broke delta
@Jimmy velocity.x += 0.07f* Game.delta;
Made delta 0 again.
yes, but that's with game.delta in ms
22:22
no you're crazy! craaazy!
0 or 0.0?
what's the exact line?
when you make it in terms of seconds, you also have to change it to 70 * dt
try (double)Sys.getTime() / (double)Sys.getTimerResolution()
otherwise things just start moving really slowly
22:22
it's not in ms anymore
@Lasse shouldn't be any different, unless java's really crazy
java is really crazy
@Jimmy you're right, but if delta is really 0, that's not the first problem
it's not 0, he' sjust printing it out to one digit
obviously it's going to read as 0.0
22:24
wrong again, that's just what the print does when it's converted to a string
cries
hasherr! what exactly did you change that line to?!
There has to be int -> float issues somewhere
@JohnMcDonald double, not float. that was the original problem. we solved that.
I think he did the cast wrong
which is why I want to see the freaking line
22:25
well, double stands for "double precision floating point"
right. float was overflowing, though
@IcyDefiance Exactly what you told me to change it to.
wrong answer
I want the line!
paste the line
I wonder how many programming man years have been wasted on @hasherr
22:27
heh, oh fun. Sys.getTimerResolution() returns a long
show me the line! or the car fax. or something.
@AttackingHobo Don't say wasted. lol
132123 years, if you count the months we were trying to explain matrix math back in the day
@AttackingHobo wasted is such a strong word
oh god, the horrors
22:27
(double)Sys.getTime() / Sys.getTimerResolution()
full line
I'm betting: return (Sys.getTime() * 1000.0f) / Sys.getTimerResolution(); also returns a float, divided by a long (converting to long), then returning a float
When people ask him something and he argues about it,and does shit like not posting the full line, that is wasting
try adding the another (double) before the resolution
@JohnMcDonald yes, that was the original problem, so we changed the 1000.0f to 1000.0, and it fixed it
22:28
Double everything!
we're beyond that now
public static double getTime()
    {
        return (double) (Sys.getTime() / Sys.getTimerResolution());
    }
lol
there you go
adddddd theeee doubleeeee
THAT'S why I wanted the whole line
22:28
@IcyDefiance Are you really beyond that? You can get decimal places out of getTime()?
can you just copy exactly what people tell you to put there
lol
(double) (Sys.getTime() / Sys.getTimerResolution()); is wrong
(double)Sys.getTime() / Sys.getTimerResolution(); is right
they're completely different
maybe even (double)Sys.getTime() / (double)Sys.getTimerResolution() just to make sure
@JohnMcDonald oh yeah, we had it working until we made another change
22:29
@JohnMcDonald getTime is long
X: 0.4400578482586007 Y: 0.9469621521198802
Delta: 0.01699999999254942
so as long as you dvide by resolution ti should work
Not sure what you're trying to accomplish.
That just broke it, as shown by the log.
@hasherr now, can you figure out why the two lines are different?
22:29
@hasherr that's the correct number now
that log looks correct to me
@hasherr that's now correct
now just change your 0.07 to 70
@hasherr How is that broken?
because now you don't have to re-divide by 1000 again
22:30
24 mins ago, by John McDonald
If your deltaTime is in seconds, and you are getting ~60fps, your deltaTime should be about: 0.016666667
oh!
X: 304.93129681107797 Y: 348.3419044163496
Delta: 0.01699999999254942
Works like a charm.
 public void move(Direction dir)
    {
        if (dir == Direction.NORTH)
        {
            velocity.y += 60 * Game.delta;
            debugPos();
        }
        if (dir == Direction.SOUTH)
        {
            velocity.y += -60f * Game.delta;
            debugPos();
        }
        if (dir == Direction.EAST)
        {
            velocity.x += 60f * Game.delta;
            debugPos();
        }
        if (dir == Direction.WEST)
        {
            velocity.x += -60f * Game.delta;
ARE YOU FUCKING HAPPY NOW
@hasherr and do you see what we just did there? why we took the /1000 and *1000 away?
now! here's your quiz. what is the difference between these two lines?
(double) (Sys.getTime() / Sys.getTimerResolution());
(double)Sys.getTime() / Sys.getTimerResolution();
22:31
@Lasse Yeah, I see it. TJis is definitely much more convinient and readable.
THE MAGIC OF ALGERBRA
@hasherr you're not allowed to write any more code until you can answer my quiz
2
^^
@IcyDefiance A casts the whole thing as a double, B casts it so that just Sys.getTime() a double.
22:32
yes, but there's even more than that
A) first does int / int, with an int answer. right there, you've lost all your decimal places.
I'm acutally tempted to buy super meat boy
Sys.getTime() / Sys.getTimerResolution() = result is integer
then it casts the int answer to a double
22:33
for only 3$
which means your answer will be an int with .0 tacked on the end
Ohh
Okay, I see
@Ali.S pretty good game but it has a dynamic timestep which is glitchy for fast moving games
What do Sys.getTime() and Sys.getTimerRes return?
I don't know what they're used for.
long, which is large integer
22:34
If you have a bad lag you can phase through walls
Lasse beat me
@AttackingHobo I've already finished that game many times (the cracked version, not proud of it)
getTime retunrs number of ticks
getTimerRes returns number of ticks per second
ninja'ed
Okay.
22:34
@AttackingHobo the only reason I've got to buy that game is to unlock it's achivements
@AttackingHobo only glitchy if you're not raytracing, and lag is a problem for fixed timestep games too
the chat is getting hectic today
Thanks guys
@Lasse mostly because of people giving bad advice, or only partly correct advice, and other people trying to correct them
sorry about that
22:35
nah it's nothing to be sorry for
it's just most people here weren't familiar with the problem
my statement did sound more insultive than I meant it to be
and now when that's resolved, perhaps I should start planning my next game project
perhaps this is the one I get finished
@IcyDefiance I am talking about a specific game, SMB, which has the issue I am talking about. There are always ways around any issue but that dev did not solve the issues
@hasherr, .. and since the result was < 1, 0.016..., converted to an int it became 0 . In case of B, both the operands were "raised"(treated as) double, so the result of division could be retained as is, with its fractional value (double represents a Real value)
I don't think I noticed any timestep glitches when I played SMB but I guess I'm used to games physics having "variable friction" by now
@Lasse I'm on that one right now ;P
22:39
@IcyDefiance @AttackingHobo it was never laggy for me, the only problem I had was it sometimes didn't play any sound
@AttackingHobo fair, I just took the statement as a continuation of your arguments yesterday. maybe that wasn't the case.
just added another star to "integer division is bad for the soul" since apparently it wasn't starred enough times
lol right
hah, apparently
@Jimmy variable timestep doesn't exactly give variable friction. that's what happens when you either have variable timestep and don't account for it, or have fixed timestep and lag a little
the only variable with proper variable timestep code is the precision of floats or doubles, which is hardly noticable
jumping through walls is a problem when your framerate is too low and you're moving too far between collision checks, which is a problem with SMB
easiest way to solve that is raytracing
22:43
I dont' think I've ever going through a wall with smb
yeah me neither
your fps has to get pretty low
It was something happening in the backroudn that caused the game to almost freeze for a few seconds
on my old computer
that would do it
there were certain parts of the game that really did not run well compared to the rest of it
With a fixed timestep game it would just pause for a second or so
or freeze then catch up
or if designed bad enough spiral of death time!
but then you could do the thing in slow motion by intentionally limiting the resources it's allowed to use, effectively cheating your way through the game
22:47
would it just just catch up by iterating the updates?
if it was programmed well, it could
Icy I make my games pauses if it goes too low for too long
I'm hardly insulting fixed timestep. I'm just saying don't rely on it.
and most games are gpu bound anyways
well I mean, that's the fixed timestep loop I see used most often
22:48
I like multiplayer and replay systems
those are much harder with a dynamic timestep
like a simple version of the gafferongames version that doesn't keep track of the partials
@AttackingHobo they're also mostly not async, especially as far as indie games go, so where it's bound doesn't matter
crap, gotta move to class
I'll probably be back on momentarily
Anyone else here ever use Debugger Canvas? visualstudiogallery.msdn.microsoft.com/…
3
nope, but I'm saving that one
Dat looks cool
22:56
crap, my archive folder of bookmarks is getting way too big. I need to split it up again.
Its pretty fucking awesome. It makes understanding the flow of the code so much easier
"Edit code directly on the canvas (including edit and continue if available) by enabling the option in the options dialog"
Dis
I have a program that is mostly in 2 files. each 600+ lines. this thing makes it so easy to edit it

« first day (1189 days earlier)      last day (4128 days later) »