00:00
00:00
Newgrounds Background Image Theme
Upgrade Your Account!

HO HO HOPE you become a Newgrounds Supporter this year!

We're working hard to give you the best site possible, but we have bills to pay and community support is vital to keep things going and growing. Thank you for considering!

Become a Supporter so NG can see another Christmas!

The Flash 'Reg' Lounge

3,086,137 Views | 60,186 Replies
New Topic Respond to this Topic

Response to The Flash 'Reg' Lounge 2011-01-10 05:48:26


At 1/9/11 02:06 PM, Chickumbleh wrote: I found this substitute for Math.floor() in the haXe community. I know just setting a Number to an int works faster than Math.floor. This seems really large to be fast.

I tested that against my one-liner:

static inline function myFloor(f:Float){ return f > 0 ? Std.int(f) : Std.int(f)-1; }

Both compiled with hAxe: mine ran 6x faster. (10 million loop with +/- pi)


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-10 05:53:25


Although, for larger values that "fast" floor function takes more time, while my function and even Math.floor take only a constant time to run for any value.

I really have no idea why that fastFloor function would be considered faster.


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-10 07:13:34


Lol: http://gust.isjackd.in/ng/ngff.swf

In summer '08 we wanted to do a programming collab where everyone makes some part of a shooter. The art there is by Xeptic and most by Luis.
Unfortunately the level of ability then was such that it took me some time just to spoonfeed El-Presidente how to make the exploding asteroids in AS3.
Also then (as now) my programming style makes grown men cry.

Before that I was working on this with Luis. http://gust.isjackd.in/ng/_shooter.swf
But then he got tired of it and decided he wants to do the collab instead.


BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-10 11:13:36


At 1/10/11 05:48 AM, Redshift wrote: static inline function myFloor(f:Float){
return f > 0 ? Std.int(f) : Std.int(f)-1;
}

trace(myFloor(-3)); //returns -4


Doomsday-One, working on stuff better than preloaders. Marginally.

Response to The Flash 'Reg' Lounge 2011-01-10 13:31:10


Before that I was working on this with Luis. http://gust.isjackd.in/ng/_shooter.swf
But then he got tired of it and decided he wants to do the collab instead.

lol thats so embarassing i want to delete your posts


None

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-10 15:08:29


I liked the snowman boss game.

Response to The Flash 'Reg' Lounge 2011-01-10 18:23:50


At 1/10/11 11:13 AM, Doomsday-One wrote:
At 1/10/11 05:48 AM, Redshift wrote: static inline function myFloor(f:Float){
return f > 0 ? Std.int(f) : Std.int(f)-1;
}
trace(myFloor(-3)); //returns -4

Doh! Stupid edge cases.. But even if you added an entire check for that, it would still be faster than fastFloor.


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-10 21:15:13


At 1/10/11 06:23 PM, Redshift wrote: Doh! Stupid edge cases.. But even if you added an entire check for that, it would still be faster than fastFloor.

If what you have said is true, quite possibly. I mean, the code is so horribly unoptimised it makes me cry. They could have totally removed the "f--" and "f++" bits of that code (since 'f' is no longer used afterwards), which would have made it so much faster!

At 1/10/11 07:13 AM, GustTheASGuy wrote: Before that I was working on this with Luis. http://gust.isjackd.in/ng/_shooter.swf
But then he got tired of it and decided he wants to do the collab instead.

Snowman boss! Wicked!


Doomsday-One, working on stuff better than preloaders. Marginally.

Response to The Flash 'Reg' Lounge 2011-01-10 21:16:36


What is the Newgrounds API thing do and what's it's for again? :o


""Victory Loves Prepareness"" | I'm a Icon Mod.

PSN: PK-Lucas//Gamertag:PSILeo

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-10 21:28:34


At 1/10/11 06:23 PM, Redshift wrote:
At 1/10/11 11:13 AM, Doomsday-One wrote:
At 1/10/11 05:48 AM, Redshift wrote: static inline function myFloor(f:Float){
return f > 0 ? Std.int(f) : Std.int(f)-1;
}
trace(myFloor(-3)); //returns -4
Doh! Stupid edge cases.. But even if you added an entire check for that, it would still be faster than fastFloor.

I didn't check its speed, I was shocked that something so large could be fast. I know that Math functions are usually extremely slow, the trig functions, Math.abs(), ect. It wouldn't surprise me if it was much faster than Math.floor(), but I did doubt its speed.

It seems like the haXe community has let me down :(

Response to The Flash 'Reg' Lounge 2011-01-10 21:49:08


That fastFloor() function uses a partially unrolled loop. Thing is, you don't need any kind of loop to compute the floor of a number. So either the person who made that is delusional, or it was used it some bizarre context.


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-10 22:04:18


It was probably just a example of how a floor could be made.

Response to The Flash 'Reg' Lounge 2011-01-10 22:18:49


At 1/10/11 10:04 PM, Chickumbleh wrote: It was probably just a example of how a floor could be made.

Well, I found this: http://haxe.org/doc/flash/cheatsheet?ver sion=8376

But notice how that fastFloor function only exists for a few versions of that page.


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-10 22:38:25


At 1/10/11 10:18 PM, Redshift wrote: Well, I found this: http://haxe.org/doc/flash/cheatsheet?ver sion=8376

But notice how that fastFloor function only exists for a few versions of that page.

And another mystery solved by the Flash Reg Crew! Nice job guys, let's go home.


Doomsday-One, working on stuff better than preloaders. Marginally.

Response to The Flash 'Reg' Lounge 2011-01-11 01:59:00


how have you all been since i last popped in here?


Sig made by me

Once again i'm falling down a mountain like a metaphor

Here ends another post by the grand master of all things: fluffkomix

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-11 07:15:49


At 1/10/11 10:38 PM, Doomsday-One wrote: Nice job guys, let's go home.

Reminds me of the army when people say that.

Response to The Flash 'Reg' Lounge 2011-01-11 11:56:49


At 1/10/11 09:16 PM, PSILeo wrote: What is the Newgrounds API thing do and what's it's for again? :o

It's used to decrypt forum messages.

Response to The Flash 'Reg' Lounge 2011-01-11 19:46:11


greetings everyone!

I've been around newgrounds and looking into the flash scene off and on since '06 with a few different aliases, but I've never really been an active member. I'm getting more serious about game development now so I just wanted to pop in and introduce myself.

So, how's everyone doing?

Response to The Flash 'Reg' Lounge 2011-01-12 07:53:13


At 1/11/11 07:46 PM, daddywa9s wrote: So, how's everyone doing?

gud


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-12 08:26:11


At 1/11/11 07:46 PM, daddywa9s wrote: So, how's everyone doing?

im ok


BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-12 16:17:36


At 1/11/11 07:46 PM, daddywa9s wrote: greetings everyone!
So, how's everyone doing?

I have a bit of a sunburn.


BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-13 01:53:54


*yawn* I can't decide if I wanna stay up or go back to bed...


Don't patronize me, I know I'm awful at everything.

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-13 01:55:49


Wow... I really need to change my sig banner...


Don't patronize me, I know I'm awful at everything.

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-13 15:24:56


At 1/13/11 02:24 PM, Innermike wrote: Trollahs gonna troll

Mike found 4chan.

Quick, kill him.

Response to The Flash 'Reg' Lounge 2011-01-14 02:24:45


is the new layout going to include forum post upvotes and like buttons? that could be pretty fabulous


the events are merely fictional, written, directed, and acted out by all who create them

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-14 08:12:48


At 1/14/11 02:24 AM, Starogre wrote: is the new layout going to include forum post upvotes and like buttons? that could be pretty fabulous

Doomsday-One likes this.


Doomsday-One, working on stuff better than preloaders. Marginally.

Response to The Flash 'Reg' Lounge 2011-01-14 18:40:57


At 1/14/11 08:12 AM, Doomsday-One wrote:
At 1/14/11 02:24 AM, Starogre wrote: is the new layout going to include forum post upvotes and like buttons? that could be pretty fabulous
Doomsday-One likes this.

Up-vote for circle-jerking


the events are merely fictional, written, directed, and acted out by all who create them

BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-14 19:50:58


When the hell is the site update, i'm getting impatient!


BBS Signature

Response to The Flash 'Reg' Lounge 2011-01-14 19:53:51


At 1/14/11 06:40 PM, Starogre wrote:
At 1/14/11 08:12 AM, Doomsday-One wrote: Doomsday-One likes this.
Up-vote for circle-jerking

O MAN THAT MADE ME LOL SO HARD
+REP


Doomsday-One, working on stuff better than preloaders. Marginally.

Response to The Flash 'Reg' Lounge 2011-01-15 20:40:40


Download my own personal personalized and cooler preloader. :D
http://www.newgrounds.com/dump/item/2be5 8356c914ad6dbc9c6c810f2c8daa


""Victory Loves Prepareness"" | I'm a Icon Mod.

PSN: PK-Lucas//Gamertag:PSILeo

BBS Signature