Custom Music For Dungeon Editor

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
wingmaster003
Posts: 2
Joined: Mon Oct 06, 2014 3:37 am

Custom Music For Dungeon Editor

Post by wingmaster003 »

Hey just wondering if it was the same compared to Grimrock Dungeon Editor with adding custom music. Oh yeah and getting so excited for the game! :D
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Custom Music For Dungeon Editor

Post by antti »

Adding custom tracks is possible but it's done a different way now: you now need to define the ambient track similarly to other custom assets. Here's an example:

Code: Select all

defineAmbientTrack{
	name = "spooky",
	filename = "mod_assets/sounds/spooky.ogg",
	volume = 0.18,
}
Workflow for importing custom assets still remains the same: init.lua (under mod_assets\scripts) is run when the mod is started and you need to add the definition to one of the imported files. In this case you could add the definition into your own music.lua file or use the pre-existing sounds.lua for example.
Steven Seagal of gaming industry
DrKojak
Posts: 23
Joined: Fri Oct 24, 2014 11:19 am

Re: Custom Music For Dungeon Editor

Post by DrKojak »

Thanks, this helped!
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Custom Music For Dungeon Editor

Post by NutJob »

Sweet, did Slayer's Reign in Blood fall into public domain yet? ~laughs~
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Custom Music For Dungeon Editor

Post by AndakRainor »

Hello!
So, how are we supposed to encode the ogg sound files ? I tried an online converter with a wav file that works fine in my custom dungeon and the resulting ogg plays far too quickly (only grimrock plays it too fast) ! What parameters should I check ?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Custom Music For Dungeon Editor

Post by minmay »

First off, I wouldn't trust an online converter to produce reasonable-quality ogg files. I'd much rather use something like Audacity where you're guaranteed that the software is using a recent, good encoder.

That aside, you probably either:
1. gave Grimrock tracks at a frequency other than 44100Hz
or 2. "converted" a non-44100Hz wav to 44100Hz Vorbis without resampling, which means you sped it up or slowed it down
The solution is to not do either of those.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Custom Music For Dungeon Editor

Post by AndakRainor »

Same result, the track is mono 44100Hz, as is the wav file (or else the wav would never have been played in game).
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Custom Music For Dungeon Editor

Post by minmay »

That's your problem then. You could call Grimrock's music demuxing a bit lazy, in that it doesn't check to see if the music is actually stereo in the first place before demuxing as if it's stereo. As a result, a mono track will appear to play at double speed to a human ear. Ambient tracks must be stereo to play back correctly.

(Also, EWWW, why would you ever want to use a mono ambient track in the first place? :( )
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Custom Music For Dungeon Editor

Post by AndakRainor »

I don't ! I'm not in charge of the music/sound for this mod, I just have to know what the technical specifications are so the person in charge can do his job.
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Custom Music For Dungeon Editor

Post by Dr.Disaster »

AndakRainor wrote:I don't ! I'm not in charge of the music/sound for this mod, I just have to know what the technical specifications are so the person in charge can do his job.
Specs are as minmay said:
- sounds (wav format) are mono 44100hz
- music (mp3 or ogg format) needs to be stereo 44100Hz
Post Reply