C-7's Forum Posts

  • See some of the inner workings for Courier!

  • This time around, I'm showing some of the systems in Courier and how I implemented them! This includes collectables, quests, icons, visuals, and more. This one should be helpful to some people!

  • No, it's simple. When you call the Play event, give it a tag ("bgmusic" or something).

    On Start of Layout

    Tag "bgmusic" is not playing ----------> Play with tag "bgmusic"

    This way, it will only start if it is not already playing.

  • I just lower or raise volumes over time based on tags, but Rex actually has a plugin called Audio Helper that does just this!

  • > but right before you fade a track in, sync it to what is currently playing. Then it will fade in correctly and you have no reason that de-syncing would even be audible.

    >

    >

    this gets tricky if you use "stems" though.. I think you mentioned you were using full mixes. I'm talking about making 1 piece of music 2 minutes long and I break it out into 4 tracks that need to be played simultaneously. So "virtual remixing" basically.. Once you have more than 1 track playing you can't re-seek those without causing audio junk that you will hear.

    I just assumed this was beyond the scope of what C2 can handle. It would be tricky enough to code it without these sync issues.. with sync issues it's not really worth the effort unless your game is dependent on the music.

    I just always assumed timing would be an issue from the start because of cpu variance, so I opted from the beginning to just have multiple versions of loopable tracks instead of relying on mixing in-engine. It isn't an issue for adaptive pieces that procedurally choose the next measure to play, but for crossfades I opted to not even worry about syncing issues and instead just mix the versions I wanted ahead of time.

  • > It looks like the new update makes this all even better!

    >

    yeah but Chrome and Firefox still won't sync tracks without manually aligning them... and when you manually align them after each loop it creates artifacts.. so still no seamless transitions with multitracks...

    like in my example from 2 years ago... (you have to let it loop 5-6 times then you hear it go way out)

    That was a quick and dirty example, but the trick would be to align the track while it's silent just before you fade it in. If you're only trying to have one or two tracks actually fully audible at a time, this should be no problem. The problem would come from trying to continuously line up a whole bunch of tracks simultaneously while they're playing. I didn't put in the check in the screenshot I posted above, but right before you fade a track in, sync it to what is currently playing. Then it will fade in correctly and you have no reason that de-syncing would even be audible.

    Your idea of a silent 'guide' track is actually a really good idea and a great way to make this all work perfectly.

  • For me, I typically just have each of my tracks "complete" instead of piecing layers together--so I switch between fully mixed versions. The only difference is at times adding maybe one element like a melody over top. A couple of those earlier events refer to the adaptive music parts that I use, so ignore those, but that's the gist of how I do it all. The business with arrays is all for my own convenience and re-use of events, so you don't have to worry about that.

    Despite the tracks being set to loop, I still re-seek them to the beginning to reset the playback time (otherwise it keeps going up). And, with how I have it set up, I just call a simple function in-game and this code will take care of it all. The adaptive stuff is much more complex, but I can still control it all with one simple function call. So once the initial setup is done, be sure to make it easy for yourself to control it all!

  • Okay, I do this type of transition work in my game currently and it works great. Admittedly, I saw this post really late at night and I really need to go to sleep. Tomorrow I'll screenshot some of my events and show you a little of how it's done, but a few hints until then:

    Do not use Wait or any other system thing for timing. This will more times than not be at least a tiny bit off from the actual audio files in use and, as I'm sure you've noticed, tiny differences make for a big problem with audio. Instead, you should use Audio.PlaybackTime(Tag) for everything. Then, you can use Audio>Seek to for lining up your tracks. Remember, though, if you're looping a track, the PlaybackTime will keep going past the looppoint (ie, it'll count past the end of the audio file) so you'll also need to seek your guide track back to 0. Lastly, you need to recognize that the events aren't going to be absolutely accurate, but you should use correct values. So if your loops is 6.345 seconds, you should run your events when PlaybackTime is > or = to 6.345.

    And, lastly, if someone sees this and is curious about how to find the most accurate timing for stuff, here's a good formula for it. If your measures are at a strict tempo, it's BeatsPerMinute/60*BeatsPerMeasure. So 144/60*4 would be 144 bpm in 4/4 time. Then, you can multiply that number by however many measures are in your track to get the loop length.

    So when I get a chance tomorrow, I'll walk you through a bit more of this in greater detail with screenshots (and probably an example).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey, that's a big jump from the last one (and thanks for crediting me)! It looks quite robust already. Was the layout transition really like that in LttP? Either way, I'm not a huge fan of that, but overall this is looking fantastic!

  • I went ahead and added the sun into my game

  • The problem is canvas2D. Apparently, even the tiled aspect of TB's was hackish to get working in canvas2D. It's all perfectly doable in WebGL, just no one has done quite that.

  • Potato23 Just add inverted "key is down" conditions to your current commands. Right-click on a condition to invert it

    Up is pressed

    left is NOT down

    right is NOT down

    and do that for each event.

  • Yes, Potato23 that link wored.

    Here's a fix for you.

    I added comments to the event sheet to show you what I was doing. Firstly, I had to fix your right-facing image points. Did you know you can right-click on an image point in the image editor and apply it to the whole animation? That way, the cannonballs spawn correctly. I also set your animations to loop (it comes up on the left side of the screen in the image editor), so just change it back over there if that's not what you wanted.

    Anyways, I added a private variable to your ship so the game keeps track of which way it's facing. I made sub-events to yours that change the bullet angle of motion for your cannonballs based on the direction of the ship. Remember, 0 degrees is → and it rotates clockwise from there.

    Lastly, I moved your firing actions to functions so you can use the same actions for all of your events. This makes it easier to maintain stuff and not copy+paste a bunch of stuff.

  • This thread should have everything you need. Admittedly, it's made for the official plugin, but it should be helpful. Once you create your font, it also gives you the spacing string to use (and the example capx shows you how to do it).