Robots.. Unicorns.. and OpenClonk?

November 13th, 2012

For my Final Assignment, I chose to do an open source game called Open Clonk. Open Clonk is an action-strategy type game for PC. For my mod, I changed quite a few things in the script. Firstly, I changed some of the models and graphics. By some of the graphics, I actually mean I changed all of the graphics. I also added some more items to the game, those being the star meteor that crashes down in the beginning and end, and the butterflies and dolphin that appear in the level as well.
The graphics took the longest to change. The background loading screen, for instance, was taken from the original, but that’s all about it that’s the same. I had to accumulate many different assets from the original Robot Unicorn Attack game by Adult Swim. These assets included the infamous unicorn, fairies, stars, rainbows, space, butterflies, and dolphins. Incorporating these all into the mod was definitely a task I tried to undertake, but some parts were more difficult to achieve than others. Just making the graphics themselves took up most of my time- except of course, waiting for the game to compile.

Tileable textures and changing the appearances of everything weren’t the only things added. There were also some components I added to the game play. The two meteors that fall down from the sky in the beginning are the first obvious things I added to the code. I also added dozens and dozens of butterflies that fly throughout the level. I even created another item, the star explosive, that is held in a chest I added (and of course changed the appearance of).

Overall, the skills I learned in the class and the progress I made was so exponential compared to what I previously knew before I took it. Understanding the way things work and realizing that I can easily find other methods of working around my problems I encountered gives me a more a more positive outlook and reassurance that there is almost nothing available now that I could not find a way to work- if I work hard enough to find it.

0 A.D. Compilation

October 31st, 2012

I compiled a game called 0 (Zero) A.D. for class project 7! The goal of this project however wasn’t necessarily the end result, but the process of attempting to get the game to work in the first. That being said, although the compilation was successful for this game, it was actually another game completely that I spent most of the time for this assignment trying to compile, and as a result, I gained more of my “newly-found knowledge” from my failed attempts in that project, than I did from my actual project I chose to turn in. However, I will briefly try to explain 0 A.D. more in complexity first before I try to touch on the knowledge I gained from the previous failed attempt.

The main thing I did from the one I got to compile was attempt to understand exactly what it was trying to do, and how that worked in the game to call other parts of the libraries and .CPP files. It would say for instance, “if this is a Mac use this timer, or if this is a windows timer, use this timer,” as well as saying things like “if this not here, well start it now.” It would also tell it to pause at random intervals, as well as waiting for certain things to happen before proceeding, and even telling the CPU to stop doing mundane tasks like looking for updates related to the game when it was in session, in order to keep the game running more smoothly.

In the first game I chose to seriously compile, Goblin Hack, I started with a base of files that I wasn’t clear what to do with. The game had not been modified for over three years, and because of that, there wasn’t a good forum base or anything to go off of other than the very unclear instructions given in one of the “read-me” files in the downloadable package. The first thing I ran into was knowing that it did not use Visual C++ for its compiler, because the .CPPs and header files were completely hidden inside multiple and multiple folders, with no clear instructions with which to use them.

Regardless I began my first process of linking the files and pulling them one by one into the program until they were all there and running ‘debug’ and going from the beginning. From there, the odd errors started flowing in by the hoards. It couldn’t find a header file that was clearly listed in my header files, so I went to the project properties, changed the VC++ format to include the exact ‘Includes’ folder where it was, and tried that. Then I got another error asking me where <ext/hash_map> was, and that it had no idea what it was. Originally I thought it was just referring to hash_map, which is a pre-compiled VC++ Win32 format file, so I got rid of the entire project and tried to rebuild it as a Win32 application. I figured it would work because it didn’t previously have the external dependencies in the empty project (or so I thought).

Nevertheless, it didn’t compile. I got a lot more errors than I even had initially. So I peered at the code and saw that it was asking for hash_map and was saying basically, “If hash_map doesn’t exist, use ext/hash_map instead!” So I discovered then that the ext/hash_map was actually a MAC OS file, and decided better to get rid of that completely. That didn’t work- it actually just got a lot more upset and many many more errors sprung out of that. Upon doing more research into the countless amounts of errors that sprung up, the conclusion was made that in fact, my game was created using Ubuntu. That doesn’t mean however that it could not possibly work in Windows- clearly the creator tried (ever-so-slightly) to incorporate Windows/Mac configuration files, however when it started calling for dependencies that only existed in Linux, it became apparent that even more problems were in store. I had the option of installing a completely new Linux-devoted compiler and then trying to take the dependencies it wanted and modifying them to work, or finally throwing the towel in and resigning to finding a new game that actually came with some form of compiling instructions, and not just “the source code is in /src. The references are in /src/references. Enjoy!” However, the process was a valuable one in that I learned a lot about compiling and finding many alternative methods on the web for solving small problems that kept arising in compiling. And lucky for me, the second time around was so much more painless because of it (despite the fact that it took an hour to compile)!

 

Snake – A Small Twist to a Great Game

October 31st, 2012

For my first assignment involving using Microsoft Visual C++, I chose to edit a previously-done game of Snake via one of the websites provided by our professor. This specific game is very blocky, and uses 1 or 0 to determine a lot of the graphics, with three colors added in. For the assignment I messed with a few things and got to know them, as well as saw a lot of things I couldn’t figure out. But these are some of the things I figured out while doing this:
I learned how the graphics work. There are no pre-used images in a reference library- Instead, there is a block which uses coordinates in a certain block dimension to move. So the snake moves block per block per block. I messed with this a little bit. I moved the scores around on the main screen just by changing the X position (of the output high score). I added a few more characters into the code- specifically, K, V, S, which are my initials, and S, N, A, K, and E, because I wanted to make them larger. I also had to relist new A and E functions and change the functions that called them so that other words that popped up on the screen (like GAME OVER) didn’t have a larger “A” or a larger “E”. I also attempted to mess with the color schemes, but the RGB way of choosing the color scheme isn’t the same as choosing HTML numbers for colors, and I just changed the colors by changing ever-so-slightly the numbers so it would still compile (because ironically, most of the times I changed one number in the color code it just wouldn’t work).
Another little thing I changed was the part of the script that changes the color of the snake as it moves on a path the player chooses. Instead of telling it to disappear, I changed it to turn black and therefore create a path which the player cannot access again with the snake. It’s a pretty simple little mechanic that I stumbled upon as I was trying out different little things, but I decided to keep it because I liked it. I also changed the top of the screen that lists the player’s scores and when the game is paused, as well as changing it so that every time the player restarts from the current version, the speed of the snake each interval is increased by 10. I was pretty satisfied I think with the way it turned out- everything I intentionally changed seems to work well. I learned a lot of little ways to use things, and about the multiple declarations and usefulness of headers in terms of separating the work. I also got a good grasp of the parts I changed, specifically, as they were used and few other parts as well, like the “if this happens, display this, etc.etc.”.

 

Geoffrey the Giraffe’s Magical Adventure (Now in Space!)

October 31st, 2012

Geoffrey the Giraffe’s Magical Adventure (Now in Space)! Is definitely a work in progress that I have yet to actually make the way I want it to be. I did the entire pseudo-code in a post-C++ layout, thinking it made sense the way I had done it, only to find out later by the professor that it would have been more ‘scale-able’ had I kept everything inside of my main function- something I, having just now realized, I did for my very first project, and regretfully did not act on for this one. The direct cause of that as it now stands is time constraints.
There are a lot of things I was trying to do for myself in this program that I either didn’t get a chance to work on or spent too much time trying to fumble with. The thing I probably spent the most time on was trying to make the integer functions call on themselves when I asked them too. The issues would normally be me not declaring something ‘int’ in front of it over and over, or me finding a loophole around the issue, or even me accidentally asking for the same bit of information twice. This took a very long time, as much as I hate to admit it. It makes me wish that I had my own Melissa on me at all times to idiot-proof my scripts so that I don’t make the simplest mistakes again. The worst part is that I don’t realize them, and for whatever reason I find these mistakes to be so easy that finding the issues on Google isn’t very effective, or at least easy to do. This entire project was definitely a learning experience for me, to say the least, and I think I’ve realized that doing this without a tutor is nearly impossible for me compared to how Scratch was.
Another very odd problem I’ve been faced with is my random number function deciding not to work anymore. By not working, I mean it completely freaks out and keeps looking for infinite random numbers until the .exe file crashes, and then after you hit cancel it says, “Here’s my random number! /end.” It’s very frustrating because I used an exact copy paste of my previous random number generator, and once again I’m sure the reason is so insignificant and tiny that it doesn’t work, and yet I cannot seem to wrap my mind around it. It seems to have something to do with my return value though I’ve now come to realize… It may not even be my random number generation at all. Even my word art doesn’t work! I try not to get so upset about it, but it takes so much of my time away from the things I actually wanted to add to it, like the classes or the integration into the main function or even a mini-type game involving oxygen supply.

I have indubitably gotten myself into such deep issues that I don’t even understand how they can be so dumb and easy to do. For example, my first problem that says, ask for answer for health; make health = answer, doesn’t work! I don’t know why- I even made it its own separate integer to work throughout the function just in case it were somehow messing with the global health variable, but that didn’t work either. It has to be something small. I just know it.

Read the rest of this entry »

Scratch: Harvest Moon

October 7th, 2012

So the point of this next Scratch assignment we had was to do a simple showing of the mechanics of the game (ie Mario hitting blocks), as well as a change of level. I asked the professor and he said going from inside to outside of a building would work fine, as well as working with the tools to show a couple of things the character can do. The target platform was a PlayStation1, however I could not find ANY sprites from the PS1 game, and the SNES ones are very two-dimensional, so in order to try to keep to the former art style, I was able to dig up some basic sprites from the Harvest Moon DS game. I have a very simple change from the inside of the main character’s home to the ‘backyard’ which is really just a small little thing. He doesn’t plant any seeds, but he picks up tools (yeah I know, not from the DS at all but I wanted a more classic HM experience!) , goes to the inventory screen, selects 3 out of the available 5 to perform actions with, and does them. He chops some logs, he fills up the water container from the pond, and he also smashes a couple of rocks with his hammer. He also can pick up the rocks and weeds as well to throw them.

Unlucky for me… I couldn’t find sprites for the throwing actions of the weeds or rocks, so I had to do those. I also hate to admit but I spent over half of my time with this assignment just organizing my sprites, because let me tell you, this script is HEAVILY costume dependent. If I had more time I probably would’ve liked to actually separated my main character into three sprites like I did previously with Ninja Senki, just because it got REALLY bad. I think the main character has 160 costumes. And the main reason I needed to separate it wasn’t so much the fact that it was hell to code between going back and forth to find Costume#s, but the movement. That’s right! I used the movement from my Ninja Senki game. What do you do when you don’t have time? Borrow your own code! Until you realize that it’s a LOT more buggy than you initially thought.

So if I said that I spent approximately half of my time just getting these sprites, then I spent at least 20-30 percent of my remainder just messing with the walking script. Still, STILL it doesn’t work. It gets SO buggy, and I’m PRETTY sure it has SOMETHING to do with the way the character responds between the arrows. Even though she might be going up, if you hit Right and don’t move for at least a second, she will continue to face the same direction Up, while moving right. Give it a second, and then she will face the correct direction again. I think it has something to do with the part of the script that tells the character, whenever a different button is hit, switch the costume to the new one. However, I think because it consistently checks to see if the character is moving in that direction to do the walk costume cycle, it bugs out between costumes left, right, up, and back. I cannot explain to you the frustration this walk cycle has given me. The best part? It’s not really a mechanic. It should be just basic rudimentary “yeah I know you know how to do a walk cycle show me something better” type stuff. But instead I have become so fixated on fixing this. My biggest problem is just the presentation itself. Everything else might work, but when you include a walk cycle that doesn’t work correctly, you become immediately detached from the personal experience and connection you get from the game. You get pulled away from it, and immediately realize problems that make the game a lot worse for such small reasons. I don’t know. I’m still upset about it. I resolved to trying to fix it if I had any time before it is due, but I don’t think I have the time. HOWEVER, at some point in the future I SHALL FIX IT! MARK MY WORDS!

C++ Geoffrey 2.0

October 7th, 2012

So this weekend, we are having to add some stuff to our scripts we previously did to make them better. I’m pretty partial to the one I made for the last class called Geoffrey the Giraffe’s Magical Adventure, so I decided to stick with it. I’m still pretty rudimentary with the C++ knowledge I have so far, so I’m using a lot of if statements and switches and such. However, the professor asked over the weekend that we add some functions to it and maybe add some stuff to the AI to make it work better. Lucky for me I didn’t have any AI or the latter, so I get to do both. They sound pretty simple but for me for some reason I have to make things difficult on myself and spend hours trying to find out the simplest things, like brackets missing or whatever. But at the current moment I’m confused because I have some code that I borrowed from our textbook used in the main() function, but I’m trying to take it out of its function to use in the rest of mine.

vector<string> inventory; //creates the inventory
inventory.push_back(“1. teeth”);
inventory.push_back(“2. clothes hanger”);
inventory.push_back(“3. spit wad”);
inventory.push_back(“4. your uncle Jeff”);

Sounds simple, right? Well not for little old me it isn’t! I tried to pull it out of Main() and create a separate function altogether called “InventoryBag()”, but then I didn’t know how to call specific parts of the function, like the ‘inventory.size’ which is constantly being called on throughout the Main() script as well as the others. At the current moment I’ve resolved to just relisting it inside of every single function, but I know that isn’t a good idea. However at the moment it’s going to have to do. I spent way too long just trying to realize my curly brackets were the reason my void function wasn’t working. (Award for the day goes to me! :D )

But if you’re just DYING to know what my game is like, I’ll post the script later at some point to let you see it. That is ASSUMING that you like giraffes…

My First Text-Based C++ Game!

October 7th, 2012

My first C++ code! And guess what? I bet you can’t guess this! I didn’t get to finish it! Hahaha.

I do like it though. It’s about a giraffe named Geoffrey and how he’s the meanest, fiercest giraffe that ever lived.

Since I still have a lot to learn about execution in C++ and having spent more time than I should have (as usual) on Scratch, I just have a simple text-based RPG-type game. It has a very narrow story though because the constraints. I also was a little distraught at the fact that I was putting everything inside of Switch statements, so the whole thing became very cluttered very fast, and I resorted (since it still worked) to ask for help with it the next day.

I do like it though! PLAY IT >:O

Read the rest of this entry »

Scratch Zero Wing

October 7th, 2012

ALL YOUR BASE ARE BELONG TO US!  Really though. They do. Haha, well anyway, I did Zero Wing for the next Scratch project in my coding class. I did what I do best and started by ripping my own sprites from YouTube videos (don’t judge! the resolution is only 640 x 480 in these games!) and getting down a few of the base mechanics. This game sadly didn’t get finished to the point I wanted it to be, but I am actually debating at a later point when I have some time, going back and tidying it up and adding some more of the things that I had planned on doing to the previous one. This was also one of my cleaner games, if I do say so myself. Third time’s the charm!

This is the first scrolling game I actually did in Scratch. I used a basic scrolling function though, just with a simple “scrollX” variable. (Not even a “scrollY”, because I didn’t have time to add the backwards mechanic!) The background changes according to the width of the screen and scrolls between I think it was like 7 to 9 different backgrounds. This game also took the least amount of time I think to code, because I was able to use a lot of the same things that I had previously used. However, I did branch off of my original star throwing mechanic from my previous game and found a better script online. It was almost identical, with the difference being that it calls multiple hits, so instead of the usual “press X and wait five minutes for the missile to something or go off the edge”, it shoots constantly switching between four different numbers in a variable to shoot. So if Hit = 1 shoot of Missile1, if Hit = 2 shoot Missile2, etc. etc. up to four times. The other difference is that it reshoots the first one again instead of waiting for it to disappear off the screen. So that was a good improvement I think from the first game I did, which was like the other example I listed (shoot and wait).

I also implemented a powerup that drops off of one of the enemies in the scene. If the character touches it, then the powerup gives him two extra vehicles to the north and south of him, tripling the amount of firing power towards the enemies. I controlled these of course with a few broadcasts. Sadly though I didn’t get the opportunity to add more the powerup aspect of the game. I had the sprites loaded into the game though, and had planned on adding the “ice” powerup, which changed the missiles to more of a laser beam-type attack from all three of the vehicles (or one, depending on if you have the first powerup when you get it). I also didn’t get to add the more adventurish aspect to the game, where the character, upon going through narrow areas, will shrink inwards with the two other vessels and then spread back out.

To be honest though, the biggest issue I had with this game that literally took probably at least half of my time had to be the timing of the enemies. The worst part about this whole thing is that I now realize I could have implemented a VERY simple sprite that would’ve solved this entire problem, but at the time, what can I say? Staying up late is very bad for you. You realize everything the next day and wonder why you were so stupid the night before. But at least my room mate made me feel better by telling me that she too didn’t even realize at the time to equate the two, or she would have told me to use the same mechanic to solve all of my problems as well (instead of listening to me rant on about how angry I was, haha). So the problem I was having, if you haven’t guess it already, was the disappearing and reappearing of the sprites. When I used the simple “scrollX” script from a website it gave me a small piece of code to use (which I don’t remember now) to input and make the rest of it go away when it wasn’t on screen, but this didn’t work for me. So my time was drawing thin. What else to do? Oh yeah, that’s right. I went and found the ScrollX position of every single one of those sprites when it appeared on the screen, and made EACH one disappear and reappear when it touched that number. So in case you’re wondering how I did this, I watched the game. Over. And over. And over again. At least four times (AT LEAST) for each sprite, to make sure they showed up at the correct time when I told them to. Because if not, the sprite would chill out on the side of the screen forever and not actually do anything until it hit its Scroll X position.

So anyway, I realized the day after (when it was already submitted), that by far the easiest thing I could have done would’ve been to simply put a border around the sides, probably the color Yellow with a ghost effect set to 99. I then could have easily told it after it had hit it’s ScrollX position telling it to appear, that it needed to disappear whenever it touched this said color. And voila! My troubles would’ve been gone.SO simple. Even talking about it makes me angry! But like I said, I do want to come back to this game at a later point in time and add a LOT more enemies (because I didn’t have the time to add more than 9!) and the other things I mentioned previously, along with a boss. That’s school for you.

Yay! Pictures!

Ninja Senki Remake!

October 1st, 2012

A Super Nintendo game?!?!?! O__O Yeah I couldn’t decide. Then out of nowhere I’m just fiddling around on my laptop, doing that whole “procrastination” thing that we as college students are known for from time to time, and there it is! I’m playing it! Ninja Senki. Ninja Senki is a game created by Jonathan Lavigne and is very very fun and addicting. It definitely has the same exact feel and graphics as a SNES game as well, so I knew I could do it (or at least try to in the amount of time I had). A link to the game if you’re curious can be found here.

The main character throughout most of the game runs at enemies and shoots ninja stars. There is a jump mechanic as well, and a neat walking action when you scroll left to right. So first off! Ironically I didn’t actually make mine scroll, instead I used a pan to the next background instead to make the game seem a bit more constrained into “segments” for time’s sake. I created a lot of hardships for myself actually when I did this project though, because I ( being myself!) get carried away on the smallest things and will literally devote all of my time to fixing it if I know that I can.

So the character animations were the biggest problem of mine. I started off with one sprite, tried a gazillion different ways to get him to move the way I wanted to, and eventually I just split it up into three separate sprites. The reason I was having trouble with this, mind you, is because of the changing of the outfits from one to another when left and right is pressed. And when I added a lot more costumes to the equation than what I used in the Diglet game, it got a LOT more complicated, especially working in Scratch which for some reason hates costumes and makes it very difficult to access them if you use large quantities on one sprite. So I split them. And lo and behold! It worked. Too bad for me, my tutor Melissa saw what I had done, called me crazy and overworked, and came up with a magical solution to putting them all back together on one sprite. (I should be quick to mention that it only involved changing one number… just my luck). Neat! She (the main character, who I conveniently changed to a girl ;>) doesn’t moonwalk anymore, so that’s great. But she glitches. Not enough to really cause a disturbance though, and Fullscreen in Scratch always makes things work better.

Too bad for me the next problem is the collision. So I look up some scripts in Scratch for collision, and oh my god do they not make sense to me. I also need to add that by this point I am still EXTREMELY sleep deprived, so things that would normally make sense at 5:00 PM at night don’t at 4:00 AM in the morning. So instead I resort to something else. That’s right! I’m going to FAKE it! And by “fake it” I mean the character’s jump is extremely badly coded and I just don’t care because it’s 4:00 in the morning and I need closure. So! Originally I rammed my head for another few hours into a wall because I was just using the sprite of the girl to collide with the objects, and when she hit colors crazy stuff would happen. Probably an hour or two later it finally hits me I can make a ghost block (the only script I actually borrowed from anywhere) to collide with my objects for me. But that’s not the end! Oh no, I added some color collision in there and changed a couple of colors (where I wanted her to jump on the platforms) EVER so slightly, to the point where the black box would JUST touch it and then make the jump to the top.

Since this experience I have become a lot more savy with Scratch and could have avoided a lot more problems now than what I had then, mostly by using the broadcast function a LOT more than I did. But either way, it was a learning experience. I don’t think this one is worth being downloaded though, hahaha. BESIDES, it was only made for INSTRUCTIONAL USE ONLY!! :) But here’s a few screenshots anyway, haha.

Whack-A-Diglet

September 16th, 2012

So we’re doing a project that’s supposed to be simple like an Atari 2600 game. I’m choosing to do a Whack-a-mole game except with diglets, because apparently that’s what my mouse drew that morning instead of a mole. I’m having some little issues here and there. It reminds me of my VFX programming class in Maya… Always one little thing goes wrong and now you have to spend hours trying to find how to fix it.

This program, Scratch, seems very limiting at times. It’s limiting in that things that I would otherwise find easy to do it has a hard time letting me do them. A classic example was Mariel in Class 2 repeatedly saying, “Why can’t I use just ‘unless’? That’s all I want!” It’s also kind of difficult thinking of the multiple sprites and scripts as one whole piece instead of separate scripts. Something I found myself asking repeatedly was, “Why can’t I just stop this entire sprite’s script aside from having to add it to separate scripts inside the script?” I struggled a little bit with that until I found another way around it (as it seems with every script we do, ‘take another route!’)

I seem to be having a really hard time telling my Countdown sprite to STOP counting down and restart itself whenever a certain a certain count is reached. Sounds easy, right? Well try telling that to my script. I have literally tried every combination of code I can think of, including changing the way it works and every time it seems to think it means continue past the certain limit I told it not to go past. I said, if Click < 3 (the number of clicks of the diglets), then do the countdown. If not (the number of clicks surpasses 2), then stop the script. Well it doesn’t seem to understand this and continues to go to zero, and then restarts itself. I don’t know what to do. Still trying to figure it out.

Earlier I was messing with the addition of levels in my script. I’m having to change a few things, like the countdown that before just counted down until zero, and the “GAME OVER” sprite that would originally just pop up after 11 seconds and end the game immediately. There’s some other little things I need to add too. I haven’t set up the “get all these diglets means you win” script either. I’m starting to think I’m taking the longer-than-necessary route to achieve this, but if I get to it work I can always get a friend to simplify it for me later on, probably during the critique tomorrow. Looking forward to it.

Until next time.