In the over a year since the last blog post I've done very little development on From The Sun and a few months ago decided to stop work on it all together. As I built on the initial concept of playing as a particle of light that changes color and energy levels by absorbing other light or running into obstacles I realized that I didn't have a full plan for what the final game would look like. As an experiment and learning experience I consider it a success, but I don't see a larger appeal with it in its current encarnation so I'm taking what I've learned and am moving on to a new project. More about that to come.
Taking on a solo project and exploring more of the aspects besides programming was really good for me. I gained a renewed appreciation for all that goes into a game. Chiefly among the aspects of game development that I had underestimated are design and production. I did no real design work going into development for this game. It started out as a little experiment with no player interaction where colored balls spawned on a screen, redder colors on top falling down and bluer colors on the bottom floating up. When balls collided the bluer one would become one step bluer and the redder ball would be destroyed. I then iterated on that design a few times until I reached the mechanics in the current build. That was my design process.
Once I was fairly happy with the game mechanics I started building out actual levels and a structure for the game. In that process is where I learned the value of planning the production beforehand in order to be able to plan a timeline for the game. I didn't have a timeline at any point in the development process. My documentation consisted of a trello board that I threw tasks in to as I thought of them and some pages in a notebook with ideas for what levels should be like. As a result of that a lot of little things in this game are completey flat and bland: menus, interface, sound effects, etc. I'd realize that one of those aspects needs attention, spend a little time on it, and then get distracted by the next thing that needed attention.
Two things that I ended up being pretty proud of making as part of this project are the level editor tool for building waves of debris and a crystal 3d model that I don't actually remember if made it into the game.
The level editor tool makes use of lessons from CatLikeCoding's Splines tutorial to spawn debris along smooth curves in addition to manually placing prefabs. In the screenshot below two such curves are visible. Not shown are the widgets that appear when they are selected for editing. This is a view of the first few waves in the Venus level (if you want to see it in action you'll have to give the game a play.) Also visible in this screen shot is how a wave with a bezier curve only allows for one curve so the parrallel curves are actually two waves with very close together timing.
The crystal model is for a type of debris that wasn't as useful as I had hoped. I wanted to have them fill the role of providing a reason players to try and be a specific color rather than going for the highest power level, but in play test it was confusing whether you could pass through them if you matched their color or if they turned you to their color. I had thought the former made sense but many players expected the latter.
Ultimately the usefulness of the crystals hinged on a ditched mechanic where redder colors would still fall from the top and decrease the player's power level. The design iteration process led me to get rid of any reason to change to redder colors and the design took on a model where the player could take more hits and deal more damage by being high powered and there was no reason to go lower. This is the change in design that made the most sense and also removed much of the original inspiration.
The final version of From The Sun is playable here on itch.io. It includes Mercury, Venus, and Earth as levels, they end up getting pretty difficult.
That's right, you can finally destroy Earth!
The new level introduces a new type of hazard, complements of Earth's inhabitents: satellites. The solar panels they have absorb your shots instead of being damaged by then, some satellites use the generated electricity to fire back at you, so watch out!
This build also has all levels unlocked so you can try all of them even if you get stuck on one. It also features an animated sprite for the player. It's a little rough right now but it's a start.
Showed From The Sun to some other CAs at GDC and got made what are hopefully some good incremental changes.
- Scaled down most obstacles
- Limiting the variance in photon spawning so there's less visual noise
- Replaced the particle effect on the player with a trail renderer
- Skinned the planet meshes to look more like a planet and less like a bunch of rocks stuck together
- Updated menu assets, fixed a scaling issue
- Added more music tracks and made minor adjustments to existing ones
Added a second level to From The Sun, which of course is to Venus. It has its own music, and the music for Mercury is improved from last time. Both levels are available on the main menu, although eventually they'll be locked until beaten in order.
Check out the web build here.
It felt good to move on from a single level test bed of a game to creating more content with a base setup that I'm happy with. It was also great to have a sudden inspiration for a theme to follow while I created the waves of debris for the level, before it had felt more like filling space than coming up with a design.
I want to get an Earth level in the game by this weekend too, but I don't want to force that and make a level that's just filling space. If something comes to me I'll get it going otherwise I'll spend that time improving other aspects of the game, like the transition between levels.
There are two UI elements that I've built in Unity for From The Sun by creating a 2d mesh and mapping portions of this 8 pixel image to it.-> <- It's 1x8 and I'm just using it for color definitions. You can see the two UI elements in the picture below. They're the big rainbow gauge on the right side and the smaller rainbow gauge inside it. The big indicates the player's current color and the colors that are upgrades or downgrades from the current. The smaller one shows a history of the players colors as they make progress towards the current planet.
The big UI element is basically just a stretched out version of the raw image. I create a mesh of vertices that define those bars, with wider space for the player's color. The uvs just correspond to the image distributed evenly among the vertices, working out to one pixel providing the source for the two triangles that make up each bar. The triangles are just built directly from the vertices. The biggest effort for building this element was animating between the focused color, which was still just maintaining the current point of the boundary and animating it with time, stopping when the new color is full sized.
The smaller element took a little more building up of data to represent what is being shown. Instead of a current value to track that just represents an index the progress bar tracks the history of how much time the player spends as each color, in order and as distinct sessions. It was easy enough to set up a Progress class that has the color and duration, then keep a list of those, adding a new Progress item when the player's color changes and tracking time on that one. Then using the width and height of the rect that the progress bar will fill as boundaries I can start building a mesh from the bottom, adding new vertices from the bottom up for each progress item. This is where I went from copying code for creating meshes from vertices, uvs, and triangles and understanding it enough to read it and adjust it, as I did with the larger spectrum indicator to rewriting it completely to fit my needs. I iterate over the progress items, creating 4 vertices for each, uvs to sample the right color of the 8 pixel image, and triangles for those 4 specific vertices. This ends up with more vertices than actual on screen point locations, each boundary is 4 points for a line instead of 2, but as far as I can tell that's what I need to do to get the right uvs for each rectangle. I also make sure to only create triangles for the rectangles I want to display, not the infinitely small spaces between them. Once I reviewed the mesh generation code I already had and looked at how I was tracking the progress data this approach really fell into place and I feel like I have a better grasp of how a mesh and a texture map to eachother. The pointy bit and borders on the smaller gauge are done with a shader, the dot is just a copy of the renderer for the player that I move with the progress.
Check it out live in my latest build. Maybe turn your volume down because my 'music' is a little rough.