root

Wizard Academy - Weekly Gamedev Study Group

Recommended Posts

wizardacademy1.png

Do you want to learn how to use Unity for making your own goofy game in time for the next Wizard Jam? Have you been meaning to teach yourself, but find that without the pressure of deadlines and the absence of peer approval you haven't been able to properly structure your own learning path? Consider: Wizard Academy.

wizardacademy_precis.png

Learn game development skills with the Idle Thumbs community! Every week we work through a Unity tutorial and post our work to this thread. Enjoy building your game develepment skills in a collegial environment with peers working toward the same goals you are, with a weekly deadline to help you keep moving forward.

Post your work as you go in this thread, and be sure to comment on the progress of your study-group peers.

You can also upload your assignments to the group's itch.io jam page, to keep them all together in the same place!

The week's assignment will be posted every Monday. We will discuss every weekend which tutorial to do for the next week's assignment.

wizardacademy_syllabus.png

WEEK 1, AUG 29 - SEP 3 2016: Roll A Ball tutorial

WEEK 2-3, SEP 5 - 17 2016: Space Shooter tutorial


WEEK 4, SEP 18 - 24 2016: Survival Shooter tutorial

 

WEEK 5, SEP 25 - OCT 1 2016: Tanks tutorial


wizardacademy_qa.png



  • Why are we doing Unity? What if I wanna learn the Unreal Engine, Gamemaker or some other toolset?

I won't tell you not to start similar threads to group up with folks who are interested in learning other software!

  • Can I start late? I have other life obligations that prevent me from participating this week. Or what if I finish late?

You can turn in your work late for half credit. If you want to add the class after the start of the semester, you will need a class add/drop card.

  • I already know lots of stuff about Unity, this is all remedial for me but I don't like not being included in things. Can I still participate?

That is totally cool because we need TA's anyway. Did you know that teaching people stuff reinforces and builds on the existing skills and knowledge you already have? It's true! By helping others learn you are helping yourself

  • Are we gonna do anything other than tutorials?

That's a good question! As we increase our facility with unity, we can try adding diversifiers to the tutorials to increase the challenge. There's nothing keeping you from undertaking your own projects during open lab hours, either.

Share this post


Link to post
Share on other sites

I've been using Unity for a couple of years, but I'd like to participate anyway. So do I just go through the Roll-A-Ball tutorial by next Sunday?

Share this post


Link to post
Share on other sites

Yeah, my short-term objective here is to have enough facility with Unity to participate in the Winter Wizard Jam on my own, rather than just through contributing art to other projects, and obviously my longer-term objective is to make my own games (or collaborate meaningfully with more skilled friends).

 

I don't really know exactly how long it would take to work through each of the tutorials, but I figure if a project is relatively short, doing it in a week is no big deal, and if one of the tutorial sets winds up being notably more involved then pushing it out another weak is also no big deal.

Share this post


Link to post
Share on other sites

Even though I have done the Roll A Ball and other tutorials, I want to at least follow along for the first bit and then probably join in full force at some point. I am sure I forgot something useful/fundamental from every tutorial I ever watched.

Share this post


Link to post
Share on other sites

Maybe this will be the time I realize I should use these "coroutines" everyone raves about.

Share this post


Link to post
Share on other sites

Maybe this will be the time I realize I should use these "coroutines" everyone raves about.

 

My first "game" had none. It was terrible.

Share this post


Link to post
Share on other sites

Edited the first post to hopefully make it a little more clear what we're up to here!

Share this post


Link to post
Share on other sites

Can I just send a check and get a certificate or diploma? I don't want to do work or think or anything like that.

Share this post


Link to post
Share on other sites

I finished and exported a build of the roll-a-ball game, which you can download here if you want to play it on windows. The only snag I encountered was in case sensitivity - my script for the player object called start() rather than Start() and so there was about twenty minutes of me being frustrated because I couldn't figure out why nothing was happening.

 

I noticed under each tutorial there's a list of related tutorials that go into more depth each of the concepts explored, I'm gonna try to dig into as many of them as I can before the week is out:

 

related_tutorials.png

Share this post


Link to post
Share on other sites

If you are on PC, the shortcut to rename the gameObject immediately after creation is 'F2', not 'enter'. Learning to use that just now is a small convenience, but I do it so frequently; I probably gained a few hours of life by looking that up.

Share this post


Link to post
Share on other sites

I finished the tutorial and added some additional scripting and art-assets. I couldn't stand not having sound and things escalated from there.

 

elderpanache.png

http://www.glorioustrainwrecks.com/node/10308

 

Here is what my PlayerController.cs ended up looking like

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class PlayerController : MonoBehaviour {

	public float speed;

	public float soundDecay=1f;

	private Rigidbody rb;

	private int count;
	public Text countText;
	public Text winText;

	AudioSource audioSource;
	public GameObject particleCelebration;

	public float spotlightTime=5f;
	float spotlightTimer;
	public GameObject _spotlight;

	bool endGame;
	float endGameTimer;
	float endGameLength=8f;

	void Start(){
		rb = GetComponent<Rigidbody> ();
		audioSource = this.GetComponent<AudioSource> ();
		count = 0;
		SetCountText ();
		winText.text = "";
		countText.gameObject.SetActive (false);
		particleCelebration.SetActive (false);
		rb.AddForce (Vector3.up * 200f);
		_spotlight.SetActive (false);
	}

	void FixedUpdate(){
		float moveHorizontal = Input.GetAxis ("Horizontal");
		float moveVertical = Input.GetAxis ("Vertical");

		Vector3 movement = new Vector3 (moveHorizontal, 0f, moveVertical);
		rb.AddForce (movement*speed);
	}

	void SetCountText(){
		countText.text = "You've pulled " + count.ToString ()+" tricks without injury!";
	}

	void OnTriggerEnter(Collider other){
		if (other.gameObject.CompareTag ("Pick Up")) {
			other.gameObject.SetActive (false);
			audioSource.pitch = 1f;
			audioSource.volume = 1f;
			audioSource.Play ();

			count = count + 1;
			SetCountText ();
			if (count > 8) {
				winText.text = "PROFESSIONAL!";
				winText.GetComponent<AudioSource> ().Play ();
				particleCelebration.SetActive (true);
				rb.AddForce (Vector3.up * 1000f);
				endGame = true;

			}
		}

	}

	void OnCollisionEnter(Collision other){
		if (other.gameObject.CompareTag ("Wall")) {
			audioSource.pitch = 0.2f;
			audioSource.volume = 1f;
			audioSource.Play ();
		}
	}

	void FadeOut(){
		float vol = Mathf.Lerp (audioSource.volume, 0f, soundDecay * Time.deltaTime);
		audioSource.volume = vol;
		if (audioSource.volume <= 0f) {
			audioSource.Stop ();

		}
	}

	void Update(){
		if (audioSource.isPlaying == true) {
			FadeOut ();
		}
		spotlightTimer = spotlightTimer + Time.deltaTime;
		if (spotlightTimer > spotlightTime) {
			_spotlight.SetActive (true);
			countText.gameObject.SetActive (true);
		}
		if (endGame == true) {
			endGameTimer = endGameTimer + Time.deltaTime;
			if (endGameTimer >= endGameLength) {
				Debug.Log ("over");
				Application.Quit ();
			}
		}
	}
}

Share this post


Link to post
Share on other sites

Awesome! I thought about going beyond the constraints of the project as described, but didn't. D:

Share this post


Link to post
Share on other sites

So this week we're doing space shooter! If you wanted to participate last week, the roll-a-ball tutorial was not especially challenging or time-consuming, you should have no trouble catching up.

Share this post


Link to post
Share on other sites

Well that was fun! A bit strange to have the player object keep count of score and win condition, but it makes sense to keep things simple to start with. I hadn't manipulated UI with code yet so I learned something in the process. :tup:

 

Also, I gave itch.io and Unity's WebGL compiler a try. This is super rad!

Hopefully it works for y'all: https://sindreskaare.itch.io/grenaderoller?secret=UyetEWfYn7kPuM3cOI6dxd5HnuA

 

And yeah I made the ball into a grenade because of course.  :P

Maybe I'll go back later and make an actual hill with the terrain system or something. 

Share this post


Link to post
Share on other sites

Oh that's rad! I'm gonna have to figure out how to operate that myself when I finish this week's project.

Share this post


Link to post
Share on other sites

It was super simple. Just build for HTML5, zip the files and upload the zip to itcho.io 

Make sure to select HTML as the type, not Unity. The latter is their old deprecated web player.

 

Also, it would be neat and handy if we made a Wizard Academy group/jam to upload to.  :)

Share this post


Link to post
Share on other sites

Also, it would be neat and handy if we made a Wizard Academy group/jam to upload to.  :)

 

 

Done!

 

I also tried the webgl build option to do a test submission, since I haven't uploaded anything to itchio before, and while my game seems to load just fine, for some reason it doesn't seem to be picking up keyboard input.  Which is weird, because it plays fine in Unity itself.

Share this post


Link to post
Share on other sites

So I've gotten all the way to the end of the Space Shooter tutorial and everything is copacetic EXCEPT: my enemy ships spawn randomly in the play area itself, rather than the top of the screen, and the Mover script doesn't move them downward through the play field the same way it does with the asteroids.  Considering both the GameController and Mover scripts drive the spawn location and the downward movements of both the asteroids and the enemy ships, I can't figure out what would cause this behavior.  Currently I'm digging through the unity forums to see if anyone else has had similar issues, and how they solved it.

Share this post


Link to post
Share on other sites

Regarding the spawn location, my guess is that the parent Transform of your enemy ships might not be reset to origin. I would have to see a screenshot of the Inspector view when the enemy ship is highlighted and look at your script to figure out the moving problem. If you want to post those, I'd enjoy looking at it. I haven't finished the tutorial yet, I just finished the laser-firing part.

Share this post


Link to post
Share on other sites

I'd be interested in extending this tutorial an additional week. It's significantly longer and more complex than Roll-A-Ball and I toggled the VR-enabled button and now I want to spend more time adapting Space Shooter for that platform.

Share this post


Link to post
Share on other sites

Regarding the spawn location, my guess is that the parent Transform of your enemy ships might not be reset to origin. I would have to see a screenshot of the Inspector view when the enemy ship is highlighted and look at your script to figure out the moving problem. If you want to post those, I'd enjoy looking at it. I haven't finished the tutorial yet, I just finished the laser-firing part.

 

The position transforms of the enemy ships model and the parent gameobject are both zeroed out.  When I disable the Evasive Maneuver script component and just have their movement behavior controlled by the Mover script component alone, they behave (and spawn) just like the asteroids.  When the Evasive Maneuver script is active, though, I get this:

 

spawn_issues.gif

 

And this is the script:

 

using UnityEngine;
using System.Collections;

public class EvasiveManeuver : MonoBehaviour {


		
	public float dodge;
	public float smoothing;
	public float tilt;

	public Vector2 startWait;
	public Vector2 maneuverTime;
	public Vector2 maneuverWait;

	public Boundary boundary;

	private float currentSpeed;
	private float targetManeuver;
	private Rigidbody rb;



	// Use this for initialization
	void Start () {

		rb = GetComponent<Rigidbody> ();
		currentSpeed = rb.velocity.z;
		StartCoroutine (Evade());
	}

	IEnumerator Evade()
	{
		yield return new WaitForSeconds (Random.Range (startWait.x, startWait.y));

		while (true) {
			targetManeuver = Random.Range (1, dodge) * -Mathf.Sign (transform.position.x);
			yield return new WaitForSeconds (Random.Range (maneuverTime.x, maneuverTime.y));
			targetManeuver = 0;
			yield return new WaitForSeconds(Random.Range (maneuverWait.x,maneuverWait.y));
		}
	}

	// Update is called once per frame
	void FixedUpdate () {

		float newManeuver = Mathf.MoveTowards (rb.velocity.x, targetManeuver, Time.deltaTime * smoothing);

		rb.velocity = new Vector3 (newManeuver, 0.0f, currentSpeed);
		rb.position = new Vector3 
		(
			Mathf.Clamp (rb.position.x, boundary.xMin, boundary.xMax),
			0.0f,
			Mathf.Clamp (rb.position.x, boundary.zMin, boundary.zMax)
		);

		rb.rotation = Quaternion.Euler (0.0f, 0.0f, rb.velocity.x * -tilt);
	
	}
}


 

Edit:

 

So I'm isolating portions of the code to try to drill down to where the issue is.  When I comment out the entire FixedUpdate function, the movement behavior is same as the asteroids.  When I comment out the rb.position statement specifically, the movement now appears to be correct:

 

	/*
        rb.position = new Vector3 
		(
			Mathf.Clamp (rb.position.x, boundary.xMin, boundary.xMax),
			0.0f,
			Mathf.Clamp (rb.position.x, boundary.zMin, boundary.zMax)
		);
        */

 

I don't see any discrepancies between the code I entered when following the tutorial and the example code given beneath it, so either there's something important I'm not catching, or the example code is incorrect.  But as it works without this statement, I'm calling mine done.  Maybe I'll come back to it later when I have a better understanding of what the code is meant to do here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now