Well, this last weekend of the quarter wasn’t a total loss (except for sleep but that comes with the territory). I managed to finally put all the assets I’ve been working on into the actual game and making it look nearly identical to the mock up screens on my presentation. I say “nearly” ’cause I’m missing a few elements such as the GUI, enemy barbarians, and the player barbarian. At least the logs are there but unfortunately, I still can’t get the collider function in my code to work the way I want. Why oh why can’t programming be easy for syntax challenged designers like myself?
Category Archives: Cadence Crusaders
Basic Scolling Complete!
My God! What a long road it took to get this basic function to work! With a little help from one of my classmates, we came up with the right code to allow my environment to scroll in the way that I want it to. Looking back on it, I can’t believe that I went through tens of lines of code just to see that it only took close to 20 lines. *sigh* My programming skills really need some brushing up, but that’s what this upcoming winter break is for! Anyways, below is the script when inserted in my gameobject “scrollTerrain”:
var topSpeed = 20.0;
var minSpeed = 1.5;
var currentSpeed : float;
var acceleration : float = 5.0;
function Start () {
currentSpeed = minSpeed;
}
function FixedUpdate (){
currentSpeed = Mathf.Clamp(Time.time, minSpeed, topSpeed);
}
function Update () {
currentSpeed += Time.deltaTime * acceleration;
transform.Translate(-currentSpeed * Time.deltaTime, 0, 0);
}
Onward to completing the rest of the game’s features now that this great hurdle is over with, and what I’ve learned from it is to never be too proud to ask for a little help. It could go a long way! As always, keep gaming.
Collision Catastrophe!
Ugh! What is the magic code for getting the collision to work correctly? All that I want to do is to have my horse, whenever making contact with a log or getting attacked by another barbarian, have it’s momentum reset. At the moment, I don’t think that function will be available for the alpha build and will require some further research during the Winter break. This game will be polished; I’m in too deep!
UV Maping Dilemma Solved!
What it is everybody? Recently I came across an issue in Maya where I needed to take a mesh that I imported that was UVed in Headus and transfer that UV over to my original, non-UVed mesh.
“But Dantrell, that’s easy! Select your UVed mesh and shift-select the original, go to Mesh>Transfer Attributes option box from the polygon menu, and transfer only the UV sets. After that’s done, delete the mesh that you imported.”
In another situation, random armchair Maya buff, you’d be right on the money. You’d just have to remember to delete the history of the original mesh before deleting the other. But here’s the thing: my original mesh contains animations on it.
“So what’s the dealie?”
Here’s the dealie! Deleting the history also deletes the animation on the mesh. The rig is still remains with the animations intact, though. Wait, before you ask…
“Just reskin the mesh with the rig!”
Dammit! Remember what happens once you skin your rig?
“It…can…animate?”
Correct! Now remember what happens once you play the animation?
“Ewwwwww! It’s all blobbity-blobbity!”
And why’s that, Mr. Armchair Maya Buff?
“Oh right. The problem is that you’d have to go through the trouble of repainting the weights again, even though they were already painted correctly before the UV transferal?”
Bingo! Here’s how you can get around that and save you lots of time.
This tip assumes that you have a scene where upon opening, all you’d need to do is transfer the UVs and your original mesh contains animations. After applying all of the steps mentioned above, save your scene and rename it something easily identifiable, then import the original scene. Now, and this is gonna blow your mind, select the imported mesh and then shift select the original. Then at the Animations menu, go to Skin>Edit Smooth Skin>Copy Skin Weights. Now just clean your scene up by deleting all of the components that you imported from your outliner and don’t forget to save. This should solve everything!
Fellow ITGM majors, as always, feel free to share this info to anyone that needs it.
Keep gaming!
Animation Dilemma Solved!
Before moving on here, let me take the time to thank Professor. Altman in providing me with the solution to solving this animation situation.
So, an issue that I was having earlier this week was trying to export the horse I’ve created for my Cadence Crusaders game properly from Maya and importing it to Unity, the game’s engine, with all of its animations that I’ve painstakingly created for it in the previous week. Turns out that the way I managed to organize the animations, that being saving the walking, trotting, and galloping animations into their own separate scenes, isn’t the correct method. As far as I’ve been told, unless you’re a masochist trying to make more work for yourself down the road, it’s best to have all the different animations you’ve made in just one scene and all on the same timeline so when importing to Unity, it’d be much easier to tell it where the frames for the animations are when the time to use them comes up. When it came to applying this new information however, I’ve constantly hit roadblocks. Protip for those of you that’ll come upon the same dilemma: DON’T go to scene “y” where animation “y” is, select all the controls from the outliner to then head over to the graph editor to copy the graphs displayed, and finally paste them in the graph editor in scene “x” containing the end of animation “x”! Your model will turn into a janky Frankenstein of a monster!
Instead of pulling your hair out, do what did: the right thing! In the scene containing your first animation, open up the Trax Editor found in Window>Animation Editors>Trax Editor. After selecting all your controls from the Outliner, select Create>Animation Clip from the Trax Editor. Once successful in creating a clip, it’s time to export it by selecting File>Export Animation Clip. Name it something fitting and save it ’cause you’ll be coming back to it later. Repeat the above until all of your clips are exported then open your scene that the first clip was created from then return to the Trax Editor to import your clips via File>Import Animation Clip to Characters. An error message along the lines of “You must select a character first” may appear; by character they mean the first clip you created earlier. You might not see it in the Trax Editor at the moment but it’s there; just highlight the object “multiCh” in your Outliner then press the Load Clip button in the Trax Editor to make the clip appear. Highlight the clip and finally Import Animation Clip to place them wherever you need it on the timeline. Make adjustments to the clips to whatever suits you best as its going to be exported for Unity purposes later. Speaking of, do just that right now: File>Export All/Export Selection (if you have a lot of junk you don’t want exported, use the latter option), and save it as an FBX file. Import it from Unity and presto, your model is ready to come to life!
Please don’t keep this knowledge to yourself my fellow ITGM majors. Feel free to pass this info along to that one student on the cusp of punching his (or her) monitor and stomping on the keyboard from frustration. As always, keep gaming!
Senior Studio
Although I’m still a Junior, my adviser recommended that I take Senior Studio for the Fall quarter this year. I knew what to expect before the first day of the course but damn, I didn’t think I would’ve been dealt the hand that I received! Long story short, instead of being put on a team to create a game like, ya know, what a majority of the other students who completed the course did, I ended up being a one man army (or Marine in my case – see biography info if confused); I’m flying solo through this ordeal! There are two other students that are in the same boat though so ironically I’m not alone here. Kinda wished that the three of us formed some sort of brotherhood called “Deserted Developers” or something like that, but I digress. Anyways, the game I’m creating is called “Cadence Crusaders”, a rhythm-based action game for the PC and iOS devices. You’re a barbarian on horseback on a quest to rescue 8 damsels within 8 days. It’s an automatic-scrolling game similar to “Jet Pack Joyride” with the only actions required from the player is jumping, attacking, and blocking; each successful action triggering a music cue. There are other elements of the game to mention but why type it out when I can just provide you with the same presentation I used in class? It’s progressing quite a bit I believe and I recently gained some valuable animation experience during the process, but I still have a ways to go to get this game in alpha status before the quarter’s finished. Looks like me being busy for the next five weeks is more than guaranteed! Keep gaming!