Showing posts with label stuffs. Show all posts
Showing posts with label stuffs. Show all posts

Friday, October 8, 2010

Flash 3D Engines Anyone?

Yup been busy lately.. busy playing Starcraft 2 and other stuffs... (not a very good explanation of being busy...)

Now some of you have already seen and even played with 3D flash games. Ever wonder the 3D engines behind them? How it works? Who writes them? What were they thinking? What do you mean you have not watch Piranha 3D? Go watch it now! Well currently (at time of writing) Flash CS5 does support 3D but in a limited away that you need an engine to be on top of it to ease things out. It's like saying :

"Yeah C++ can do 3D with OpenGL and DirectX and stuff but then to get moving fast (fast and productive being the operative word here...), people probably work with an already built 3D engine like The Unreal Engine (Unreal), The Crystal Engine (Final Fantasy)..."

Well, in Flash we have 2 FREE 3D Engines to work with. (popular ones that is)

You can just download the libraries and plug it into Flash Develop like how you did it with Flixel in my previous tutorials.

Which one am I using? Well err... not any actually... just browsing along.. moving along but Away3D seems to be pretty easy to get into... no I am not promoting it. Just ignore my previous sentences.. well ignore this whole paragraph but you might want to take a look at a book called "The Essential Guide to 3D in Flash". It's easy to follow and though there are errors in the codes, it's easily spottable.. spotable? Is this a word? 'Spotable'? By the way, it's based on Away3D.



Note : if you are interested, there is this Piranha flick movie called "Mega Piranha" which is totally awesome in a comedic way.

Saturday, August 28, 2010

A simple A-Star pathfinding in Flash

Been trying to come out with a prototype of what this pathfinding A* (Pronounced A Star) was all about ever since my previous post.

Reffering to http://www.policyalmanac.org/games/aStarTutorial.htm, which is a good explanation of the topic along with nice pictures of the pathfinding algorithm in progress, I have managed to come out with this...







Go ahead click on it. It should find a path from the blue box to the rather darker blue box.

Sometimes pictures are worth a thousand words.

Tuesday, June 22, 2010

FIFA 2010...

It's here it's here... started... that means some shows are cancelled on TV just for the brokast broadcast. Though you have to agress this time around, the outcome of the first few games are rather unexpected.

I am not really a footbal fan sadly but true. The only time I am into these things are for the Padini sticker books. Soon I realised that I can't get those books filled... always a missing sticker here and there...

The same with the padini dinosaur collection and then that nice robot stickers... what was I thinking... I was a dino myself young... what can i say.

Ok back to the topic... football... soccer if you must. There seems to be some rather unsettling news on the new ball being used in FIFA 2010. Complains came in the form of

  • Ball too round - resulting in weird angular kicks

  • Ball too lite light - causes much flying

  • Ball too slippery - causes frequent miss

  • Ball too aerodynamic - way better than Nissan 370Z

  • Ball too happy weird - player unable to determine the head or tail of the ball... I am talking nonsense again...

  • The design and striking lines camoflauged it from the players eyes making them hard to judge its distant from them - the so near yet so far syndrome

  • Ball too soft - stuck to foot when kicked too hard



But well, seeing how things turned out, there might be some truth to those claims.
Referees aren't exactly too shy in giving out colored cards either...

Meanwhile I have missed Prince of Persia, A-Team, Toy Story 3 and a whole bunch of other movies... argg... I gotta keep up to date. Catch you all later...

Saturday, April 17, 2010

Pathfinding... what is it?

Path finding is extremely important for some game. Note the 'some' games. Well this is because games like 'Tetris' does not need path finding, nor does Twin Bee. Wha? You don't know what Twin Bee is? Go google... While some does not need it, others like C&C (Command and Conquer) can't work without it. What does this 'pathfinding' means. Let's put it this way. When playing all rts (real time strategy), clicking on a tank and clicking on a destination, you actually asked the computer to move the tank to that destination. It needs to calculate the road it's gonna use, which bridge is accesible, what rock is blocking, which humans the tank can mow over... you get the point don't you? And thus... that is pathfinding.

Basically an algorithm to calculate possible path from point A to B taking into account obstacles and some point even type of terrans terian... terry...

This is just a small article to tell you what it is, I am done. Go on... go away...
... it's over.

Ok.. since you decided to read on, I am gonna introduce you to some path finding algorithm. I am by no way gonna go detail into these algo but I am gonna direct you to some really nice readings about them.

A* (pronounced "A Star") is one of the famous ones... and it's most famous article here at http://www.policyalmanac.org/games/aStarTutorial.htm This article comes highly recommended as I tried and tried to understand for about 80 years but to no avail really gain some insight on it on the very first reading which got me interested to learn more. Oh ya... this is only good if you are dividing the play area into grids and want to find the nearest path from A to B. This one moves from one grid item to another and count and move to another and count and again and again. Yes it's quite computing intensive. You can see a sample here in flash... at http://pixelwelders.com/experiments/pathfinding/ if it's still there...

Dijkstra's algorithm is another one. This is a bit different as it spreads out from it's origin until it reaches it's target unlike A* which travels node to node (point to point). I found and old example dated year 2000 at http://www.electrotank.com/junk/mike/ai/precomputedPathTutorial.html. Basically Dijkstra is slower than A* for the obvoius reason of spreading out...

There are others out there but since we are going into Flixel with tilemap style gameplay I think the A* should suffice. Well no codes for today... just some reading... come on it's weekend... take some time out and play something duh...

Tuesday, April 13, 2010

About game libraries and stuffs....

Well I noticed I mentioned Starcraft II back in 2008. It's 2010 now. My how time flies and I am still waiting for it's release... I wonder how those developers at Blizzard do it. I mean come on.. .2 years ? 1 game? Not ready yet? I seen the beta footage and all and it looks great... ready for release I think.

Ok now look at myself... ha! 2 years barely 10 posts on this blog. Talk about kettle calling the pot black. Anyway I do hope Starcraft II, when it's out 'soon' will be able to run on my aging PC. I got ready for the game 2 years ago, it's already outdated in terms of processing power and graphic card today. Still remember those... 'yes I needed that graphic card for the coming Starcraft II' in 2008 thoughts... but if they did started development 2 years ago, the PC requirements shouldn't be that bad right? yeah right... they probably had it on papers for a whole year Right? Anyway C&C 4 is out and it's been great! Supreme Commander II has since hang's on my PC and refuse to work. The only thing I could joyfully play on my PC now is actually.....
...
..
.
nothing.
I am stuck with Flash Games and mini exe.
Nothing works anymore.
It started showing signs of aging when I poped in and installed Street Fighter 4 and started playing it in slow motion. Then that racing car game that doe not render correctly, then Supreme Commander II with it's 3 frame per second thingy on my PC when things get crowded. It's a sad world and if we don't upgrade often enough, we get left behind.

Same goes to game programming. We need to constantly do stuffs... program mini modules... just get things compiling. It started out really hard when anyone try to grab the concept but with gradual trial and error, you get the picture.

There are a few game libraries that work well with Flash Develop. Gone not really were the days where I used to draw using that Flash Pro tools on vector graphics and all. Nowadays it's Gimp for graphics and a little bit of other tools.

2 rather popular libraries are (FREE too)


- http://www.flixel.org



- http://www.flashpunk.net


These 2 are suitable for sprite based games like those you get on 8-bit days. Wha? I am talking super mario here and games that are 2D, flat. As with other libraries, these 2 makes it easier for game programmers to put things on screen and move them around, provides easy collision detection methods, a game loop, blah blah.. the list goes on

Of course there are others around like

- http://pushbuttonengine.com
- http://code.google.com/p/as3isolib
- http://www.theoworlds.com

and specialised libraris like

- http://code.google.com/p/collisiondetectionkit

These are all cool and all requires time to learn and get used to.
Do take a look see, download the libraries and try them out!

Now why should I? Well you should cause I am gonna use one of these libraries for my next tutorials! .. like next year or so... is that Ironman II coming out?

Sunday, March 28, 2010

How time flies..

Gosh how time disappears flies. It's 2010 and guess what? This site ain't getting much hits anymore. Well, I guess simply because of lack of updates. Don't worry... I will still be here not. Kinda playing on with Flash Develop nowadays. In case you guys have no idea what it is look.... here at www.flashdevelop.org

It's a free AS3 programming interface which works rather well for programmers. Note the words 'free AS3 programming interface'. This simple means you are not getting those drawing tools like you get in normal Adobe Flash Pro and stuffs like that. Well Flash Develop don't even have a timeline for you to look at. It's all in the mind... you need to plan it out and stare real hard at the screen to actually visualised something and they not to develop tumor. What good is it anyway without those nice drawing and timeline? It's for the programmers... not designers. You get to compile stuffs written in pure actionscript. For a better understanding of what it is, here is a screenshot...





You still get a compiled .swf as the final output just that you need more understanding in AS3 when doing it in Flash Develop than in Abode Flash Pro itself. For starters... remember how you use 'trace("Hello World!");' in the timeline to output in the debug window? No? What do you mean you don't remember?
... and how you conviniently use the 'this' to refer to the whatever you are writing the script to target in... well you need to specify if clearly and import, extends... full blown programming in Flash Develop. What I am trying to say is you pretty much needs to import the libraries and stuffs to use it unlike in Adobe Flash Pro where you are spoonfed with the basic libraries without lifting even a single finger.. well not really actually. Flash Develop just don't work out of the download package itself. You need to get the FREE Downloadable Flex SDK from Adobe and point to it in Flash Develop under Tools->Program Settings. (At current time of writing it's Flex SDK 3.5) Screenshot as below...





Once all that is up, you are ready to go... except you can't run in debug unless you download the Adobe Flash Debug Player or something like that from Adobe yet again FREE...

So basically three stuffs to get going

- Flash Develop - FREE
- Flex SDK - FREE
- Adobe Flash Debug Player - FREE
- Brain - FREE

After that, just go ahead and google all the tutorials for Flash Develop. Yeah go on... go on.. what do you mean I am supposed to write one? And I am supposed to convince you to use it too? ... grrrrr

Monday, November 9, 2009

Wow... missing in action.

Wow I noticed my last post was almost a year ago. Way to go for losing the readers and followers... if there are any to start with :)

Anyway back to the Flash world, I have again discover something new... in the lines of...

http://www.3dfla.com

It's a plugin for 3D studio max to produce 3D flash stuff... after seeing how flash matures into a 3D playground over the pass few years.

Friday, November 21, 2008

Have you heard of '3D Flash Animator'?

Have anyone heard of '3D Flash Animator'? It's suprising this piece of sweet software is not mentioned often. Although I would say it's not exactly what the software name suggest... it's also actually a 'click and produce your game' software much like the old 'Klik & Play' with actions and all those... even scripting if you are really into it!

You can use it's various actions available for the objects (if you find programming AS3 to be really mind bogging unlike some 'multimedia fusion' tool... ).. not too many though... but you have the basics for a good game like collisions and such...

The end result may be output in the web just like normal flash would...

Anyway if you are interested, you can visit the site at http://www.3dfa.com

Monday, November 17, 2008

Tutorial Sourcecode Downloadables available!

Yup, you heard that right! I have added the sourcecodes for Tutorial 8 and 9 in ZIP format ready for downloading! Now if you have followed some of m tutorial you mgiht find it difficult for ME to refer to certain items... NOT anymore! Now download those files and I will just refer to them as item A, line 5 .. go check it out and read! Ha! Having said that... the solution is fairly straight forward. This blog is in blogspot and I hosted the files via sites.google.com so it's basically the same family! I hope this keeps on working and does not violate any rules. Anyway do inform me if this method is illegal not right.

PS : I have finisheddddddd RED ALERT 3.. hahahaha!!! Now looking forward for Starcraft 2... just when is that coming... I thought it was this year???

Tuesday, November 4, 2008

Open wider...

At last it's wider... I was looking at my blog and noticed how 'thin' it is. As I post my codes, they kinda get the nextline treatment and I didn't really like that. Thennn... Ta daaa... now it's 900 px across the screen... originally 700. In case anyone would like to know how to do this, it lies with the Layout->Edit HTML page again. Different template offers different ways of changing but basically just search for width and a little bit of experiment, you should get it right.

Anway please backup or copy the codes to another page first before attempting this as it might ended up being totally crap corrupted.

Monday, November 3, 2008

Testing of Syntax Highlighter

This is a test for the syntax highlighter...


function listenKeyDown(event:KeyboardEvent)
{
if (event.keyCode == 37) { //Left arrow
leftdown = true;
}
if (event.keyCode == 39) { //Right arrow
rightdown = true;
}
}

Damn the colours doesn't work... or do they? Anyway let's just stick with this for a while ya. :) If anyone is interested, I am using 'prettifier' yeah sounds feminine... which can be seen here http://google-code-prettify.googlecode.com/svn/trunk/README.html

I had to copy and paste the codes within the blog Layout->Edit HTML area since I do not want to link to any other host and blogspot does not allow any uploading of .css and .js files. I hope with this 'prettifier' things will start to look good better. :) (PS : If it's all messed up on other browsers, please please please tell me... thank you.)

Friday, October 31, 2008

Why this? FPS? Frame?

Well, I have browsed a lot... and have read many tutorials about Flash. I am taking a less serious approach here while contributing my part. These tutorials I am writing here are going to be long and rather basic. I am learning as I am writing this too :) I will go from concept to code and even focused on possible mistakes and shortcomings of the codes whenever possible.

Unlike other tutorials, I write lots of gibberish here, so please bear with me. There will bound to be gramatical mistakes here and there but as long as you get what I am trying to say, it should be ok. Meanwhile I hope you all won't maul me for not having a tutorial today hahahaha... whoopps... don't worry. Coming soon.

Once more thing, I do not publish during weekends. It's because I am a lazy bonehead I need err.. time to think of what to write... yeah so that you all can benifit ... err better future... something like that.

Anyway since I am not writing any tutorials todays, I might as well just briefly talk about Flash a little. Who knows what FPS stands for? Whenever you start a document in Flash if you look at the document properties, you are bound to find FPS there... FPS is actually First Person Shooter so kinda get to er.. shoot people in Flash. The higher the rate, the more bullets you get to shoot... NOT. FPS here actually stands for Frame Per Seconds. It is the rate at which the number of frames is shown in 1 second. The higher the framerate of the FPS, the smoother the animation. Now please don't go and change it insanely high like 120 (max for Flash) thinking you get superior smoothness and all shall bow to your animation... Take note that cinema runs at 24 FPS and your television goes 30 FPS. The human eye can be tricked to see smooth / fluid movement with 24 frames per second. In other words, you won't benifit much by putting the framerate to 120 frames per second. Then how come NVIDIA is boosting about how games like F.E.A.R can perform over 160 fps with their GeForce 8800GTX... Yes that's good... very good... they are trying to tell us how powerful their graphic processor can go but do you know that not all games are able to run that way? For example, GTA (Grand Theft Auto) have a standard 30 fps. It can't run properly with frames more than that without killing itself... why? Try running the previous tutorial with the settings of 120 FPS. The clownship got a huge speedboost :).. almost uncontrollable... it's the programming that counts. What we did was we programmed based on frames instead of time, so the higher the framerate, the faster the game. I will talk about this in my next tutorial :) Hohoho... now look at your monitor / LCD panel, what is the highest 'Screen Refresh Rate' does your monitor / LCD panel supports? 90 Hertz? Hohoh... (Christmas in 2 month's time...) That equals to the maximum of 90 frames displayed per second :) So even if your F.E.A.R runs at 160 FPS, you can't see it. It's capped by the limitation fo the display device.

So that's it today. I hope this post is as informative as the grass growing on your lawn.

Tuesday, October 28, 2008

Gosh... no files...

Recently (how embarassing), I have come to realised that I cannot upload any files other than pictures to blogspot. This has been a real pain as I was so willing to share my flash scripting .fla files... but too bad Alas this will not deter my err... determination... I will still blog about flash. Now what was it I am supposed to write after this paragraph?... hmm... makes me wonder...

My Game Making History

You read it right. I am interested in game programming. It started with Klik & Play. I actually bought the whole diskette stack together with the manual back in 199+. Back then, it was the only thing that can really make games without much programming. I actually learn simple logic scripting with that thing. I was back in university (UPM-anyone?) then and everything was done with my laptop. It was during that time that I discovered the pain joy of making a game. Not only you have to crack your brain thinking what to do but... I was all alone back then with my Pentium 133Mhz (yes it was the state of ark) running 3D Studio 4 (nope not 3D Studio Max 4.0 but 3D Studio 4 for DOS, way before 3D Studio Max 1 or was it Lightwave 4.0 hmmm ) I rendered myself a few images of what looked like a ball with an inverted ball for two eyes of a weird looking character, animate them a bit and import them image by image into Klik & Play. Anyone who actually did this would felt the hardship I went through and cried on this very moment. You would then said something like .... 'Actually there is another way'


I got into creating a clone of Snow Bros, something I called Fire Bros. The gameplay is similar, jumping from platform to platform and shotting red flaming balls of fire at the enemies insted of snowballs in Snow Bros. It was fun and nice (in a way if you think burning cute animals is fun... ). My sis got to play with it and dare I say it was additive. That fueled me further and it was shaping out to be a good game with boses at the end of the level (I used the gaint ant animation which came with Klik & Play). Then I did something stupid back then with my laptop. I installed Windows 2000 ( Cursed Unofficial ALPHA Releasessss ) over my Windows 98. Seeing how Windows 2000 have the tendancy to switch to FAT 32 from the existing FAT 16 in Windows 98, it formatted my entire harddisk. I was thinking that it was an upgrade and my stuff would have stayed intact so no backups were made. (There were no such things as thumbdrive, only floppy disk and CD writer cost a bomb on a laptop). To my most dismay, I lost all my stuffs including a half done shoot them-up. I cried overnight at my university dorm. Nah... I didn't. I just went blank and hope that I might be able to recover the info. After trying for about a month, I lost all hope together with Fire Bros. (Internet was not the norm back then so none of my work was uploaded anywhere and I use rocketmail - later bought over by yahoo to be yahoo mail) What a sad ending. The tools I used were

  • Klik & Play
  • 3D Studio 4.0 (DOS)
  • Paint Shop Pro
  • ~a very old sound editing software which I have forgotten


These 3 tools were good... very good for what I did back then. Very good friends of mine they were... good friends they were (ok enough gibberishing). Klik & Play is still available from http://www.clickteam.com/.
My second big attempt weren't that glorious. It was for a course in Multimedia Design. I took screenshots from the animation Anastasia and created a point and click kinda game. And what did I use?

  • Multimedia Fusion
  • Paint Shop Pro
  • Cakewalk (midi music)
  • Media Studio Pro (Ulead)


Klik & Play was off the board as Multimedia Fusion kicked in. You can still find the later versions of Multimedia Fusion at http://www.clickteam.com/. Anyway I got a freakingly bad not so good grades due to some errr volume problem. (I still can't believe they rate based on the number of diskettes and CDs handed in)
Then came the big final year project! I took the challenge of creating a game. It was something I never did before (hahaha yeah right..) and I do not know what came into my brain when I took up that project. Oh wait.. I do. It was that Final Fantasy 7 game that was released on PC on that year. 3D animated character on 2D background! That was awesome back then! I played and played and played (finished and restarted again and again) until my laptop motherboard melted and burn down the entire dorm along with our papers. I went on a wild research and bought a whole lot of books on OpenGL and Direct3D. Finally it was done in Direct3D. It was DirectX 5 back then and the only major game worth mentioning was Diablo, Warcraft, Red Alert, Quake, Doom.. (Halflife does not exist yet OMG!!! ) Halfway through my project, DirectX 6 was released but I didn't upgrade. I sitll did my stuffs in DirectX 5 with C++. The tools used were

  • Visual C++
  • DirectX Library
  • Lightwave3D (Switch from 3D Studio)


I wasn't into sound so the project was without sound until the very last part where I passed the stuffs to my partner to add in the sound department. I got an A. It was one of it's kind. It was called The Sanctuary. It was just a POC (proof of concept) demo game where a 3D character actually walked around a 2D rendered room similar to Final Fantasy 7 and only consisted of 4 areas to walk around. After graduation, I got students emailing me about my project. I passed on the codes and became a regular at http://www.putera.com/ for Q&A for game programming until they revamp the site.

The Dead Blog...

I notice that my last post was way back in July 4. That was like more than 3 months back. When I started this thing I thought it was easy to write and simple to share stuffs. Guess I was wrong. Anyway I am (supposedly) back on track...

Friday, July 4, 2008

Why Flash?

I am gonna start up this blog by talking about Flash... no.. not the flashy type but Adobe Flash. Flash has been around since it's introduction in 1996. It was under Macromedia back then (Macromedia Flash) and gained much momentum as a standard for the web animation and media delivery. Then in December 3rd 2005, Adobe Systems acquired Macromedia. T thought that it was the end for Flash but then I was wrong... and I was wayyy wrong. Adobe released Flash Player 9 in 2006, along with a preview of ActionScript 3.0. It was not until 2007 that Adobe Flash CS3 came out with full support for AC3. Why all the fuzz about AC3? Well, it's like this...

Long time ago I played with Flash and AC (Action Script) 1 and 2. It was good and things were going pretty well. However, the speed of AC 1 and 2 was a bit on the disapointing side but that didn't stop millions of programmers from creating games, sites and applications with Flash. We just have to make do with all the things and restrictions we have that time. When AC3 was released, it changes everything. It's fast... and way way faster that it's predecessor. And then things just got better and better!