Project – Demo

this is a demo of our final project, a multiplayer videogame made with Unity.

chozaoop

Hey guys!

So we finally have an stable version of the Tanks Online game we did as a project!

Reminder: This game is not ours entirely, we got the game, then customized some stuff such as 3rd person camera, aim freely, visual filters, power ups, respawning, and most importantly a multiplayer capability we learned at the Unity Roadshow about 2 or 3 weeks ago.

Here’s a video showing some gameplay:

We had been testing the game on Ken’s class, it has been fun and it’s looking real different from the first version, Hermes freaking rocks!

While testing we detected some bugs and errors in general, Hermes then fixed it and also added some stuff. We also noticed how the game becomes less stable the more people enters a game, so let’s say it’s a good 1v1.

View original post

Advertisements
Mr I Never Use an Umbrella

TC201 #CourseReview – Mr. I Never Use an Umbrella

This course has been something really new to me.

I learned the more fundamental concepts of Object Oriented Programming, as well as putting most of these into practice. Classes, objects, attributes and methods. APIE: Abstraction, polymorphism, inheritance, encapsulation and delegation. Has-a, is-a relationships. Visibility modifiers. Overloading and Overriding. Also I learned about software development tools and practices like UML and CRC cards. I still have to learn about the metaobject protocol. I also learned a lot about the Unity game engine and about video game networks and protocols, the Authoritative Server approach, latency compensation, client prediction, server reconciliation and other interesting concepts. this and this  are some really nice articles about the subject.

First off, I thought I wasn’t doing a lot of things, the course was really relaxed, doing the assignments whenever I wanted and learning whatever I wanted. A lot of people coursing OOP with Salinas told me that I was learning nothing, because the way the class works. But at the end of the first partial I realized I had learned more than my fellows from the class of Salinas, and they are still saying “you didn’t learn about Java user interfaces”,  but honestly, I don’t give a duck about user interfaces. I was learning all the theory and doing the programming wsq’s by, which is quicker than having the teacher trying to put the concepts in everyone’s head in one class, because I think everyone has it’s own learning rhythm.

I personally think this teaching method is really good and could work really well, but first, ken has to polish some aspects of the course:

First, there must be more emphasis on doing the assignments, because people (at least most I know) is not very interested in self-education, they don’t do the things they should until they realize they have one or two days left for finishing everything. They don’t manage their time correctly, they prefer to procrastinate all the time instead of focusing in what is really important.

Second, I think there should be more programming assignments, sometimes I learned the concepts, did the posts about what I learned and everything but never put these concepts into practice, making me feel like I did not master the topic completely, and I don’t mean learning Java, I mean reinforcing the concepts learned with something practical, because I definitively think that this class (and every programming class) should be language agnostic, focusing on learning the theory and putting these concepts in practice in whichever language the student wants.

I think that if ken really efforts improving his course in these aspects he will have a really, really good course, keep the good work!

James Gosling interview

Just finished watching Triangulation 245, featuring James Gosling, the creator of Java, one of the most popular programming languages in the world, and the Java Virtual Machine.

Glossing staring right into your soul

Gosling staring right into your soul

He was interested in programming at an early age. The idea of creating Java came from observing how everything was switching from hardware to software, writing code instead of inventing new machines. I also want to point out that he is Canadian.

Canadian-Flag.jpg

Ward Cunningham

Ward Cunningham

This post is about my thoughts on the Triangulation Chapter 239, where Ward Cunningham is interviewed. He is the inventor of the wiki, he contributed to the development of Eclipse 3x2_Collective_CUNNINGHAM.jpgand Relic and is part of the Smalltalk community.

Wikis are the biggest knowledge source in the world, where anyone can write, read and edit any publication. Extreme Programming is a methodology for agile software development where there is more emphasis in adaptability  than predictability.

367px-Extreme_Programming.svg.pngThe interview showed me how a simple man can make a huge contribution to humanity, such as wikis; where people share their knowledge just to make that knowledge public for everyone, and how we can work together for a better society.

 

Project Update #4

So we’ve finished the tutorials and we will start creating our own game.

As a reminder, our objective in the course is to explore and learn about the Unity engine, game logic and how game objects work.

In the last couple of days we implemented a system to create different tanks in the same scene, the logic to control the game flow and audio mixers.

The tank manager is a script that controls that instantiate a tank in the scene, setting its new color, and defines several methods to modify the behaviour of the tank, like disabling control.TankManager.png

The Game Manager is a script that controls the game (duh), setting the targets for the camera (because there could be different number of tanks), and have different functions that are executed based in the current state of the game (i.e.: starting a round, playing, finishing). We can archive this thanks to coroutines, which are functions that can pause its execution and return to the normal flow of unity (updating the frame, etc.) and then continue executing where it left.GameManagerCode.png

So the Game Manager just defines the number of rounds to win, the delay time to start (a countdown), controls the targets of the camera, instantiates the tanks and the Manager also keeps track of the state of the tanks (to finish the game when there is only one tank left in the scene).

GameManager.png

The starting delay just shows the text “tanks!”.

Text.PNG

The audio mixer is just like a filter to all the audio sources that the game have, you can just create one in the project folder.CreateAudioMixer.png

You can also create sub-mixers, so you can divide the sounds of the game and apply different filters to it, in addition to the main mixer.

Attenuation.PNG

In the output field of the audio source of the different objects you can select the audio mixer that you want that sound belong to.

DrivingTankAudio.png

And as you can see in the images you can add filters, modify the pitch, level, attenuation and other things until you are satisfied with the sound effects of the game.

The next idea is to create an interface to interact with the tank and game manager scripts. This interface will let the player to set some properties for the game (like adjusting the damage, the force and the color of the tank).

Project Update #3

We are almost on the end of the tutorials, I guess we will finish it and start creating the modified game by Wednesday. Because there are a lot of things we’ve done and there is no much time to explain everything, I’ll just add some images and briefly explain what they are.

This part is about creating the tank health, UI and logic. So I started adding a slider. Because the canvas is it’s own space it’s needed to change the Render mode to World Space.

Canvas

I moved the slider under the tank, changed its size and deleted the thing to move its value.

canvas2

I changed the default image by this one, it is a circle with a gap in the middle. Also changed the slider mode to radial (so it fills clockwise and not left to right).Canvas3

I added the script to control the health slider, I used color interpolation to calculate the color needed in the cicle and set the value of the slider based in the health of the tank.

chap3

And now you can see that the tank has a green circle around it. There’s also a explosion animation for the tank, when the healh of the tank reaches zero, an explosion animation is created in the same position as the tank and the tank object is deleted from the scene.

explosinThis part is about creating the shells prefabs.

First I added the shell model to the scene, added a Capsule collider to it, checked Is Trigger (to trigger a method when it collides with a tank), and also a light.

Shell

Here’s some code that goes in the Shell. When it collides it searches for tanks (that are in a special layer that groups all the tanks), calculates its distance to the tanks and apply a force and a damage to the tank according to that distance. When the shell touches something, it plays an explosion animation and deletes the shell object. Also, the shell is automatically deleted after it’s been two seconds in the scene (to avoid having around shells that, for some reason, never collided).

explosionScript

Here you can see, I dropped a shell in the scene, it exploded and the tank taked damage.shellExplosionNext part is about shooting shells, I added another slider, changed the image to the yellow arrow and set its position in front of the tank.

FireShellUI

Here’s the code that allows the tank to shoot. The tank can charge its shoot and when the player releases the shoot key, a new instance of the shell prefab is created, and its velocity and direction is calculated according to the tank position, rotation and the amount of time that the player pressed the key. It also sets the value of the slider to the value of the charge amount, so the player can see the arrow growing when they press the fire button.ShellShootCode

And here you can see the tank rotating and firing shells!shootingShells

Next in the list is creating a manager to handle the spawning of tanks.

CRC cards

CRC Cards

 

What are CRC cards? Are they really useful or just a waste of time? Why should I care? Where where were you on the night of December 25th? We all have asked these questions to ourselves at least once in our lives. And I’ll just answer the first one.

CRC (stands for Class, Responsibility and Collaboration) cards (stands for Community Assistance for Reconstruction, Development, and Stabilisation) is an Object Oriented design pattern, useful.

These cards are supposed to help the software developer to think which objects he will need to have, what methods they will have and how will they interact among them, even before start writing code. It is supposed to be a good tool to learn the OOP paradigm because, regardless the syntax or implementation of an specific language, you can focus in what really matters, the whole concept of objects.

To write CRC cards you need to think about three things:

  1. Class (name):The class has to have a short and descriptive name of what it represents and what it does.
  2. Responsibility:
    The problems that the class is supposed to solve and its procedures, these should be short verb phrases containing an active verb. This is typically what this class does when it interacts with other classes.
  3. Collaboration:
    Objects should not be isolated from each other, they all must collaborate to accomplish a common goal, just like we learned from The Wonder Pets! Here you write with which other classes this one interacts with.

CRC cards have the following format and are written in 4×6 index cards:

With CRC cards you can clearly see the relationship between classes, and the index cards have the advantage that you can move them around, organize and overlap them so you can put them in certain position that helps you to think about the relationship between these classes.

And with this I answer to the fist question, you should be able to answer the second and third questions by yourself, maybe the fourth too.

Information and images extracted from http://c2.com/doc/oopsla89/paper.html

Permission to copy without fee all or pan of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publication and its date appear and notice is given that copying is by permission of the Association for Computing Machinery. To copy otherwise, or to publish, requires a fee and/or specific permission.