Monday, February 4, 2013

Logic and Sets in video games.

     I wrote this for an assignment and decided I would post this on my blog. I might start doing it more frequently. It was a discussion post where I need to write about the following;


  • Choose a particular computer program (a mobline app works as well) or game which math plays an important role and provide an analysis. Give a description of which type of mathematics is used, and why it is important component of the software or game. 
  • Identify and explain the use of either Logic or Sets applied in your area of interest (games or mobile apps). Some examples are provided below if you are unable to think of any examples. (Make sure you review this week's lesson before attemting this part of the discussion) 



     In The Legend of Zelda: Link to the Past if you die but have caught a fairy in a bottle and had it on you at the time of death, then the fairy will resurrect you. So it is likely the logic works something like this; If your health equals zero and you have a fairy in a bottle then you stay alive but heal up, or else you die.




     A way I might write that in a scripting language is { if (health < 1 & fairy > 0) then health += 50; (if health < 1 & fairy <1) then end game; }. In Finite Math the logic would look something like this; ¬h ^ f meaning if health is not true and fairy is true. To test if both are false I think this could work ¬(h ^ f).

     As for sets it is likely that Equipment is a set of which Weapons is a subset and Swords is a subset of 
Weapons. So if I wanted to make a database and then look for all Weapons that are NOT swords, such as 
bows and boomerangs then in Finite Math it would look like this; 1x = W - S meaning list every step of x 
where x is the W set minus anything in the S set. I’m not quite sure if in this context Equipment would count 
as a universal set. I think everything from Equipment to Monsters would be different sets in the Universal 
game set.

     The reason these are important aspects of the game is because without this logic programmed into the game simply wouldn't function. I think every interactive game there is requires variables and if statements. It is possible to program a game without database logic or sets but really that is bad programming and limits the functionality of the game. Also people will naturally sort things into sets in their head so any tools that help you play the game will organize things into sets. People use this logic just as much as machines do but on a more intuitive level.

     Many games also use databases or sets to allow the addition of new items or enemies and such into the game. This helps the programming team as well as modders. For example a weapon might use an array defining it’s graphic, power, cost, size ect. as well as be contained within a Class or Type called Weapon which really is just a set.

     A note on grammar, I intentional capitalized any word I was speaking of as a set such as Equipment. Although a piece of equipment is not a title I treated the word Equipment as a title of a set if I capitalized it. It was not a typo.

1 comment:

  1. Really impressed! Everything is very, very clear, open is a description of the problem. It contains celebrity dresses, tattoo shops, climbing shoes the information.

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...