"Who are you?"
Hi, I'm GriffinVarro on various platforms. I've been coding for over a decade but haven't managed to produce a full game in that time. I want to use this game jam to push myself to make a complete product, and pick up some more skills along the way. Unity is a fun and easy engine to use and will be my focus, and ideally by the end here I'll have practiced some basic art a bit more and learned how to make sounds and songs for any future projects.
Game Thesis: Blow up the Death Star, again
After some thinking on Day 1 I decided on a few things. With the theme of "Cycles" I want to hit two marks; the first is the meta-narrative with the work-in-progress title above. The player will be a space pilot infiltrating a large space station with a giant laser with the intent to blow it up. For the very light narrative, this circumstance happens again and again; the player will have to defeat several to end the game, but probably not end the narrative cycle. The second mark I want to hit is Cycles as a game mechanic in some way. Obstacles operate on some sort of rhythm, and the player should have some ability to control it. Perhaps the player could slow down the cycles of the machine to get through dangerous obstacles, or speed it up to get to a desirable point.
For the actual gameplay, I figured I'd attempt a space-physics drive top-down shooter. My first attempt at making a space-physics style game similar to this was with the LOVE scripting engine back around 2010-2012, so it's been on my mind before. Unity is very handy when it comes to very rapidly making a game if you want to make it physics-driven entirely, so the choice is easy. Players then should be able to move, stop, shoot, and use their ability. The game will also need obstacles like smashing zones or turrets firing at the player for the player to destroy.
If and when we get to level creation, I think this idea would work best with 3 possible levels; a simple introduction to the idea and challenges, and two more increasing in difficulty. In an ideal world maybe these could be procedurally generated forever but I don't think that's within scope for a gamejam, at least not my first one.
Actual Coding
With some free time Sunday and the basic ideas in mind from Saturday, we've made some progress! Our first goal was to get a our player moving about which took just a moment; WASD to apply force in any direction with gravity set to 0 worked perfectly for the feel of preserving momentum in space. I quickly made up a prototype ship to slot in since I'd need to know what direction it was facing; actually getting it to face the right direction proved a bit of a challenge but helpful gamejam folks pointed me a bit more in the right direction. With the ship turning and moving properly it already felt like a space game, but the strafing + mouselook combined feels a bit awkward and results in some very quick and unpredictable spinouts as the ship ends up tracing a very very wide circle. That's something to put a pin in to tweak later.
I decided to set up a turret next; I quickly drew a drone-looking spirte and could copy over the code from the mouselook function to have it face the player at all times. Firing a laserbeam is pretty straightforward, but positioning was trickier than the previous rotational trouble I was having. I needed to spawn the laserbeam object at a short distance from the turret, in the same direction as it was facing. I started with a hunt for trigonometric solutions but couldn't quite get anything to work until I discovered the Ray object had a function to get a position X units down its length at will. As long as I could point the ray in the same direction as the turret, I could spawn the object anywhere infront of it that I wanted. The important lesson I learned here today is that if a function calls for a normalized vector, it doesn't need a normalized vector at all; target - ourPosition inserted will get the correct result for a direction Vector3.
To finish things off, I made sure the newly spawned laserbeams would die after a few seconds, and die on impact as well; the first prevents garbage piling up, the second lets me insert future functions for damaging the player or producing other effects. The laserbeam uses a AddForce function to push itself through space at the player and I think around 30 units of force seems about right to start being a threat; the default 5 I set is almost comically slow.