Mar 19, 2016

Game Project 2 Progress

After some deliberation I decided to make a multiplayer space shooter for my next project. I also decided to work in GameMaker since I already have some experience with it. So far the process has been pretty smooth. I have all of the basic gameplay functions added in, with both players shooting, damaging each other, and being destroyed with health reaches 0. I also have a start screen that displays controls.

The few things I have left to add in are:
  • Game over screens
  • Try to tighten up the controls a bit
  • limit the fire rate for shooting
Potentially I'd like to add gamepad support and other stages, as well as user defined number of lives. 


Mar 14, 2016

Midterm Production

I decided to start with the actual board, since that seemed to make the most sense to me. I created a simple NURBS plane and then expanded it to fill the grid. I then applied a lambert and the 'checker' 2D surface. The default grid is black and white, which would have looked fine, but I wanted to make it look a bit more like the chessboard I found and posted in my pre-production post, so I edited the colors a bit to reflect that. I also added another plane around the edge of the grid for a border.

This is what it looks like with the board and the black rook I've already created:
I then duplicated the rook 3 times, and added the texture for the white pieces. Then I made the pawns and did the same. This is the result:
Next I made the bishops. This was the most difficult piece yet because of the slit that bishops have in their top. I made the piece like normal using the CV curve and revolve tools, and then I had to do some research to make the slit. I watched this Youtube video that showed how to use the Boolean Difference tool to make it. I did that, then I had to figure out how to use the NURBS version of the tool. It wasn't too difficult, and now I've got bishops that look pretty realistic:
My next piece was the queen. It didn't really cause any trouble at all and was nothing new, so I'm just going to post the picture:
I then made the king. It was a little more complicated than the others but still not terrible. I first made the piece with a flat top using the CV curve and revolve tools, then to make the cross on top I used two cubes and transformed them to look like a cross. 
The last piece I had to make was the knight. I was specifically holding off on the knight until last because I knew it would be the most difficult piece to make. All of the other pieces are cylindrical and symmetrical, so using the CV tool and Revolving worked perfectly. The knight is a little different. I drew the outline of the horse like normal, except I drew the curve all the way around. Then I duplicated it and used the Loft tool to make the outline. This left me with the outline of the knight, and I only need to fill in the hole. I learned that I had to convert my NURBS object to a polygon. I followed these two tutorials:
This gave me the horse, but I still needed the base. For this I used the CV and revolve tools like normal, which gave me a round base, Then I positioned the horse on top of the base. I wanted to combine these objects beyond simply grouping them, since they will never be separated and should really be one object. I found a tutorial on combining polygons, so I had to convert my NURBS base into a polygon and then use this tutorial: Combine polygon meshes

I ended up with a pretty decent result that fits in with the rest of my set:
The only thing left for me to do is camera and lighting work. I made a camera and looked through it, then simply set keyframes while moving the camera around. Then I smoothed out the animation on the animation graph. For lighting I just added a couple spotlights. Then I batched rendered and made the sequence into a video, which is below.

I had a really fun time making this project. A lot went right, and there was never a time where I felt frustrated or lost. I'm really satisfied with the models I made. The only thing I would really change is the lighting. I feel that with enough time I could alter the lighting to make the pieces really look great. In the future I would like to maybe animate the pieces to make a full game of chess.





Midterm Pre-Production

For my midterm I've decided to make a chessboard. Since this assignment is heavy on modeling and relatively light on animation, I figured making a chessboard with all the pieces would be a good idea and would let me practice modeling more. I also know what a chessboard and pieces look like, so I don't have to do too too much research before I start modeling.

I'm trying to base my chess board and pieces off of the ones in this image:
I'm using these specific images as references:
pawn

bishop

king

knight

queen


I already have the rook modeled from last week's assignment (see a few posts below), so that's two pieces out of the way already.

I needed a refresher on using the CV curve tool and the Revolve tool, so this video was pretty helpful. It also pointed out using a reference image, which I had never thought of but is obviously really helpful.
https://www.youtube.com/watch?v=wt4oMqSL0iE
I ended up using several tutorials and help pages during this assignment, including:

Mar 7, 2016

Questions about Games in Class 3/7/16

The game I enjoyed most was Astro Duel. It was the easiest to pick up and play, and the simple game mechanics were really enjoyable. Even though it was simple it was really competitive. Everybody could pick up on it really quickly so there wasn't a period where we had to fiddle around with the controls.

A screenshot from Astro Duel


The game with the most novel concept was Filo Filo Disco. I didn't really understand the objective at first, but after a few rounds I picked up on it and found it really fun. I thought the swinging and throwing mechanic was really cool and added some strategy to an otherwise really simple game. It was pretty cool how such a simple concept could be so competitive and require strategy.

Single Screen Multiplayer Game Idea

Our next project is to make a multiplayer game that uses one or no screens. I'm thinking of making a 2 player shooter game in GameMaker. I have a little bit of experience with GameMaker, so with the time we have I think I'll be able to create a game with a couple levels. Since the theme is "grit", I think a shooter is appropriate. The players will have to shoot all of the enemies to advance to the next level. After a couple of levels they will fight a boss. After defeating the boss the game is over.

Mar 6, 2016

More NURBS Models

Our assignment this week was to make another NURBS. I learned some things last class that made it a lot easier to make complex objects. I followed along with the pencil tutorial and this was my final result:

For the homework I decided to create a rook from chess. This wasn't too hard. I used the EP curve tool to draw one half of the piece and then used the revolve tool. Then I added a lambert texture and made a dark color, like the black pieces in chess. This is the result:


Mar 2, 2016

Finished Game

So my game is finished, and I've got mixed feelings about it. On the one hand, I'm glad that it works and is pretty stable. I came into this project only wanting to make a simple game of tag with some special features, like obstacles. As I worked I had to remove some of the features I wanted, like obstacles and a restart button, for the sake of having a working networked prototype at the deadline. If I had more time I would have added things like:


  • Obstacles with collision detection
  • Make players switch colors when they touch (switch who is "it")
  • A restart button
I'm also a little disappointed that I didn't get to add in any data checking during the grace period that would have let me run the game at a higher framerate. I just didn't have time with work and class.

The finished project is pretty simple. I took some screenshots to show the progression of the game:
The start location for the players
The red player, who is "it" gets closer to the target.
When the red player touches blue, both players see the game over screen.
There were a few code snippets that I think exemplify some of the effort I put into the project, even if the end result wasn't very flashy. First, there's the logic I built for the collision detection. 

boolean isInsideRect(float x, float y, float rectX, float rectY, float rectW, float rectH)
{
boolean answer = x > rectX && y > rectY && x < rectX+rectW && y < rectY+rectH; return answer; }


This function was used in my IMM120 class (I can't find the original github repo) and I had to tweak it for my implementation:

if ((isInsideRect(player1.x, player1.y, player2.x, player2.y, size, size)) ||
(isInsideRect(player1.x, player1.y+size, player2.x, player2.y, size, size))||
(isInsideRect(player1.x, player1.y, player2.x+size, player2.y, size, size))||
(isInsideRect(player1.x, player1.y, player2.x, player2.y+size, size, size))||
(isInsideRect(player1.x+size, player1.y, player2.x, player2.y, size, size))||
(isInsideRect(player1.x+size, player1.y+size, player2.x, player2.y, size, size))||
(isInsideRect(player1.x+size, player1.y+size, player2.x+size, player2.y+size, size, size))||
(isInsideRect(player1.x+size, player1.y, player2.x, player2.y+size, size, size))||
(isInsideRect(player1.x+size, player1.y, player2.x+size, player2.y, size, size))||
(isInsideRect(player1.x+size, player1.y+size, player2.x+size, player2.y, size, size))||
(isInsideRect(player1.x+size, player1.y+size, player2.x, player2.y+size, size, size))||
(isInsideRect(player1.x+size, player1.y, player2.x, player2.y+size, size, size))||
(isInsideRect(player1.x, player1.y, player2.x+size, player2.y, size, size))||
(isInsideRect(player1.x, player1.y, player2.x, player2.y+size, size, size))||
(isInsideRect(player1.x, player1.y, player2.x+size, player2.y+size, size, size))||
(isInsideRect(player1.x, player1.y+size, player2.x+size, player2.y+size, size, size))
== true) {
gameOver = true;
}



As you can see, it's a bit tedious and sloppy. But it's the way I know how to do collision detection, so I used it. It seems to work.

I also like the way I did movement for the player who is "it". I used processing's second() function to count time, and after 30 seconds have passed the player moves faster. It isn't really anything special, but I liked the functionality of it.

void update(){
if(keyPressed == true && keyCode == UP){
y -= speed;
}
if(keyPressed == true && keyCode == DOWN){
y += speed;
}
if(keyPressed == true && keyCode == RIGHT){
x += speed;
}
if(keyPressed == true && keyCode == LEFT){
x -= speed;
}
if (x > width - 100){
x = width - 100;
}
if (x < 0){ x = 0; } if (y > height - 100){
y = height - 100;
}
if (y < 0){ y = 0; } if (time > 30){
speed = 15;
}
}



All in all, there were a couple takeaways from this project for me.

1. Collision detection is hard
2. Everything will always take longer and be harder than you think it will.

I wish I had had more time/skill to implement the features I wanted to. I'm a little disappointed with the outcome of this project, but I'm glad it at least works on some level.