Friday, June 16, 2017

Day 62: End of Year Post

Well, I made it. Sixty-nine posts total, including monthly posts, and the odd "side-post". I've probably learned more in this course that I will use, than I did in my chemistry class.

I've learned the basics of Unity such as camera controls, adding/manipulating objects, and using the child/parent system. Then I learned some more complicated stuff such as colliders, and using them in a script, as shown in my first (Roll-a-Ball) project. Later, I learned some more complicated scripting that included different variables such as strings and bool, and also included raycasting, and using raycasts to access variables in another game object. Finally, I took all that I learned (along with a dozen help pages and tutorials) and used it to start making a game (Audio-Only). One of the big things I learned from making it was how to use sound in Unity. I could probably compact it down by making it a function, but I decided to keep it expanded just so I know what's going on.

Now, next year there will probably be more people taking the independent course. So here's some advice for them, if they decide to learn Unity.

1) Start small.
Many people may be tempted to jump right in to a big project. DO NOT DO THIS. You will lose interest extremely fast. 90% of your time will be spent looking up tutorials and asking questions on the forums. Do the official Unity tutorials before you take on a project of any size.

2) Learn how the code works.
While doing the tutorials, don't just type it in without figuring out how it works. That's not the point of learning. If the tutorial doesn't explain it in enough detail, do some experimenting. Find out what works.

3) Use the Asset Store
Most of the assets cost money, but there are many free objects and tools that are decent quality. If it's a script, learn how it works.

Day 61: Audio-Only Game: Day 36

(Continuing from last class)

[Henrik] You're quite the figure here, friend.

[Player] It seems I am...

[Guest] It is him!

[Henrik] So, now that you're here, I can introduce you to some more-

(Rumbling sound. Guests stop talking)

[Henrik] (hesitant)...friends of mine...

[player] What was that?

[guide] I do not know sir.

(Sound of wall exploding, crumbling. Guests scream, run.)

[Henrik] (angry) What the devil is this?!

[player] What is happening?

[guide] Th...the dead are walking!

[Henrik] Necromancer! Guard. Get the guests to safety. I shall hold of the dead.

[player] as will I.

[Henrik] But you're blind!

[player] My hearing is as good as ever. Hand me a sword!

(Player can now equip and use a sword. Fighting ensues.)

(After the player has killed most of the enemies...)

[Henrik] You were not lying, friend! Though blind, you can still wield a blade!

[player] Would I lie to you?

[Henrik] Of course you wou-

(Sound of roof collapsing. Henrik and the guide yell. Then silence.)

[player] Henrik!

[Necromancer] How touching.

[player] You! You shall pay for what has taken place here!

[Necromancer] You are wrong. We shall rule eternal.

(Necromancer leaves and a few more of his minions attack. Once they're dead...)

[guard] Sir! We must leave. The manor is collapsing!

[player] My guide...and Henrik...

[guard] We can not save them. Come with me.

(The player follows the guard, who tells him to hurry up if the player hesitates too long.)



Tomorrow, I will do my last post, which will include advice for people planning to learn Unity in Info Tech.

Wednesday, June 14, 2017

Day 60: Audio-Only Game: Day 35

Now that I've gotten the basic outline for the game done, I can now do a much more detailed "script" for the game, sort of like a movie script. So, here we go...

The game starts with a black screen (the whole game will be like that), and silent. The sound of two horses gradually fades in. One horse can be heard to the left of the player, and one in the same spot as the player, to give the impression that the character is riding it. On the second horse is the person guiding the player.

[guide] Have you ever met Jarl Henrik before?

[player] Yes, I have. I met him during the war against the Southern kingdom. We were friends then.

[guide] Will he remember you?

[player] (sounding slightly offended) Of course he will. Would he have invited me otherwise?

[guide] Sorry, I did not mean to offend.

[player] (sighs) No offence taken. I spoke out of turn.

(a few seconds of silence)

[guide] Does Henrik know that you're...

[player] I don't believe so.

[guide] How will you tell him?

[player] He will see when he comes close enough. Knowing Henrik, he will probably be over-dramatic about it, but some things can not be helped.

[guide] I can see the manor up ahead. It's quite a nice looking thing.

[player] Henrik always was one for fancy decorations.

[guide] I'll say. I can scarcely imagine the amount of gold he-

[Henrik] Old friend, is that really you?! My, how the years have flown.

(the horses stop. sound of guide dismounting and Henrik walking towards them.)

[guide] Let me help you down, sir.

[Henrik] Who is this with you?

[player] My guide.

[Henrik] Why would you need a guide?

[player] (slightly sad voice) I'm blind, Henrik.

[Henrik] Dear lord...what happened?

[player] That is a story for another time, but I can say it was during the war, after we parted.

[Henrik] It pains me to see you like this. But no matter, now is not the time for bitter sadness. Tonight, we feast!

(Henrik leads the player and guide into his manor, where many conversations are taking place. Some people notice who Henrik is leading)

[guest 1] It's him...

[guest 2] No, it can't be.

[guest 3] Is he blind?

[guest 1] ...fought a dozen South-men, and won...


Next class I will continue the script.

Tuesday, June 13, 2017

Day 59: Audio-Only Game: Day 34

Continuing on from last class, the player will eventually find the necromancer in a random town (so it likely won't be the same for each playthrough). The player asks the necromancer for help, and he agrees, on the condition that the player find certain items that the necromancer would need, as well as gold to pay him. It will probably require three items. I don't know what they will be yet though. The player and the necromancer will then go search for the possessed necromancer. When they find him, the player will have to fend off his minions while the other necromancer starts the spell. After a bit, the player will be told to shoot the possessed necromancer with a crossbow bolt to help the spell work. Once that happens, the friendly necromancer can complete the spell, and destroy the spirits. I will probably have some sort of ending to the game after that.

In total, the game will probably have around 2-3 hours of gameplay, maximum. Maybe 4.

Friday, June 9, 2017

Day 58: Audio-Only Game: Day 33

The village 'elder' will tell the player a story about the necromancer. The necromancer tried to summon spirits, but messed up and was then possessed by them. The possessed necromancer, now with the ability and power to summon the dead, seeks to kill or enslave the living. The elder then tells the player that they can be stopped, but it would be hard. To stop them, the player needs to find another necromancer who can destroy the spirits possessing the other necromancer.

The player can then walk around in a relatively open-world map (guided by the different-sounding paths) going from town to town looking for a necromancer who is willing to help them. I might have around 10 towns or villages throughout the map. 

In one of the towns, I may also have a blacksmith that give the player a quest for a better (2-hit kill) sword. it won't be necessary to have the sword to complete the game, but it will make it easier. The blacksmith also won't be very easy to find.

Thursday, June 8, 2017

Day 57: Audio-Only Game: Day 32

 After escaping, the player finds themselves in a haunted forest, at night. I plan to have the player be guided by one voice, while others try to lead them astray. There may also be the odd wolf or bear that attacks the player.

The voice eventually leads the player to a small village, who's inhabitants are unaware of the attacks by the mage. After walking around and talking to people, the player may eventually come across the village "elder", who knows who the mage is, and where to go to find out how to defeat him.

Wednesday, June 7, 2017

Day 56: Audio-Only Game: Day 31

Continuing from last post, I plan to have the player get lost, and eventually come to a small castle or manor. The player's character will ask for directions, however, the lord of the manor/castle won't be nice. They will require the player to kill a small pack of wolves that has been hunting in their land.

The player will then go search for them, using sound to locate the wolves. After killing them (there will only be 3 or 4), the player will go back to the manor and tell the lord they killed the wolves. He will be surprised and angry, but will give the player directions to the capital.

Upon reaching the capital, the player will discover that the king has been killed, and his son put on the throne in his place. The player is framed for the assassination, and the new king immediately orders the player's execution, but right after, the necromancer attacks the capital, and the player is able to escape into the nearby forest.

Monday, June 5, 2017

Day 56: Audio-Only Game: Day 31

Making the variable would be easy. I just need to do the same thing as I did for the "Distance" variable. First of all, I made an integer variable named "Damage".

Next, I Added a line to each block of script that controls the weapon equipping. These lines set the amount of damage that will be dealt depending on the weapon.

Finally, I changed the Raycast function so that instead of subtracting 50 Health with each hit, it subtracts the "Damage" value instead.

Now that that's done, I can start planning the storyline of the game.

First off, the main player is blind. There should be some story behind how that happened. I plan to make the player a famous veteran of a war This is set in medieval times, probably somewhere between 1000 and 1400. I plan to make it an alternate universe, so it won't be historically accurate. As for why he's blind, it will probably be due to some accident either during or after the war.

The game will start with the player riding a horse, being guided by an aid, also on a horse. The veteran was invited by the leader (Jarl? Mayor? I don't know what the town leaders will be called) to a 'party' of sorts. Then, I will have a powerful enemy attack, maybe a sorcerer and some minor enemies. Something that can cause a lot of confusion. It will be up to the player to escape while killing any of the minor enemies in the way. I will probably add a blocking mechanic. The player will be one of the few survivors of the attack. The player's character will then offer to take news of the attack to the king. One of the surviving characters will say that he has no chance of making it that far. The player's character will ignore him, and leave anyways, using the sound of footsteps on the path to guide him.

Next class I will continue planning the storyline.

Friday, June 2, 2017

Day 55: Audio-Only Game: Day 30

So, I managed to figure out how to do what I needed without needing an answer on the forum.

My problem, was that I couldn't get the player controller script to access the "Health" variable in the Statistics script on the enemy that was hit. I tried a few different things yesterday, none of which worked. So, instead, I decided to follow a tutorial, and change it as needed.

first, I added a new private "storage" space.

Next, I added 2 lines to the Raycast function.

The second to last line adds the "Statistics" script of the enemy that was hit, to the 'statistics' storage space. The last line accesses the Health variable through the script stored in the storage space. It then sets the Health variable equal to the Health variable minus 50. So 50 health is removed each time.

Next class I will add a variable that changes the damage dealt depending on the weapon. The sword will probably do 35 damage, and the crossbow I'll have at 100 damage.

Thursday, June 1, 2017

Day 54: Audio-Only Game: Day 29

I tried to add couple lines of script that would allow me to access the Health variable in the script of the enemy that I hit, but it isn't really working. I've tried a few different things, but the problem is I don't know what to put after "hit.collider.gameobject._____".


So I asked a question on the forums.


Hopefully I'll get an answer by tomorrow. If so, I'll be able to continue it.