Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1383547 Posts in 66151 Topics- by 58583 Members - Latest Member: mattiasw

October 21, 2020, 07:32:51 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsLeilani's Island
Pages: 1 ... 53 54 [55] 56 57 ... 63
Print
Author Topic: Leilani's Island  (Read 241488 times)
JobLeonard
Level 10
*****



View Profile
« Reply #1080 on: February 02, 2020, 04:51:54 PM »

Optimisation

Polish work continues, this week focused on a bit of optimisation. There were a couple of levels that were running badly and I wanted to smooth them out.

The Debug build of the game notably ran very badly in these areas, and still does! I was hoping to get it running nicely but it's not very important. The more optimised Release and Final builds are running nicely which is the important thing.

(For those not familiar with these terms - I'm not sure if other game making tools have the same concept: Debug, Release and Final are common names for different builds made with different compiler settings. Final builds are the ones released to players, and the compiler optimises it to run as quickly as possible. The Debug build is a lot slower, but contains debug information that allows breakpoints to be used, stepping through the code line by line, looking at variable values, etc. The Release build is somewhere in between.)

Mine collision

The first problem area was the challenge level with updrafts and mines.



The large object count - especially with them all in close proximity - was making the game slow down. My collision routines are not the most efficient and usually rely on there not being too much happening! I took a very targeted approach to fix this particular case by giving the mines here a special setting that turns off a lot of their movement code. The mines don't move anyway - but normally could be triggered to explode if a platform moved into them, for example. This isn't possible in this area so it's an easy fix to just not use any of the solid collision code. It now runs at the target frame rate (60fps on my laptop, 120fps on my PC).

Waterfall sprites

The second problem area was some busier parts of the waterfall level.



This was more of a rendering issue. The primary culprit was the glow effect that I put on the edges of the waterfall to make it stand out in the dark lighting.

A brief overview of how my rendering works - I have a Sprite Batch system that I feed sprites into. It does very simple batching on them where possible - consecutive sprites that use the same texture, blend mode, etc, are batched into a single draw call.

The waterfall is composed of lots of sprites 16 pixels in height. The glow effect is done by drawing each sprite twice - once normally, and then once with an additive blend mode to brighten it. This resulted in every sprite having a separate draw call - because there's a normal sprite, then an additive sprite, then a normal sprite, then additive, and they can't be batched together. The fix was to separate these sprites out so all the normal sprites were drawn together, then all the additive sprites, so they batched up nicely.

Sprite ordering

In the process of doing this I overhauled the rather inefficient way that sprites are sorted into layers. For example, the player being always drawn in front of a checkpoint marker.

The game has a concept of Render Priority values, and each sprite is assigned one of these values. The checkpoint uses ENTITY_NORMAL priority and the player uses ENTITY_PLAYER priority, which is higher.

The old process was super slow-

  • Loop through every sprite of every entity, only sprites that have priority ENTITY_NORMAL are put into the sprite batch.
  • Loop through every sprite of every entity, only sprites that have priority ENTITY_PLAYER are put into the sprite batch.
  • Sprite Batch draws all sprites in the order they were added.

Imagine this but for many entities at once, and many different priority levels! And not only entities either - particles, scenery tiles and various other things all fitted into this system in a similar way. Absolutely everything had to be drawn in the order that it should be displayed on screen.

The Leilani code originally used one of my Ludum Dare games as a base. So it does have some of these kind of antiquated systems that were suitable for a small game but not for something more complex!

I've now reworked the Sprite Batch system so we can define a number of groups beforehand - in this case one for each of the Render Priority values. Sprites can be drawn into any of the groups. The sprites within each group will be batched together where possible, and once everything's done, each of the groups will be drawn in the appropriate order. This allows us to loop through the entities just once, and send every sprite into its appropriate group.

  • Loop through every sprite of every entity. All sprites are put into the sprite batch, into the ENTITY_NORMAL or ENTITY_PLAYER group.
  • Sprite Batch draws all ENTITY_NORMAL sprites, then all ENTITY_PLAYER sprites.

This is now much nicer, and a little more efficient!

Quote
My collision routines are not the most efficient and usually rely on there not being too much happening!

Although you're probably happy with your current collision routines, I have to put an obligatory link to the rbush and flatbush libraries, which obviously are the wrong language for your usecase (JavaScript) but might have some algorithmic interest - near the end of the readme of rbush there are a few links to papers about r-trees and their derivatives as well:

https://github.com/mourner/rbush

https://github.com/mourner/flatbush/blob/master/index.js
Logged
Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #1081 on: February 14, 2020, 09:35:02 AM »

Although you're probably happy with your current collision routines, I have to put an obligatory link to the rbush and flatbush libraries, which obviously are the wrong language for your usecase (JavaScript) but might have some algorithmic interest - near the end of the readme of rbush there are a few links to papers about r-trees and their derivatives as well:

https://github.com/mourner/rbush

https://github.com/mourner/flatbush/blob/master/index.js

Sorry I didn't get around to replying to this sooner - thanks for the links! It's not really my style to get too much into complex algorithms - if a naive solution will work then I'm usually happy with that Grin Though it's also valuable to remember that smarter solutions exist and are out there to read about! Maybe for a future project I'll try something less basic - depending on the needs of the project.

5 years of the devlog!

I'm one day late, but the devlog is now 5 years old. Hurrah! Coffee Many thanks to all those who read my posts, it makes the whole thing worthwhile!



Those explosion effects have always been a bit weak-looking, and I've had various todo-list notes to revamp them over the years but never did it. I thought since it's a special occasion that I'd actually make the effect to tweak them!



Nothing too groundbreaking - but they're more punchy now at least.

6 years of development

5 years of devlog means the game has been in development for 6 years. I'm still not willing to put any release date on this! But I'm feeling good about development. I was on holiday last week so took a nice little break from the game - I'm starting to get back into development today and looking forward to pushing through to get the next playtestable version done, hopefully without adding too many more things to my todo list...
Logged

Prinsessa
Level 10
*****


Ava Skoog


View Profile WWW
« Reply #1082 on: February 15, 2020, 02:25:52 AM »

So many devlog anniversaries all at once! Congratulations! Game and updates keep looking amazing. Kiss
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #1083 on: February 15, 2020, 05:00:43 AM »

Congratulations!
Logged
EJlol
Level 0
**


View Profile
« Reply #1084 on: February 17, 2020, 12:04:52 AM »

Congratulations! Grin
Logged
OctoMini
Level 0
**


Talk does not cook rice


View Profile WWW
« Reply #1085 on: February 17, 2020, 12:45:20 AM »

The amount of polish and attention to detail is staggering for an indie project, but what I Iike the most in this project is Leilani herself. Such an affectuous little protagonist! You truly have something special in your hands! Can't wait to play this one! Congratulations on hitting the 6-year mark! Quite an achievement!
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #1086 on: February 22, 2020, 12:20:27 PM »

It's a bit late, but Leilani and a maca were able to settle their differences and enjoy some birthday cake together. ^_^



Audio System - Further Improvements

I've begun the daunting task of doing a full pass over the game's sound effects. I spent a few hours playing through what currently exists of the game, making notes of all the situations where sound effects were missing or obviously placeholder. I also noted down some new features that it'd be nice for the sound system to have.

I previously wrote about the audio systems here (basics), here (music, reverb) and here (expanded features).

Reverb Zones

Previously, the game supported reverb but only for entire areas of a level. I added the ability to instead specify individual zones where the reverb should occur.





In this video, on the left side there's no reverb. As Leilani goes into the cave, the echoey reverb effect kicks in.

The FMOD API made this easy; it has a ready made system for setting up reverb properties and then applying them to either whole groups of channels (which is what I do for the level-wide reverb) or to individual channels (which is used here). I didn't showcase this in the video, but the reverb is on a per-sound basis - so even if Leilani is in the reverb zone, if a sound occurred outside the zone, the reverb wouldn't be applied to it.

This feature is a bit overkill! There's a specific level with a mix of outside and cave areas where I make good use of it, though. As I make more levels I'll see if there are other appropriate places to use reverb.

New sounds: Rainbow drop sequence

The rainbow drop sequence was previously entirely silent! I've done a pass over it adding some sparkly, bubbly effects.





Audio design isn't my strong suit - I take a long time to get anything done, and I'm not always able to even describe to myself what I want a sound to be, let alone have the skills / tools / knowledge to make it. As such all sounds in the game are considered possibly-placeholder with the idea that I may find a sound designer to work with at some point in the future.

However for now, I have a few tools that I use. I source some sounds (such as the sparkly sound used here) from Freesound. I'm maintaining a list of all the sounds that I grab from there, and where I used them in the game, so I can double check licenses and attribution in the future. If I edit sounds I usually use GoldWave or occasionally Audacity.

I also synthesise some sounds. The bubbly sounds in the above video were made in LabChirp. I also use the old favourite BFXR.

I don't want the effects in the game to be overly 8-bit-sounding, so those are the most likely candidates to be replaced further down the line.

Data-driven Sound Controls

While working on the rainbow sequence above, I added another new feature to the audio system.

I'd like to focus on the RainbowAppear sound. It's a looping sound. When the rainbow begins to appear, I play the sound. When the rainbow finishes appearing, I stop it.

Code:
<Sound name="RainbowAppear"
filename="Sparkle.wav"
loop="1"
sustain="1.0"/>

In the XML data for the sound, I add a one second sustain which causes the sound to fade off nicely even after the rainbow's code has stopped the sound. However, I don't really have any more control over the sound. I could alter the pan, pitch or volume, but only for the entire sound.

The effect I want is for the sound to increase in pitch over the duration of the rainbow's animation, and also pan from left to right as it goes across the screen. It would sound really flat to play a monotone looping sound for the whole animation!

One possible solution would be to author a unique sound for this situation, tailored specifically for the rainbow's animation. I don't use this solution for various reasons. It doesn't suit my limited audio editing skills - it would take too long to tweak the sound to behave how I want. It's wasteful as the sound file can't be reused for other purposes, as well as the sound itself being longer than a short looping sound is. It's also not flexible; if I decided to change the length of the rainbow anim, the sound would need to be remade.

The previous solution I would use was to hard-code all this behaviour. The code for the rainbow, which starts and stops the sound, would also calculate the appropriate pan and pitch changes to make and apply them to the animation. Some pseudo-code to demonstrate this:

Code:
// Progress the rainbow appear anim from 0-1
anim += deltaTime;
anim = Clamp(anim, 0, 1);

// Apply visual effects
...

// Alter sounds
float pitch = Lerp(0.5f, 1.5f, anim);
float pan = Lerp(-1.0f, 1.0f, anim);
SoundSystem.SetChannelPitch(rainbowSound, pitch);
SoundSystem.SetChannelPan(rainbowSound, pan);

This works, but has slow iteration times. If I need to tweak one of the values, I have to stop the game, compile the code, and relaunch the game.

I've now made this data-driven. The sound XML data can contain a new feature called a Control.

Code:
<Control name="RainbowAppearProgress">
<Pitch>
<Keyframe input="0.0" output="0.5"/>
<Keyframe input="1.0" output="1.5"/>
</Pitch>
<Pan>
<Keyframe input="0.0" output="-1.0"/>
<Keyframe input="1.0" output="1.0"/>
</Pan>
</Control>

The control maps a single float value to multiple sound changes. This simplifies the code, and moves all the tweakable numbers into data. If I want to change the numbers, I can just edit the XML and hit a button to reload the level, without any compilation needed.

Code:
// Progress the rainbow appear anim from 0-1
anim += deltaTime;
anim = Clamp(anim, 0, 1);

// Apply visual effects
...

// Alter sounds
SoundSystem.ApplyControlToChannel(rainbowSound, "RainbowAppearProgress", anim);

As I continue my sound effect improvement throughout the game, I'll be changing old cases of hard-coded sound alterations to use this new system.

Semitones

One final thing! You'll notice in the rainbow drop video that the pitch of the sounds increases throughout the sequence. It could be done by specifying pitch multiplication values directly, like so:

Code:
<Sound name="RainbowDropCollect1"
filename="RainbowDropCollect.wav"
pitch="1.0"/>
<Sound name="RainbowDropCollect2"
filename="RainbowDropCollect.wav"
pitch="1.2" />
<Sound name="RainbowDropCollect3"
filename="RainbowDropCollect.wav"
pitch="1.4" />
<!-- etc -->

However this can end up sounding really wonky. Numbers that look nice on paper - increasing the pitch by 0.2 seems like it should sound good - don't tend to sound good in practise.

I have a little helper code in place to calculate these pitch values for me based on the idea of semitones. In music, the notes (ABCDEFG) form an octave. In a single octave there are 12 semitones (in piano terms this includes the white and black keys in the octave). The difference between octaves - for example between note A on one octave, and note A on the next octave up - is that the pitch is doubled!

So to change the pitch of a sound by one octave, or 12 semitones, we double it. It's a little more tricky to change the pitch by individual semitones. For this we need a calculation that I pulled off the internet.

Code:
pitchMultiplier = 1.059463 ^ semitoneChange

1.059463^0 = 1.0 (same pitch, no change)
1.059463^1 = 1.059463 (1 semitone increase)
1.059463^6 = 1.414 (6 semitone increase. The result here is also the square root of 2.)
1.059463^12 = 2.0 (doubled the pitch, gone up one octave!)

In the XML I specify the pitch change for each collection sound in semitones:

Code:
<Sound name="RainbowDropCollect1"
filename="RainbowDropCollect.wav"
semitoneChange="0.0"/>
<Sound name="RainbowDropCollect2"
filename="RainbowDropCollect.wav"
semitoneChange="1.0" />
<Sound name="RainbowDropCollect3"
filename="RainbowDropCollect.wav"
semitoneChange="2.0" />
<!-- etc -->

And, the result of this is a more pleasant-sounding increase in pitch for each sound. I recommend making use of this trick where possible!
Logged

Prinsessa
Level 10
*****


Ava Skoog


View Profile WWW
« Reply #1087 on: February 24, 2020, 08:40:15 AM »

Aww, the pearled sprites!! Kiss Kiss

And that audio stuff and the attention to details with the rainbow sound is so neat.
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #1088 on: February 25, 2020, 05:11:18 AM »

I just realized that this is the first time I heard this game. I'm really curious what the rest sounds like!
Logged
Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #1089 on: February 25, 2020, 12:00:45 PM »

I just realized that this is the first time I heard this game. I'm really curious what the rest sounds like!

I don't tend to post videos containing sound effects - especially not general gameplay videos - due to the placeholder nature of them. Here are a couple of videos that I think both previously appeared on the devlog, if you're interested:

The end of level sequence, which is timed with the music. First with music, then without. The second time also shows the audio debug mode which prints the name of each sound in the position it's being played.





The intro sequence for a factory level. Most of the sounds are placeholder (especially the factory door opening and closing), they're on the list for a revamp as part of my current audio pass.





And then because it's always worth reposting, Woofle's Soundcloud has a playlist containing some music samples!
https://soundcloud.com/leila-wilson-woofle/sets/leilanis-island
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #1090 on: February 26, 2020, 04:30:39 AM »

The music syncing up with the lights going on in the factory
Logged
NovaSilisko
Level 4
****


Real life space alien (not fake)


View Profile
« Reply #1091 on: February 26, 2020, 04:31:43 AM »

This game is going to be a masterpiece.

edit: fixed

That reverb gives me good tinglies. It's so good. It's all so good
Logged

Prinsessa
Level 10
*****


Ava Skoog


View Profile WWW
« Reply #1092 on: February 26, 2020, 10:08:57 AM »

Oh my god yes the lights
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #1093 on: February 28, 2020, 10:56:17 PM »

Such nice comments, thanks <3 The lights syncing with the music is one of those crazy extra features that I didn't need, but had to put in once I had the idea. I don't really have any more music-syncing things in the game at the moment (aside from the end-of-level and end-of-boss sequence) but may try to find some more to add.

Sound overhaul continues

I've not had much time to work on the game throughout this week - been busy with normal work and other events - but spent Friday continuing to add and improve sounds.

Menus

One area that has been given some attention is the menus. They previously used various unsuitable game sounds - such as playing the 'jump' sound when you pressed a button - which sounded terrible. I've gone for a kind of tactile wooden feeling which feels much better, I think.





Per-sound delay

The one new feature added this week is the ability to add a delay to sounds. For 'Pause' and 'Resume' it plays the same sound three times with a slight delay, with pitch and volume changes to create small jingles. This kind of shortcut allows me to author sounds more quickly and makes the sound system more flexible for if/when I improve the audio more in the future.
Logged

nosferathoo
Level 1
*


indiedev from Poland


View Profile
« Reply #1094 on: March 07, 2020, 11:25:40 AM »

This looks like a insanely polished game - would love to play it as it reminds me of Shantae series.
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #1095 on: March 07, 2020, 05:09:52 PM »

This looks like a insanely polished game - would love to play it as it reminds me of Shantae series.

Thanks! Smiley

Factory door / Boss sounds

The ongoing sound overhaul continues, again! No real new features for the audio system this week - just lots of authoring and hooking up of new sounds.

The factory door sequence has been improved. The boss fights are also a major area of improvement this week. The boss intro cutscene used to be entirely silent, but now has appropriate sounds triggered by the various animations throughout the cutscene. The boss itself also has a lot of new sounds including a first pass at an engine noise. Also little details like adding a sound when Kuila slams her fists on the tank after taking damage.





Here's a video of the factory intro and boss fight, with the usual disclaimer: there are still plenty of placeholder sounds in here! The sound volume is also probably not very well balanced.
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #1096 on: March 08, 2020, 10:26:25 AM »

 Hand Any Key Kiss Hand Joystick
Logged
Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #1097 on: March 14, 2020, 09:36:59 AM »

Continued Audio progress

As always, audio work continues. I decided to count the items on my todo list and the current completion rate is...

67 / 162 = 41%

That's after one month. I expect I can finish the rest of the list within another month!

Instagram long screenshot

Rather than just posting about audio I thought I'd mix things up a little. I was recently inspired to try posting a long, multi-image screenshot on instagram! The source of the inspiration was this cute Animal Crossing pixel art by _t3nshi - I loved the idea of being able to scroll through a single long image. I don't put any serious effort into my instagram account but it can be fun to post things now and then. I've shied away from posting non-photographs on there before, but the multi-image thing seemed like it'd be a good fit for instagram.

To start with I needed my long screenshot. I could take multiple screenshots and stitch them together later, but the parallax backgrounds would make this awkward, because they scroll at a different rate to the main scenery and wouldn't line up. Instead, I just changed the game's display size to make it super wide!



It was fun to see the game running like this! Next I cropped the image down to a 960x240 area - enough for 4 square images. I read that 1080x1080 images are best for instagram, so I scaled the image up using the same two-step process that the game does, to keep the pixels looking sharp - first a 400% nearest neighbour scale (to 3840x960), then a bilinear filtered scale up to 1080 high (4320x1080). After cutting this into four, it produces nice clean images.

The final step was to use my phone to post the images, since instagram only supports posting via the app.

On the website the images look quite nasty thanks to the compression - but thankfully when viewed on the app they come out much sharper and cleaner.

Logged

Prinsessa
Level 10
*****


Ava Skoog


View Profile WWW
« Reply #1098 on: March 14, 2020, 10:54:35 AM »

So neat! Kiss So when are we getting the Mac touch bar build of the game so we can play it in this super wide screen glory? Well, hello there!
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #1099 on: March 14, 2020, 11:10:02 AM »

So neat! Kiss So when are we getting the Mac touch bar build of the game so we can play it in this super wide screen glory? Well, hello there!

Now that would be wide, I feel like you could see the whole level :D Although at 30 pixels high you wouldn't get much detail...

Logged

Pages: 1 ... 53 54 [55] 56 57 ... 63
Print
Jump to:  

Theme orange-lt created by panic