Actionscript 3.0 is Very Fast
January 10th, 2007
I’m not sure everybody fully understands how fast Actionscript 3 is. Even saying things like “tenfold” are laughable. For one thing, I can’t tell how fast it is because the current game I’m toying with cannot be measured. All the code for an each frame (which is a lot) is run in less than a millisecond nearly 100% of the time. Compare that to 6 to 9 milliseconds from older games.
Let’s face it though, numbers don’t do this kind of thing justice. But this animation does (via gBlog). It’s the live 3D rendering of a several ships, with well over 8000 polygons. The speed seems to vary unpredictably, but usually sticks to around 13fps or 30fps on my computer. Compare that to the as2 example, which runs at 3fps while rendering less than 1000 polygons. It’s not just faster, it’s a different level entirely. The demo is not perfect, but the 3D quality roughly matches the original Playstation.
On a side note, I noticed the files (meshes) that the example uses are text files. If they used FZip they could’ve turned around 333KB of files into a single 55KB file, making it easier to put online rather than offering it as a download. Just a thought. ;)
Beware of Flash Hacking
January 3rd, 2007
I spotted this post (via Digg) this morning. It’s a guide to hacking high-score boards in Flash games and he knows what he’s talking about. He uses Flasm to disassemble and find information in a SWF file. All the more reason to make sure the methods you use for this kind of thing are carefully hidden.
I heard a great idea from someone named Dan on Flashcoders. Send fake variables alongside real ones when a score is submitted. It could get even better if you make them interrelated and sensitive to hacking - something involving bitwise math perhaps? You could also include checksums of course. There was also my idea to “record” user input (mouse movements, key presses, etc), encode it, and send that to a server. Then simply add in the ability to playback these recordings when you want to make sure they’re legit. It’s pretty tricky though, and could have lots of problems, for starters you wouldn’t be able to change your code without breaking old recordings and you can’t use Math.random().
While I don’t like this guy, it’s not as if these methods aren’t known already. Why did people have to digg it though? It’s cheating. What’s the point? I suppose Flash coders just have to get smarter when it comes to this kind of thing.