Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts

Thursday, September 15, 2011

Of Apps and Browsers. . .

This isn't a rant, and I'm going to surprise a few Flash dudes by not bashing on Flash for once (yes, I've been pretty hard on my roots lately).

Today Microsoft announced that there will be a plugin-less experience in their IE10 Metro browser.  And yes, the Flash hate squad instantly jumped on the "Flash is Dead" train and drove it to Link bait land.  Whatever, it's a typical response.

Here's what I see the news as:  a Paradigm Shift.  We have to look at the browser in a different light, and maybe look at it in the same light as it's hated Plugin children.  The browser is being limited, and it's role is changing in the age of Mobile domination.  And guess what?  That doesn't mean the death of Flash, they have just turned the browser holy land into yet another "App".

So what am I getting at?  Move on Flash dudes, move onto AIR.  Don't hinder your awesome experiences by encasing them in a box.  A box that doesn't even want them in the first place at this point.  Am I the only one that has noticed a correlation to how bad Flash runs and the Iteration of Browser?  Maybe I'm a conspiracy dork (and I'm running a MacBook Pro as well, lol), but a lot of people have been noticing.

But I've also been noticing how much every single browser has sucked terribly when trying to view something that would've made the FWA's any other year.  Hell, even HTML5 sucks balls on the browsers.

I moved into Native Mobile Application development for a reason.  I believe that browsers have their place as a renderer.  But for a real experience I've been looking to Native Apps more and more lately.  And with new App Stores popping up on every OS everyday, I think your viewers/clients are being trained to do the same thing.

Maybe I'm wrong, and I'm sure I'll hear about it if you disagree with me.  That's cool.  Let's discuss.

Tuesday, September 07, 2010

Welcome to Multiplayer Game Development, also known as Hell.



If you have tried to look up First Person Shooter "AAA" Multiplayer Programming you've probably found very little on the subject.  While I understand why the big game development houses keep that information under wraps. . . it still sucks none the less.  So, I've decided to help out a little bit.

Here are the few resources that I have found on the web, and please feel free to add any blogs/articles/books that you know of in the comments.  We're all in this together.

http://jobemakar.blogspot.com/2009/06/actionscript-for-multiplayer-games-and.html

http://gafferongames.com/game-physics/networked-physics/

http://gafferongames.com/game-physics/fix-your-timestep/

http://unreal.epicgames.com/Network.htm

http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

Good night, and good luck.

Friday, July 30, 2010

Flash updating Twitter Status the easy way, right?

Twitter has a super easy way of updating twitter statuses via URL, but the awesome Wez Crozier and I came across some issues.  But first to how you do this:

var url:String = "http://twitter.com/home?status=";

First note:  do not try www.twitter.com, because it will not work.  Your escaped items (mainly Hashtags # == %23) will not be unescaped for you.  Props to Wez for that one.

Here's some awesome RegEx code Wez figured out for me too (I suck at RegEx):

var textToPostToTwitter:String = postText.text;
var input:String = url+textToPostToTwitter;
var output:String = input.replace(new RegExp(/\s/g), "+");
output = output.replace(new RegExp(/\#/g), "%23");

Something that I figured out because I was trying to be lazy and sneaky was that you have to replace the whole String.  I mean you can't just replace the String you want as the status and do a url + input.replace(new RegExp(/\s/g), "+");.  

So, I hope that helps some of you guys not fall into the trap we did.  And thanks again Wez, you rock.

Follow Wez at:  twitter.com/obwez

And use Grant Skinner's awesome RegExr.

Monday, June 21, 2010

The Ryndem Sound Engine




Wow, it's been a while now since I've updated my blog.  With so much going on, who has time to write?

With all the game stuff I've been doing lately in my free time, I've been finding an incredible lack of good Audio tools for Game Devs.  The only one I found that was worth a damn was  Fmod, which is amazingly powerful, but also very expensive to license for the Casual game peeps.

So, I decided to make my own Unity3d/Flash Sound Engine and it's called Ryndem.  I also took a little bit of a different approach.  While it's a sound mixing program like Fmod is, it also is a smart system that you can use to drive the gameplay itself.

It will also have a super simple Hierarchical State Machine incorporated into it, so you can map out the mix/gameplay elements.  This will be useful for Rhythm games, and just keeping everything in a beautiful sync.  I'm still working on the UI, but I have a few in game music mixes here:

www.soundcloud.com/Ryndem

And you can follow the project at:  www.twitter.com/Ryndem

Thursday, September 24, 2009

Part one in my AI for Flash Devs: How to make your own SkyNet in AS3!

I have an unhealthy obsession with Artificial Intelligence. I've always wanted to make a trainable system that learns on it's own. Sounds like fun right?

Don't be scared. It's actually not that difficult to do.

For part one of my intro to Artificial Intelligence for Flash Devs series I could have gone over Finite State Machines, Chasing and Evading, Pattern Movement, or Flocking. Yep, I really could have, but those have been done to death. Let's do something interesting. Let's make a Perceptron.

Think of a Perceptron as a smart Boolean. Due to the various stimulus it receives and it's training it will choose one of 2 choices. This is called a Linear Classifier because the problems it can solve have to be linearly separable (yes or no, red or blue, buy or don't buy).

So, here's an example with everything shown: Seantron's Perceptron.

Let me explain what's going on here.



This is your Network. Blue is input X and Red is input Y and those are connected directly to your output O (the white circle). So each connection has a weight value, and by adjusting the weights we are able to train the Network to do stuff on it's own.



This is the graphical representation of your Training Data. Huh? Well, let's say you have figured out a system for buying stocks. Your blue points could be stocks that meet the criteria that you want to follow to Buy The Crap Out of those Stocks! And guess what the red points would be? You guessed it, Those Stocks Suck Ass, Don't BUY!

So you training data sets the weights (which are those crazy numbers in the Network pic) which allows for the Network to buy or not to buy on it's own. Yes, in this example we are training the system by hand, but I will teach you how to use something called Back Propagation to set up a system to train your Network for you.

*As per makc3d's directions* end edit:

Here are some links to help you with what is going on with the science stuff:

http://en.wikipedia.org/wiki/Perceptron
http://www.youtube.com/watch?v=eDYOH9q2QdA

Gradient Descent is what is used to calibrate the Weights.

http://en.wikipedia.org/wiki/Gradient_descent



Here's the AS3 for the Perceptron example:

DOWNLOAD THE .AS HERE



*Updated the Code and posted it at the link above.  It's been awhile and it seems this blog got weird, sorry about that.*

Tuesday, September 22, 2009

Resistance Is Futile *edit*

Guess what? I don't come from a computer science background. Hell, up until 2 years ago, I thought I was going to be a Music/Motion Graphics dude. Yep, I was an artiste (an uber dork, but an artist none the less).

And one would have to be riding the short bus not to notice that most of the Flash Devs come from a similar background (notice I say Flash and not Flex, ahem). This blog post is directed at you guys, my fellow flash devs/UX dorks. You programming autodidacts (look it up mofo!) in the audience. So, if you come from a compSci background, go back to reading your white papers or writing your book on functional programming for AS3. You probably know all of this stuff.

Please understand the intention of this blog post: I'm just sharing things that weren't taught to me right off the bat. I was starting to feel a little behind the curve, and was wondering if I needed to go back to school or something. F that. Who needs school when you have blog posts and wiki/tutorials to read?

Check it yo. This is my list of things to learn by the end of the year, wanna follow me on the journey? It might be fun, nah, it'll probably suck, but you might be able to make some more money. Got your attention? Coolio. Let's get smert!

Intermediate level:

1. ANT. Learn it, love it, build it. (thanks FlashBum)
install ANT Flex Builder 3
do something with ANT

2. Command line blues. Afraid of the command line? Don't be! It's a powerful tool in the jedi's arsenal.

3. SVN, GitHub whatevs. Use one. Organizational skills are needed. If you are like me with everything on your desktop, learn organization. A clean mind is a razorsharp mind with teeth that can destroy major problems.

*3.14159 Learn Design Patterns. Here's a book to get you started: AS3. Like really really learn what MVC is. Because there is a difference between knowing MVC and KNOWING MVC. You'll know when you know it, because then a bright light from the heavens shines down upon you, and your eyes start to glow green. Seriously, look at my Twitter avatar.

4. Learn a real language. AS3 is rad, and it's my first language so I'll always have a special place for it in my cold dark heart, but it's very limited. If byteArrays throw you for a loop (ha, programmer joke! sigh, I know) learning C++ might help you with that. I don't know if I can recommend C++ to everyone, but try it, you might like it. There is a lot of power behind that language. Especially in this bad economy, multilingual == security.

*4.5 Learn Data Structures mofo! And algorithms if you dare.

Advanced level:

5. Study what's been open sourced by Adobe, like the Flex Compiler (java) and Tamarin (c++) the Actionscript Virtual Machine 2, or aka what makes AS3 run. By knowing what actually is going on under the hood will ultimately make you a much better programmer and/or bitter/insane. Then you'll start to understand what Joa Ebert has been talking about for the last year or so.

6. Embrace change, don't resist everything. I'm saying this as much for myself as for everyone else. Also try to think optimistically. Ha!

Jedi/Sith level:

7. Learn a Functional Programming language. I've been studying Erlang and F# a bit, which has allowed me to figure out the idea behind the XMPP protocol. I've also been told that Clojure is pretty awesometastic. This is the added bonus level though. Functional Programming is not easy at all, it's based on Lambda Calculus and it looks like it too. I've also heard that once you successfully complete a project in Erlang that not only do you get a free membership into Mensa, but you also learn the secret to space time and who shot JFK.

it's time to start the journey in 3, 2, 1. . .

Tuesday, February 03, 2009

MegaMarioLandBrothersAS3

Ok, ok, that last post was pretty bitter. Well you work on an impossible project for 5 months and tell me how you do. Regain composure, breathe in, and repeat the following: and so it goes, amen.

I've decided to dive into a couple of side projects to get my Flash groove back, and guess what? It worked.

Flash is good for a lot of things, 3d is just not one of them. Unless, you are cool with a pathetic 4000 polys for your ENTIRE scene! I mean come on!

And so it goes, amen.

Let's focus on the positives. I'm going back to 2d, and I'm developing a Flash Framework called MegaMarioLandBrothersAS3. If you have any brain at all you can figure out that it is a framework for old skool platformer games.

What will it include? Funny you should ask, because I've got some bullets for ya.

  • 2d physics built in (gravity, colliders/collision detection, springing)
  • Finite State Machines for A.I. (working on A* Pathfinding as well)
  • Easy Art Implementation
  • Super fast level creation
It's just a little pet project that I've been playing with. Should be releasing code within a couple of weeks.

Ding.

Thursday, January 15, 2009

Flashhhhhhhhhhhhhhh

I've been noticing that a lot of the main flash dudes are talking about things that are very un-flash lately. Such as: Unity3d (which I'm a super fanboy of already), Cocoa/ObjC/iPhone Development (I'm wondering if that market isn't already oversaturated), Facebook Development (really now?), Silverlight (it's actually really powerful, and once they unleash it's 3d power. . . flash had best watch it's back), and just generally telling all the Flash/Flex Developers to learn some new languages.

Was there a memo I missed? If you were to follow all of the flasherati's blogs and forecast where all of this is leading, you would start to wonder about Flash's future. Pixel Bender was touted as the Flash savior, but it's still too young yet (and not to mention how Flash seems to break Pixel Bender's knees somehow only allowing it to gimp along). Flash's 3d support is sad. Although the amazing teams working on Away and Papervision have pushed Flash into new territory, it's still kinda sad the poly count that flash can deal with (especially comparing to Unity3d's output).

Long story short. . . Flash is going to remain king of RIA for a while, but I think the lack of Flash support on the iPhone has really hurt it. The flash bubble has been popped. Now what?

Wednesday, October 15, 2008

Papervision Optimization Techniques (aka taming the Beast)

I've been working with Papervision very intensively for the last 5 months or so, and I've learned quite a bit about what is under the hood.

Also, I've been using it mainly in Flash (due to me designing everything in Flash as well, as developing). So, that being said, I primarily use MovieMaterials for all of my Primitives. With using MovieMaterials that opens up a whole other can of worms. CPU issues

Here's some ideas to get you going:

  1. Set animated to false as much as possible. If you need it to animate occasionally, use some checks to turn the value on and off. Because when the material is set to animated = true, that material is being redrawn every frame.
  2. Toggle the smooth and precise values on only when needed as well. This is especially true with smooth, because that is a major CPU killer.
  3. When using objects that extend off of the screen make sure that you divide the segments appropriately. If you just instantiate something like: var ground:Plane = new Plane(groundMaterial) it's using it's default values (segmentsW:1, and segmentsH:1). That will cause the ground to be clipped by the Frustrum (basically it will disappear out of view when it should still be in view), because there aren't enough segments to subdivide. Usually (I say that loosely), a setting of segmentsW:5 and segmentsH:5 will do (unless you are dealing with something huge. . . then you would have to go higher).
  4. Use flash 10, and turn on the Hardware Acceleration (direct not GPU, because GPU has toasted some of my test computers video drivers), which will not help with the rendering of the triangles, but it'll at least help with redrawing the screen. I've seen it decrease CPU load by over 30% in some cases, with smoother performance.
Oh, and lastly, do a reality check. Not everything has to be in 3d, try mixing 2d and 3d elements wherever you can.

Saturday, October 11, 2008

Generative Musings

I've finally jumped into this realm, and have already been having a lot of fun with it. I was really impressed with Bit-101's Art From Code site, so I've finally started playing with some Math.randomness.

Even though I'm late to the tea party, I might as well take a sip.

Here's my first piece I'm working on:

Missile Command Cityscape

Basically what I am doing is generating random circles, with random colors, and scaling them with a you guessed it. . . a Math.random(). But then I also graph the scaling and the circle's x and y values and that gives me the cool line work on the left. What gave me the idea to do that is I've been really into visual complexity lately. And I've been trying to figure out how to create more visuals by graphing out data that my code is already creating. It kind of goes along with the ideas I used to have to make music that sounded like Autechre. Take a sample of your own song, and then play it at various octave intervals all at the same time.

Yeah, it's no Eric Natzke, Jared Tarbell, or even Keith Peters, but it's fun none the less.

I'm also thinking of working on generative site layouts, and generative art using Papervision or Away3d. Is there room for another Sound Visualizer?