« first day (1731 days earlier)      last day (3586 days later) » 

Pip
Pip
00:00
Lol
at least you didn't both wear the same dress. that would've been really bad.
hahah
Mixed colors and opacities all working <3
boys cant even wear dresses
is that fair?
00:05
@user3047181 Hi :D
@SelflessPsychopath Hey Selfless I made urs even faster :D jsperf.com/efficient-sprite-pre-scaling/3
Pip
Pip
lol
Pip
Pip
@William'MindWorX'Mariager nice!
00:25
Whoa the latest firefox is crazy fast jsperf.com/efficient-sprite-pre-scaling/3
:) I did that. It might be my machine
@JohnMcDonald :P lol what's your specs John?
Not amazing, but a lot better than my work machine. I was running some of the earlier tests at work, and FF37 was getting the low scores yesterday
Since this is canvas, it might be my GTX970
user146722
@JohnMcDonald that's a nice piece but I think it's your CPU
lol i have a ti gtx750 but i shouldnt matter in this demo
user146722
00:32
@TheMuffinCoder you should run it on the xbox
@SelflessPsychopath :P I would once my younger brother stopped using it
user146722
PC users can just use the fast path
user146722
then @JohnMcDonald's card should matter :P
Yea I plan on adding more support but for now I want to make sure to it works on IE10
user146722
and we can really have shame, instead of only kinda
00:36
@SelflessPsychopath lol on the xbox jsperf saids it's running on windows 8
I thought it was the xbox os
UNLESS it's actually windows 8 reskin
user146722
xbox has been running windows since the beginning
user146722
Xbox -> Win2K, 360 -> Vista then 7
user146722
I would be shocked if the One doesn't run 8
Wait so has it always just been a stripped down version of windows?!?!?!
*mind blown*
what, you didn't think MS would use linux, did you? :P
00:38
@IcyDefiance obviously they were using OSx for their xbox
user146722
smh
apparently PS4 runs on a fork of FreeBSD...that's a little more surprising
Whoa
My Awesomium is running smoothly
I kinda didn't expect that.
lol these performance test are a bit unrealible
@SelflessPsychopath it does and it will get 10
00:40
Firefox it's like am super fast for the slow way, IE is like am super slow and chrome is like am average
lol I wish I had a way to test on Safari
safari will be the same or slightly slower than chrome
they're like 90% the same browser
okay time to test on mobile now
I have 5 android devices I can test on :D
user146722
If you dont mind running those on your xbox I'd like to know what happens
user146722
I tried 1 strategy, replacing x*=4 with x+=x; x+=x;
00:48
@SelflessPsychopath lol bit shifts, I was going to do that before but i stop since it might start looking like spaghetti code
I'll test them on my xbox as soon as I can :P
user146722
And then the other one, I got rid of that step and instead turned the shift left, and did 2 instead of 0
My brother started using it again
user146722
Shifting left 2 also multiplies by 4
I know :P
I was testing it before :P
Wait selfless can we leave the original in the jsperf? I want to compare with the original always :P
user146722
you can do that but I am impatient :P
user146722
00:51
I don't want to wait for one I know is slower
xD kk
weird thing is that some runs have actually said that one was the fastest
user146722
you are only scaling up by 2
user146722
the others are scaling up by 11
user146722
I thought a prime number would magically be a good choice to screw with the cache lol
00:52
Hey lets add the scale to the global so it'll all be the same, I'll update it
user146722
I think a factor of 2 is too small @TheMuffinCoder
I know :P I changed it to 11 now :D
whoa the third one is the fastest
user146722
left shift should be the fastest, since it's completely cutting out the operation
user146722
the other ones are only speeding up the *4 operation, but it still happens
I wonder why the results vary when some methods are obviously faster
user146722
00:56
but for some reason nothing in the god damn world is simple
Must be a lot of interfence
user146722
lol yeah that's why I cranked it up to 11
user146722
it's really in the pointless micro optimization range
:D time to get more testing devices
So, I've been around SO for a while, but new to Game Development (and chat) is this a place I can ask a stupid question?
00:58
Finally, the first one and the third are the fastest on IE11
@Mark depends :P
@Mark absolutely
As long as they're not as stupid as me, which is quite impossible am a dumb-dumb :P
So I've got two coordinate points, on a map, and I'm trying to figure out how to tell point A it needs to head at say, 270 degrees, to get to Point B, using actual compass headings.
@SelflessPsychopath Hey Selfless do u think there's anything else we can add? I want to finish posting changes to get people on facebook to test it
okay, so you need to translate degrees into a direction?
user146722
01:00
@TheMuffinCoder I just spotted another power of 2 only optimization
:D
Dont worry my sprite sheets are always power of 2
user146722
@TheMuffinCoder Will the source image always be a power of 2 size?
@Mark actually moving the point depends on the framework/engine you're using, but usually it's just a matter of drawing it in a different position
wait a secv
They always are power of 2
But does it have to be a square?
user146722
no
01:01
@IcyDefiance No not moving anything, just trying to do the calculation and put it on the screen
Sure them lets use that optimization
And I already know how to put it on the screen.
Wow. So a legit win at about 22 minutes in
Nexus fell
@Mark okay, so by coordinate points, I'm gonna guess you have a pair of 2D vectors, like (500, 200) and (340, 220).
@IcyDefiance For the purposes of what I am doing, that's a safe assumption.
01:03
Okay opera mobile is off to a bad start :P Just installed and wont even open
@Mark the direction from A to B would then be "normalize(B - A)"
@Mark and you can use trig on the result of that to get an angle
uhh, arcsin maybe? been a while since I've used trig functions.
@IcyDefiance Okay. I'll go poke at that. I was messing around with ATAN. The final app is in C# but I'm using PHP to run test functions because it's hella faster then recompiling and re-running the final app every time.
you were at least on the right track then
MLM
MLM
Still listening but seems like a great talk so far:
@IcyDefiance Well the funny thing is, I have a similar function working in JS that seems to work correctly, but it doesn't like running exactly the same way in C#.
01:06
might be degrees vs radians then
C# functions mostly work in rads, depending on the library
@IcyDefiance ....sigh.
Pip
Pip
It does depend on the lib though
C# supreme
It's .NET and .NET uses radians.
And so does PHP.
Pip
Pip
Oh man, the motivation is real
thanks :D
more surprising that the javascript functions don't use rads, lol
Pip
Pip
01:11
I just finished the Random class for MonoGame
finally
just have to write some API docs for it then it's complete
It does too, but I might be massaging the data somewhere to account for that.
Guys Opera for android is mad glitchy
@SpartanDonut beep
@IcyDefiance My Node.JS game server is broken at the moment, so I can't test it and I don't have the willpower to try to fix it.
Pip
Pip
01:12
The motivation is real... time to work on mah gamez
XD
@pip I need some of whatever you're doing.
Pip
Pip
lol
The motivation becomes real when you have played so many games of dota in one day that you are tired of it
Is it ethically appropriate for me to drop a youtube video in here to showcase what I'm working on?
Pip
Pip
Go for it
Pip
Pip
01:14
This room is chill, you don't really have to ask for most stuff like that
user146722
@TheMuffinCoder well I whipped up that power of 2 thing, watch out for ugly magic numbers lol
yeah if you do something horrible we'll just ban you. don't worry about it. :D
user146722
^
Pip
Pip
:D
01:15
Where on the range of horrible does 'forgetting degrees to radians' fall?
@SelflessPsychopath Testing it rn on android firefox, first one gave a error
@IcyDefiance no you get flagged :P
well yesterday I forgot to clear before drawing and spent like 8 hours trying to solve the bug, so...
user146722
the comment is slightly misleading @TheMuffinCoder
@SelflessPsychopath xD dont worry am not referencing u
This whole project is nothing but messy disturbing Math.
01:15
I remember the funny guys Alex before
When this room was a mess and a mod came
I knew it was bad when I asked my Math Major father who is a professor at uni for help and he told me he didn't understand anything I was doing...
user146722
@TheMuffinCoder lol, I didn't touch the first one
user146722
I just added that logarithmic insanity
lol code isn't bad, and math isn't bad. mixing the two...that's when things get a little crazy.
01:16
Lol why does Firefox always give error for the first one
All the others do it well
then mixing the two and optimizing afterward is when things get really crazy
I'm mixing math with code with three different programming languages and two different games, plus a DB and someone elses modpack.
user146722
@TheMuffinCoder there's a magic number in there "1.442695040888964"
user146722
It's 1.0 / Math.log(2.0) + 0.000000000000001
float InvSqrt(float x){
   float xhalf = 0.5f * x;
   int i = *(int*)&x;            // store floating-point bits in integer
   i = 0x5f3759df - (i >> 1);    // initial guess for Newton's method
   x = *(float*)&i;              // convert new bits into float
   x = x*(1.5f - xhalf*x*x);     // One round of Newton's method
   return x;
}
that's a famous function in Quake's source code
01:17
@SelflessPsychopath Oh snap, this is some hardcore optimization
that's what happens when you optimize math too much, lol
user146722
@TheMuffinCoder that 0.000000000000001 is suuuuper important
Can't wait till I fully understand bits
:D
user146722
it pushes it to the "too high" side, so that when you floor it you get the round instead for free
@IcyDefiance Have u seen the optimization being made xD
Pip
Pip
01:19
@IcyDefiance nice
@SelflessPsychopath WHOA IT IS THE FASTEST
Pip
Pip
You know what... I can't decide whether between Unity and MonoGame
user146722
It should be, I got rid of another multiply, and packed it into that same bit shift that was already there
user146722
And people on SO say the bit shift is the fastest way to go from float to int in js in IE10
Pip
Pip
hmm
01:21
go with Unity if you want a map editor or physics
if you don't need either, then it's a harder choice
Pip
Pip
I am not using anything actually devoted to Unity except for an actual working prototype
hard decision
2D so not using physics
Tile-based, so not using editor
2D can have physics
@SelflessPsychopath Tested it on IE10 on the xbox one that one and the third are the fastest :D
ICYYYY
but yeah, up to you in that case. I'd recommend going with Unity, but then I wouldn't actually do it myself. :P
01:23
@IcyDefiance So I have to normalize? I can't just use ATAN or ATAN 2?
uhh, shouldn't have to normalize
atan(y/x) would work, I think
user146722
@Mark I think normalize might be faster anyways, lol you can use that function @IcyDefiance posted earlier actually
I just put the normalize in there out of habit, 'cuz direction vectors are typically normalized, but in this case it's not required
@SelflessPsychopath shocked Firefox said it was the slowest
Pip
Pip
@IcyDefiance wait what. You recommend it but would make the other decision?
01:25
I'm allergic to map editors
So am i
I start coughing out muffins when I get too close
function checkangle(x2,y2,x1,y1) {
var angle = Math.atan((x2-x1)/(y1-y2))/(Math.PI/180);
if(y2 > y1) {
angle += 180;
}
if(angle < 0) {
angle += 360;
}
return angle
}
I don't like Unity enough to recommend it... but it is freely available, and you can get quite good results quite quickly.
Nvm reran and was the fastest :D
This is my javascript function that seems to be working, I think the Math.PI/180 at the end is the conversion to Degrees from Radian
user146722
01:26
Why do you think that?
Because I wrote this two years ago and have no idea what else it could be for?
function checkangle(x2,y2,x1,y1) {
    var angle = Math.atan((x2-x1)/(y1-y2))/(Math.PI/180);
    if(y2 > y1) {
        angle += 180;
    }
    if(angle < 0) {
        angle += 360;
    }
    return angle
}
Fixed font button for the win
it shows up when you have code in the chat box
@Pip when I started programming, WYSIWYG editors were pretty much the worst thing you could possibly use to write code, and the aversion I learned toward them bothers me every time I think about Unity and UE4, even though it's not really valid anymore
@almo Thanks for the tip.
sure, any time :) also you can up arrow to fix posts after the fact like this neat
Pip
Pip
01:27
Ah I see
I might try out MonoGame just because I've been doing some work with it recently
(x2-x1)/(y1-y2) <- Does this look right?
user146722
I see dx / -dy ?
But it's 2 - 1 and then 1 - 2?
Pip
Pip
that is really odd
I have no idea what that is doing
user146722
@Mark I missed what you're trying to do lol
user146722
01:29
@Mark it looks like you want atan2
@SelflessPsychopath Yeah, that's what I've been reading two except this function seems to already have been working for some very odd reasons.
user146722
Yeah that function is implementing atan2
Pip
Pip
@IcyDefiance current state:
Excuse the programmer art
user146722
@Mark atan2 just does that finnageling with the quadrants for you.
lookin cool pip
Pip
Pip
01:31
It's a big decision to switch to MG but I might do it just for a change
the prototype in Unity works well enough but I don't really like having to work around Unity
at the same time.... there is a lot of stuff completed already for me in Unity
:(
user146722
@SelflessPsychopath Way the hell over my head.
Pip
Pip
@Almo opinions on the switch to MonoGame?
I haven't used Monogame
Pip
Pip
I have, and like it, but.... hard decision
01:34
@SelflessPsychopath lol Selfless something wrong jsfiddle.net/themuffincoder/nLyeyhjm/1
The fastest method in action :P Doesnt scale correctly
I'll try to fix it
I feel that the order of operation may be wrong here
user146722
It is
Pip
Pip
Alright, heading to do some dev and then bed. Cya all!
user146722
@TheMuffinCoder You can fix it by adding a single pair of parenthesis
user146722
this line: var index = (x * iscale) << 2 + a;
01:39
THE NEW GAME SHOW, ADD THE PARENTHESIS
:D
Fixed :D
user146722
hint: var index = ((x * iscale) << 2) + a;
@SelflessPsychopath Thx Selfless, you're fantastic at JS
My new role model, learn to make optimization like Selfless
user146722
@TheMuffinCoder If you want an exercise in what I did there, then maybe you can try to figure out how to speed this line up a little more :P
user146722
var shifter = (Math.log(spriteSheet.width * 4) * 1.442695040888964) | 0;
user146722
I'll make it possible, hold on
01:43
:P
user146722
shifter = log2(spriteSheet.width * 4)
user146722
@TheMuffinCoder Here's what you can exploit mathematically: log(a * b) = log(a) + log(b)
user146722
and log2(x) = log(x) / log(2)
lol i learned about this last week in PreCal :P
user146722
Lets work through it
01:45
kk :D
user146722
I mean, I want you to work through it lol... find the log(a * b)
oh xD
log(a) + log(b)
user146722
@TheMuffinCoder find it in this code: shifter = log2(spriteSheet.width * 4)
xD
(log(spriteSheet.width) + log(4) ) / log (2)
user146722
perfect
01:47
Then we can hardcode the values of log 4 and log 2
Or cache them
user146722
Yeah that's one way
user146722
I personally would distribute the /log(2)
user146722
Because I know that log(4)/log(2) is a nice number
user146722
ok you're far enough :P
01:49
it's 2!
log(spriteSheet.width) / log (2) + 2
user146722
perfect!
user146722
Now remember that division fucking sucks and multiplication is only kinda bad
user146722
It would be better to get rid of the division too
user146722
01:51
And conveniently... x / y = x * (1/y)
var a = 1.0 / log (2);
log(spriteSheet.width) * a+ 2
user146722
yep
user146722
now we need to round it to an integer
user146722
well, we don't need to, but it's supposed to be a bit shift
(log(spriteSheet.width) * a+ 2)|0 ???
user146722
01:53
theoretically yes
user146722
sadly we have floating point error in the real world, and x|0 will turn 2.999999999999 into 2
Okay time to apply this knowledge
Well
While you do that
I think I am going to give up and go shoot something
and resent all my math teachers who were right when they said I should pay more attention.
:P why?
Hey Mark are u still in highschool?
Hell no
01:57
All this info is recent to me xD am only in 10th grade
Though, working with the people I do
It still feels like it
user146722
@Mark hey I wasn't trying to be mean earlier, I just thought that was the clearest way to show how they are related

« first day (1731 days earlier)      last day (3586 days later) »