Storm City (camera paths)

Quite some time ago, I did some experimenting with getting camera paths from Blender (see here). I ended up not being completely satisfied with that, because you needed to do a lot of smoothing to get good results, which made the paths kind of mushy. So now I have a better technique. The paths are still made in Blender, but it reads the mesh data directly and makes bezier curves from that. (So essentially you make splines which get converted to meshes which get converted back to bezier curves…but it works!) It reads the normal data so you can get banking if you tilt the points in Blender. You can also now control the relative speed in the path by having points closer together or farther apart. Also, with another script you can optionally add extra rotation to each point (as if you’re moving a camera around while riding an airplane for example).

I was working on some other stuff recently, so I thought it would be kind of fun to make a little demo using some of those elements plus the camera path technique. So here we have “Storm City.” I guess it’s some kind of chase scene…make up your own story to go with it. :wink: If you get bored watching the demo (which loops infinitely), press return to bail out, and then you can walk around with the standard FPS controls (WSAD, space to jump, and also I implemented running with shift). Press return again to get teleported back to whatever craft you were in (not sure what it is…maybe an invisible ornithopter? :roll: ). Comments, criticism, etc. welcome. I already know there’s at least one point on the map where you can consistently get the rain to disappear behind the ground, but I have no idea how to fix that…darn alpha textures. Speaking of alpha textures, I couldn’t get the blob shadow projector to project onto the ground, either…any ideas about that?

I’ll post the camera path project folder itself in another topic.

EDIT: Yes, the “handheld” camera movement is intentional, but after watching this again, I think I overdid it. Pardon me while I go fetch a flight sickness bag. :wink: I’ll probably post a revision without quite so much “handheldness” and maybe some other stuff…

–Eric


40490–1498–$stormcityweb_786.zip (2.98 MB)
40490–1499–$stormcity_128.zip (10.6 MB)

Nice work Eric, I d/l the webby.

I feel like Im in a second chopper. Can I have an M60 so’s I can shoot th one in front? :stuck_out_tongue: That and some tense music…dudes on the roof shooting back…watching rogdolls get blown off would be …interesting…

I like:
The use of reflections- if you post the project I guess I’ll see if they’re indie or pro…
The puddle ripples-Are they a version of your “unity ripple thingy”?
The Chopper model !! (this might work well with Joachims Vehcle Examples Scripts)!!
The framerate-Smooth as here mate! Good work!

Noticed a single frame physcadelic flicker at the loop point, no biggie @ all

I’m interested to see how you handle your control system swapping too, a bunch of us here have come up with various methods, some I follow… So seeing your bail out script would rock, frankly.

Good one Eric another wicked presentation.
AaronC

wow nice!

for a camera path demo you sure added a bunch of polish - the reflective puddles / foot splashes are cool and i love the lightning effects. i moved outside the city to see if i could catch any bolts - i didn’t see any but its great how the clouds light up in localized areas (i spotted the plane too). now to check out the path project.

very cool ; )

The project is 80MB so I’m not posting it. :wink: (90% of that is excessively large Photoshop files though.) The reflections are just flipped objects…cheesy but reasonably effective.

Nope, just a single 2048 x 128 texture, animated by using the offset. This gets 16 frames, and to disguise the fact that the same ripples are animating over and over, after each cycle, I set the offset to something random and repeat the animation at that point. This is even more horribly cheesy than the “reflections”, but it pretty much works in this case.

Thanks, that was my first attempt at modeling/texturing an aircraft. The texturing was done relatively quickly and though it exists in a higher resolution than used here, needs work. I’m using it in another project so I’ll be hopefully improving it, but I figured you don’t really get a close look in this case.

Cool…I’m sure it helps that the only thing that uses pixel lights is the chopper (and a spotlight with a cookie on the clouds for the “lightning”, but that’s intermittent). What mostly drags it down is the 9K polygon model for the city (twice), and to some extent, the 1,500 rain drops. :wink: (Though I cheated again and used a texture with two “drops” for each particle, which doubles the density at no cost without being too obvious, I think.) I typically lose around 20fps by having the rain collide with the city model, so I didn’t bother since it didn’t seem that noticeable most of the time.

That’s odd, I don’t get that here. I’ll definitely look into it though. If you look at this page where I got the camera path idea from, you can see the arrows do that at the loop point, so it must be related.

It’s really basic…

function Update () {
	if (Input.GetButtonDown("Bailout")) {
		if (vehicleActive) {
			vehicleActive = false;
			vehicle.GetComponent(Camera).enabled = false;
			player.active = true;
			playerCam.active = true;

			player.transform.position = vehicle.transform.position;
			player.GetComponent(MouseLook).rotationX = vehicle.transform.eulerAngles.y;
		}
		else {
			vehicleActive = true;
			vehicle.GetComponent(Camera).enabled = true;
			player.active = false;
			playerCam.active = false;
		}
	}
}

That’s placed on an empty, with the appropriate variables declared and assignments made in the inspector of course. The “vehicle” is the camera, which is why that’s different for the player (where they are separate objects). There’s more stuff that’s enabled/disabled, but it’s just more of the same, no additional functionality, so that gives you the idea I hope.

Nope…was going to, but I already spent enough time on this. :wink: On the other hand, I do want them for another project, so maybe I’ll do a revision. Unfortunately the locational sound is messed up so the thunder and chopper sounds frequently come from the wrong speakers, which I think is a bug (already reported). This makes it harder to tell that you can, in fact, tell how far away the thunder is by counting the seconds between the flash and the sound. :wink:

–Eric

yeah that’s an issue for my project as well.

nice - i like little details like that in a game. 95% of players don’t notice them but for the 5% who do its a cool discovery ; )

Wicked, good stuff Eric!
Im glad you posted that code, I get it up to that euler angles bit which is something I will find in the docs no doubt. Its just really good to see examples regardless, so less skilled programmers can affirm they’re on the right track…

Im curious, did you mean you duplicated the geometry and rendered it in a different camera or is it using an alpha channel on your ground plane and one camera?

AaronC

That is one polished demo! Thanks for sharing :slight_smile:

The reflections are great for Indies. Exactly how did you do them (more specifically, test when to flip what ever is above it, and to render it what portion… If that makes any sense.)? :lol:

cheesy?? thats genius, i was going through wondering if it was unity pro or indie and i was sure it was pro, the reflections look absolutely perfect, and the offset for the rain drops is again, a stroke of genius

good stuff

but may i suggest being able to walk a little faster, and the rooftop textures kind stick out, may be changing the tint color on them to a little darker would make them seem more gloomy and dark like the rest of it, and the buildings would look a little better if they had a rim around the edges at the top

but any who very very nice, it looks amazing

and how did you do the lightning flash??

Most of this stuff I did for another project or I will be using in another project soon, so it seemed justifiable to spend time on things like that. I think only the city itself is unique to the demo, though putting everything together into a semi-coherent form was more involved that I was planning on.

That just means “get the rotation on the Y axis from the vehicle and tell the script on the FPS Walker to use that for the MouseX rotation.” (MouseX actually controls the Y axis rotation, using the X axis of the mouse…confusing, eh?) So theoretically you have the same rotation as the vehicle when you leave it. But I never really understood the relationship between euler angles and quaternions–sometimes you get wacky results with euler angles–so I’m not sure if that works 100% of the time. Someone tell me a better way, please. :slight_smile:

I didn’t do any of that stuff, just mirrored the city model in Blender on the Z axis. :wink: The ground has two materials, one with an alpha shader with no blending, just cutoff, for the puddles (I raycast against this to find out when to do the puddle splashing sounds), and the water ripples are standard alpha/vertexlit. So it’s just one camera. The helicopter is bilaterally symmetrical, so I made a copy of it and put this script on the copy:

var objectToMirror : Transform;

function Update () {
	transform.eulerAngles = Vector3(0, objectToMirror.eulerAngles.y, 0);
	var relativeForward = transform.forward;
	transform.rotation = objectToMirror.rotation;
	transform.position = objectToMirror.position;
	transform.RotateAround(Vector3(transform.position.x, 0, transform.position.z), relativeForward, 180);
}

Again with the eulerAngle thing…is there a better way of doing that? Seems to work though. And of course the script on the mirrored rotor blades makes them rotate in the opposite direction. Oh yeah, and the lights don’t affect it or else it would look quite wrong (since the “underside” would be lit). So nothing interesting at all, just a couple of flipped objects, but sometimes “simple” works… For a much more interesting reflection technique (involving two cameras), look here.

Hey, you can already run by pressing shift. :wink:

Yeah, I think you’re right about the rooftops; looks like there’s a bit of emissive color on them which shouldn’t be there. And they could definitely use a rim around the top edges…the buildings could look better in a lot of ways, but at least the rims would be easy to do.

The sky is a plane, so I have a spotlight (with a sort of blob-shaped cookie) projecting upwards at a given spot. Then I fade the light out, though sometimes I have it flicker once or twice first, for a bit more randomness and realism.

–Eric

Very nice! I like the atmophere in this one a lot. Nice gfx effexts and the sound design is the best for me in this one. Fit’s well together, congrats!

Wow. Colour me impressed. I kept running it over and over and over last night. Nice work.

that’s really good eric - nice job! so… november in copenhagen? cough

Thanks! I did spend a fair amount of time scrounging for sound effects (if only I had a budget above the single digits… :wink: ) and tweaking them in Audacity and Unity. Thanks to Physics.Linecast for example, the buildings largely block the chopper sound if there are any between you and the chopper. Finding a decent rain sound effect helped, and since it’s largely white noise anyway, it was easy to remove extraneous elements without any audible jumps.

–Eric

Sadly Audacity is an awful piece of crap. I wonder why there is no cheap alternative like good old CoolEdit on windows for osx.

It’s certainly not great, but for the price ($0) it works well enough. :wink: Someday I’ll get a better audio editor…any suggestions?

–Eric

The old version of Audacity had horrible interface problems. The new one (is it still beta?) is a bit more ironed out. I still don’t like the interface much, but it does exactly what it’s supposed to for free. So, I use it.

I did come across Amadeus Pro (thanks to MacZot!) and it looks pretty good. It was $25 via MacZot, but it’s normally $40. You can download and try it out.

Well done! I love the reflection in the puddles and the rain particles. Now if that rail-system could be integrated in Unity somehow…

Oh, I stopped to help hijack the thread and forgot to say,

Fantastic job Eric! :slight_smile: All demonstrations should be this fun to look at.

Seriously, when prospective users come looking at Unity, serious ones will check out the docs and demos and they’ll be grasping at any and every example of runtimes (especially of reasonable download size.) Making them nice and non-clunky speaks volumes about the tool and the community. So… good on ya.

The sound is very nice indeed. Good idea with the raycast.

But the splashing feet? How did you detect that you were over water? Did you use Texture2D to test an alpha value?

Very good polish overall :smile:

I did hit.textureCoord for a raycast and checked the alpha value of the texture at that point, yep. (Multiplied by the tiling size of course.) Might be kind of nice to be able to at least read from compressed textures even if you can’t write to them, since that made the ground texture rather large… I suppose I should just translate the player’s world coordinates to texture coordinates and check against a much smaller texture, since you don’t really need pinpoint accuracy for something like this. That would only work reliably for flat planes, but that’s what the ground is in this case anyway.

I appreciate the comments…at first I was going to do just a quickie demo of the technique since I mentioned it in another topic, but it was more fun this way. :wink:

–Eric