Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411526 Posts in 69381 Topics- by 58436 Members - Latest Member: GlitchyPSI

May 01, 2024, 10:55:35 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Rinku & Increpare (and more?) Learn Flash
Pages: [1] 2 3 ... 29
Print
Author Topic: Rinku & Increpare (and more?) Learn Flash  (Read 76474 times)
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« on: January 17, 2009, 11:11:59 AM »

I've never used Flash before and am going to learn it (in particular, AS3 / Flex) in this thread. I've used other languages before (QBASIC, C, Hamsterspeak, GML). I'll use this to chart my progress and ask any questions of any Flash vets that may be inhabiting the forums.

To start, I've been following these two tutorials:

1. http://www.brighthub.com/internet/web-development/articles/11010.aspx
2. http://forums.tigsource.com/index.php?topic=2630.0

I will update this as I learn more and/or run into problems and to show off any examples I make while learning. I just started the tutorials today and have just been basically copying and pasting the code into the Flex SDK, compiling it, and seeing that it works.

Here's a question: I assume both Flash 9 and Flash 10 use AS3, yes? What's the difference, are there things that will work in Flash 10 but not Flash 9? If so, is it better to make a game in Flash 9 or Flash 10? Does Flash 9 have any limits Flash 10 doesn't? I know this won't matter to me for a while, since it'll probably take me a few months before I can make anything good in Flash, but it'd be good to know for when I get there.
« Last Edit: March 19, 2009, 09:13:07 PM by Derek » Logged

J.G. Martins
Level 2
**


AKA anvilfolk


View Profile WWW
« Reply #1 on: January 17, 2009, 11:24:14 AM »

Hey there, good luck in your endeavour!

We had to learn AS3 for an assignment at uni and at the time (about 9 months ago?) it was buggy as hell. Hopefully you won't run into a lot of troubles. Many people seem to like it Smiley

As far as I know, all Flash players are backward compatible, so as long as you do it in the latest version, you should be OK. You can pretty much assume everyone's player version is updated Smiley
Logged

Gold is for the mistress -- silver for the maid --
Copper for the craftsman cunning at his trade.
"Good!" cried the Baron, sitting in his hall,
"But iron, cold iron, is the master of them all."
--- Rudyard Kipling
increpare
Guest
« Reply #2 on: January 17, 2009, 11:28:13 AM »

Okay, well my first small project was Burn.  The source is here.  I sort of avoid doing any complex stuff.  I kept a lot of global variables, and use getpixel and putpixel instead of sprites proper.

It was based on a template I got, through terry, made by BenH, which I found pretty helpful.  With his permission, I've put it up here.

Also, as directed by terry, the Flex Documentation is pretty good...
« Last Edit: January 17, 2009, 11:32:02 AM by increpare » Logged
mrfredman
Level 4
****


off on an adventure


View Profile
« Reply #3 on: January 17, 2009, 11:29:16 AM »

Ooo I've been seriously considering taking the time to learn flash, I just might join you rinkuhero (although not right this second as I'm a bit overwhelmed with other things). Just know I will most likely be following in your footsteps a few weeks down the line, so I'm really looking forward to something vaguely guidelike that will help me figure out how to get started with flash development.
Logged
John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #4 on: January 17, 2009, 12:20:37 PM »

are there things that will work in Flash 10 but not Flash 9? If so, is it better to make a game in Flash 9 or Flash 10?
There are a bunch of things that only work in Flash 10. Here are some off the top of my head:

  • The Vector datatype in Flash 10. It's basically an array (NOT a position in 2D or 3D space!), with the restriction that it can only hold one datatype inside of it. Meaning, you could have a vector of ints, or a vector of Strings, but not a vector containing both. This is in opposition to the Array datatype that is available in both Flash 9 and Flash 10, which can always contain any number of datatypes. Vectors are more optimized and come with all the benefits of strong typing, but judging from your comments in other threads, rinkuhero, I guess you'll probably want to use Arrays anyway.  Wink
  • Some optimized graphics functions. You can pass a complex datastructure representing all of the graphics commands you want to run, instead of calling a function for every atomic operation. (function calls are kinda slow in Flash) Again, this is mostly an optimization issue.
  • Some built-in 3D graphics effects. Mostly this just means that you can rotate sprites, or anything else that can be projected onto a flat plane, around the X or Y axis. If you want to use more complicated 3D models, you'll probably need some additional library like PaperVision3D, which is available for both Flash 9 and optimized Flash 10.
  • Flash 10 also comes with some additional options for connecting to servers or other clients, but I don't know much about that right now.
  • You have the option to generate your own sound/music in Flash 10. In Flash 9, you had to use existing sound files (MP3, WAV), which meant that you couldn't use generated music such as the MOD format, unless you resorted to a bizarre hack. But either way, if you want to play MOD music, you'll want to borrow something like badsector's library.
As for which you should use... well, if you don't need any of the features of Flash 10 immediately, it's fine to stick with Flash 9 for now. You can always upgrade later if you need to, since Flash 10's AS3 is backwards compatible with Flash 9's AS3.
« Last Edit: January 17, 2009, 01:31:11 PM by John Nesky » Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #5 on: January 17, 2009, 01:29:11 PM »

Thanks!

Well, if there's a speed difference, then of course I'd use Vector when it mattered (if I were to use Flash 10). Game Maker has a similar problem: its arrays are slow and its data structures (ds_grid, etc.) are fast, so it's preferable to use the data structures when speed matters. Besides, you still have to define the data anyway presumably somewhere along the line, so the advantage of not having to deal with data types wouldn't come with using arrays.

Can Flash 9 use ogg, or is it restricted to mp3 and wav? I imagine ogg's are preferable since they are smaller, and download size would matter a lot in Flash games.

From the list, there isn't anything I particularly need in Flash 10 at first. Since my first games will be simple, the function/array optimization stuff doesn't matter much just yet, unless the difference is enormous.
Logged

John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #6 on: January 17, 2009, 01:40:25 PM »

Neither Flash 9 nor Flash 10 have built-in Ogg Vorbis support. However, Flash 10's more flexible sound options allow people to make libraries like this:
http://barelyfocused.net/blog/2008/10/03/flash-vorbis-player/
One downside of using Ogg Vorbis in Flash like this is that it takes some significant time to use AS3 to decode it into raw audio waves from the Ogg Vorbis format. Whether this trade-off is worthwhile is up to you.

EDIT: The source code for that Ogg Vorbis player that I linked to seems to be missing.  Shocked Oh well, I'm sure some more googling would reveal something.
« Last Edit: January 17, 2009, 01:46:27 PM by John Nesky » Logged
Glaiel-Gamer
Guest
« Reply #7 on: January 17, 2009, 01:47:32 PM »

Okay, well my first small project was Burn.  The source is here.  I sort of avoid doing any complex stuff.  I kept a lot of global variables, and use getpixel and putpixel instead of sprites proper.

It's a nice demo but I would avoid using bitmap data objects for the actual game and save them for graphical effects instead. Flash has its own great graphics renderer (vector graphics) so I would recommend that you focus more on learning how to manipulate the vector graphics and how to use movieclips and such before you worry about its "extras" like bitmap effects and such.

I know you're used to using bitmaps for graphics and textures and I see this a lot with people that move to flash from something like c++. It's slower and not what flash was designed for, so I would stay away from it for normal graphics and just use its built in stuff.

Since AS3 is interpreted, you will very very very rarely be able to make a faster alternative to something it has built in to its engine.

Also another hint: Flash sucks at optimizing your code. OOP adds unnecessary weight to your game often, so even though OOP is great I would keep the number of classes down to a minimum. I tend to use one or 2 classes per project (to handle vector math and camera movement and sometimes physics) for me, and then manage to handle the rest pretty procedurally because flash has a decent library of built in classes (sprites and sounds).


Can Flash 9 use ogg, or is it restricted to mp3 and wav? I imagine ogg's are preferable since they are smaller, and download size would matter a lot in Flash games.

You can choose what type of compression flash will use in the publish settings. All your sounds will be converted to that format and ogg isn't one of them. I tend to use mp3, 64 kbps best for my sounds.
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #8 on: January 17, 2009, 01:48:09 PM »

Does it take any more time than for mp3's? Both are compression formats, so it's surprising that one would be slower than the other.
Logged

Glaiel-Gamer
Guest
« Reply #9 on: January 17, 2009, 01:50:01 PM »

Does it take any more time than for mp3's? Both are compression formats, so it's surprising that one would be slower than the other.

flash does MP3 for you, that ogg player is actually written in AS3 (meaning its interpreted and not built in so it is a lot slower)
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #10 on: January 17, 2009, 02:01:21 PM »

You can choose what type of compression flash will use in the publish settings. All your sounds will be converted to that format and ogg isn't one of them. I tend to use mp3, 64 kbps best for my sounds.

Doesn't that break the mp3 license somehow? Mp3's require a license to distribute more than 5000 copies of. Or does that apply only to stand-alone files and not to files which embed mp3's?

http://en.wikipedia.org/wiki/MP3#Licensing_and_patent_issues
Logged

Glaiel-Gamer
Guest
« Reply #11 on: January 17, 2009, 02:06:51 PM »

You can choose what type of compression flash will use in the publish settings. All your sounds will be converted to that format and ogg isn't one of them. I tend to use mp3, 64 kbps best for my sounds.

Doesn't that break the mp3 license somehow? Mp3's require a license to distribute more than 5000 copies of. Or does that apply only to stand-alone files and not to files which embed mp3's?

http://en.wikipedia.org/wiki/MP3#Licensing_and_patent_issues


It's a built in feature and I think if that's the case that Adobe took care of it.
Logged
increpare
Guest
« Reply #12 on: January 17, 2009, 02:18:05 PM »

It's a nice demo but I would avoid using bitmap data objects for the actual game and save them for graphical effects instead. Flash has its own great graphics renderer (vector graphics) so I would recommend that you focus more on learning how to manipulate the vector graphics and how to use movieclips and such before you worry about its "extras" like bitmap effects and such.
I take it that there are loaders or importers for standard graphics formats?  Edit: it seems so.  Are there any non-Flash (the software) tools that anyone'd recommend for doing such things in?

Would there be a speed disadvantage to procedurally generating vector graphics? (given that they're static, say).

I'll look more into this when I have my current project out of the way (maybe a couple of days).
Logged
Glaiel-Gamer
Guest
« Reply #13 on: January 17, 2009, 02:35:48 PM »

Yes, just draw them in flash. You can draw it in AS once but for some reason AS3 got rid of the duplicate function for movieclips so you'd have to recreate the vector every time.

Just draw it in flash. If you need DYNAMIC effects, then use its drawing API.


Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #14 on: January 17, 2009, 02:40:35 PM »

Boo, does that mean we still need to buy the Flash development environment in order to make good Flash games? The appeal of Flex was that it was free, whereas the development environment costs around $700.
Logged

Glaiel-Gamer
Guest
« Reply #15 on: January 17, 2009, 02:46:08 PM »

there's a reason flash is $700 and flex is free
Logged
John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #16 on: January 17, 2009, 02:46:40 PM »

Nah, the free compiler is still very useful. Go ahead and use whatever combination of bitmaps and procedurally drawn vector graphics makes sense for your project.

Figuring out how to optimize graphics in Flash is kinda complicated. If your project is indeed simple, just go for whatever makes sense to you. When you want some more intense graphical effects, come back and we'll explain how to optimize Flash's graphics.
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #17 on: January 17, 2009, 02:55:38 PM »

Still, those Flex tutorials / advocates should really warn that most people can't realistically make good games without the development environment, instead of it being billed as a free way to make Flash games.  Cry

Anyway, will continue with the tutorials. I don't think I'll be able to afford Flash in the foreseeable future though. I only make around $200 a month, so buying Flash would be more than a quarter of a year's income for me.
Logged

increpare
Guest
« Reply #18 on: January 17, 2009, 03:00:06 PM »

well you can make svg graphics in loads of free programs, and there's an svg-to-swf converter in existence, I think.  Yeah; I think it's going to take some looking in to, though.
Logged
Glaiel-Gamer
Guest
« Reply #19 on: January 17, 2009, 03:04:06 PM »

if you can show that you're a good game designer or artist or programmer to a sponsor, you can sometimes get them to buy flash for you with the expectation that they'll get a game from you in the future. Download the trial and show them what you can do.
Logged
Pages: [1] 2 3 ... 29
Print
Jump to:  

Theme orange-lt created by panic