Moving and (unintentional) shaking

 

A part of me wants to address the nature of hiatuses and general spottiness in update schedules – the root causes, how can they be avoided or picked up from afterwards, even down to the fine balance between finding something worthwhile / enjoyable and how that changes over time.

But what’s more procrastinatory than writing at length about the nature of nothing!?

nothing

Nothing, unless you’re literally the author of this book, which I haven’t gotten around to reading despite owning it for years. It’s an endless cycle.
So instead I’ll talk about the key objectives and concerns with the movement mechanics that as shown in the video are just about fully implemented. Let’s start at the highest level and work on down~

 

Objective: Movement that reinforces the genre
Concern: It’s new and scary

Is this concern true? I haven’t seen it done anywhere else. When I say “it” I mean – the game involves the traversal of platforms at various heights and distances and angles, but unlike any other platformer you care to name there’s no all-purpose jump button or rigid grid system to guide your movement (or some sort of jet-pack / grapple hook / spring shoe get-out), just a general sense of up/down/across. You could guide the movement with an eye-tracker that presses up + left when looking in the top-left corner or the screen.

Am I reinventing the wheel? Am I trying to create a whole new locomotive device and is it closer to a hoverboard or a full-body high-tension jumpsuit that turns your body into a giant slinky?

slink

Obligatory full-body horse slinky

I think it’s fair to say that not everything has to be a twitch platformer, and the alternative doesn’t need to lead you by the hand every step. But I’ve seen a lot of puzzle-platformers that require an unreasonable degree of accurate player input such that the puzzles get pushed to the background (worst case, pixel-perfect jumps requiring you to re-do already solved puzzles).

At the very least it’s a unique selling point, though that should ideally be the icing on a cake of intuition, depth and satisfaction.

  • Intuition is sort of the raison d’être, so I’m happy with that once old habits are displaced.
  • Depth is offered by the range of available movements: it’s freedom in the sense of being able to do whatever occurs to you, though being restricted by the layout of the environment is necessary to provide objectives and challenge, so again I’m pleased with the shape it’s taken.
  • As for satisfaction – well so far I’ve only created situations that involve freely scampering to and fro without much reason, so this is one to keep in the forefront when puzzle design comes into vogue. But what I’ve played so far is very satisfying indeed, though that could just be the effort required to get here talking.

 

Objective: Make the tightly contextual movement feel fluid
Concern: There’s only so much you can do with a box

The player character is a box – 3 units high by 0.8 units wide. But the animations go all over the place. When you roll down a ledge the animation lags behind and ascends while the box itself descends.

roll

It’s wild but it functions fairly well. I made the mistake at first of trying to manipulate the box alongside the animation, but when you determine a foolproof way to rotate a 2D object around an erratically moving point offset from the pivot in Unity do let me know – the horrors I’ve seen applied to my poor character’s skeleton…

The way the movement works allows for a lot of low-effort seamless transitions between states. You can do all sorts of neat things with 3D models, having their head move independently of their torso and arms from their legs by blending animations, but it doesn’t translate well to 2D unless it’s one of those swivelly stick-shooters, which we can all agree are the most natural looking things around. But with the contextual movement I can do things such as pause a brief moment before taking off, since it’s already determined that the character *will* successfully catch a moving ledge, so I can put some decent squash into the animation when preparing the jump. And when they grab they can transition straight into a swing since the next movement has already been determined.

But it’s not all good – when I’ve got things looking smooth it’ll stand out all the more when an epic leap resolves as a tiny 3 inch hop.

leap

The worst part is that I could fix the discrepancy by adding a load more animations for jumps of varying lengths, but that’s too horribly tedious to consider, and where does it end? So I’m doing my best to make the movement as all-purpose as it can be while adjusting for every situation.

And some things just defy reason and there’s not much to be done: being able to swing from underneath a ledge to the other side of the same ledge is a very useful skill that is difficult to make look realistic because it’s impossible.

swwing

Nope!

For the record, I do have one hold-out from the box-rotatey days when clinging to the side of a corner, in order to place the feet on the wall at any angle. It works… just about. The skeleton somehow retains most of its integrity, but the offshoot is that if anything goes wrong it goes very very wrong.

 

Objective: Give as much freedom as possible
Concern: There are about a billion edge cases

I never get tired of referring to everything as an edge case when it concerns climbing up and down all these edges. “You want to scale a building then jump to the underside of the adjoining roof? That’s an edge case!”

 

I can’t quite bring myself to go hunting for examples, but that might be a fun activity later on (and a necessary one even further down the line). So for now just know – if you don’t expect a forward jump to send you spinning through the floor towards an almost entirely obscured corner, prepare to be surprised!…

I have a new third-favourite phrase.

 

Objective: Make these darn slopes work
Concern: Slopes… how do slopes work?

Jumping from slopes is the very last thing I coded as far as movement goes. Slopes that you slide down were surprisingly tricky themselves – I decided not to conserve momentum off the end of the slope so that the player could choose whether to drop or jump away, which also allows for epic last moment catches on the end of said slope. (The NPCs just fly off the end because it was more fun to watch).

socool

If Die Hard was a video game

From the beginning I’d only allowed jumping from the end of a platform, because why would you ever need to jump across in any other situation? Then I encountered this arrangement:

slopes

It seemed daft to require the player to walk underneath an edge when they know that the character is capable of jumping to it from where they are. What if there’s a hazard down there (as there clearly is!)? Okay, fine, so what should the mechanics be?

Should I be able to jump up the slope?
Umm, no? Not to be overly restrictive but that seems like a pointless manoeuvre that I’m not sure how I’d handle. For that matter surely you don’t need to jump on a flat surface, just walk why don’t you!

How close to the end should I be before it tries to jump from the end like normal?
The normal distance? Except, the difference between where you press the button and where you end up when the jump is calculated can be quite dramatic, so I’ve no clue what will feel best in practice.

What if I’m trying to jump on a slope that has a no-drop edge at the end?
Oh dear… make it a no-jump zone… unless you’re jumping to something in particular in which case… but how to determine the edge type… uhhh…

(One approach to) Learning new things

This video is a general update on how things look so far, with some limited exploration of what I used to get there.

 

I’m hesitant to go beyond discussion of mechanics, design, programming and so on because there are well established mediums for this sort of advice, which depend on context and expectation to have any effect. Still, when learning is all I’ve been doing for the past few weeks it can’t hurt to talk about, and it’s always worth reiterating. At the very least I find it useful trying to put my thoughts into words… and it’ll be a reminder for my future self who tends to forget these sorts of lessons.

As a baseline, I’m assuming the following generalisations apply to whatever’s being learnt:

  • It’s probably fair to say that learning how to learn is a desperately hard skill to acquire just by reading about it – an omniscient mentor is invaluable for attaching the process to reality, whether or not they come across as something to aspire to or a cautionary tale against taking things too far. But outside of a classroom or a decent workplace these can be hard to find, and most expert knowledge comes from scattershot tutorials and forum posts that won’t have your problems in mind.
  • As I’ve gotten older I’ve gained an appreciation for the argument that learning new tricks gets harder with age – as responsibilities mount up it’s difficult to justify spending the time to learn something without any long-term practical benefit. I haven’t reached the stage where I need to justify anything, and I hope I never do, but I can still appreciate it.
  • It’s also understood that most things worth learning are a bottomless well of complexity, with common practices built on lessons long forgotten and a dozen ways of achieving the same result with varying efficiency. Sitting back after hours of production-less research and realising you’ve hit a fraction of a percent of what’s available – just thinking about it is making me want to stop typing and play something instead, where all the hard work is already done.

 

These circumstances can seem insurmountable, but hopefully even just listing them out makes them a bit more manageable. I have to constantly tell myself that everyone who knows anything went through the exact same tortuous process of learning as I keep putting myself through. But I’ve also learnt to take motivation where I can get it.

This is my approach to learning new things, which exists on an arbitrary corner of the internet, comes with little justifiable benefit and only scratches the deionized dust of the nebula.

IDidntEvenKnowThereWasARedBit.jpg

1. With a time limit and a simple project in mind, flail wildly until you achieve your goal or the time runs out.

I always start here, perhaps out of habit, but it intuitively feels like the easiest way to get started. You won’t be overwhelmed by theory, the first step is always the hardest and this is more like a desperate lunge, and everything that comes after will feel familiar, like someone pointing out the poisonous snakes in a wood you’ve just sprinted through. Don’t do this if you’re learning how to e.g. reconfigure your BIOS, but for most things you can’t go wrong.

The time limit is not mandatory, in fact I usually substitute it for ‘until the first gentle ripples of frustration start rolling across your skull’, but it’s important not to take things too seriously and no one likes sinking time into fruitless endeavours.

Examples:

  • With Blender, all I wanted was a plane that I could cut shapes into. I pressed every button, encountered only a tenth of the possible views, ended up erratically deleting vertices from the middle of a prefabricated grid and managed to create something that when exported was a hundredth of its intended size angled 90 degrees the wrong way flipped vertically that wouldn’t render a texture and was only technically a plane as many of the vertices were at completely different depths.
  • With shaders, all I wanted was for a sprite not to turn black when the x axis was flipped. I ended up systematically deleting from a pre-existing shader until it was half the length of the original code with no measurable impact on the material being shaded (though a lot of options I didn’t understand were removed from the UI). I then spliced two shaders with different purposes together, ending up with massive distorted outlines, white boxes, transparent objects, and at one point a rapidly flashing array of colours. I could only guess at what caused what, but at least it wasn’t a baseless guess.
  • I started learning the ukulele by working out the base riff to Lullaby by The Cure, but the octaves were all wrong and I had no semblance of finger placement. Still, I made a curiously catchy tune arise with only a block of wood and four strings.

 

2. Take several steps back, probably start from scratch, find the friendliest and most relevant tutorial(s) and enjoy the reminiscences.

The steps can be taken figuratively, but in my case I literally step back from my desk, abandoning the second monitor and the mouse and I sit on the bed in the least productive position I can find. It helps me let go of any progress I may have made and focus on the tutorial without constantly trying to apply my half-baked knowledge.

Every time a significant action is concluded I’ll switch to the project and recreate the action as it relates to what I’m trying to do, so there’s an element of applying the knowledge rather than following it by rote.

Examples:

  • I found a 50 minute video of someone with self-confessed little artistic ability opening Blender from scratch and making a windmill. He explained the perspective/orthographic views, the quick-search feature, and general location, scaling, extrusion and duplication. All stuff I’d toyed with without much purpose or adeptness. The most significant lesson that I could only appreciate with my initial attempt was how programmatic it can be: one button to choose the view, another to start transforming, x/y/z to choose the axis, then enter a number and confirm. Nothing approaching drawing or sculpting or any of that supposed artistry. I wasn’t making a windmill and the tool I needed wasn’t explicitly covered, but in the end I could work out the rest for myself.
  • Shaders were simpler in a way, the tutorials were written out and what I learnt was that it boils down to applying a few effects depending on the requirements and the syntax is just as obtuse as I thought. I only needed to know how to read a shader, not write one myself, so relating some snippets to some effects sufficed.
  • Back with the uke, I went in search of tabs and found they only applied to guitar, and I couldn’t establish the distinction between finger placement for chords and plucking, if there even is one. I was too bemused to look up a more basic tutorial, I know how to hold an instrument darn it, you’re not the boss of me.

 

3. Refine the process, hit overly specific roadblocks, engross yourself in the community and any reference manuals, it’s too late for you now.

There are a lot of steps here but I’ve written enough for now. I find at this point things start snowballing and you’ll have enough momentum to seek answers to your infinite questions. If not, reassess what the project is for, or stop thinking so hard about it – we’re getting into self-help territory.

Examples:

  • Why are my textures all wrong? All I’ve done is the simplest possible use of the program, surely the answers to this sort of question are so numerous it’s some kind of running joke. No? Better ask on the forum, suggesting it’s something to do with this UV mapping I’ve heard so much about. It might be, have you checked the UV map editor? I didn’t know that existed! Oh look this shape looks nothing like that shape -> dawning realisation and profuse thanks.
  • I didn’t have much more to say about shaders once I’d solved my problem, but I did find someone asking about a similar problem two years ago, so I threw in my solution in the hope it helps someone in future.
  • Gave up on the ukulele, I couldn’t find any answers or think of any more questions. At least a piano will play a note with some consistency!

Texture, Movement, Animation and Naming!

 

Though the video was quite long it would need to be five times the length to go in depth on the steps I took to get there. There’s room in a future update for a discussion about various Unity quirks I’ve discovered and the various suspicious workarounds I’ve used, but that would require me to attempt to learn why things happen the way they do, and I’d prefer to move past those things for now!

So instead I’ll save myself some work and go through four articles for different games that talk about light and textures, which I suppose makes them an indirect influence. They’ve all provided moments of penny-dropping clarity, so if anything in the video lacked explanation you’ll find it here.

 

4-1 4-2

Gamasutra: Dynamic Character Lighting in Unforeseen Incidents

I don’t know anything about the game above that isn’t summed up by the screenshots. It’s an adventure game with some more advanced lighting tricks than I’m willing to apply.

But it puts across the versatility and potential of the engine, while introducing the notion of lighting 2D planes like a stage with spot lights projecting from the foreground, so I’ve been referring to it whenever I’ve wondered whether something is possible.

 

4-3

Anton Kudin: Perfect pixel-art with specular and bump lighting in unity

This article is a step-by-step guide to applying bump maps with specular lighting to sprites. Personally, I’ve heard the phrase ‘bump map’ dozens of times without any idea of what it could be – turns out it’s ‘just’ a way of faking bumps on a smooth object without any extra polygons. It can use either a height map or a normal map, both of which I showed off in the video, with normal maps providing more control (actual artists sometimes draw them by hand!). Normal maps dictate how the lighting works so I’m using those, though Unity supports both. There’s also parallax mapping which is newish and exciting but I don’t understand it or need it.

Once issue with the article is that it refers to a shader that is now listed under ‘Legacy’ on the built-in shaders menu. Since version 5 Unity has consolidated all their shaders into a few core ones and one all-purpose shader that doesn’t seem to play nice with sprites. So my philosophy is ‘use what works’, although now it seems that the legacy shader doesn’t react to spot lighting for some reason so my philosophy has transmogrified to ‘wait and see what works’.
4-4
alkemi: A game of Tricks – Normal mapped sprites

Here we have some talk of normal maps, specifically using the maps alone to create a ghostly version of a particular texture. I’m sure I can find a way of using this to make the Piloted Light look like it’s encased in a semi-permeable aura, or give a glow to my character. The examples are also phenomenal at showing how much detail can be conveyed, which is reassuring when I’ve already decided not to make anything that complex.

4-5

The section at the end takes a regular sprite and applies some varied lighting, which is something specific to aspire to.

 

4-6

Whole-Hog Games: Lighting a 2D Game
Finally, I’ve actually played and thoroughly enjoyed Full Bore, though I can’t say how integral the lighting and environments were to that experience. The article brings everything together: bump mapped textures layered on top of each other and lit from various sources in a purpose-built engine. It makes the process look effortless, but points out that the original design was far less graphically striking, and reminds that these effects should serve a larger purpose where possible.

 

My reason for following this route is because light is a crucial aspect of -thermia, emanating constantly from the character and most of the main mechanics, so even a superficial response from other objects will sell the impact of that theme. I also want the domiciles to look warm and cosy, in contrast with the harsh outdoors, and to create a space that can be invaded by the character and by other design elements.

So far it isn’t too difficult to create what I need, though getting the aforementioned quirks to line up in my favour is proving troublesome. Good job I only need to sort that out once, then I’m sure nothing unexpected will happen.

 

Piloted Light

 

I only focused on one thing in this short episode. It’s more visual than most so words will be slim, but I’ll try to expand on the more interesting aspects.

My memories of the original Ape Escape are that it was amazing for any number of reasons – in case it doesn’t mean anything to you, it was a 3D platformer about catching apes that made full use of the Playstation’s new dual analog control sticks. So everything from swinging a sword to rowing a boat required you to spin those sticks (approximately) accordingly.

apeescape2c

 

But one thing I never particularly enjoyed was the RC car item, whereby the right stick controlled the car while the left retained control over the player. The level design did its best to accommodate by letting you walk around any puzzles that required it to get a sense of perspective, but often it devolved into guesswork as the tiny group of pixels somewhere in the distance moved erratically in the vicinity of a pressure pad.

My point is, if my childmind could coordinate itself enough to get past those obstacles that were more perspective sussing than problem solving, it should be reasonable to expect the concept to work well when you know exactly where the second entity is at all times. Therefore, I shouldn’t be worried that it will be more infuriating than fun (please point out any faults in this logic, they will be warmly met).

ambidextrous

 

Segueing now into how this impacts the design – a key way of avoiding frustration will be to avoid designing levels that need a lot of moving things around simultaneously. The limited duration of the Piloted Light™ will help, as there isn’t much you can do in the time available. But – you can do something in that time, so if a player particularly wants to set it off while in harms way then move both at once it’s a viable option, and so different playstyles are implicitly encouraged and it just so happens that’s exactly what I’m aiming for!

***

I said in the video that I felt it was an inherently fun thing to mess around with – something about the acceleration and subtle alterations to the velocity come together into an agreeable motion. But now I’m wondering whether expanding upon the mechanic to offer varying degrees of movement will override that feeling.

An analogy might be a shield against damage: at full capacity it allows you to wade out into battle and storm the trenches with temporary invincibility, changing how you approach various situations. But what if it had several levels of effectiveness, so for instance at first you had a shield that absorbed 50% of damage – at best it’s a panic button, at worst it’s never used because it doesn’t change your approach since the safe bet is still to hide where possible. If a mechanic has no use or is no fun when the effect is toned down, the player should only ever have it or not.

 

onoff

 

So I’m going to experiment to see whether it’s still fun when the Piloted Light™ is bouncy rather than flying, and whatever other variations I think of. If you’ve any ideas for variations or thoughts on how to maintain the fun regardless, let me know!

Art and Ice

It’s been just over a week since I started this and the most significant thing I’ve noticed is how long this past week has been. In case you’re used to similar expressions stitched to a prolonged sigh – I mean that in an entirely positive way! There hasn’t been a single moment over this period when I haven’t had the answer to ‘what should I do now?’ I’ve known many people who were really into certain activities, and I’m retroactively jealous of the fulfilment it must have brought them.

Anyway, here’s the next video:

 

There’s a lot shown that I didn’t talk about, but I’ll fill in those gaps later. For now, onto the subject of drawing.

I started using vector art (as opposed to pixel/raster art) before I even thought about why. If I had to pin a reason to it, I’d create a word salad along the lines of,

‘because poor drawings look slightly closer to how they should look when they’re a series of lines rather than a collection of dots’.

Here’s my first attempt at a mountain (before I’d looked at a picture of a mountain to remind myself what a mountain looks like) compared to what I eventually sculpted it into:

mountains

I can’t shake the feeling that even though it’s a single basic outline, I’d have way more trouble with pixels than with vectors. As it was, all I had to do was bully the lines into the shape they were supposed to be (and realise that snow doesn’t work that way) rather than trying to erase and draw whole new contours.

I’m sure there’s some practical benefit as well, but I don’t know enough about resolutions and porting to comment on them, but it seems like the safe way to go.
For the rest of the video I looked at the ice, how it now reacts to an ‘aura’ around the player by melting when hit by an upwards-moving circle. There isn’t much more to say, that’s all it does. There was a moment in the video when I fell off a ledge and onto the ice, which stuck around rather than receding to a point where I could fall through. I failed to realise what was happening at the time, but of course each point on the ice isn’t reacting to the aura – only the closest point reacts which then pushes the points around it down as well. So it was hitting a point that was as low as it could go, and the nearest points to that were also as low as they could go, and since there’s no check for such points nothing happened until I increased the distance within which to lower nearby points! It may be a hopeless enterprise but here’s a diagram to illustrate:

diagram

 

So rather than brushing it off like I did in the video, it may be worth revisiting and seeing whether it can work a different way, as I’ve noticed it can lead to odd situations and unexpected collisions, as well as messing up some other ideas I have for the mechanic. I suppose the sensible thing to do is to try to find each point within the ‘aura’, except circle casts don’t work that way.

Except… I can could probably base it off the origin of the collision (the red circle) rather than the point of collision (the blue circle) and grab the points from there. Okay, that makes this all worth typing down, as I hadn’t arrived at that possibility until just now. The incremental ice mechanic saga shall continue!

Don’t get me started on other improvements I’ve considered, such as moving the points away from the player instead of straight downward – that’d probably lead to ice being smeared in a straight line across the scenery.

 

Finally, in keeping with the style from last time, here’s two opposing lists~

Things I now understand since last time:

  • when to use rigidbodies
  • triggering
  • animators
  • layers
  • sorting layers
  • meshes (a bit)
  • cookies (these won’t come into play for a while)

 

Things I’ve discovered that I don’t understand since last time:

  • shaders
  • particles
  • feet

Orientation presentation

Welcome to my hastily spawned blog! All of the initial words I wanted to get out I squeezed into the 15 minute video below. I’ll write a recap and some thoughts afterwards, but it’s so early days that there’s too much to focus on. I’ll make future posts as narrow as I can, and use them to explore a particular topic or problem as they come up.

 

Things I covered in this video:

  • I want to make a game
  • I have no prior experience aside from what I’ve played, watched and read, but I can barely code!
  • I’m using Unity for no particular reason
  • I can’t draw (elephants. For all you know I can draw a koala perfectly well)
  • I’m feeling far more communicative now
  • One of my themes of choice is fire. As such melty ice ‘physics’ are my first nut to crack
  • My explanations are piercing and erudite

 

Things I didn’t cover in this video:

  • The genre of the game
  • The name of the game
  • What I hope to get out of it, who it’s aimed at, my expectations, how motivated I am, any mechanic examples besides the ice one, everything else

 

I feel that in keeping with what I said in the video about packing as much into as few components as possible, it’s probably going to be a puzzly action game that involves snooping around a location looking for ways to reach the objective du jour. I’m slightly uncomfortable with how inevitable that sounds, but hey it’s my first attempt, I’ll break the mould when I’ve grown into it.

The name should have something fire hot heat flame inferno about it, but nothing I’ve considered has a fun double-meaning to it without sounding poncy. I’ll pontificate later.

The rest is yet to settle – it won’t be until I’m running around and affecting change in my little world that any of those questions can be answered.