OpenXcom Forum
OpenXcom => Suggestions => Topic started by: Mr. Quiet on February 06, 2014, 03:13:26 am
-
I just found this: https://archive.org/details/Sounds_of_Nature_Collection (https://archive.org/details/Sounds_of_Nature_Collection)
and now I'm excited to add these environmental sounds into my game(after I edit them with tense ambient music of course), but I have to choose certain nature tracks so they blend in with every battlescape map. I hope this adds immersion to my game.
Here's my question. Is it possible for OXC to be able to play, for example "Jungle track 1" only when you enter a jungle map? I also want a City in Distress track for Terror-Sites too, if I could ever find one or find time to make one. I don't have time for anything these days :(
Can this be done by messing with the rulesets or something? I dunno anything about modding X-COM, so I'm at your mercy ;_;.
I apologize if this has already been posted before.
Thanks everyone!
Edit: If this can't be done through the game, I guess I can do it manually, but it'll be a pain. As soon as I land and know which map type it is, I save and exit, switch .ogg file to the map type track and get back on. I'll do it when I know I'm going to be in for at least an hour.
-
If this can't be done through the game, I guess I can do it manually, but it'll be a pain. As soon as I land and know which map type it is, I save and exit, switch .ogg file to the map type track and get back on. I'll do it when I know I'm going to be in for at least an hour.
I think using Winamp or Windows Media Player would be easier. :P
I really like the idea though.
-
https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/BattlescapeState.cpp#L485
_game->getResourcePack()->getRandomMusic("GMTACTIC")->play();
It is not currently possible. One would need to change the source to allow rulesets to change this.
If you have a tune or two that catches some guru's attention, it could get implemented quickly I think. Like, in v1.1.
-
so right now its impossible? thats sad i was really interesed on this feature,by now i just tab and hear the music track on my aimp3 and then tab again to the game :'(...a pretty lame solution xDDD
-
TFTD had this; how was it handled in that game?
-
TFTD had this; how was it handled in that game?
TFTD had two tracks, one for underwater and one for surface missions. We will consider expanding this flexibility to any mission type in the 1.0+ mod overhaul.
-
Thanks I'll do just that with VLC :)
If I ever have time, I'm gonna attempt to make a decent track using Audacity ;)
I just thought of something neat, adding military radio voice overs as well every couple minutes, but we'll see how that turns out.
Maybe this won't be answered, but I'll ask anyway.
How long or how big in size does a track have to be so that it'll begin to lag the game in anyway? Because if I do anything creative, I'm gonna think big and make a long track, with maybe the same music repeating, but different ambient sounds will appear, so it doesn't feel repetitive in one mission. Would an hour long track be okay? Size being under 100MB.
-
i don't THINK any track length would cause it any significant lag, it loads all the music into memory at startup, so you'd be looking at a longer initial load time, and a larger memory footprint. the engine itself needs about 5 meg of ram, so go nuts, but don't expect it to work too well with mobile devices.
-
Do you guys have ideas what rules could be defined, what would be the parameters for specifying music tracks?
The initial suggestion was battlescape, based on terrain type.
Mission type could be an additional parameter or the approximate number of live enemies.
On the geoscape, I could imagine starting a specific track if there are UFOs on the radar or having a different music in the early stage of the game.
Although, realistically, I doubt anyone would use all these features if they were available.
-
I think you might be on to something, hszp.
If we define certain "flags", maybe they could later be used to change the ambient music in certain ways? This wouldn't have to be used at first, but there appear to be people here who are interested in creating additional music tracks... also, maybe it could be possible to change the music's pitch and/or tempo according to certain flags?
think about this: geoscape music changes to a slightly dramatic "alert"-type music when a UFO appears. you send an interceptor, and the music changes to a more "dramatic/battle" type of music. as your interceptor closes in on the UFO, its radar detects a second UFO - the music increases slightly in tempo (doesn't even have to be a noticeable difference... it will have a subliminal effect). if you happen to detect even more UFOs, each new one will increase the tempo even further... in heated air battles, this would probably increse the player's adrenaline levels without him/her ever noticing :)
the same would happen in the battlescape.
I would think of flags for these "situations":
geoscape:
- UFO detected (wait, does the music already change for that? I'm not sure and can't check right now)
- UFO shot down
- number of UFOs visible on the geoscape
- number of interceptors in the air
in dogfight:
- number of shots fired (?)
- amount of damage to participating interceptors
- amount of damage to UFO
battlescape:
- number of aliens visible in the battlescape
- number of soldiers wounded
- number of soldiers killed in this battle
- number of aliens killed in this battle
- number of soldiers with morale below certain threshold
- number of shots fired during turn (?)
I'm sure there's many more things that could influence the music... but do you think this could be possible at all, Warboy? How difficult would it be to include more music tracks? And would it be possible at all to change pitch and tempo according to "situations" as above?
-
Changing the tempo may sound like a good idea, however the SDL library which is used by OpenXcom does not let you mix the music to this extent.
-
I intend to make a patch to support the feature in the subject of this topic and a little more: choosing music depending on mission type + terrain type
An example of the ruleset I'm aiming at:
- type: GMTACTIC_CRASHSITE_COLD.ogg
overrides: CRASHSITE
terrain:
0: POLAR
1: MOUNT
- type: GMGEO_REPLACEMENT.ogg
overrides: GMGEO1
- type: GMGEO_ADDITIONAL.ogg
extends: GMGEO
This would
1. define a specific music file for arctic and mountain missions.
2. override one of the geoscape tracks
3. add an additional geoscape tracks
I may decide to simplify it further. I would not want to make it any more complex as this will be my first shot at contributing code to OpenXcom.
-
Thank you so much hszp! I have another suggestion that will be more specific, but I'm asking for too much. I'm happy with this ;)
Thank you!
-
I've managed to compile and do some modifications, overriding the built-in tracks 1:1 is possible in this branch, but not depending on terrain type:
https://github.com/szabopeter/OpenXcom/tree/MusicRuleset
-
I had some second thoughts on this topic. Now I want to move the basic music definitions to the rulesets not just hack in the additional music files.
So a part of Xcom1Ruleset.rul will look something like
music:
- type: GMDEFEND
midipack: 3
- type: GMENBASE
midipack: 6
- type: GMGEO
files:
GMGEO1: 0
GMGEO2: 18
GMGEO3
GMGEO4
- type: GMINTER
midipack: 2
- type: GMINTRO1
midipack: 19
- type: GMINTRO2
midipack: 20
- type: GMINTRO3
midipack: 21
- type: GMLOSE
midipack: 10
- type: GMMARS
midipack: 9
- type: GMNEWMAR
midipack: 8
- type: GMSTORY
midipack: 12
- type: GMTACTIC
terrain: [CULTA, DESERT, FOREST, JUNGLE, MOUNT, POLAR]
files:
- GMTACTIC: 17
- GMTACTIC2
- type: GMWIN
midipack: 11
And a mod could have something like this in its ruleset:
music:
- type: GMTACTIC
mode: replace
terrain: [FOREST, JUNGLE]
files:
- WILDFIRE
- type: GMTACTIC
mode: extend
terrain: [DESERT]
files:
- DUSTBITE
This way you could either replace or just extend the list from which the engine randomly chooses a track.
-
I would absolutely love this. :)
-
Well, there have been a few minor changes in the end as to how the ruleset looks like, but the idea has been 'materialized' into code in the end: https://github.com/szabopeter/OpenXcom/tree/MusicRules
What I plan to do before submitting the pull request:
- Compile a win32 version so that you don't have to compile if you want to give it a try
- Testing with alternative rules
- Code cleanup
-
Test data (Music files from https://lorcan.freelanzer.com/)
# Lorcán - Cydonia's Fall OST
music:
- type: GMDEFEND
files: [ UFOCF-OST/Defend Base - Lorcan ]
- type: GMENBASE
files: [ UFOCF-OST/Lightning War - Lorcan ]
- type: GMGEO1
files: [ UFOCF-OST/Geoscape (Part I) - Lorcan ]
- type: GMGEO
files:
- UFOCF-OST/Geoscape (Part I) - Lorcan
- UFOCF-OST/Geoscape (Part II) - Lorcan
- UFOCF-OST/UFOpedia - Lorcan
- UFOCF-OST/Waiting - Lorcan
- type: GMINTER
files: [ UFOCF-OST/Interception - Lorcan ]
- type: GMINTRO1
files: [ UFOCF-OST/Intro (Part I) - Lorcan ]
- type: GMINTRO2
files: [ UFOCF-OST/Intro (Part II) - Lorcan ]
- type: GMINTRO3
files: [ UFOCF-OST/Intro (Part III) - Lorcan ]
- type: GMLOSE
files: [ UFOCF-OST/Lose Game - Lorcan ]
- type: GMMARS
files: [ UFOCF-OST/Debriefing - Lorcan ]
- type: GMNEWMAR
files: [ UFOCF-OST/Mars Briefing - Lorcan ]
- type: GMSTORY
files: [ UFOCF-OST/The Story - Lorcan ]
- type: GMTACTIC
terrain: [CULTA, DESERT, FOREST, JUNGLE, MOUNT, POLAR, UBASE, URBAN]
files: [ UFOCF-OST/Tactical Battle - Lorcan ]
- type: GMTACTIC
terrain: [MARS, XBASE]
files: [ UFOCF-OST/Far From Earth - Lorcan ]
- type: GMWIN
files: [ UFOCF-OST/Win Game - Lorcan ]
- type: GMGRAVES
files: [ UFOCF-OST/Nightbird Theme - Lorcan ]
-
Here is the windows binary: https://bit.ly/1i0iOb8 (3.54MB)
-
Nice job! :)
I assume all the file-items in the "files" part (in the ruleset file) are required to be exist in the file-system...
-
Thanks, Fenyő!
Yes, the specified files are absolutely mandatory. If any of them are missing, you get a nice error message right after loading the rules. But if you override the standard rules, the original music files are not needed and not loaded.
-
Well, is there any chance that this feature is actually implemented?
I have so many ideas on what to do with this... :)
-
It is implemented, there has also been a pull request (which I will have to update sometime), but it will probably not be merged any time soon.
-
It is implemented, there has also been a pull request (which I will have to update sometime), but it will probably not be merged any time soon.
Right of course, I meant merged. ;)
Seeing as the nightly build is updated several times a day, and that the new versions are actually useful, I don't really feel like experimenting with external exes. Especially if I have to compile them myself.