Skylight - 1st-person platform jumping and randomly generated music

Official Release Trailer

This post has been updated to reflect the final version.

I started making a Doodle Jump clone as a simple game to help me learn Unity, and somehow it turned into this.


Skylight is a first-person platform jumping journey with randomly generated levels and music. At first I had the player climbing straight upward, but a cylinder of platforms is too annoying, because you have to be looking around all the time while trying not to fall down. I think that the path-like arrangement it has now works a lot better.

It’s written (in Unity) using C#. This is my first real Unity game and it’s been a good experience; the platform seems really solid.

Version 1.0 changelog from 0.92:
NEW AND CHANGED

  • Added flocks of birds
  • Added a locked bonus mode (unlocks on getting to 100%)
  • Added a “lamp platform” which is basically just a normal platform with a light on it, to look cool and help out a little near the end
  • Other minor adjustments to level generation (both performance and layout related)
  • Improved performance somewhat
  • No minor chords play when you’re past 75%. Other minor edits to music generation
  • Improved robot 3D model a little and added visible “thrusters” when moving
  • Added mute button on main screen and pause menu
  • Made the instructions screen sightly tidier
  • Spotlight now turns off again when light level gets high
  • Tweaked view bob when hitting a platform in 3rd person a little

BUG FIXES

  • Fixed platforms sometimes double-registering a collision, causing erroneous score and extra damage
  • Fixed the music engine sometimes playing the same sound multiple times at once
  • Fixed clearing high scores also resetting mouse invert setting
  • Fixed audio volume not adjusting correctly to compensate for many sounds at once, occasionally causing clipping
  • Fixed clouds not updating to face you when in 3rd-person mode (revealing the terrible secret that the clouds are actually groups of 2D planes)
  • Fixed unfocusing and refocusing the app while paused making the music start playing

1.0 Gameplay Trailer

Download

Its amazing amazingness , although i would like a sound track mode where i just listen to randomly generated song

Actually, someone else asked for that already - something where they could just listen to the music. So I made this hacky version which just plays some random music. It uses a huge amount of ram for a simple music player because it’s decompressing all the music samples on load, but hey it does the job.

I hadn’t really thought of seriously putting a “listen to music”-only mode into the real game. I actually didn’t think the music was good enough. :confused:

As you can see here, I am a master of modelling and animation: http://www.youtube.com/watch?v=jSN4z9EpAig

I love it. But you could add more to the level like moving platforms or more visual stuff because It gets a bit dull staring at the same things.

Yeah, I agree that improvements to the world are needed. Better scenery would be nice and help with a sense of movement and where you are. More variety in the level itself would make playing more interesting and make randomly-generating levels more worthwhile. At the moment the levels being random isn’t so interesting because they’re all much the same.

However, I don’t have infinite time to devote either, so I’ll see what I can do.

… I really like the autoplay stand alone… May have to use it as a go to bed tool with headaches. :slight_smile:

Updated the download in the OP to version 0.90.

This is one of those updates where not much has visibly changed in the game, and maybe the marketing department comes and talks to you, and they ask what you’ve been doing for the past week.

That’s why you always have The List:

  • Added basic gamepad support in-game (no keyboard or gamepad support in menus yet)
    Slightly spruced up the high score screen
  • Fixed “already broken” platforms and other platforms sometimes overlapping each other
  • High scores now also store and show % complete
  • Added different animations for falling and winning, so now you can flail around in like three different ways
  • When near the end, notes and chord changes will sometimes trigger on their own
  • Landing on the ROOF of your house at the end now ends the game, instead of you having to slide around to get down
  • Continue platforms temporarily lock the chord to C, so their own notes harmonise with the music
  • Added wind noise when falling fast
  • Continue point restarts are now based on the position of the continue platform, not the position of the player. Previously, if you hit the platform right in the corner or something you’d restart above that point
  • When reverting to a continue point, the camera is now angled down a bit so the player realises they’re right above a platform
  • Tried to add a particle effect when hitting platforms but scaling particle systems (for the different platform sizes) is currently not possible in Unity :(. Coming next release apparently
  • Hopefully eliminated the audio clipping in loud passages near the end of the game, but reducing overall colume when many sounds are playing
  • Background music fades out when you win or lose the game, and winning also locks chord to C
  • Increased continue point frequency slightly as I still have a lot of trouble finishing the game

There’s a very rare bug where a null reference occurs and the game will miscalculate where you are, which can cause it to think you’re below the platforms and hence have lost the game. I think I’ve stopped the bug from causing the game to think you’ve lost when you haven’t, but now it could cause the game not to end when it should. I haven’t been able to track down what’s causing it yet, but as I said, it’s very rare.

Next version will have either added background scenery or additional content in the level itself (or both). The version after that might actually be the real release.

Truly amazing.

What I find most annoying about your game is the first person view. First person has a reputation for being terrible when it comes to platformers, and no offense, but this is no exception. The loose and poorly positioned (for games centred around jumping) can get pretty disorientating.

I recently added third-person as an option! Personally I don’t think it makes it any easier, but I put it in for people who complain about first-person :slight_smile:

Press C, and then you can also zoom in and out with the mouse wheel. A little more work is needed on the 3D model but the basics are there.

I feel like for third-person to really work in this game it kinda needs something like a big line extending straight down from the player so they get an exact idea of their position; but I don’t want to baby the player either. It’s like modern games making all the items you can pick up super-glowy. The player shadow does help a little in the same way.

Pretty clouds, testing.

As part of doing this I took ikke998’s particle cloud system and updated it to the new Shuriken system. If you’re interested in using it, I posted it in that thread.

I thought I’d share some code I wrote yesterday to create “clumps” of clouds inside an area. Hey, maybe someone can even correct my bad coding.

This could be used for any objects which you wanted to group generally together in clumps or flocks, while still maintaining random placement. I couldn’t find anything via Google that did what I wanted, but there could very well exist a better algorithm for doing this already. Surely someone’s wanted to make clumps of trees or animals or something in the past.

// startPos is the position of the first platform. endPos, the last platform
// Generate some clouds along the path
void MakeClouds(Vector3 startPos, Vector3 endPos) {
	int numClouds = Random.Range(minClouds, maxClouds + 1); // Int random range is max exclusive
	print("numClouds = " + numClouds);

	int clumpiness = Random.Range(1, 26); // Choose cloud climpiness in the range 1 to 25
	print("clumpiness = " + clumpiness);

	// Work out the box that the clouds will fit inside
	// This is a long cuboid with the path roughly in the centre
	//(randomness causes the path to deviate, but usually not too much)
	float midZ = (startPos.z + endPos.z) / 2f;
	// Clouds don't start until a certain distance
	float cloudsStartDelay = Random.Range(cloudsMinStartDelay, cloudsMaxStartDelay);
	Vector3 bottomLeft = new Vector3(startPos.x + cloudsStartDelay, startPos.y, midZ - (cloudsWidth / 2));
	float cloudsEndBefore = Random.Range(cloudsMinEndBefore, cloudsMaxEndBefore); // Clouds stop before the end
	Vector3 topRight = new Vector3(endPos.x - cloudsEndBefore, endPos.y, midZ + (cloudsWidth / 2));

	// Define cluster points. For cluster level 0, every cloud is its own cluster
	int numClusters = numClouds / clumpiness;
	// Bigger clumps are allowed to spread out more, because they have more clouds in them
	float maxDist = 25F + (1.5F * clumpiness);
	int cloudsPerCluster = Mathf.RoundToInt(numClouds / numClusters);

	// Make some clouds within the box
	Transform cloudContainer = GameObject.Find("CloudContainer").transform;
	int curCluster = 0;
	int prevCluster = -1;
	Vector3 curPos = new Vector3();
	int cloudCount = 0;
	for (int i = 0; i < numClouds; i++) {
		if (curCluster != prevCluster) {
			float XPos = Random.Range(bottomLeft.x, topRight.x); // Float random range is INclusive
			float ZPos = Random.Range(bottomLeft.z, topRight.z);

			// Because it slopes up based on XPos
			float percentThrough = (XPos - bottomLeft.x + cloudsStartDelay)	/ (topRight.x - bottomLeft.x + cloudsStartDelay + cloudsEndBefore);
			float curYPos = Mathf.Lerp(bottomLeft.y, topRight.y, percentThrough);
			float YPos = Random.Range(curYPos - (cloudsHeight / 2), curYPos + (cloudsHeight / 2)); 

			curPos = new Vector3(XPos, YPos, ZPos);
			curCluster = prevCluster;
		}

		Vector3 cloudPos = new Vector3(curPos.x + Random.Range(-maxDist, maxDist),
			curPos.y + Random.Range(-maxDist, maxDist),
			curPos.z + Random.Range(-maxDist, maxDist));

		GameObject newCloud = (GameObject)Instantiate(cloud, cloudPos, Quaternion.Euler(0, 0, 0));
		newCloud.transform.parent = cloudContainer.transform;

		// Randomise this cloud a bit
		ParticleSystem parti = newCloud.transform.particleSystem;
		parti.startSize = Random.Range(15, 30);

		cloudCount++;
		if (cloudCount > cloudsPerCluster) {
			cloudCount = 0;
			curCluster++;
		}
	}
}

EDIT: Oh God my formatting. Paste this into Notepad++ or something for your sanity.

Clumpiness is an extremely scientific term by the way.

You have something quite special here. I admit its mostly the music doing the work of evoking emotion and making the time fly by, but the simplicity of the game lends itself well to the direction you are taking it. Very nice and peaceful

I’ve put up version 0.91. This is likely to be the last free release so get it while you still can. Assuming no major issues, the next release will be the real 1.0 paid version (I’m still thinking $3US), although I still have a bit to do before then.

This release adds clouds. I’m still tweaking them a little but they’re basically there. I found a bug in the above source code so I’ve made a minor edit to the Y position calculation, in case anyone’s copied it already.

Awesome

How does

work?
It sounds so cool like it’s real music

Thanks! It works the same way as the game itself, except it just pretends you’re “hitting a platform” every now and then.

In terms of how the music system itself works, the short answer is, I have a lot of samples of single sounds on different notes, and I play notes which (although “random”) are chosen to make sure they harmonise with each other.

Long answer, I made a video about it which hopefully makes sense: http://www.youtube.com/watch?v=_idPIjOptjs

I’ve put up a small update to Skylight (0.92) because I felt there were two significant issues with the 0.91 release.

  1. Sometimes clouds would form across the path and significantly block the player’s view. This especially sucked later in the game where platforms are more sparse. This seemed unfair and, although the levels are “random”, I feel they’re always been “fair” in the past. The game never generates a jump you can’t make, for instance.
    This has been addressed by making the clouds fade out when the player is close by, so they can be seen through.

  2. The cloud system I was using - based on the particle system - was killing performance. Drawing the clouds could take something like 50% of the game’s processing time. So I’ve rewritten the whole cloud system to use billboarded meshes instead. On my low-end test machine, framerate has doubled.

New gameplay video: http://www.youtube.com/watch?v=X-Gcq2L9YFw

Great video, I would never show the character since it will kill the whole feeling of YOU being immersed in this world. I said before I love the game, the music is great and I want to see this pushed further. The clouds really look great. I honestly dont see anyone paying 3$ for it, seems a little out of the range for such a title, but you never know.

You might be right about the price, but I can always lower it. A lot of work has gone into this, but I’m also very aware that the average price for “casual” games is very low at the moment. And I’ve seen some terrible games for $10.

Re third-person view, I know what you mean. I totally agree, but for every person saying it needs to be first-person for the immersion, there’s someone saying they can’t play without third-person. So I made it an option, but it will always default to first-person and I intentionally made it not save that setting when you exit the game.