2012-03-20 23:05:33 Posted by RetroZelda

Maya Ranting

So yeah, this lab using the Maya API is really really really really really really really really really really awful. The Maya API is messy, and its documentation is less interesting than trying to read the bible in Hebrew. And then the instructions for the lab are like reading hieroglyphics while hanging hanging upside down while poking your eyes with a Cricket bat handle smothered in hot candle wax. It is painful on the head and I really wish i could spend the money for some kind of explanation of how to use the monstrosity of an API. Oh wait... WEll, my ranting is over, it is time to get back to this peice of Taco Bell mushy shit that comes out of the body of terrible, cheese eating, asparagus-juice chugging, computer scientists who have no idea how to make things understandable to weak minded people, like myself! RetroZelda out. RAAAAAAAAAGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!!

2012-03-20 23:05:53 Posted by RetroZelda

Global Game Jam - Thoughts

So it is official... I have signed up to participate in this year's Global Game Jam! For anyone who isn't familiar to what the Global Game jam is, it's basically a time where groups of artists, designers, programmers, noise makers(Audio engineers?), etc, all get together in designated host spots that can be found all around the world and they make a game. Doesn't sound hard, right? Wrong! You have only 48 hours to produce said game and you must have it fit into a specific theme! This is exciting for me because I get to compare mine and my team's creativity with millions of other teams from all over the world! Japan, China, New Zealand, Canada, Mexico, Germany, France, EVERYWHERE! It also gives me a chance to put my programming skills to the test to produce the best code and algorithms i can to make debugging and QA testing easier for me and my team, as well as something i can check off my ever-expanding bucket list(Coming Soon). Now, you may be thinking "e;How will you be able todo that with school, Plunder, FIRE, and a half-completed web site"e;, and if you weren't thinking that, you are now, but my answer to that is "e;I don't know until I try!"e;, even though I do know, but now you are satisfied and we can move on! Anyway, I started ranting, so i think its time to conclude this post. Oh, dont worry, I do plan to post again about my experience with the Global Game jam, and if you are interested in signing up, or you just want to know more, you can go to their site, here to do so. RetroZelda out!

2012-03-20 23:06:15 Posted by RetroZelda

Old mans junk = My new Toy

Yes, I have found a new toy. The Wii motion plus of course! For my optimization's class, we have a project to improve an algorithm, function, workload, etc on an older project and because I LOVE working with peripherals, Optimization is really important to make code run faster and faster, so I decided to check out my algorithm for detecting/guessing a wii remote's off-screen dot using the IR sensors. Now, because the wii remote's normal accelerometers cannot calculate YAW, I had to come up with something else that I could work with. So I used the accelerometer in conjunction with the IR dots for the off-screen dot placement. I accomplished this by first getting the distance from the two dots as they were last seen. This required a buffer of previous locations of the dots that I could use to later compare too. I then needed to get the angle between those two dots. A few dot products and other math fun stuff later, I had my angle. At this same point, I need to capture the ROLL of the accelerometer, and then get the difference between the ROLL and the angle between the two dots. Then with the saved old data, I could compare the current ROLL of the wii remote with that old data in conjunction with the single remaining dot on the screen to get the angle to the new, off-screen, dot. Now, by doing 1 of two things, I am able to directly place the off screen dot. I could use the distance between the last two dots, or I can use that distance and the accelerometers change in its Z axis to determine if the wii remote is now closer to the sensor bar(dots closer together). And Wha-lah! I have the position of an IR dot that doesnít really exist! Sounds simple, right? WRONG! Games now a days need to run fast fast fast, and with DMD (the project the wii remote is doing this on) being done [mostly] on a single thread, doing that kind of math is fairly pointless. Plus, my algorithm will not work if both dots are off screen, and thatís no fun! So, what could I possibly do to improve the accuracy of the in game cursor, as well as decrease the pointless workload that I am doing on a frame by frame basis? Well, for starters, I needed a way to calculate an angle between two points faster and easier. And then I need to calculate the off screen point faster! Then it hit me, I should completely forget about doing these calculations, and just use raw data to move the cursor. Well, having recently played (and highly enjoyed) The Legend of Zelda: Skyward Sword, I thought that using the Wii motion plus like Nintendo used on their menus to control the on screen cursor would be a lot easier, and it would greatly improve the wii remote's accuracy while trying to move the cursor around when the screen is so much closer to the player than on a normal wii game where the TV is, at least, about 10 feet away. So, by mimicking Nintendo's approach to how the on screen cursor will give me, the programmer, a lot more accurate data to work with, and give anyone who plays this game optimized control that are much simpler, and cleaner to use. So, I first enabled the wii remote to read extensions in the extension port, and I enabled the wii motion plus and I would poll the data from the motion plus along with the data from the wii remote itself. Doing this worked well, but the data I was reading in was reading fairly slowly, and I speculate this because that the wii remote gets pulled once per frame, grabbing all the data from the hardware and bringing them into memory. But when an extension is plugged in, unplugged, or even just changed, the sizes of data could possibly change, and if something gets removed that I am still setup to read from, I will crash. So to fix this, I wrote a callback function (basically a functor that the wiiyourself library takes in that will get called [asynchronously] when specified events happen). I have the callback function looking mainly for event with the wii motion plus to handle the plugging in and unplugging of the peripheral. Not only can I easily handle what data I read from the remote, but if the remote gets disconnected, or the entire game crashes, I can now handle it so the wii remote can properly shutdown which will in turn prevent the remote from leaking memory. Now that is all and good, but back to the fun stuff! The motion plus connects, and I can read its values, and they sure do look beautiful, and now itís time to get the cursor to move with this new data. So, I simply set the cursors position(x and y) to equal the motion pluses roll and pitch respectively. I run the game and I do not see anything. So then I go back into code and I enable the pressing of the Down button on the remote after B is being held to center the cursor on screen. I run the program again. I hold B and press down, and zoom, the cursor snaps to the center of the screen and then hastily moves towards the top right corner. I realized why Nintendo has a calibration time in every game that uses the motion plus, so now it is time for me to incorporate my own calibration state. But first things first, I know that I need to hold these values in memory so I can modify them with my calibration data. So, I make a structure of 3 floats (roll, pitch, and yaw), and I read in the motion pluses roll, pitch, and yaw, and I store them inside an instance of the structure. (Note, the wiiyourself library read both raw data and relative data, I am using the relative data). I then read about 20 of these in an array of these structures and add them all together as I read them in, and then I divide by the amount I read in. This took way too long, and made the function call take almost 3 seconds! So, I decided to split each read into one read per frame. Then, after reading in all the data into the array, I added each array member into a master object (of the structure), going one object at a time. Then, when all the objects of the arrays were done, I divided like I did before and I moved on with my life. This made the actual state last slightly longer, but It allowed the wii remote to have time between data reads(the time to run everything else each frame needed) to get more realistic results, and it also helped to reduce dependencies, which greatly improved the speed of the function, making its total time around a second. Now, I take the calibrated data and every frame I subtract it from the data read in by the motion plus and then ran the game. The cursor moves so smooth and fast that I need to slow it down a bit to help reduce the sensitivity that the motion plus has, and I simply divide the change in direction by 2, and the results are beautiful. I then use QueryPerformanceCounter() to time the new method of moving the screen cursor, and it is about half a second each frame. This is unacceptable! I then go to where ever I read from the motion plus into a structure, and I simply use memcopy to move the data over. I then take all my divide by 2ís and turns them into multiplies by 0.5s. I run it again, and I am getting around 0.0004 seconds each frame. That is more like it. The wii remote's input is not optimized to not need to do any kind of calculation for off-screen IR dots, as well as optimized for each player, to give them faster reads from the wii remote, and giving the cpu more time to work on other things that I think using the wii remote with wii motion plus is a lot more enjoyable! Happy Holidays, RetroZelda

2012-03-20 23:06:52 Posted by RetroZelda

No.. no.. no... Why YES!

So much to do, and yet no time to do them! What a bother it is to want to try doing an entire list of stuff including ffmepg, dll Injection(hehe), Plunder, RZEngine2D, Play Video games, classes, the journey to and from each class, blah blah blah more stuff more stuff. This doesn't make for any productivity when productivity is inflating me like a balloon, and I am ready to burst onto a single project; a single thing that I can look forward to do every day. Yes, a new project with new people in a new place and continue my Journey of Awesomeness with a fresh coat of paint! Although I havnt updated much of my doing on here, I can say that i am rather tired now, and wanted to type something before going to bed. Good night! I wont see you later, because i am merely text on a screen! -- RetroZelda

2012-03-20 23:07:08 Posted by RetroZelda


Yup, RZEngine2D is a slow work in progress. RZEngine2D is going to be an XNA 2D game engine, with hopes for it to be able to easily compile on the XBox360, Windows Phone 7, and, naturally, PC. Now, I have the basic interfaces done for some of the needed bits and pieces, as well as some things ported over from my other works, but it is a slow work in progress. If Anyone wants to help develop the engine, feel free to contact me about it, and I can get you set up on the repository.

<--Prev 0 1 2 3 4 5 6 7 8 Next-->