Page 3 of 5

に and へ particle Review

Today I reviewed two topics that I felt I was pretty fuzzy on and wanted to blog about for the sake of notekeeping.

The first is the: General Japanese Sentence Arrangement

Topic Frequency Time Goal Verb
私は よく 七時ごろ うちへ 帰ります。

(Page 93 of Genki 1: Second Edition Textbook)

The second is the use of へ particle and how it can be used where に has been used by myself as a default.

Review: に is used to refer to a goal of movement (location, time).
に is used for days, and time 時 but not for RELATIVE time like ごろ for example.

へ pronounced “e” (not “he”) is used to indicate the goal of movement similar to に.
However, へ can only replace に in use of ACTUAL goal of movement. So it CANNOT be used to indicate time like に can be used.

When in doubt, use に of course, but using へ can help improve fluency with the language.

(Pages 90-92 of Genki 1: Second Edition Textbook)

Game AI Final Assignment Report (Hirgana Hunter)

Game AI Final Assignment Report

“Hiragana Hunter” (demo prototype)

The game uses the following three game AI mechanics: A*, Path Smoothing, Agent Sensors. A* is used through a series of pre-defined nodes (the grass tiles actually), and performs a series of calculations based on A*, with the Manhattan Distance heuristic to calculate the shortest path to the target (the exit portal, the purple circle).

Once the A* final path is calculated, path smoothing is performed, albeit, in a somewhat lacking manner. The path smoothing will only perform smoothing on the final three tiles within a shift of movement from horizontal to vertical movement, and vice versa.

pathsmoothing_astar

Continue reading

Game AI Assignment 2 (A* Code Demo)

Game AI Assignment 2 (A* Code Demo)

Summary of Code

The software used for development was Unity 5.3.2f. It has scenes available to it, and can be thought of as “levels”. The code I wrote for the “first level” is a very simple “main menu” type scene. The scene displays a sprite image with text explaining controls to play the game. Pressing enter will enter the game, aka “level 2” aka the actual assignment. I thought that the best way to start would be to have a screen that explains the controls and features right off of the bat. The code for the main menu uses key down detection for the Enter key in order to progress to the other scene. Since this is a summary of the code, and not a comments of the code this will be very brief.

Continue reading

Apache and PHP for Raspberry Pi

(Source from: stewright.me)

Step 3 – Install Apache

Here’s where the fun begins. We’re going to start by installing Apache and some other packages. To do this its begin with entering:

sudo bash

This means we’re not having to type sudo each time we run a command. When you’ve done this, enter the following:

apt-get install apache2 apache2-doc apache2-utils

This shouldn’t take long. Once we’ve done that we’re going to install a few support packages including PHP. Once complete, enter the following command:

apt-get install libapache2-mod-php5 php5 php-pear php5-xcache

This too shouldn’t take too long. Follow up with installing the support package for database connectivity:

apt-get install php5-mysql

Now we’re going to install MySQL server. Do this by entering the following command:

apt-get install mysql-server mysql-client

As part of the installation, you’ll be asked to set a root password. Enter a password and then confirm it when prompted in the blue screen.

THEN!

sudo apt-get install libapache2-mod-php5
sudo nano /etc/apache2/apache2.conf

#At the end of the file add: (if it’s not there)

AddType application/x-httpd-php .php

Game AI: Foundations

My Game AI assignment 1: Foundations

The Engine

The game engine that I used was Unity3D 5.3.2. The game Engine provided an IDE (Integrated Development Environment)  with the ability to generate game objects, with labels, positions, rotations, sprite and/or script components without actually writing any code at all through the IDE’s GUI (Graphical User Interface). It also gave me the ability to use raycasting and to set up colliders using Unity’s built in functions, which also provided details such as distance of collision, the name of the object collided with, and so forth. Unity also provided some great tools to make vector manipulation easier, such as Vector addition, subtraction, normalization, and even dot product calculations rather than needing to perform the math step by step ourselves.Unity also does a great job of listening to key press events as well.

Continue reading

What is Ray Casting?

I found this wonderful explanation on Ray Casting attributed to the user kolban from this unity question page: RayCasting and AI

The idea behind RayCasting is to think of yourself inside the game. Unfortunately, you can’t see (you are blind) but you have a magic gun. You hold the gun in your hand and you fire it in a particular direction. Instantly the magic happens. The bullet that you fired from your gun is now returned to you and (because this is magic) the bullet talks. It says … hey .. you fired me in this direction and here is information about the thing I hit. The bullet tells you all about the Game Object that it struck, where it struck it and how far away the Game Object was. If the bullet missed striking an object, it will also tell you that.The bullet has more capabilities but this is the core of the story.

In computer graphics, there is a technique called “Ray Tracing” which is used to draw 3D rendered images. This works tracing paths from light sources that bounce off objects and may eventually reach a point which is the back of your eyes and hence be seen. Since our story here is not drawing complete 3D rendered images (using ray tracing), I believe the act of following a single “photon” of light (the bullet) is called ray casting.