Sunday, June 3, 2012

Week 5 of Session Spring B

Last week I wasn't able to input a entry because it was memorial day weekend and I didn't have access to a computer. So this week in my Artificial Intelligence class we covered how to make agents receive and send messages to the world instead of checking every second if something happened and fuzzy logic. In my 3D's Max class I learned about a camera cinematic, lights in 3D's max, Bink video a type of in-game cut-scene, sounds and Kismet/Matinee.

For my Artificial Intelligence class I learned that you can improve performance in your simulation or game by making a Master AI that sends messages to all of the agents in the game world. The way that it works is that it checks what all the agents in the "world" are doing and gives them order according to what the Master AI is programmed. For example, if a agent touches fire the agent doesn't know it's on fire until the Master AI say "Hey your on fire, take damage." and if your agent would take enough damage the Master AI would say "Hey your dead, get to your dead animation." It would be the Master AI to tell the agent to move out of the fire but the Master AI won't do it for him. The agent should have all of these functions built already inside of it all that the Master AI does is make the agent do or call on these functions. In a way the agent is your body and the Master AI is your brain telling it what to do. Your body has all the capabilities to do the things but it's not just going to randomly start doing it.

Fuzzy logic is a way in which what we human use to do calculations. When we say things like something is 'about' or 'kinda' we are just giving a rough estimate then rounding depending on how we see this. The way computers make decisions is by having a cut off point like a border on a map. As soon as you cross that line you are in another county so if you were to apply fuzzy logic to this example you will no longer have a solid line that says "As soon as you cross this line you are in so and so county." Instead it would have a point in which the two counties blend together and you can say that your kinda in this county but not really. Another example is when your blending colors together and you say that the color in between the two is kinda one color but not really. 





In my 3D's Max class I learned about cinematic cameras, Bink video, sounds Kismet/Matinee, and lighting in 3D's Max. The normal light in 3D's max is alright if you just want to view your model quickly, but if you want to set up a cinematic scene you are going to want to change the lights in 3D's Max and also some cameras so that you won't be animating in just one viewpoint. This method is good and bad in both ways the ready it's good is because you can use all the tools that 3D's Max has that UDK doesn't for example in 3D's Max you can get hair to be really fine and have individual strains of it like we have in real life, but in UDK you can't do that your hair will loop like it's a bunch of groups placed together. Just like I said this is good and bad the reason it is good is because you will get a nice cinematic scene the reason it will be bad is because it will use lots of your memory getting a nice video. Most games now use in game cut-scenes instead of pre-rendered ones. That brings me into what I learned next. We learned about the video converting program called Bink Video. What Bink Video does is it compresses a movie file that you already have so that it won't use a lot of your memory. You can also convert a movie into a texture and apply it to something. That would be the advantage of using Bink Video. You would chose to use this instead of doing all your animations during the game because you won't want to have someone shooting your or trying to hurt you while you are talking to a important person in the game. 



Some interesting things that I learned to do with cameras is that there are four different camera movements. Even in movies there are just four types of movement. There is Pan, this is when the camera stay stationary and just rotates left or right, then there is Dollie up/down what this does is it moves the camera completely up and completely down but doesn't rotate, There also is Track or Trucking what this does just like Dollie up/down the camera moves left and right as if it were on a track, and finally there is zoom in/out this what it does simply is just like the name says zooms in and zooms out. Those are all the cameras that the movie industries uses and they are the movements that work the best.



Sounds was something that we briefly touched but it was so simple that you would be able to understand it. What we did was go to the internet and get some sounds of just random things. Then we used the program Audacity a sound editing program. The program is really simple to use all you do is highlight clips of the sound you have and add effects. The only hard part is getting the sound to sound like you want it. You can obscure the sounds to sound very strange and not even like the original. You can get a piece of paper and crumble it then add some bass also slow it down to get a nice explosion instead of actually exploding something and holding a microphone next to it.


Kismet and Matinee are two built in programs inside of the Unreal Development Kit. Kismet is a type of "coding" that UDK uses to do things in the game engine without having to write tons of line of code. Matinee is what is used when you want things to move around in your game. For example, if you want a camera to move with your character you would want to attach it using Kismet but if you want the camera to move in a specific way for example in a Dollie up motion you would use Matinee and add a trigger in Kismet that would get activated if you did something in the game. One thing that I really like about Kismet that you can't do in a lot of other programs is change something then run is right after without having to build it again. What I mean by build is that when you create a program you have to do two things one is build it then you can run it, when you build it your getting the program ready to run, and with Kismet you don't need to make it ready to run and you can just run saving you the time it takes to build the game. At first when you start a level it will take a couple of second to build your game but once you start adding lots of lights and tons of meshes that will eat up a lot of your power and will slow down your build time.

Sunday, May 20, 2012

Week 3 of Session Spring B

This week was also just review of what I already know for my #D's max class. However, In my AI class I was able to get a seek, flee, arrive, and wander algorithm working.

For my AI class we just learned about singleton classes. Singleton classes is to put it simple a master AI that tells all the other agents what to do. For example if your going to be doing a game that you need to hide and there guards looking for you, you will want to set two things. First you have to set up the way points for each agent then set a singleton class if one of the agents finds you and have them all look for you, but you still need to have them make sure there not walking into any walls or objects. So your going to have to always check if the agent is colliding into something but not have the singleton class (Master AI) check for it because if one of the agents is hitting a wall all the other agents will think there hitting it as well.

In my 3D's max class we just went over how to create a simple box man and how to rig it. When you rig something that means that your inputting the "skeleton" to the model so that you can animate it. We also learned how to import a model or object to the Unreal Development Kit. I also learned how to this about 2 or 3 months ago so it was just review for me. On my current assignment we have to import 5 different models that we created make sure they have collision . I already have two from last week and the professor said that it was ok to use those but we need to make sure they all have collision and at least have a general theme that would make sense. An example he used was that don't have a tea kettle surrounded by mountains on all sides.

Here are the new models I made. I also included how it would look like in the Game Engine UDK. The Slight Grey is the Collision and doesn't show in the Game.


Saturday, May 12, 2012

Week 2 of Session Spring B

This week I didn't learn a lot of new things in class.

In my Artificial Intelligence class we learned about path finding. Dijkstra's algorithm is a way to calculate a path to a certain point. The way Dijkstra's algorithm works is by making a grid and assigning values to it depening on many factors. For example, if you have a flat surface then the formula would calculate all possible ways to get to the end path but if there was a lake or a long table between you and the end point then it would check if it's less work to jump over the table (if the game/simulation allows it) or to walk around the object. This formula is good the only problem with it is that it calculates everything.

There is another formula that gamer developers use and that is called the A Star Algorithm. This formula is better for games because it would just calculate the necessary path to the end point and nothing else. For example, if you start a point in Dijkstra Algorithm it would calculate if there is less work to travel backwards, A star won't do that, it would just calculate from the beginning point to the end point. The problem with using A star is that in the process of finding the path you might lose the shortest and best path, the only good thing about this is that you would use less processing power and be able to make faster decisions as illustrated in the diagram.





Photobucket

In my 3Ds Max class I didn't learn a lot of new things this week mostly review for me. All we did was create normal maps which I already have been doing in ZBrush, unwrap UVW maps, and learning how to import to UDK. For normal mapping we were given a program that generates a normal map from a texture file we give it. It is really neat but the only thing is that you are looking at text boxes the whole time and there is no way you can preview it until you import it to 3Ds Max.The program that I use to make normal maps is ZBrush. What you do there is import your 3d mesh and increase the poly count on it, then you would mould it however you want after that is done you just have ZBrush create the normal map and you just save it.

Next we learned how to create UVW maps and that is when you make a map of how your model will get textured. What I do is simply flatten the mesh and texture it that way instead of cutting the model by steams. My method is fast and simple but you have to know what each of the parts do before you start texturing it because it can get really easy to get lost in it. The best solution for this is by connecting the broken pieces of the map together so that you can get a general understanding of what your looking at when you start texturing in Photoshop. Here some examples if you don't know what a normal map is.




Photobucket

Photobucket




Besides that we were given a Lab to do in which we had to create, UVW map, and texture two meshes and a terrain. Seeing as how I have some prior experience with 3Ds Max this only took me about 30 minutes to do. What im most proud of is how I was able to texture the wood. Yes the texture looks horrible and blurred but that's how I wanted it to look like. I wanted to be able to compare to Nintendo 64 graphics which were great at the time but with the consoles that we have now is considered "bad" Here are screen shots of my meshes and terrain. These meshes are separate from my mid-term game and are just examples of what were are being taught in class.



Photobucket
Photobucket
Photobucket

Saturday, May 5, 2012

Week 1 of Session Spring B

Things I learned: Since this week I had my first couple of classes of 3Ds Max and AI programming I learned a couple of things.

For AI I learned that a lot of the code derives from just a simple three line code and the there about 9 different variations of AI. the simple one that everything is from is seek, the way that seek works is by having a force pull the actor to the object. Then there is flee which is the same formula expect its negative, What flee does is puts a force between both objects. A way to picture this would be to have to magnets together if there opposite they are going to slowly move to each other and that's seek then if you have two of the same that would repel each other. Pursue is almost like seek but is pursue the object is moving and with seek its in one position and with pursue the AI calculates position, speed, and targets position, targets speed so that it can estimate where it's going to be and head there. A funny thing with pursue is that there is nothing that can predict where humans go and reach what you do is assume that the object is going to head in a straight line. A example of pursue would be a 'Aim bot' what the aim bot does is just pursue the target and the displacement it sets your cross hair is very small so that it gives the illusion that your following the player, but what its really doing is just calculating the trajectory of the person. So if the player would just stop and turn instantly they would fowl the aim bot for a second but then it would just recalculate to the new position its heading. Evade is just like flee but with the principles of pursue, the object is moving all the time. Wander is another form of AI and the way it works is that it draws a invisible circle in front of the object and chooses a random point in it then follows it and keeps rotating around the circle and that it makes it look like the object is wandering randomly, smaller movements in the circle the smoother and realistic the movement looks. Obstacle avoidance makes a box in front of the agent and checks if it hits anything if it does it will adjust the box and position so that it will be less and less until there is no collisions. Wall avoidance works a bit like obstacle avoidance but instead of making a box it makes two lines horizontally to you and checks how far the walls are from you. Hide finds a obstacle and hides between you and something else. Flocking is one of the coolest forms of AI in my opinion it is when a group of agents move in the same way like a flock of birds or a bunch of little fish together. What flocking does is that it generates a force based on proximity to other agents which is called separation or don't crowd. Keeps them heading aligned with neighbours, alignment or stay in step. Opposes of separation, cohesion or stay together. Having them not crowd but stay together makes them not wonder in random directions. A way flocking is used is that when you want to generate a crowd in a game you set up flocking points and place a whole lot of people in a lets say city and since they cant move through the city they just looks like there walking around the world minding there own business. So in a game like assassins creed or a simulation where you have a huge market place you set about four or five flocking groups and about 30-35 agents in them and have them flock to points in the map and as long as the map doesn't get to crowded it would look like people are just wandering like in real life, and that's why this form of AI is my favourite. When you make a really good AI that you don't question the purpose of it you have succeeded in giving the illusion of intelligence that's what game AI does it gives the illusion of intelligence. One important thing I forgot to mention is that the correct amount of force that you add cant be measured, that means that you will have to run things in trial and error to get a good understanding of the force you need to have for each of the different types of AI.

In my 3DS max class I learned how to create a terrain in two different ways. one is simple you just grab vertex points and move them around or you can use a type of paint tool to select one point and the points around the center. I liked this but when you want to create a world that just flows nicely I wouldn't use this method this is more if you want to edit a terrain you already have. The other way that I learned and I personally like is creating a displacement map. The way that worlds is that you have a black and white picture and black is the floor level and white is the peek everything between is the levels to create it smooth. So you can go to Photoshop or even MSpaint

Mid Term Progress: Something I'm am going to start adding in my blog is having a picture of what I wanted to go so that you don't just have to read text after text of what I'm trying to do and actually get a visual of what going on my mind. The progress I made in my midterm wasn't very much I tried to have a single bone structure like I have in the picture. When I went to rig or animate the character the points didn't act the way I wanted them to. If I would try to move Uno's foot it would reach a point and then the mesh would invert and break. So I'm back to the drawing board on finding a way to make his bones so that I can animate him correctly. I was talking to my Professor and he was talking about new way to create bones he said that it uses boxes and all you need to do is make use you have a box wrapped around the arm or leg of your character and it would automatically envelop it and UDK accepts them as normal bones. He says once the school upgrades the 3Ds max to the newer version he is going to stop teaching bones and just use the box method because it is the future and everyone is going to start using it in the industry so it would be useless for use to make things with bones its still good practice but the box method makes things so much simpler and faster. When your creating a game or movie you want fast and simple because half the time you are going to be in a strict schedule.

Sunday, April 29, 2012

End of Spring Break

So yesterday while i was doing the animations I had a thought. With jumping animations do you need to actually make your mesh jump or is that something you do in the game engine. I would think that it's something you do in the engine or else you will mess up your hit boxes, of course I can always just be wrong and its something that I have to do in 3ds Max. Since on Tuesday I start my actual 3ds Max class I will ask my professor that.

Monday, April 23, 2012

A New Problem

In the short amount of time from the last post to this current post I have learned or remembered how to select specific vertices and exclude others. Now I'm facing a new problem which is that I can't rotate Uno's Body. That is stooping me from making his Idel animations I believe that you change your mesh on the fly using the same exact animation time line. I will have to try this out and if this fails then I will have to do some research to fix this simple problem.

At least I remembered all the things that have to do with bones and how to envelope specific vertices.

Spring Break, No Break

This week during my spring break I will be learning how to use the bone tool. I had some experience and know what it does but that was over 4 months ago, so I will have to brush up with it. One problem that I have come across is when enveloping the vertices with the correct bones. I know there is a way to have only certain vertices enveloped with specific bones. So I will have to get as much information on that as possible since that is the only thing stooping me from adding animations.

For this week I will get different varieties of walking animations since I'm not sure what my team leader wants, jump, roll, action, and idel animations for Uno. Walking animations, and a idel stance for the enemies.