I’ve uploaded a new build (v0.3) for Urban Parking Simulator, which squashes two tiny bugs:
- When you successfully enter a valid parking spot (hence winning), and your current momentum makes you crash into a car, you no longer confusingly lose and win at the same time
- Timer no longer ticks down after you’ve lost for some other reason
These silly win condition problems took only a few minutes to fix, but it made me think (yet again) about how spaghetti-like my code was, even “for a prototype.” Earlier this week, I spent a few days thumbing through some “intermediate” Unity features/concepts, such as ScriptableObjects. I also brushed up on delegates and events. I’ll be playing around with these in some simple hello-world kind of experiments in the next few days.
Urban Parking Simulator’s second prototype is out! You can download it now and play with a friend.
You can read more about it on the project page, but I wanted to take some time to jot down a few notes.
Apart from being able to vent my frustrations about finding parking…
- Unity’s built-in image effects (from Standard Assets) are actually super cool and easy to use. You just drag and drop, and the different parameters are all very easily manipulated through scripts. It was a lot of fun designing the camera drone view.
- My “procedurally generated” parked cars came out all right. Basically, the level itself has no parked cars initially. Each block has a script that, at runtime, spawns parked car prefab instances along each of its four sides. Then, another script shuffles all 1000+ of them, and pseudo-randomly picks a handful to be turned into green spots or red spots. If a green spot is too close to the starting point, it will turn red.
- The drone losing signal when it strays too far from the car works surprisingly well in practice. This encourages players to really cooperate and simply use the drone to peek one block over or so.
- The time and distance bonus conveniently sets up a money system, meaning players can upgrade their drone/car for better performance and increased bonuses.
- I hacked together the car “physics” to allow for much better handling (less ice skating)
Upon revisiting this project someday, my to-do list would probably look like this (starting with the highest priority):
- Add some rudimentary sort of traffic (other cars that cruise by, pedestrians crossing, stoplights)
- Implement two actual lanes on two-way streets
- Randomize the spawn point (“home”) and orientation
- Allow (or require?) actual parking in the spot
- Build out money/upgrade system, which in turn unfolds a riveting story about a promising startup (“Uber, but for parking”)
- Procedurally generate everything, from crosswalk markings to stop signs to one-way signs to varied building dimensions to…
In the meantime, enjoy! Let’s see what we can work on next.
The v2 of the parking game prototype is underway! This version will feature:
- street layout based on my actual hometown
- some rudimentary traffic from other cars
- lose condition for incorrectly turning into a one-way street
- lose condition for hitting other cars or street signs
- a time limit
There’s a long list of things to hate about New York City, and the impossibility of finding parking has always been one of them. A dedicated parking spot (i.e., a neighbor’s driveway) typically costs in the $100-200/month range, which isn’t worth it for me, as I drive only once a week or so.
I’ve come home late at night a few times this year, only to drive around in circles for up to half an hour before I find street parking. It’s really bad. Terry and I began thinking of possible solutions.
Maybe I could try constructing Larry David’s car periscope?
Then I thought about those cheap camera drones that go on sale a lot. What if the passenger could send a drone to nearby blocks and look for open parking spots? I realized this presented a sort of cooperative two-player game between the driver and passenger. We could call it “UPS” — Urban Parking Simulator.
The driver’s job:
- Follow normal traffic rules (don’t hold up traffic, obey one-way streets, don’t hit anyone or anything, don’t run red lights)
- Decide when to turn or circle back, and when to keep going straight (farther from “home”)
- Visually confirm that a parking spot is actually valid (there aren’t any no-parking signs, fire hydrants, or driveways)
The passenger’s job:
- Pilot the drone in an efficient manner (don’t waste time sending it the wrong way, as it isn’t very fast)
- Identify potential parking spots (empty spots along the curb, pending visual confirmation from the driver upon closer inspection)
- Determine the order in which to check all the open-looking spots (hey, sounds familiar!)
- Effectively communicate directions to these spots (cardinal directions, or relative?)
Best of all, there’s a natural time pressure (no one likes circling around aimlessly). Scoring could also take into account how far you went from home. Later down the road, we could add car and drone upgrades! Including hats to put on the drone!
We were pretty excited to try prototyping this, so I jumped into Unity the next day. On February 26 (about three weeks ago), I whipped up a sloppy proof of concept and sent it to some friends, but didn’t have time to blog about it. These wonderful volunteers gave me excellent feedback on it, and I’ll be working on the second iteration this week. Here’s a gfycat featuring a few seconds of gameplay: