Destruction in 3D Video Games: Part 2

Welcome back!

Today is all about the Physics of Destruction. I'm going to discuss different types of deformation as a result of different types of forces and stress vs. strain. 

In material sciences and engineering, Deformation is defined as the change in an object's shape, size or structure as a result of applied forces or changes in temperature. For now, I'm only going to discuss forces. There are different types of applied forces that can cause deformation: 

  • Tensile Forces - These types of forces are pulling forces, or tension forces. These are forces that pull in opposite directions of the material and are intended to stretch or lengthen the object. For example, consider a rubber band. If you wrap one finger on both ends of the rubber band and pull in opposite directions with your fingers, you would see the rubber band start to stretch! That would be a Tensile Force!

  • Compressive Forces - These types of forces are pushing forces. These are forces that push inward towards the material and are intended to squeeze or shorten the object. For example, consider an empty soda can. Sometime people like to show off their strength by putting their hands on both ends of the can and pushing inward to crush the can. This would be a Compressive Force!

  • Shear Force - This is a type of unaligned force that pushes one part of a material in one direction and another part of that material in the opposite direction. For example, consider a deck of cards. When you push the top of a deck of cards in one direction, and the bottom of the deck in the opposite direction, you will see the deck move in two opposite directions. Shear forces can cause cracking or tearing of the material.

And here are other concepts related to deformation that result from forces, but they aren't forces themselves:

  • Bending (Flexure) - The behavior of a structural material that is subjected to some force perpendicular to its longitudinal axis. (see picture below)

  • Torsion - Also known as twisting, as a result of torque. (see picture below)

Now, I also mentioned how there were different types of deformation. The three different kinds of deformation include:

  1. Elastic Deformations - These are reversible deformations, meaning that as soon as the applied force of this material is removed, the material will return to its original shape. For example, consider a couch pillow. When you push your foot down on the pillow a fair amount, and then lift it up after some time, most pillows will go back to their original form.

  2. Plastic Deformations - These are irreversible deformations, meaning that these materials will not resume their original shape after an applied force is removed. This is the 2nd stage of deformation. Before an object can undergo Plastic Deformation, it MUST first undergo Elastic Deformation, even if only by a small amount! Consider a piece of metal. If you apply a decent amount of force to the object, you will notice that it won't return to its original shape. It'll be reshaped and restructured.

  3. Fractures - These are also irreversible deformations, except these deformations result in the material breaking and being split into two or more different pieces as a result of excessive stress. This is the 3rd and final phase of Deformation, where the material first has to undergo Elastic Deformation and then Plastic Deformation, THEN fracturing. Consider breaking a stick for a bonfire. When you bend a big, rigid branch far enough, it will usually snap into two different pieces! That would be a Fracture!

And finally, I wanted to clarify the different between stress and strain

  • Stress = the applied force per unit area of a material. This is a vector, since it has a direction!

    • σ = F / A where σ = stress, F = force applied, and A= cross sectional area of the object.

  • Strain = the deformation of a material or object due to excessive stress beyond that object's maximal stress load. Too much stress causes strain! Strain is what causes the different types of deformation, as seen in the Stress-Strain chart below.

 

Bending structural beamRetrieved from https://en.wikipedia.org/wiki/Bending

Bending structural beam

Retrieved from https://en.wikipedia.org/wiki/Bending

Destruction in 3D Video Games: Part 1

I recently was out for a walk around my neighborhood a couple weeks ago, and as the critical thinker that I am, I began contemplating the universe. I was thinking about how video games are incredibly powerful because of the virtual worlds that game developers could literally "build and destroy" with their own imagination and the right tools. I then started to think about how games could be made more realistic and more enjoyable with destructible environments and material physics! After seeing the Crackdown 3 gameplay trailer a few years back, I became interested in applying realism to gaming. As a side note, These topics can also be applied to different forms of engineering, real-world simulation testing, and even VR as well! 

For today, I'm going to briefly discuss some background information on 3D models and how that connects to Destruction in video games.

For starters, a Mesh is a collection of vertices, edges, and faces that structure and shape a 3D game object. Think of a mesh as a lattice-structure of these vertices and edges that represents the geometry of that 3D game object.

Most of the time, 3D game development tends to follow this process:

GameDevelopement.PNG

Game development always starts with thinking about ideas for every aspect of the game, which includes things like the story, characters, gameplay mechanics, theme, style, etc. Once these have been formally laid out, the developers decide which ideas will most likely be implemented in the actual game. Then the concept artists are put to work to create generalized sketches, or even technical sketches with dimensions and multiple perspectives, of the game objects and game environment. The concept art helps the 3D modeling artists to begin constructing virtual 3D meshes that depict the game objects. After a 3D model has been created, it has to be UV-mapped.  UV-Mapping is the process of taking the complex geometry of a mesh (i.e. its triangles, polygons, and n-gons) and projecting that geometry onto a flat 2D grid to prepare for texturing. They use the term "UV Unwrapping" to describe this process. The UV part refers to the coordinate axes. The axes are labeled (u,v) instead of the classic (x,y) in Cartesian coordinates. Once you have these UVs laid out properly, you can layer an image onto the surface of the 3D model. This image to be wrapped around the surface of the 3D model is called a Texture. Textures are what make game objects seem more realistic and they make these objects have a "look" and "feel" to them. Then the game object is ready to be exported and used in a game engine! Yet, it's easier said than done of course!  :)

Now, here is the part on how 3D models relate to destruction.

There are a few limitations to mesh deformation in video games. Here's why: A while back, game developers traditionally meant for 3D models to be "static" in the game world, meaning the mesh (i.e. its geometry) and textures weren't meant to be changed at all when the game was running. Sure, these 3D game objects could be moved (translated), rotated, or even scaled at runtime, but that never changed the virtual geometry of the mesh. Due to the massive computational load on many computers, 3D models are usually intended to be static entities. Yet nowadays, changes to a game object are often desired by game developers. By "changes", I mean object deformation and destructibility, whether that be through colliding with another object, the player physically applying force to an object, etc. 

Since computers have gotten more and more powerful over the last few years, a lot of game companies are trying to uncover new techniques to make these "changes" possible at runtime. 

For example, suppose you are driving your favorite car extremely fast in a game. You suddenly lose control and smash into a concrete barrier with the front of your car! Oh no! Normally, the player would expect the front end of the car to take damage and have massive deformation, such as the hood now being dented, the paint scraped off, the bumper hanging on by a thread, or whatever. In this example, one problem developers face is calculating the area of impact, the amount of damage the car took, and what parts of the car should deform in a seemingly realistic sort of way. Another major problem would be the car's UV mapping and texturing. The UVs and the textures of that object would need to be recalculated and updated after every single collision (given that deformation occurs). If developers don't update the UV maps (or if they don't recalculate the UVs correctly) then the textures wouldn't map correctly to the mesh and the game object would look TERRIBLY unrealistic in the game!

One work-around for this limitation would be for developers to create other separate 3D models of the same object, each of which represents a varying amount of destructive damage on that object. The good news is that each one of these meshes of varying amounts of damage only have to be UV mapped and textured ONCE, and thus requires no updating when the game is running. Then, when that object receives a certain amount damage in the game world, that object is removed from the scene altogether and replaced by the more damaged 3D model of the same object. This switch in meshes happens in-between update frames, so the player (almost always) cannot tell this has happened! The limitation of this approach is that the developers would have to create a TON of different 3D models that are all UV mapped and textured in order to make the game feel very realistic. It also would be super hard to accurately control which mesh to replace. What do I mean by this? Consider the car example again. Let's say you only have four levels of destructive damage to your car (that is, four different 3D models of the same car with different amounts of damage). If your car gets side-swiped by another car in the game, the player would expect some scratches or dents on that specific side of the car. It would seem very inaccurate if your car was replaced with the mesh that had the hood dented upward and the bumper breaking, since there was no collision even close to that area! This leads to the limitation of this approach. Developers using this work-around would have to spend LOTS of time creating LOTS of separate meshes, UVs, and Textures for the game object to act realistically. Developers would also have to worry about the specified area of impact to make the mesh replacement more realistic and physically correct! Not only that, but the same 3D models that represent the destruction of the car would become repetitive over time, unless you created a large number of them!

Thus the limitations of the approach to creating separate 3D models with varying amounts of damage would be:

  • Time-consuming to create meshes

  • Need to create lots of 3D meshes for different amounts of destruction, with UVs and Textures

  • Managing the Transition between different meshes accurately upon collisions or deformation

  • Unrealistic and Repetitive - if there aren't that many 3D models to replace the mesh with

That's a lot of information for today! Hope that was all clear! 

 

Sneak Peek of the Next Few Days of Content: Destruction

"Humans are creatures of creation... and destruction..." -Aaron Hernandez

Lately, I've been reading up on Destructible Environments in video games, and there is a LOT of content that I still have to read before I can write about it in depth! So over the next few days, I'll be covering this type of information.

So to keep things short for today, while I'm studying this topic, here is a sneak peek video of destruction in a game called Crackdown 3

Crackdown 3 is a new game that is supposedly coming out in 2019, and it seems that the developers are adding destructible environments for virtually every object in the game, including buildings! They actually had to use multiple servers to pack a lot of destructible objects into the game due to the massive computational load of mesh deformation. You can even shoot out pieces of a concrete wall and watch that piece fall and crack into a million pieces on the ground! How cool is that!

Here is a cool video from a few years ago of how you can literally destroy every single part of a building in Crackdown 3. I hope this still makes it to the actual game, as that would be a major step for future game development and even VR!

The Different Ways an App can make Money

Hello everyone, 

Very quick post today,

Have you ever wondered how free media, such as videos or games, make money?

Well today I found an interesting article and a video about this process! Check it out!

It seems that there are 3 main ways that apps can make revenue:

  1. Paid Downloads\Pay to Play - These are the apps that you actually buy once and play forever, or those games with recurring subscription fees that are required in order to play the game.

  2. Free Apps - Games that are downloaded and completely free to play, but ones that can have different types of ads pop up on the screen at certain times. The types of ads that can pop up are listed below.

  3. In-App Purchases - The third way to make money with apps is to allow users to purchase extra content within the game. For example, maybe you provide an incentive for the player to buy more gold, more resources, or less waiting time to continue his/her building experience.

  • Banner Ads - These are ads that are placed either on the top/bottom/left/right of the screen in order to prevent disrupting the user experience. However, they are visible if the player scrolls on the screen and still might appear as a nuisance. Very common on game websites.

  • Interstitial Ads - These are ads that pop up in-between certain parts of a game. For example, if the game is based on how long one can survive, then once the player loses or dies, an ad pops up that the player must exit out of before he/she can try again. This is seen in lots of phone apps, such as Flappy Bird!

  • Prestitial Ads - ads that play once when an application starts or before a website homepage is loaded.

  • Reward Ads - optional ads that play if the user wants to receive some sort of bonus, such as skipping the time it takes for something to finish being built, to gain an extra life, etc. This is seen in Clash of Clans for example

 

http://www.indiumsoft.com/Blog/make-money-using-ads-mobile-games/

 

The Rise of Indie Game Developers

Hello everyone, 

I'll do a short post today, since I've discussed some really dense topics the past few days. Recently I've been continuing development of my first game, X-Squadron, and I've become more and more aware of the rising indie game development industry. I've found an article on how Microsoft is helping small indie game developers launch on their platforms, such as the Xbox One. 

It seems to be that the new trends in gaming are the rise of the indie game developers, VR, and next-gen consoles (at least within the last few years!)

But why are some developers choosing to go indie? I've done some thinking and some research, and I've found that a lot of triple-A game companies tend to want to deliver content quickly rather than creatively. In ways, this is a good thing and a bad thing. The good thing about delivering games faster is the fact that they can reel people into the action quicker, hype up the features, and make a lot of money at the same time with less content. In other words, they give a viable product for the user with a minimum time cost, which also means they can focus on making other games sooner! The bad thing about this approach is that these triple-A game companies sometimes are not able to pack a lot of creative genius into the story, gameplay, or environmental attributes of the game, given their time constraints and their need of money to pay the bills. I'm not saying that all triple-A companies neglect creative content, but some of them out there only want rapid content to stay in business. And that is perfectly fine!

Indie game developers (or even smaller game companies) tend to pack a lot of creative power into their games because they envision their products in different ways. They think about adding an interesting mechanic into their games, such as using a screwdriver in first-person perspective to escape a room. These developers tend to focus on how they would respond in a given scenario in their game. These types of developers try to do as much as they possibly can to make the game that much more interesting, and most of them have a lot of extra time to experiment with "never before seen" content. As I've learned from being an indie game developer, you can have a LOT of fun brainstorming creative, and sometimes even crazy, ideas with your fellow coworkers! But hey, sometimes even the craziest ideas change the gaming world for the better! New algorithms, creativity and new ways of thinking are rising with indie game developers. That's why I think more and more companies, like Microsoft and Sony, are pushing for more indie game developers.

Here is that article I was talking about too

https://business.financialpost.com/technology/rise-of-the-indie-developer-microsoft-puts-small-studios-closer-to-the-centre-of-its-gaming-future

The COG Language from Jedi Knight: Dark Forces II

Yesterday, I briefly discussed programming languages for game engines and the difference between a compiled language and a scripting language. Today, I am going to briefly cover some of the features of the COG programming language from the article written in 1997 by senior programmer Robert Huebner. Again, everything I present today belongs to LucasArts and the developers of Jedi Knight: Dark Forces II.  

The developers of Dark Forces II wanted to create language that was easy to use for non-programmers (such as artists and game designers) and one that was fast enough for real-time action. This is what inspired the COG language! Huebner mentions that COG was a custom compiled language that was based on the C programming language. The developers used the C programming language as a starting point and modeled COG off of its syntax, while removing a bunch of C's "obscure" keywords and some major parts of the language. Huebner states that the library of COG functions for the author to use is the most important part of the language rather than the actual syntax. For those of you who don't know what a 'function' is, think of it as "a step-by-step instruction guide for doing a particular task in code." These functions supposedly were useful in the game engine for manipulating the environment and other tasks such as information querying. Essentially, Huebner boils it down to the idea that the COG language functions were used to "control the game environment", while the language syntax provided were used for "branching and looping control" (i.e. if-else statements, while loops, for loops, return keyword, etc.)

Some sample COG library functions include:

  • StartAnim - starts an animation for a sprite, surface or material

  • CreateThing - creates a new "thing" in the game world, which is essentially an object.

  • GetCurSector - obtains a reference to the current sector (i.e. area/region) that a "thing" is in

  • SectorThrust - sets a thrust force for a given sector to create an apparent feeling of physics.

  • AISetTarget - sets the target of the AI. In other words, set the target of the AI as the object the AI is attacking.

The game engine for Jedi Knight: Dark Forces II was event-driven, meaning that the engine frequently checks for certain types of events to occur, such as user input, collision detection, or other "messages" passed along by other programs. Some sample COG event messages that could be passed along are:

  • Touched - an event called when an object touches another surface or object. Both objects that collided can be referenced.

  • Entered - an event called when an object, such as the player, enters a different sector, which is basically another region or room that has been defined.

  • Damaged - an event called when player took damage from bullets or explosives, where the references to the source of the damage and the type of damage can be found.

  • Arrived - an event called when the player arrives at a certain destination

  • Killed - an event called when either the player or the enemy are about to be removed from the game due to his/her death

Through these event-driven COG scripts, the game can be manipulated in whatever manner necessary to the event OR the game can choose to ignore the event entirely! This is very powerful! According to Huebner, there are additional messages that are also sent to the COG scripts directly, rather than the objects to which that script is linked. Such messages include level startup messages and even player respawn messages!

What is even more interesting is that COG scripts execute as "separate virtual machines, each with its own variables, stack, and execution pointer", as Huebner states. This means that these COG scripts are protected from each other. So if one COG script is broken, then it only affects itself and the objects to which that script is linked and nothing else! 

Again, here was just a brief introduction to the COG language written for Jedi Knight: Dark Forces II. The rest of the article gets very technical on compilers and parsing, and describes some other 'stack' data structure operations. I don't want to explain too much to the point where it gets confusing, so I will leave that as an exercise for you!

Hope that all seemed interesting! All rights belong to LucasArts.

Here are the links to this two-page article by Robert Huebner, and I've also attached a video to Jedi Knight: Dark Forces II gameplay!

https://www.gamasutra.com/view/feature/131641/adding_languages_to_game_engines.php

https://www.gamasutra.com/view/feature/131641/adding_languages_to_game_engines.php?page=2

Creating a Programming Language for your Game Engine

Something I've recently been considering is writing my own programming language for my own video game engine in the future. Now, I know creating a programming language is hard. And some people will probably say "why in the heck would you ever want to create your own programming language?", especially when many others exist. However, it is actually fairly common for many game companies to create their own game engine and their own programming language, especially companies that make Massively Multiplayer Online Role Playing Games (MMO for short). For example, the MMO Runescape has its own scripting language called RuneScript, which was written specifically for AI interaction among your character and non-player characters (NPCs) and for quest logic (such as having the required items before the next quest task).

When discussing programming languages, it is important to know the difference between a scripting language vs. a compiled language. A scripting language is one that is usually interpreted. Interpreted languages aren't translated from a programming language to a target program. An interpreted language takes the source code directly and any user input and runs it through an interpreter, which reads the code statement-by-statement and processes the input. If there are no errors, the interpreter produces corresponding output from the code and input provided. Scripting languages are also used for "gluing together" functionality of an already created piece of software. A compiled language is one that takes the source code of a program and runs it through a compiler, which is the "translator" of the following code into a target program as output. Usually the target program is an executable machine-language program, but the target program could be practically any language you specify. Another one of the compiler's jobs is to detect any errors and report them while translating. Compilers are typically considered to be way faster than interpreters because machine-language programs are faster at mapping inputs to outputs. However, interpreters are better for debugging purposes and error diagnostics since they run statement-by-statement.

This is just a brief introduction to the idea of compilers and isn't extremely specific in any way! If you are interested in this subject, pick up the Dragon Book, which is "Compilers: Principles, Techniques, and Tools" by Alfred v. Aho. I have yet to read the entire book, but I have read through chapter one.

As I was digging around about two months back for information on how to create my own programming language, I found this link to gamasutra.com, which has a TON of really interesting video gaming articles! The link below was written on October 3rd, 1997 by Robert Huebner, a programmer who worked on creating a compiled programming language called COG for the game Jedi Knight: Dark Forces II. Many of these articles are from the 1990's and early 2000's, and they're usually multiple pages filled with video game knowledge, old or new! I've learned a lot of really cool computer programming techniques from this website, and I highly recommend reading them if you're an avid gamer!

To prevent this post from getting super long, I will save information about the COG language in the article for tomorrow

Anyway, enough of my blabble! Here is the link!

https://www.gamasutra.com/view/feature/131641/adding_languages_to_game_engines.php

 

Jedi Knight: Dark Forces II gameplay screenshot.All rights belong to LucasArts.

Jedi Knight: Dark Forces II gameplay screenshot.

All rights belong to LucasArts.

Vehicular Physics in Video Games

Hello everyone, 

For all you physics lovers out there in the world, today is all about Vehicle Physics in video games. I have been super busy today, so I'm going to make a very quick post about it! Now, I'm not going write up too much on the technical or mathematical nature of physics in video games. I'm mostly going to talk very briefly about the conceptual part and I'll post a thesis on a lot of simple (and complex) mathematical equations to consider when driving a car in the gaming world! However, that does NOT mean that I won't ever post about physics/mathematical equations on this blog. I definitely will post more on these topics later on as I learn them and as I take mathematical notes with the LaTeX document preparation system. 

Vehicle Physics is always an interesting topic to consider in lots of games, such as city-based games like Grand Theft Auto and Racing games like Need for Speed. However, you'll notice that a lot of major AAA games that AREN'T Racing related don't tend to implement too realistic of a vehicular physics-based system! Why? I think that the main reason a lot of major game companies aren't is because developers are focusing on creating other content that is way more important to the core game, such as the story, the environment, the weapons, or even just the overall gameplay experience. Nevertheless, vehicular physics can make games a whole lot more fun and intriguing! For example, suppose you've driving a huge truck with cargo in it and you're driving it along the road at a very high velocity. When you slam on the brakes, the cargo in the truck will probably move a bit towards the front of the truck and the truck should take a longer time to slow down to a complete stop than a small car. If video games neglect something as minor as this, it will make the physics system in the game seem wonky and unrealistic. That's why I like to think of Vehicular physics as a component of detail, and people tend to notice minor details like that!  

Here is a VERY interesting master project/thesis done by some unnamed author (at least I couldn't find it anywhere) about car physics. It discusses all sorts of physics equations related to drag, traction, engine torque, weight transfer, suspension, and even some collision detection and response and much much more! It also describes some of the physics pseudo-code,  which are human-readable notes on how the physics program should work.

 

https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc12/Srisuchat/Thesis.pdf

 

Here is also a cool Mad Max the game video on its car mechanics!

Motion Capture and Animation Sequences in Games

Every time I watch those videos of people in the Motion Capture suits (whether they're ready to film a scene for a movie or fight someone for a video game or whatever), I always am amazed at the direction technology is headed in!

For those who don't know, Motion Capture is defined as the process of recording the movements or actions of human actors for use in animating digital characters. Motion Capture is widely used in the fields of entertainment (video games, movies, animations), sports, health, and even research! 

The reason game developers sometimes use Motion Capture is because some animation sequences are extremely difficult to create; motion capture helps with complex character skeletal movement. Without Motion Capture, think about all the bones on the skeleton that the animators would have to move and time accordingly, depending on the type of animation used. It can be very overwhelming, especially since game development is challenging enough with the amount of programming, artwork, asset creation, music, and even testing! Lots of animators in video games use an animation process called "Keyframing",  which is the process of filling in the movement of a character animation over time. Essentially, Keyframing is almost like taking a picture at one point in the animation, and then another picture at a later point in the animation, and automatically filling in the animation transition between these two animation poses in time.  

Motion Capture involves a lot of acting. Physical actors have to put on suits that either optical or non-optical. Optical suits have tracking cameras that may or may not have markers on the suit, whereas Non-Optical suits have inertial or mechanical sensors (meaning detecting changes in motion). Optical systems with markers track the position markers on the actor's body (those ping-pong balls attached to the suits) and use the data that was tracked to try and approximate the actor's actual movements digitally on a virtual character. Markerless optical systems use algorithms to find certain types of features on the actor's body, such as his/her nose, mouth, or clothing. Once this data is captured, it is then mapped onto the virtual character's skeleton using software. Usually developers will use "Virtual Cinematography" on set, which allows them to see the animation footage previewed on their computer monitors before assuming it is good to use in the game; otherwise, you wouldn't know if the animation data transferred to the computer correctly until you replayed the footage hours later! 

Since Motion Capture typically requires having a studio, motion capture suits, props, and software,  it is very expensive to use. However, some companies have their own Motion Capture area, or they rent a place. Pricing has come way down within the last few years though, and you can buy markerless motion capture devices for around $300!

Here is the link of the article I used for reference:

https://www.engadget.com/2014/07/14/motion-capture-explainer/

Also, Here is a great video of the Motion Capture footage from Friday The 13th: The Game

Choosing a 3D Game Modeling Software

Quick post!

I often used to find myself wondering what the "best" kind of 3D modeling software would be for video games. 

Autodesk 3ds Max seems best for architecture and modeling realistic game environments, while Autodesk Maya seems best for character animations and visual game effects! Autodesk products also currently are the industry standard for major AAA game companies, because they have been around since the early 1990's. However, Blender tends to be more suited for beginners of 3D modeling and for indie game developers, since there are literally tons of tutorials for it. Not to mention it is constantly being updated, and it can even be used for movie editing, animation, physics simulations, and practically a little bit of everything!

There are positives and negatives to each software you use, and the video I just provided below talks about these ups-and-downs. I found it very informative, and then you can decide which software would be of practical use to you!

I personally have been using Blender because it is free, open-source, and pretty intuitive for beginners! Autodesk products are super expensive, (unless you are a student in which case it is free for personal use) but they are also super powerful. I found this video when I was thinking about the subject of 3D modeling software and the benefits of each one.  Blender Version 2.8 comes out in the Fall and it is going to be massive for 3D game developers! I also posted a video about Blender V2.8. 

Hope this seems interesting! 

An Introduction to Artificial Intelligence in Video Games

I first became interested in the subject of AI back in March of 2017, when I was on spring break in my senior year of high school. I was reading a book on beginning C++ programming, and I remember the author began discussing how to program a Tic-Tac-Toe game with an Artificially Intelligent opponent. As I observed the C++ code and typed the source code onto my computer, the more I realized how the games I play use artificial intelligence.

For example, one of the most interesting games that uses AI is Animal Crossing for the GameCube. For people who haven't played that game, essentially you are a kid that moves into a new town and you buy a house, and the whole goal of the game is to interact and socialize with other animals, pay off your debt, and purchase new daily items at Tom Nook's shop! Not to mention, that game even mimics the current weather outside in real life in the video game (i.e. if it is raining in real life, it is either rainy or cloudy in the game). One day in the game represents one day in real life; it matches your calendar on your GameCube. But the AI still fascinates me, because every animal in that game has its own personality and almost every time you talk to that same animal, they say something different. There must be hundreds of sayings! The animals even know the time you last talked to them (i.e. the number of days in real life that have gone by). The animals make a lot of decisions for themselves too, like fishing or running around, or even testing you with questions! It is really a brilliant, yet simple game. All you have to do is talk to animals and upgrade your house by finding money or selling items. 

Anyway, as I mentioned before, Ben Sawyer in his book The Ultimate Game Developer's Sourcebook discusses Artificial Intelligence, and I wanted to highlight some key concepts related to AI that I've learned. I don't want to describe anything super technical here because it would probably be extremely confusing to people who haven't seen algorithms before. I am also still learning some of these algorithms myself!

Nevertheless, here are a few important ideas he discusses about AI, but in my own words:

*Note: an 'agent' usually refers to any interactive object or entity, such as an AI, within a game.

  • An Artificially Intelligent agent in a game represents a non-player controlled object that appears to make decisions similar to that of a person in real life using a decision-making algorithm. This algorithm processes information provided by the program, where the rules of what kinds of decisions to make (and possibly when to make them) have been formulated by the game designer or programmer himself.

 

  • An Artificially Intelligent agent makes decisions depending on certain factors or conditions, not randomly. For example, these decisions may revolve around the external environment, such as the numbers of threats near the AI's base, or the time of day and a human's hunger level. For example, if the player has an army surrounding the AI's base, then the AI may decide to send all its troops to that location to protect its base after taking 1/2 damage. Or If it is around noon to 2 P.M. sometime, usually a human is hungry for lunch. Thus an artificially intelligent agent at this time in the game may say "Man, I need to eat lunch."

 

  • The hardest part of Artificial Intelligence in video games is the fact that few decisions are "cut and dry", meaning that most decisions either aren't simple to make or sometimes overlap. For example, in real life, you may schedule to hang out with a friend and go to the movies, but you also have to consider "how do I get to the movie theater? Do I drive or is my friend picking me up? Will I need money for food? What time do I leave? Do I need to reserve seats online?", etc. This is why AI depends a lot on Game Theory, and requires a set of actions (or decisions) to be made with certain rules defined in an algorithm. The more factors your algorithm considers, the more realistic your characters may react. This is especially important in games like the Sims or even in sports games like Madden

 

  • As long as the AI appears intelligent to the player without seeming TOO smart, then the game will seem realistic and thus more entertaining. If your AI appears to be too powerful or "cheating" in the eyes of the player (say, by seeing everything you have and knowing your strategy) , then the AI will actually seem literally "artificial." Just like humans, Artificially Intelligent agents must appear to make mistakes at times! This makes them vulnerable and more realistic! Otherwise, the game becomes frustrating and unfulfilling.

Hope that was all interesting! See you guys tomorrow!

AI.png

The 3 Core Conditions of "Fun" Gameplay

Back in my Freshman year of high school, I read almost all of this one gigantic, 800-page book from 1996 called The Ultimate Game Developer's Sourcebook by Ben Sawyer. Even though people consider it "outdated", it certainly has some incredible game development considerations, and I highly recommend it. With gaming, nothing is ever outdated. I'm still amazed at concepts/papers that people wrote down and shared in the 1970's and 1980's! 

As I was rereading Sawyer's book a few months back, I started thinking about "what makes gameplay fun or exciting to the players of the game?" and other things like "what is considered a 'good' game to the eyes of a player?", especially because this is very subjective.

I brainstormed on the key aspects of gameplay before reading Sawyer's section on it, and after I read his section, I came up with 3 core features that I thought must exist to make gameplay supposedly feel "amazing":

1.) Interactivity -  This is the most important feature. This is the capability of the player to perform many actions in the world and manipulate the environment around him/her. Examples of interaction can include talking to artificially intelligent agents in the game, picking up items for your inventory, firing a weapon or projectile, punching someone, driving a vehicle, turning lights on/off, sitting down, eating/drinking, climbing or jumping, throwing objects, trading items/bargaining, and a VAST amount of other possibilities. Basically anything that the player can physically "do" in the game world is defined as interactivity. Without a lot of interactivity in a game, the less the player can "do", which usually makes the gaming experience get old or repetitive quickly. 

2.) Immersion - The subjective feeling of the player to the point where he/she connects to the environment he/she is surrounded in. In other words, this is that feeling (whether conscious of it or not) where you feel as if you are a part of this artificial environment and connect with the world, its people, its story, and/or anything else that draws you in! This is that feeling of transcending from the physical world into this artificial game world, like when you can't put a book down because it is so intriguing. That may sound funny, but seriously... that happens! Having a highly interactive world assists immersion because the more the player can interact with, the more likely the player will bond with and feel a purpose to the world. However, this is not always the case. Immersion could be related to the level design or environment. For example, if you are playing a horror game that takes place in space, and you don't find the spaceship environment stimulating or interesting, then that takes away from immersion and ruins this experience; this may cause you to "not like" that game because the environment is "boring", even if there are a lot of items you can pick up.

3.) Creativity/Variability - This is really the feature about the "little" details in games. What stands out in this world that other games haven't considered? What makes this world unique and changing? Mad Max the game is a great example of these small details! Your car in that game has a certain amount of gas that needs to be filled regularly. It has realistic winch physics and tires that spin in the sand as you're dragging. You have to replenish Max's health with water fountains throughout the world, and the fighting is awesome! Very realistic in terms of survival. This is just one game, but all of those features are creative, different, and make the game that much more enjoyable. Without some creative power or varying mechanics among other games, the game can seem like a "copycat" or a bit bland, which would ruin immersion as well. 

Gameplay is very interesting, indeed. Stay tuned for more. I will definitely discuss more topics that are also in Ben Sawyer's book sometime soon.

Perhaps tomorrow... (wink, wink)

 

Ben Sawyer's book I mentioned. Don't be fooled by reviews on this book. It is definitely an interesting read, regardless of how old it may be.

Ben Sawyer's book I mentioned. Don't be fooled by reviews on this book. It is definitely an interesting read, regardless of how old it may be.

Ragdoll Physics in Video Games

I remember first becoming fascinated with physics when I went to Six Flags Great America back in 8th grade. I remember waiting in line for this one rotational cart ride with my one friend, and we began talking about how all these roller-coasters and rides supposedly "worked".  This one old man heard our conversation, turned around, looked us in the eye and screamed "You gotta use physics!" That was my starting point

Anyway, I am currently interested in getting some kind of degree in Physics at UW-Madison because I love to think of all the applications involved in video games and simulations! I am currently reading John Taylor's Classical Mechanics.

I discovered that many games rely on a Physics-based, computer animation technique called  Ragdoll Physics.

One important thing to mention before discussing more on physics is the idea of animation. More recent Game engines (from the late-1990's to present day) utilize a skeletal system for their characters, where the animators create, place, and link "bones" on their characters that can be posed and constrained. These bones are joined together in such a way that the animators can create animations by moving/rotating these bones individually while recording an animation. This mathematical process uses the kinematic equations to find the joint angles between interconnected segments (bones) and the pose/configuration among these bones; this is called "Inverse Kinematics." I haven't yet learned the mathematical formulations for inverse kinematics, although I will definitely touch up on this again in the future! It involves Jacobians!

Ragdoll Physics is a type of physics system that utilizes "Procedural Animations", which are real-time, generated animations of characters in a gaming world that are played when objects interact with their skeletal structure. For example, if the player gets hit by a ball, the player's character may animate (or respond) differently each time the ball is thrown at him/her. This is incredibly useful because it sometimes allows developers to eliminate tons of predefined animation sequences that are hard-coded into the game and that are often repeated again and again. Ragdoll physics offers more animation diversity!

Here is a Wikipedia article on Ragdoll physics if people are interested, or if you like Wikipedia. I love watching the videos/simulations that Wikipedia users provide, and this is definitely an interesting page. It links to other kinds of topics too.

https://en.wikipedia.org/wiki/Ragdoll_physics

Here is a short video on the history of Ragdoll Physics

 

Briefly on Ray Tracing and Real-Time Rendering

Ever since I wanted to create my own video game engine, I've always been keeping my eye on any sort of new gaming discoveries that have been made. I continually look at past articles on certain game engine techniques.

Lately, I've been studying some really complex mathematics behind Ray Tracing, which is a rendering technique that uses rays of light to determine object interactions and realistic reflections within the gaming world. It is STUNNING how realistic this rendering technique is! However, the only problem with Ray Tracing is that it requires a LOT of processor power to the point where it currently is not able to render in Real-Time on almost all computers. Movies are able to utilize this rendering technique because there are "rendering farms" that can render different scenes for hours and hours. However, video games update every fraction of a second, and thus cannot rely on mastering real-time rendering for all sorts of gaming computers anytime soon. 

Yet, I've read that Nvidia, a leading computing company that manufactures GPUs and specializes in graphics for gaming, has come out with a Ray Tracing library called RTX way back in March. Nvidia seems to be striving for real-time rendering in the distant future using this library! They also announced their largest GPU called the "Quadro GV100", which is supposedly $9,000!

There is so much to explain, and I will do my best to elaborate as I am learning this amazing topic! 

Here is a link to "How Nvidia’s RTX Real-Time Ray Tracing Works", which provides a really cool demo video for the upcoming game Metro: Exodus in 2019. I'll post the Metro video and a couple of video demos below too! 

 

How Nvidia's RTX Real-Time Ray Tracing Works

https://www.extremetech.com/extreme/266600-nvidias-rtx-promises-real-time-ray-tracing