I'm not sure I'll ever stop being surprised by how things that appear to be really simple and have not so simple intricacies within.
I made a game for the LowRezJam where you are restricted to only ever displaying 64 x 64 pixels. I settled on making a game where those pixels are for a sensor on a space telescope and the player acts as the onboard computer, searching for exoplanets. There's no doubt that I was geeking out on my space game. I made an intro scene which goes through the basic stages of a rocket launch. I have the first stage simply fall into the ocean, but during this jam, SpaceX landed their first stage on a barge in the ocean. Figures, my rocket was immediately outdated.
The first pass of my game was that the player would need to stabilise the spacecraft before it could start analysing the stars that it could see. It would then find exoplanets based on how far away the stars were. It was my first time using Unity's Lens Flare. They don't look amazing usually, but with the pixelated script I had running on the camera, they looked surprisingly stylised. They could have their fade speed adjusted which worked nicely for an "exposure" effect, where the stars further away would take longer to appear.
I created it so that there were different types of stares, dwarfs, ordinary (like our sun), giants, pulsars and black holes. Each had a different probability of having a planet orbiting it. Each star also had a different likelihood to spawn. And then there are 3 different types of planets that can spawn, rock, ice and gas; and each of those have different properties (size and distance from star). The orbits of the planets are randomised so that the normal to their plane of rotation was random, as you'd expect. This create the real problem of the fact that some stars have planets orbiting them but they don't eclipse their sun so are harder to spot. I was happy with all of this, but feedback I got was rightly that there was almost nothing for the player to do. They could just move the camera to a new spot and then leave it to find planets itself. Not much gameplay. While I was happy for it to not be very filled with gameplay - just something to geek out with - I did want the players to try to hunt for the eclipses.
Initially too, there was no visible indication of the found planets. So I created a simple target image that I'd use in Unity's UI to show up when a planet was found by the automatic analyser. A simple task that was absolutely not as simple as I had expected. Unity's UI doesn't simply move around using it's position... it has a confusing maze of transforms. Great for using the GUI in the editor to set up UI. Not so great when you want to do things in code. I tried lots of attributes that didn't behave as expected. The most obvious one was the "position" but... wow... no. Maybe local position? Negative. Perhaps the offset min/max? Nope. Eventually I got it: anchor min/max. Setting both of those to the same position essentially allowed me to move them where I wanted in viewport space. Later in development, I also came across an issue with scaling. The game has a screen at the start that lets you change the scale of the screen (either 64x64, 128x128, 512x512 and even 32x32). I'd been testing in the largest scale because that's naturally the easiest to work with. However when I tried the smaller screen, the targets were still the same size - and so relatively huge! While in playmode, I tried changing a setting and viola, it was the correct size relative to the screen! So I exited playmode and made the same change. Then I started the game again and... nothing, the targets were being scaled too small to be seen. I reverted to the original setting and pressed play. Huge again. Once more while in play I changed the setting and they scaled exactly as I wanted them to... So my fix? I keep the setting that makes them too big in smaller screen sizes, and then in script I change the setting. And that works. Fuck if I know how or why.
So now I could have the target pop up when a planet was found. Unfortunately, I thought the stars looked really good, and very quickly loads of targets filled the screen, and looked shit. My quick fix was to add a button to toggle whether the UI showed the found planets.
There was still the issue however of lack of playability. I decided that instead of just showing the player all the planets, it could throw in some fake ones and the player must determine which were real. This helped slightly but there were still issues. For example, a player might see a star very obviously get blocked, but will have to wait until the computer highlights it before they can claim it. Additionally the randomisation of the planets made it really difficult to find lots of planets. I needed a further overhaul.
Eventually I made it so that there was no automation. In retrospect, this is an obvious thing to do, but I guess I was just wanting to make a cool gadget instead of a game. But as I went along I definitely wanted more input from the player. So instead, the player highlights a star by putting the mouse pointer over it and they can then select it if they think that there is a exoplanet there. Find 10 and they win, mess up 5 times and they lose (so that they don't just go on a clicking spree). I also overhauled the planets. To my upset, I removed all the orbiting crap. I originally tried to increase the likelihood of an eclipse by increasing the sizes of the planets and slowing them down and putting them closer to their stars and... it was just getting absurd. So instead, they now move backwards and forwards along a straight line that points towards the camera. This way I could guarantee eclipses while still controlling their length (by adjusting the midpoint of their movement). This worked perfectly and made it much more playable, as now I could be sure players would be able to hunt for the planets without the risk of too many being out of view.
I did however have a weird bug where a target would appear over apparently nothing. Sometimes a star is really far away and so it's light takes a while, but sometimes nothing would ever appear. There are black holes in the game but they're incredibly rare and I aligned my scene view camera with the game camera and there was nothing there (I have Gizmos to help show me stars and planets).
What the fuck was my camera locking onto? And then I realised. I turned the scene camera around 180° and sure enough, there was a planet that lined up from the target through the camera. The way I do my targets is to make an array of them (enough for every star) and then make them transparent. They then are locked to their equivalent star and move was the camera rotates. They then appear when the mouse hovers over them. As I should have expected, things behind me when converted into view space will fall back on screen. I fixed this by simply disabling the target so that it's hit-box wasn't being picked up if the star's behind the camera. I later refined this to only enable if the star comes into view.
After tracking down a few bugs, I was able to finish up the game. It's not a huge game - it's a game jam game - but I'm really pleased with how it's turned out. And while I was originally a little sad to drop authenticity for playability, I can see it was the right move.
I made a game for the LowRezJam where you are restricted to only ever displaying 64 x 64 pixels. I settled on making a game where those pixels are for a sensor on a space telescope and the player acts as the onboard computer, searching for exoplanets. There's no doubt that I was geeking out on my space game. I made an intro scene which goes through the basic stages of a rocket launch. I have the first stage simply fall into the ocean, but during this jam, SpaceX landed their first stage on a barge in the ocean. Figures, my rocket was immediately outdated.
The first pass of my game was that the player would need to stabilise the spacecraft before it could start analysing the stars that it could see. It would then find exoplanets based on how far away the stars were. It was my first time using Unity's Lens Flare. They don't look amazing usually, but with the pixelated script I had running on the camera, they looked surprisingly stylised. They could have their fade speed adjusted which worked nicely for an "exposure" effect, where the stars further away would take longer to appear.
I created it so that there were different types of stares, dwarfs, ordinary (like our sun), giants, pulsars and black holes. Each had a different probability of having a planet orbiting it. Each star also had a different likelihood to spawn. And then there are 3 different types of planets that can spawn, rock, ice and gas; and each of those have different properties (size and distance from star). The orbits of the planets are randomised so that the normal to their plane of rotation was random, as you'd expect. This create the real problem of the fact that some stars have planets orbiting them but they don't eclipse their sun so are harder to spot. I was happy with all of this, but feedback I got was rightly that there was almost nothing for the player to do. They could just move the camera to a new spot and then leave it to find planets itself. Not much gameplay. While I was happy for it to not be very filled with gameplay - just something to geek out with - I did want the players to try to hunt for the eclipses.
Initially too, there was no visible indication of the found planets. So I created a simple target image that I'd use in Unity's UI to show up when a planet was found by the automatic analyser. A simple task that was absolutely not as simple as I had expected. Unity's UI doesn't simply move around using it's position... it has a confusing maze of transforms. Great for using the GUI in the editor to set up UI. Not so great when you want to do things in code. I tried lots of attributes that didn't behave as expected. The most obvious one was the "position" but... wow... no. Maybe local position? Negative. Perhaps the offset min/max? Nope. Eventually I got it: anchor min/max. Setting both of those to the same position essentially allowed me to move them where I wanted in viewport space. Later in development, I also came across an issue with scaling. The game has a screen at the start that lets you change the scale of the screen (either 64x64, 128x128, 512x512 and even 32x32). I'd been testing in the largest scale because that's naturally the easiest to work with. However when I tried the smaller screen, the targets were still the same size - and so relatively huge! While in playmode, I tried changing a setting and viola, it was the correct size relative to the screen! So I exited playmode and made the same change. Then I started the game again and... nothing, the targets were being scaled too small to be seen. I reverted to the original setting and pressed play. Huge again. Once more while in play I changed the setting and they scaled exactly as I wanted them to... So my fix? I keep the setting that makes them too big in smaller screen sizes, and then in script I change the setting. And that works. Fuck if I know how or why.
So now I could have the target pop up when a planet was found. Unfortunately, I thought the stars looked really good, and very quickly loads of targets filled the screen, and looked shit. My quick fix was to add a button to toggle whether the UI showed the found planets.
There was still the issue however of lack of playability. I decided that instead of just showing the player all the planets, it could throw in some fake ones and the player must determine which were real. This helped slightly but there were still issues. For example, a player might see a star very obviously get blocked, but will have to wait until the computer highlights it before they can claim it. Additionally the randomisation of the planets made it really difficult to find lots of planets. I needed a further overhaul.
Eventually I made it so that there was no automation. In retrospect, this is an obvious thing to do, but I guess I was just wanting to make a cool gadget instead of a game. But as I went along I definitely wanted more input from the player. So instead, the player highlights a star by putting the mouse pointer over it and they can then select it if they think that there is a exoplanet there. Find 10 and they win, mess up 5 times and they lose (so that they don't just go on a clicking spree). I also overhauled the planets. To my upset, I removed all the orbiting crap. I originally tried to increase the likelihood of an eclipse by increasing the sizes of the planets and slowing them down and putting them closer to their stars and... it was just getting absurd. So instead, they now move backwards and forwards along a straight line that points towards the camera. This way I could guarantee eclipses while still controlling their length (by adjusting the midpoint of their movement). This worked perfectly and made it much more playable, as now I could be sure players would be able to hunt for the planets without the risk of too many being out of view.
I did however have a weird bug where a target would appear over apparently nothing. Sometimes a star is really far away and so it's light takes a while, but sometimes nothing would ever appear. There are black holes in the game but they're incredibly rare and I aligned my scene view camera with the game camera and there was nothing there (I have Gizmos to help show me stars and planets).
What the fuck was my camera locking onto? And then I realised. I turned the scene camera around 180° and sure enough, there was a planet that lined up from the target through the camera. The way I do my targets is to make an array of them (enough for every star) and then make them transparent. They then are locked to their equivalent star and move was the camera rotates. They then appear when the mouse hovers over them. As I should have expected, things behind me when converted into view space will fall back on screen. I fixed this by simply disabling the target so that it's hit-box wasn't being picked up if the star's behind the camera. I later refined this to only enable if the star comes into view.
After tracking down a few bugs, I was able to finish up the game. It's not a huge game - it's a game jam game - but I'm really pleased with how it's turned out. And while I was originally a little sad to drop authenticity for playability, I can see it was the right move.