Age/Gender: 30, Male
Newgrounds Stats
Whistle Status: Bronze
Exp. Points: 1,920 / 2,180
Exp. Rank #: 16,393
Voting Pow.: 5.57 votes
BBS Posts: 96 (0.05 per day)
Flash Reviews: 356
Music Reviews: 16
Trophies: 1
Stickers: 0
Just when I thought Flash's garbage collection was inherently flawed, I suddenly figured out what I and everybody else was doing wrong.
The symptom of poor Garbage Collection pretty obvious, and very painful. I first saw this in the Bloons turret defense game a long time ago. Basically, the game gradually slows down and then suddenly speeds up, over and over again.
It turns out, Flash 9's garbage collection is just FINE. You just need to know how to use it:
As you know (if you're using AS 3.0 anyway) a typical main loop looks like this:
// Initialize main game timer
var gameTimer:Timer = new Timer(20);//20 ms = 1/50 second!
gameTimer.addEventListener(TimerEvent.
TIMER, gameMainLoop);
gameTimer.start();
//Main game loop
function gameMainLoop(event:TimerEvent):void {
//Game code goes here!
}
You set up a timer event listener, and then when the listener fires, your code gets run. In my example, I'm doing it every 20 milliseconds, which works out to 50 frames per second. So you'd think the natural thing to do would be to set the agme's Frame Rate to 50 fps so you can see every frame, right?
WRONG!
You need your main timeline's refresh rate (or I guess stage.framerate if you're doing it in code) needs to be LESS THAN the ammount of time between refreshes. So, for example, in my game, I used the timer code above to update my game state 50 times per second, but my SWF only updates the graphics on the screen 40 times per second. The game runs a lot smoother now.
Why?
Because it's using that extra fraction of a second's worth of downtime after every screen update to run Garbage Collection!
So, that explains the "uneven" frame rate issues I was having with my game. It runs silky-smooth now! Next time I see anyone's game on Newgrounds and it seems to suffer from GC issues, I'll be sure and link them to this post, so they know what's going on.
And I'm still a Flash 3.0 noob, myself, so if I got some of the technical details wrong in this post, and you know better, go ahead and post a Reply below.
Update: Looks like Bloons Tower Defense has already been updated to address the GC issue. They fixed it so you can't cram as many tack towers into the corners, too... oh well, just trust me, at one time, it was the poster child for GC problems.
Updated: 10/05/07 9:46 AM 0 comments | Log in to comment! | Share this!It's taken me a long time to catch up, but I've finally started to make some headway into understanding AS 3.0. It's taken me a while to get into it, but can you blame me? The online tutorials are skimpy, the official tutorials seem almost deliberately obtuse, and the community, while enthusiastic, is kinda small. It doesn't help any that they made subtle tweaks to virtually every keyword you're used to using. Well, almost. Unary and Boolean operators still work the same, and the Math object made the transition strangely unscathed. But other than that, all of your old tricks are now illegal.
Here's a tip: Don't follow the tutorials blindly. You CAN still put code in the main timeline, or even (shame on you!) in movieclips on the stage, but you'll need to learn the new syntax in order to do it. You can't attach code to Objects anymore, which was one of the few elegant things about AS 2.0 (from a flash developer's point of view.) I'm 90% sure it's impossible to run a block of code per enemy per frame without creating an official class the OOP way. That's certianly how I did it. At least, for objects I spawn a lot of such as bullets and enemies. The player and lone background objects, I just implemented in the main timeline using AS3 as a scripting language. I may transition them to OOP later and see if the game gets even faster or not.
I understand the biggest speed boost in 3.0 is won by eliminating the MovieClip class from your game altogether, but I haven't quite figured out how to do animations with Sprites yet. The tutorials on Sprite games are absolute rubbish, by the way. They assume you want to store all your graphics in some damned web directory, thus making SWF-only portals like Newgrounds difficult to accomodate.
This is what happens when you try to turn a Graphic Design Utility into an Enterprise Language. It's just Adobe being greedy, of course. But in the end, Java's still slightly faster and better documented, so I can't see the professional programmers adopting it no matter how logical the API is. All they've done is alienate the community that put Flash on the map in the first place.
Well, despite the upgrade, I'm working on a little Halloween game right now. The AS 3.0 version runs faster than I ever dreamed... but the screen updates are a little uneven. Hopefully I'll improve upon that as I grow more experienced. I'd like to use screen flipping or double-buffering or something, but I think I read somewhere that that only works in full-screen mode. I don't remember. Oh well, I'm sure I'll figure it out.
It was a pain in the ass to learn, but the worst is behind me. From here on in, Things can only keep getting better and better. :)
And after seeing the improved performance, I don't think I'll ever want to go back to 2.0.

Well, it finally happened. Almost a decade since it was in any way relevant, I finally saw the Matrix, plus both sequals. I scored them at a GameStop for less than it would cost to rent them.
I guess that explains every fight sequence ever seen on Newgrounds.
I had some problems with the series, of course. I choose to believe that Morpheous was simply ignorant about the fine details on how humans are being used for energy, and that it's not some alledged biological energy output (if they could tap waste heat, there are much easier ways to get it) but simply the human brains being used as paralell processors for monitoring and controlling the fusion reactors that power the machines. (You know, without slaving something valuable like an AI to the task.)
I was annoyed at the use of bullet time in the orgy/mosh pit scene when a simple establishing shot was enough to get the point across. I got sick of Morpheous constantly landing on the very edge of that semi, over and over and over again. I thought the skirmishes against the machines in the third movie were cool, but the war as a whole dragged on a bit.
But there's one thing about the Matrix movies that really stuck in my craw. It's sitting there, in the back of my mind, slowly driving me crazy. I'm almost afraid to talk about it, it's so disturbing, but here goes:
I didn't hate the last two movies.
I actually enjoyed the fuckers.
I know! I know! I can actually hear my nerd credit dropping as I type this. Every review I can find says Matrix was okay, the sequals sucked. Matrix Reloaded was only 2 bucks to buy... I'm pretty sure it's a violation of FCC regulations for me to enjoy that movie. But I enjoyed 'em anyway.
Granted, I didn't think they were any better than the first movie. And they certainly took the action in a different direction than the first movie. Maybe critics and theatre-goers were expecting them to just be bigger, badder carbon copies of the first movie. But coming to the series as late as I did, I had the opprotunity for my first watching of them to be all three movies, back-to-back. I was able to absorb them as one long story.
And really, I kinda suspect that's how they were meant to be seen. God knows I would have been bored with Matrix Revolution, if I'd come into it expecting to see non-stop bullet time kiung-fu action, and instead I got this stuff about robots and ships and seige warfare. But that's not the way it went down.
God help me, I was even able to take Keanu Reeves seriously in this role, as long as he kept the glasses on.
Maybe I'm just brain dammaged.
But, I don't know, if you own all three movies, and were disappointed with the sequals, maybe you should try watching them all three back-to-back in a marathon some night. You might just find that they're more watchable that way.
Updated: 09/03/07 11:34 AM 1 comment | Log in to comment! | Share this!Once you start reading this, you... HEY, DON'T DELETE ME! NOOOO!
Posted by WarpZone Aug. 30, 2007 @ 3:48 PM EDTSeriously, that's as far as I read before deleting the bitch. And I can't immagine anyone else here at Newgrounds doing otherwise.
I mean, you either believe in them of you don't. If you do, you're functionally retarded, and thus can't figure out how to access the internet in the first place. If you don't, then you read the first sentance, realize that what you're reading is a chain letter, and therefore a waste of your time, and delete it. There's no reason for anyone with an I.Q. higher than cheese to read any further.
The other thing I've noticed is, a lot of this is being perpetuated by throw-away shill accounts with nonsense names like "jklsjh" or "aetedf." I can think of two possible explainations. One, it could just the latest wave of circle-jerk griefing we've all come to know and love here at Newgrounds. Two, (and this one's the truly scary thought,) regular users could be signing up for garbage accounts so they can forward the chain mail without hurting their own reputations.
Is that depressing, or what? Just think, there could actually be someone out there savvy enough to realize that everyone else thinks chain mails are garbage, but gullible enough to just do what the junk mail says so nobody gets hurt.
Updated: 08/30/07 3:58 PM 1 comment | Log in to comment! | Share this!Needless to say, winning that contest was quite a windfall for me. Naturally, the first thing I did (before even getting my check,) was to purchase Flash CS3.
Let me tell you, the transition is HARD. Mostly because all the examples are presented as friggin' classes that you can't really use for anything without building your own test case. I'm interested in doing OOP eventually, sure, but not while I'm still trying to learn all the new commands. Sheesh.
Fortunately, AS 3.0 still works as a scripting language, it's just that a lot of the old ways of doing things have been replaced with classes, and sometimes one simple thing, such as a movieclip, has been divided into numerous classes, so you need to understand each component class and how they fit together, before you can really use one.
So yeah, I'm still learning the individual building blocks, but with luck I should soon have enough knowlege to start work on a simple AS3 game.
You know those really fast games with all the crazy ammounts of geometric shapes flying around? Yeah. I'm pretty sure you can't do those in Flash 8. They leverage the new Shape class, and I'm pretty sure they don't even contain the underlying code for timelines at all. It really is a totally different beast.
Flashkit has been a tremendous help, so far. With any luck, I should know enough to start seriously working on a game in a couple of days. :)
Updated: 08/30/07 2:59 PM 0 comments | Log in to comment! | Share this!Yep, I made a ClockDay movie. Not only that, I did it all in one day. And not only both of those things, but also it was halfway decent.
Happy Clock Day, everybody!
1 comment | Log in to comment! | Share this!WOOT! That's incredible! Wow! I won first place in the contest!
Here's what BoMToons had to say about Veggie-Matic:
This game was very polished in all respects, good menus and graphics, good voice-acting, and very addicting, fun, varied, and balanced gameplay. Plus it won some bonus points for having a wacky, semi-educational storyline that kids loved. The concept wasn't anything too new, but the execution more than made up for it. Everyone who played this one had a rocking good time and came away with a giant smile on his or her face. An additional note is that this game had some of the most organized and efficient code out of all the contest entrants.
That is just so incredibly gratifying. Oh man. My sister called me when she heard the news... she was real excited. Real proud of me. Wow. Holy shit, man.
I find it amusing that they described my source code as "organized and efficient." I thought it was kinda a mess, myself... big chunks of it were procedural at best. I just didn't have time to do it any better.
But the best part has got to be the description of everyone who played it coming away from it with a big smile on their face. Game design. That's what it's all about. Making a game... that's fun.
Wow, I just can't believe I pulled this off! :D Thanks, Newgrounds, for making this contest possible! :)
And those of you who are sick of seeing Wiggi World games on Newgrounds?
Relax, it's over. :P
Updated: 08/15/07 12:48 AM 2 comments | Log in to comment! | Share this!Needless to say, I'm anxiously awaiting the contest results. Most people seem to have really enjoyed the Veggie-Matic game, so I like my chances. Also it seems it got FrontPage'd, which was pretty sweet. A few people bicthed about it, but that always happens at Newgrounds. Frankly, I was expecting a lot more abuse and a lot less constructive criticism. I guess I must have done something right, after all. :)
Now all I can do is wait and see if the judges agree with the masses. It's tricky, because I don't know how strongly they will weigh Fun VS Moral Fiber. The contest rules said "Games that feature one or more of these morals will be graded more fairly," with the predictable result that every single game submitted to the contest stressed as many of those values as the author could think to squeeze in.
But then none of the games were any fun, and BoMToons posted saying he thought the morals thing got over-emphasized, so I guess we'll see.
I hope the kids like it. :)
Updated: 08/14/07 2:38 AM 0 comments | Log in to comment! | Share this!Well, I guess it took a $4000 pot for me to get off my butt and actually submit something. This wasn't the first Flash thingy I've ever made, it's just the first one I thought might actually stand a chance at NewGrounds. It's made for 5-12 year olds, so the first couple stages are excruciatingly slow. Consider yourself warned.
0 comments | Log in to comment! | Share this!