C-7's Forum Posts

  • >

    > Your scenario implies loading in nearly an hour of music at once, which is more than many games have for music in their entire soundtrack. In actual practice, particularly with interactive music, you'd never load in more than a couple minutes of music (15-30 MB) at a time, and you totally get more mileage out of less audio content with interactive music.

    >

    I once wrote and produced 30 minutes of music for a small little game. if that music was not streamed they would have had serious memory issues - they simply would not have been able to do it with the graphics they had. All I'm saying is to anyone reading this is the same thing that is in https://www.scirra.com/blog/112/remembe ... our-memory - and even though it does not mention audio per say, I think at the time of writing it was not conceived of a reason for music to be read into memory.

    EDIT: People want to make music games with C2. and look at the problems that KLANG had... it's just a friendly warning!

    It's not worth arguing, that isn't the point of the thread. But my point is the developers would've been morons to load all 30 minutes in at once. The total amount of music for the project is irrelevant as of now. For instant playback of interactive music, the best bet is always loading what you need into memory. If you're just playing basic loops or tracks to play through, sample-accurate playback time isn't important and streaming is fine.

  • >

    > I've only tried this with the audio preloaded into memory. I'm not sure if streaming it (ie, putting it in the "Music" folder in C2) will have an effect. I put everything in the "Sounds" folder, personally, and just preload everything I need.

    >

    Now that you can unload sounds it's less of a problem but still.. you need to be careful here.. loading music fully into memory can take up a lot of space quick! If I remember correctly audio is uncompressed in memory so your 8MB song can easily be 80MB in memory. Add a handful more tracks and suddenly your footprint is half a GB... and that's no good.

    You're not thinking realistically about it. Uncompressed audio is about 10 MB per minute. Your scenario implies loading in nearly an hour of music at once, which is more than many games have for music in their entire soundtrack. In actual practice, particularly with interactive music, you'd never load in more than a couple minutes of music (15-30 MB) at a time, and you totally get more mileage out of less audio content with interactive music. This also is loaded into system memory and not vram, which most PCs have tons of. Even on mobile, which is quite limited, it's not even close to being an issue. Even before the ability to unload it was barely a problem in nearly all cases, but now it isn't at all.

  • Okay, you're doing it for soundtrack purposes. I'm a little tied up doing animation work to make an example, so hopefully this explains how to do it.

    Each of your four clips need to have the full music for the time frame they should represent + the decay that overhangs the end of the bar. Don't worry about the length of the clips--you'll never use it. But this will give the most realistic approach and is how every major studio does things like this. So for this, I'm going to assume each clip is two measures long in 4/4 with a tempo of 140.

    First, you need to determine the length of time for your segment. This is solved by 60/140*8 (60/tempo*beats). Store that in a variable.

    Now, all you need to do is cue up the next track to play at that regular interval. So 3.428571 repeating. Just have C2 solve it and store the answer in a variable ("length" or whatever)--don't bother using a calculator. I'm going to assume you can come up with your own method for deciding which segment should play next. I keep track of the track currently playing, where it is in context of the piece, and assign the next segment based on that + game parameters.

    So on the first play, store the current system time in a variable ("oldtime" or something). Your next segment should play at "oldtime" + "length" time. Don't use the Audio>Play action any more because you can't ensure events will run at the right times. It may not matter for visuals much, but 16ms is quite significant for audio. Now you should use the Audio plugin's Schedule option. Once the other segment is playing and the current system time is far enough beyond the "oldtime", schedule your next segment. Schedule it for "oldtime"+"length" then set "oldtime" to "oldtime"+"length". I suggest delaying when you call the schedule event until as late as you think reasonable so that you can make last-second changes in what track comes next should you need it. So I run my schedule event after something like 'is system time > "oldtime"+"length"- (however long you want. I suggest maybe 200 milliseconds or .2 seconds). This way, it will schedule the next track 200 milliseconds before it's time to start.

    I've only tried this with the audio preloaded into memory. I'm not sure if streaming it (ie, putting it in the "Music" folder in C2) will have an effect. I put everything in the "Sounds" folder, personally, and just preload everything I need.

    If you're going for mixed-meter stuff, change the "length" variable to a new solution of 60/tempo*beats whenever necessary based on however you determine what track comes next.

    I hope this helps!

  • It could also be that you haven't preloaded that audio file. So playing it silently accomplishes that, but there's an event in the Audio plugin to pre-load specific audio files so they don't have to be loaded in on their first play.

  • You need to be clearer on what exactly you're asking for. Are you talking like a regular playlist of multiple songs? Sure, that's simple. My audio player on my performance music website is done in C2 here. Are you talking about seamless transitioning between segments of music for an adaptive/interactive soundtrack? That's also totally doable but not as simple as using something like wwise or fmod in other engines. As far as the 16ms thing with ticks, there's an event option to schedule audio to play at absolutely precise moments regardless of events or framerate/dt hitches. So for the soundtrack in Courier, I schedule segments of music based on the playback times of previous audio files.

    So maybe tell us what you're trying to achieve. That will be far more useful than something so broad.

  • 99 is just being a pain about terminology. Export with nw.js and you'll have your desktop executable file which can be used on steam. Full screen works just fine. What he's trying to say is nwjs uses Chrome's browser engine, but it isn't running in a regular browser.

  • I put everything I want sorted in a family. Then give the family a family variable. Every however often, I set that variable to each object's Y coordinate. Then I run the sort command and sort it, ascending, by that value (note, the command has to use a variable and not some other value). Perfectly simple, works great so long as I have image points set up correctly. Any manual changes to the Z order are done immediately after that event.

    There's my full event. I narrow it down to what's on-screen and on the layer I want, set my variable, then sort. Then I have some manual adjustments after for different object types (Spriter objects).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is this a new post by them? Last they've said is that despite them working, they won't allow a C2 game on their shop because of some security issue.

  • Then clearly that feature isn't aimed at you. Sheesh. I would never use a phone for my primary development, but tweaking stuff when I'm out in the rest of my life away from my computer? Heck yeah, I'll do that. You already admitted the browser is a good way to allow for cross-compatibility. Why is it a problem to support even more devices? An android tablet with a keyboard can be a great way to get some stuff done on the go when you can't always have your computer with you. Same with a chromebook for that matter.

  • No, but I would always welcome more control over handling audio at least.

  • After putting in some thought, I think there could be some workflow benefits.

    Firstly, collaboration could be far more streamlined like this. Obviously, you'd need to be online, but that's not a big deal for collaboration to me.

    But as far as workflow, it could be awesome. Hear me out. So if it were a possible multi-tab thing, it could really be great. So there are obvious things like layouts and event sheets being in different tabs (if you want). So now drag one of those tabs out into its own window on another monitor. Cool so long as they update each other. Now allow plugins to be in their own tabs or windows. You could work with a timeline plugin or animation plugin in its own tab and watch it update the project on the other monitor. Cool, now have a teammate doing that on their own machine while you do control work. You could multitask yourself or with teammates across operating systems in near-realtime (probably 'save' could be an auto-cloud-push). Then maybe plugins are paired to your account but hosted by Scirra. Have the stuff available everywhere even if your work rig is not.

    And that could all be possible without any teammate having to install anything. Ever. That's a service and workflow I can get behind.

    Now is this how C3 will actually work? No idea! But I think there's a ton of potential to this and I'm interested to see what Scirra has come up with.

  • No problem! Glad it got cleared up! I suppose at runtime you could potentially make a call to preload or something, but there's no real use, just have them do it in first.

    Glad I could help!

  • The audio files are all put in a media folder and can be replaced freely before or after export. The easiest way would be to require the same file names as your example files. Otherwise, you'll have to pull file names from an XML list or something.

  • It all depends on the game, of course. Once you know the tools, you can work rapidly. That also means you could, instead, create a massive amount of content.

    This was 48 hours solo for me:

    Little Girl (ludum dare compo)

    This is an ongoing multi-year project:

    Courier

  • I've got a new trailer out that shows a ton more of the game! See snippets of bosses, enemies, dungeons, puzzles, environments, and more all set to original music!