Thursday, November 30, 2017

Final Feature, Revamping Old Ones

Hey all,

This week on Particularly Wavy I have been working on the final feature I intend to add to the game, in addition to revisiting some previously implemented ones and giving them a bit more depth and UI dazzle, if such a word can be used.

The final feature I'd like to add is the emission of light from heated objects. I have a script and shader that are working to update the appearance of an object which is hit by an intensified beam of light, and the next step is simply to add the actual emission of light from that object. This is more or less the easier part, since it follows almost the same rules as the lasers and objects which emit light due to collisions.

The features I'm revisiting are chargeable objects and movable objects. Chargeable objects originally were implemented to connect to other objects using a line renderer to display an arc between the two objects, but I never got this working to my satisfaction, so I've gone back and changed it to a particle system which travels between the two. I've also been adding more functionality to the objects connected to the chargeable objects. They can be of different types, like doors that swing open, lasers that get activated, etc. For movable objects, I'm trying to add tracks to show where and how they can move.

Saturday, November 25, 2017

Fog of War

hey all,

So I have been working on adding a fog of war effect to my game. Fog of War normally means an effect in strategy games where parts of the map without any player units are unlit and in order to reveal that area, the player will have to send a unit there. Doing so will light up that area of the map and reveal any enemy units that were hiding out there.

I wanted a similar effect, but instead of units, I wanted my beams of light to reveal parts of the level. It turns out that this was very wrong of me, as it took over two weeks and more than 63 hours of coding, banging my head against the monitor, research, more coding, more head-smashing, more research, etc.

At first, I thought I would just implement a simple fog of war effect using shaders and quads. This worked fine for single objects that did not extend to far in any one direction, but just didn't look very nice for light beams.

Then, I thought just using Unity's built in lights would be the next obvious step, but they did not produce the results I wanted, and had awful side effects like washing out the little color that I have in the game and making some elements look even more unattractive than before.

My penultimate step was to look at particle systems. This actually seemed like it might work, but I ran into bug after bug after bug, even after literally copying and pasting code from Unity's own website. So I gave up on that.

I was about to just quit and when I remembered a subject that I had researched in some detail months ago for my Digestion Game: metaballs! Now, before you get sick images of balls made of other balls, metaballs are simple a way to take overlapping sprites and combining their properties in various ways. They have been used for water rendering, influence mapping, and for lots of other stuff. I quickly found a few shaders that looked promising, tweaked their code, and set up some prefabs in Unity. The actual setup to produce the effect took less than an hour, but I spent a good 4 hours working out the best (to my mind and to my current abilities) solution for handling them together with my lights. It is still not fool proof, but I think I have got a pretty nice solution.




Wednesday, November 8, 2017

All Work and No Play...

hey all,

Yes, I'm still hard at work on Particularly Wavy. In the last week I have designed six new puzzles, many of which utilize the mechanics I've been describing in the last several blog posts. I hope to publish the game very soon, but I will continue to work on adding more puzzles over the next few weeks.

In addition to adding more content to the game, I've now implemented rudimentary scoring mechanics and, yes, have found and fixed even more bugs with my refraction calculations. Above a particular angle between the surface normal and the light vector (if you understand that phrase, then you already know what is coming next), the light will be reflected inside the prism instead of exiting it. This requires a different kind of calculation, and basically just re-complicated my refraction code that I had spent so many days simplifying. In any case, it seems to be working nicely, and without hogging too many system resources.

But don't get the idea that I am chained in front of my computer all day every day, slaving away at this game. I'm still enjoying playing video games that others have slaved over, such Total War: Warhammer, The Banner Saga, and Duskers. I'm pulling up to the 200 hour mark for Total War: Warhammer, and there are still two factions (Beastmen and Brettonia, plus another DLC I don't have yet for Norsca) that I haven't played, as well as two special campaign maps that I haven't done yet. And then there are still several games that I purchased months or years ago that I haven't gotten around to playing, like SpellForce 2, King of Dragon Pass, Democracy, and Crusader Kings II. And my wife and I are still planning trips to take in the near future, so we will be getting out and about and exploring this planet of ours.

Cheers,