My Life On Anime (so far):



Thursday, May 1, 2008

Face Lift + Programming News

First things first. A new face? Are you joshing with me? No wai! What happened here? Truth be told, I just took my other layout that I made for my other blog (an Anime North 08 Convention blog). I really liked it, and since I was gonna scrap the other blog once anime north was over, I thought "why not make use of it". Well, here it is, in all its anime-ish glory. There's some stuff I have to edit however (like making dividors appear at the end of my post). If worse comes to worst for the divider example, I'll just edit the html of all my posts and at the end, just manually add a separator myself. Cheap, but gets the job done.

Anyways, to the important stuff. We had a drag/drop assignment to hand in today. The day before I did a bit of a demo, where you basically had to drag items onto Suiseiseki -desu, and depending on whether they were edible or not, she would eat it. This was just a mock up (as I'd add the other stuff - which I'll mention in a second - at home). We had a substitute yesterday actually, and he insulted me! I started typing my phrases in netspeak (aka bad grammer skills). The subsitute was surprised to see a few of us done so early, and he came up to me and checked to see what I had done before playing my games. I showed him and it's almost as if he looked for a way to get me to go back to work. Then he looked at what I had written when you dragged an Aerosol can on top of Suiseiseki: "NO WANT AEROSOL CAN, CHIBI BAKA DESU", and then he started mocking me, saying how it was weird for me to get accepted into Mac's engineering with "atrocious" linguistic skills. Psshtt, what does he know ;).

Bah, so on with my program. My program was the bomb (as usual) and I went above and beyond what everyone else did... only because I got carried away with my madness, which isn't all to new anyways. Basically, I had 3 items that could be placed on Suiseiseki, two of which were edible and the other not. When you dragged the appropriate pieces on top of her, certain counters would go up (failure/success based on non-edible/edible respectively, and total) and then a calculation would be done to tell you how much of a failure you were. As well, I added a place holder image box onto the form, which would only accept the aerosol cans and a couple timers to clear the text boxes/image boxes as well as refresh the failure message. In the process of doing this however, I noticed that any image would drag unto the boxes unless I created some kind of check (in my case, I used flags). Flags aside, that's not all that was special about my program. I did a bit of research ahead of time, and looked up how to add sound files to ones programs. I had tried earlier in the semester, and I was successful in adding the wmp component to the tool bar, but could never get the code to work (and it was a pain looking for it the first time I tried... though ironically, after reading Mr. Chiarelli's examples, I easily found the same information on msdn... go figures eh?). So I took some sound clips from Rozen Maiden (the anime that Suiseiseki is on). I then set the files to my bin folder, and put the code in a bam~presto! I was finished and had an impressive piece.

Overall, I'm quite pleased. Now I've just gotta keep this pace up for the next few weeks, and score big on my major games to keep my mark up (or maybe possibly raise it a percent, though I'm skeptical). Anyways, I've got math to study for, so I'll have to cut it a bit short blog! Until then, see you later my few somewhat loyal fans!


Roy "Maria" Kaminski


C#: Graphic Lessons starts. AS 2.0: Event Listeners

Well, we're finally hitting crunch time! There's about 6 weeks of school left (and then it's vacation)! With that, were getting into the BIG chunk of the course (where 50-60% of the course mark in programming is to be had/lost). So with all that stress building up from all those courses, I'm going to have to double time everything and put more hours just to make sure I can keep the marks up there. Programming being no exception. So all that extra flash learning I'm doing will have to be moderated in with all the other stuff, including the #C sharp game to still make!


Praise from the working corporate business chimps!

So we've started the graphical part of our course in visual C#, one of my more... favored parts ;). We've been checking out a few methods of applying images into different mediums (in particular, the form and the panel, as well as picture boxes). On top of that, we learned of various methods of drawing stuff onto and into these areas.

Things like .drawrectangle, .drawimage, .drawarc, .drawcurve etc (forgive the lack of capitols). They're all available to someone who writes in the code properly. Interestingly enough, you could even go further, and use image arrays to create moving images and animation. And just like before, there are a couple methods of animating as well; regular images loaded into a panel in timed intervals, image arrays, and even back buffering. As one can expect, each one has a different uses, each one more useful than the other, the ultimate being the back buffering as it resolves the common issue of flickering that is found in all other data types. I remember doing in back in the VB days; twas such a pain! Luckily enough, Mr Chiarelli says it much easier then VB, and apparently, there is a command associated just for back buffering :O! Holy crap! No wai! Haha, even so, it doesn't get over the fact that we have to use bitmaps for image (heavy on the file size) and requires masks in order to create transparencies. Such an ineffective method of animating (and to think, Ultima Online was made using .Net framework!). I would much prefer Flash's intuitive visual drawings over C# any day, any time, any place. You name it, flash > c# in terms of visual components.

Well... just plain C#. I looked around on google, and found there were plugins and what not for important more visual aspects into C#, but they weren't free and cost a hefty amount ($500+)!

In Flash news, more coding stuff. Little time on visual stuff. I've been tinkering with listeners. Funny that I bring this up. Today, Mr Chiarelli talked about enabling Keypreview on the form in Visual C#. It is pretty much the same principle. Just like in C#, where enabling it tells the computer to listen for keydown events, so too does the listener (though it can be applied to a few other things; in this example, a movie clip). Anyways, you create a key listener and it will look for whatever you tell it to look for. In the scenario I'm about to show you, it will load an image. On load start, it will display in your output panel that something is loading, while load intialization will output the fact that it's done (and display the image in the movie clip) while onLoadError will do as expected, and will leave an output saying the loading was unsuccessful.

//Define a variable to hold my image location
var imgUrl:String = "http://img223.imageshack.us/img223/3247/54yg7.gif";

//create an Empty movie Clip that will hold the object, given the name img_mc
this.createEmptyMovieClip("img_mc",100);

//creates the mcListenerObject, which is latter defined as a Listener
var mcListener:Object = new Object();

//as the listener looks for the loading start, it will //trace out that it is doing so
mcListener.onLoadStart = function() {
trace("starting to load");
};

//on load initialization (meaning done loading), the //trace command will tell you it's finished. If there is //an error, it will say error
mcListener.onLoadInit = function(target_mc:MovieClip):Void {
trace("finished");
};
mcListener.onLoadError = function(target_mc:MovieClip):Void {
trace("error");
};

var cliploading:MovieClipLoader = new MovieClipLoader();
//adds a listener to cliploading as well as load that image and places it in //img_mc.
cliploading.addListener(mcListener);
cliploading.loadClip(imgUrl,img_mc);

So there you have it folks. A simple program that just makes use of event listeners. I'll be using this for my key references, so it should be interesting to see how things turn out!

Well, that's all for today my few loyal (somewhat...I almost forgot that important part) viewers. Here's a youtube video to lead you on your way!

Youtube Clip: Baka Rangers






Roy "Maria" Kaminski


Tuesday, April 22, 2008

AS2.0: Error Checking = A #*$@%

Well, I've been doing some of the tutorials that were included in the documentation for Flash CS3. And I have come to hate it, oh so very much. Oh boy, am I ever annoyed.

Let's begin by showing you my script:










class
student{
private var _kidname:String;
private var _age:Number;
private var _lastname:String;

public function student(kidname:String, age:Number, lastname:String){
this._kidname=kidname;
this._age=age;
this._lastname=lastname;
}

public function get kidname():String{
return this._kidname;
}

public function set kidname(value:String):Void{
this._kidname=value;
}

public function get age():Number{
return this._age;
}

public function set age(value:Number):Void{
this._age=value;
}

public function get lastname():String{
return this._lastname;
}

public function set lastname(value:String):Void{
this._lastname=value;
}
}

Firstly, I'm working with a class, so it's an external AS script. I had a handful of fun little annoyances with this one! Oh boy! For example, when I was stating a function, I declared it as a :void, instead of :Void, and boy... was that a pain if I ever had to realize one. I mean, it took me 5 minutes trying to understand exactly what the compile error was trying to tell me (because AS is pretty bad at doing that too). Ugh, AS 2.0 is so case sensitive that it sometimes really frustrates you. And the compile errors are not always useful. I guess I'm a littler harsh when I say it doesn't help at all, but it's not all that great either. Happily, it will tell you which lines have occurring problems, but I just wish it was more visceral like it is in Visual C#.

Anyways, I've also been doing arrays in flash, which, just like the error checking, are quite annoying! I mean the logic is there, but it's far more de-simplified compared to something like VB or C#. Arrays are basically created within arrays... I mean, this is the only way I've learned (so far) in how to make arrays. Very tedious for something that could have been so easily done in other languages! Take this for example

var myarray:Array = new Array(3);

for (var i = 0; ilength; i++) {
myarray[i] = new Array(3);
for (var j = 0; j<3; style="color: rgb(51, 51, 255);">trace (myarray);
Wow... just wow... do you know how many lines you could do that all in C#? One. One line fits all... apparently, this got lost in translation. I am seriously praying that this is only an early lesson in the flash tutorials, and that I'll be taught a more efficient (as in, less time consuming) way of creating an array. Here's praying!

For Blake (taken from IRC):
GTA nowadays is for 14yo boys
who also enjoy playing counter strike and WoW

LOLOLOLOLOL


Roy "Maria" Kaminski


Monday, April 21, 2008

AS2.0: Data Types/Objects

Went over some data types in Action Script. Declaring variables is done a bit differently compared to C#. In terms of data types, you have many which are found in other languages (Numbers, Boolean, Strings, undefined, Void, Arrays, Errors, Functions, etc) and a few that are specific to Actionscript (such as Objects or Movie Clips).

As you know, Booleans, Strings, Numbers, Null and Undefined. They are all declared after variable names by using a semicolon (:) followed by whatever type you need putting. These types of data are known as primitive Data Types, and are often found inside of Complex Data types. A complex Data type (or reference data types), are more action oriented compared to primitive types.

I'm not going to get into the gist of all the types you probably already know (or should). However, I will go over the Object. Objects, in essence, hold properties that are set by the user and can be called upon a whim. What's interesting to note about Objects is they way there are called. Take this for example:



//Second Method for Objects
var SecondObj:Object ={firstvar:"Hello", secondvar:"18", thirdvar: new Date(1989,11,24), fourthvar: "I like Anime"};

var i:String;
// the code block says that basically, :
// go up for every i in SecondObj.
for (i in SecondObj){
trace (i+": "+ SecondObj[i]);
}
When you look at it, it's almost like a Class in C#. In fact, it most certainly is (though I'm no expert in the termanology of C#, so it's open to questioning). Look at the code again. Specifically the line where i declare the variable SecondObj. Do you see how I'm assigning it? Like an array! That's the beauty of the object. It's got a cross reference between arrays, and has a bit of similarity to it. In fact, it is functions exactly like an associative array (I'll get on this topic another day). In short, an associative array calls upon data embedded in the array through the use of string literals instead of integers. But that's not the only way you can declare properties of the object, you can also do the traditional method:

//First Method of Objects
var FirstObj:Object = new Object();
FirstObj.firstvar="Hello"
FirstObj.secondvar=18;
FirstObj.thirdvar= new Date(1989,11,24);

As you see, there's just another way of doing it all. So many possibilities to achieving the same outcome, isn't that just the beauty of programming? You think you have one thing solved, and then BAM, there comes another more simplified way. I guess that may be one of the reasons why the need for Object Oriented Programming arose. Anyways, I'd give you a demo of some sort of flash stuff I've done, but lately been only doing programming aspect, and have been using the trace command to show all my work. Tough luck eh? Bet you were looking forward to my next works :D. Ah well, can't be helped I suppose. Maybe next time!

Well, in other news, Anime north is almost here! Just gotta wait on blake being accepted. Don't know if he has been accepted yet, but meh... I'm sure it'll happen soon. We kinda need him, since he'll be one of the drivers. Here's hopin'! Gotta keep those fingers crossed! I am so going to enjoy this event. First off, it's happening on a friday (so that means an early weekend ;)), loads of anime stuffs and goodies, as well as hanging with friends! What more could you ask for? NOTHING :D


Youtube Clip - Philosophy (Yue Ayase's Theme)





Roy "Maria" Kaminski


Thursday, April 17, 2008

Flash: Getting ready for my game!



I've gotten to work on my game! Yes, the boat has left dock, and it is now on her long maiden voyage! I'm holding back the tears right now... so beautiful. I see the light at the end of the tunnel... the very long tunnel! Yes, though I start the graphics, thats only one foot into the door. And this door is big... VERY BIG. Ok, so let my give you a run down of the game.


First off, yes it's an anime game. Did you expect any less of me? Not likely. But it's not just any anime game, it's one that will have a bit of life based off Negima, but not directly. The name of the game is Mahou Sensei: Alchemical Challenge (Magic Teacher: Alchemical Challenge). Basically, it's takes place in the Mahou Sensei Negima: Magister Negi Magi universe. No characters will make cameos, all will be original, but I just love the whole magic thing that Ken had going, that I always wondered what it would be like to put my own character(s) into his story.

So the game takes place (and this is all subjected to change if it be needed) in wales. You play the role of student named either named Eriko, Harumi, Kayami... ah let's just call her Kayami for the sake of the conversation. She's not the brightest of students, and she's doing pretty badly in school, her worst subject being Alchemy class. You take the roll of going through her lessons, which I want to make a cleverly designed puzzle game similar to bejeweled, if I am able to code it that is. Basically, each lesson is a level, and you must reach a certain point score before the timer runs out. When it does, you get graded upon how well you did, and you rack up experience based on your points. This experience can then be used in the character menu to learn spells. Yes, spells. Here's where I want to sort of redefine the genre. It's so common to just have a regular puzzle game, that if I were to do so, it would be nothing more than a "fancier" bejeweled. As such, I wanted to reward the player by allowing them to get cool spells that will both be awesome to cast, and provide them with a strategy and/or a last minute saving throw. In doing this, and combing a small story line (I'll probably stick it into 10-18 levels, and it'll be easier then you think because I can keep calling on the scene with the actual game, and just change the variables to account for the higher difficulties). The big problem however is the actual code itself.

This is what I've narrowed it down to: I'm obviously going to be using recursion. If you've never play bejeweled before, here's a picture. Try and keep up if you can, it may be hard t
o understand without actually playing it (that or my explanation skills suck really bad)


In bejeweled, you are trying to match up a set of colors within the board. As such, the objective is to move a piece into a line of similar colors of 3 or more, in order to make them disappear and add to your score. As they disappear, the column above the cashing in jewels falls down to replace them, and more jewels fall in from the top. If the jewels that fall down come into another chain where there are colors that are lined up with 3+ of the same color, they too will disappear, and will continue this chain until there is no more!

Now here's the challenge:

  1. I have to make it so that when the jewels are initially set, they do not match in pairs of three or more, therefor causing a chain reaction from the get go
  2. I need to make some sort of method that is called whenever jewels are moved into place. This method will then do a recursion to see if there are any colors around (horizontally/vertically) that are the same color and are of a chain of 3 or more.
  3. Develop it so that whenever there is a disappearance of jewels, the top will drop more jewels to replace the empty spots.
That's quite a bit... And on top of that, I have to include spells so that regardless of whether colors are lined up or not, all the jewels within the spells range will disappear. I don't know how long it's going to take, or if I'm gonna have to change the formula a bit... but that's what I've thought up. I'm going to work in the next week purely on the game, worrying about the other details afterwards (story etc.). Once that's done, I should be good to go, and will hopefully be able to make this dream a reality. Until then, here's some screens of what I've drawn so far (the actual game menu in the school, and the actual game screen itself).


School menu: All hand drawn myself. As you can see by the lines, I've been using perspective lines. You don't see the other perspective lines for the 2d part, because they're invisible. This is just to give you and idea of what I'm putting in!



The game screen itself. I imported the text from Adobe Photoshop CS2 as an image, since that text won't appear on other people's computers as it would on mine on the account of them not having the font type. In here, you can see the mana (which is the alchemical container). The blue stuff inside (essence, or Substantia as I've searched up in Latin) will go up and down depending on how much mana you have/have recharged. I'll do this via a masking layer. Beside it is the spells, I don't know how many spells I'll have, but a few to have different area effects!

On top of this, I have some ingame music to go along as well. I'll be using one of the songs from the OST for Fable (xbox game). It has some of the best VGM (video game music fyi) I've ever heard orchestrated. God, how I loved the feel to that game! Such an artistic point on fantasy and fairy tale!




Oakvale - Russell Shaw


Well, with that folks though, I have to call it wraps! Best regards, my few semi-loyal and now privileged viewers :D!