Is adding music possible?

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Elucca
Posts: 1155
Joined: Tue, 30. Oct 07, 18:46
x3tc

Is adding music possible?

Post by Elucca »

I know you can replace music. That's easy, just replace the file.
But is it possible to add more? I've got plenty of fitting tracks, but they'd only get old if i had about 2 at a time.

Edit: Hmm, i just recalled XTM did it, so it's definitely possible. Does it require some special modding tool?
fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud »

Yes you can, but it requires a little work.

You have to edit the universe file and add/change the new tracks you want to each sector. In my last game I had about 260 individual tracks.

The catch is, when you edit the universe/map file, you need to start a new game for the changes to take affect.

The other hard thing right now, is the lack of an editor. But you can change it in notepad/similar.

Example:

First line in x3_universe.txt (Kingdom End)

<o id="26" f="4" t="1" x="0" y="0" r="2" size="14000000" m="8101" p="1247631758"

Music track value in red.

As far as I know, there's still only 5 "battle" tracks, which I was hoping they'd expand on.
Elucca
Posts: 1155
Joined: Tue, 30. Oct 07, 18:46
x3tc

Post by Elucca »

Well, having to start a new game kinda breaks it for me. That, and i was mainly looking to add more battle music.

Thanks for the help anyway.
SSwamp_Trooper
Posts: 207
Joined: Sun, 29. Apr 07, 17:58
x3tc

Post by SSwamp_Trooper »

I haven't found a way to have more battle music other than just replacing it :(
jlehtone
Posts: 22500
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

@Elucca and fud: Could you add some details, like where to put/replace the tracsk; format; how to name the files; etc? What you already have here looks like a start of a "tutorial and resource", so I added a link to the sticky. A bit more flesh on the bones by you, and the link is fully justified, don't you think? ;)
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud »

I'll skip the replacing of tracks, as that's just renaming them (if memory serves, 00019-00040 are the sector tracks, with 08101-08105 (give or take) being the specials, like Kingdom End, Seizewell, etv).


To add a new sector track:

Step 1:

Take any mp3 you like. Bitrate really didn't seem to matter when I did it, I had some as high as 517Kb/s and others at 256/etc. As far as which codec, I don't know. I was using tracks that I ripped with EAC and Lame. I suppose as long as it's not something completely exotic, it should work.

Rename them to anything you want, I used numeric values, I didn't test alpha-numeric, but I don't know why it wouldn't work. Drop them in the "x3 terran conflict\soundtrack\" folder.

Step 2:

Editing the x3_universe file (universe map, that has every bit of data in it for all sectors in the game).

Since there's no updated editor, the instructions here are a little different than they were in X3R. But, you'll still use Doubleshadow's X3R mod manager [held for link].

Once you have the mod manager installed, launch it and "open" 03.cat in the x3 terran conflict folder. Inside that catalog, scroll down to \map\x3_universe.pck, right click and extract.

Close mod manager.

Go to the location you extracted the universe file, open it with winrar/7zip, whichever you have/choose (I have winrar).

Extract the file.

Rename the file (which won't have an extension) to x3_universe.txt.

Now you can edit it in notepad/notepad2 (whichever you choose).

On the first line of any given sector entry, is the x/y coordinates and the music track.

From the post above:

<o id="26" f="4" t="1" x="0" y="0" r="2" size="14000000" m="8101" p="1247631758"

Music track value in red.

Change that to correspond with your file, and you should have your own music in the game. it definitely adds a lot to it when each sector has it's own unique track.

You can either put the file back into a cat and use it as a mod/false patch, or, you can drop it in the "x3 terran conflict\map\folder", making one if there's not one there. I will say this is untested, as I've only done this in X3R, and this ability wasn't there for it. But I do have modded files in subfolders in the main install folder that work, without needing a cat/dat pair like in R.


This WILL require a new game start though.


As for the battle music, I've looked in every conceivable file to see if ANYTHING references it, and I can't seem to find it. It leads me to believe it's in the code somewhere... Really wish you could change/add those as well. 5 tracks for a game that you're in battle 80% of the time (well, ME anyway ;)) gets a little monotonous. I end up lowering the music volume to 0 as a result, and it's a shame.

If this confuses anybody, speak up and I'll try to clarify. "Technical Writing" wasn't really a class I excelled at in college. :p
User avatar
Elffin
Posts: 371
Joined: Wed, 18. May 05, 22:34
x3tc

Post by Elffin »

nice tutorial Fud. 8)

quick question tho...

are you allowed more than 5 battle tracks in TC (yet to get it...) won't b long tho...
fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud »

No. It's just like R, there are 5 and ONLY 5, which is a let down. Like I said, I looked through every file and found nothing referencing those tracks.

Apparently, no one else has either. After more than 2 years, if it was there, you'd think someone would have found it.
cucher
Posts: 126
Joined: Tue, 14. Oct 08, 12:56

Did you like music in Home of Light? Want it back?

Post by cucher »

I always liked the background music in HoL sector. It's one of a kind, very tranquil and nice. Why it was replaced by just ordinary track which sounds also in other sectors? May be it'll be better to bring the old track back? Can you, guys?

P.S. I know that it's possible to replace files in sound game folder, but in this case the same track will be playing in other sectors. My proposal is to bring back the melody for HoL only.


{Merge to thread that already has the answer. jlehtone}
cucher
Posts: 126
Joined: Tue, 14. Oct 08, 12:56

Post by cucher »

So, my post was moved from Tech thread... Therefore let me ask few questions here. I assume that after changing of Universe file, the game will be "modified", won't it? If the answer is "yes", then it's not my case. I've tried to pay attention to possibility of bringing back the old HoL track without having "modified" game. Pleased to hear.
fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud »

I don't know if it puts the game into modified mode or not.


Guess I've never understood why that's such a big thing. :shrug:

If you can get the game to play how you want, what's it hurting?
cucher
Posts: 126
Joined: Tue, 14. Oct 08, 12:56

Post by cucher »

I'm planning to post my stats to Ego site. It'll be impossible with "modified" tag.
fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud »

I see.

That never bothered me. I don't want people to see how bad I suck anyway. :)
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

You can still post your stats. It's just placed in the modified category rather than the normal category.
Irrational factors are clearly at work.
cucher
Posts: 126
Joined: Tue, 14. Oct 08, 12:56

Post by cucher »

Yes, but for me "modified" results are equal to "zero" results. Who knows how the "modified" game is actually modified? Nobody can tell.
shireknight
Posts: 1094
Joined: Mon, 9. Feb 04, 21:31
x3tc

Post by shireknight »

Sorry fud I admit I read your instructions but I'm still a bit confused about something.

I don't want to add any new tracks but I do want to swap around some of the sector music. For instance I find that a lot of the sectors have very quiet/dull music but I love the music in the Mars sector and some of the other sectors as well, is there a way I can have say the Mars music playing in some of the other quieter sectors please mate?
My (new) PC:-

Intel® Core™ i7-4770 processor (3.4 GHz, 8 MB cache)
Microsoft Windows 10
16 GB DDR3 Ram
NVIDIA GeForce GTX 1060 6 GB GDDR5
fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud »

One way to do that, is to take the track played in Mars (08508.mp3), copy/paste it, then rename it to one of the main tracks (00019-00040).

That'll get it into a few more sectors, and you won't have to edit anything.

So:

1. \x3 terran conflict\soundtrack
2. Copy/paste 08508.mp3
3. Rename to anything between 00019.mp3 and 00040.mp3.


The new sectors have (fairly) unique tracks to themselves. Renaming something to the 00019-00040 batch is a blanket change, as the other 150 or so sectors share these 20-odd tracks. There are about 5-10 original X3R sectors that had tracks to themselves, Siezewell, Kingdom End, to name a couple.
shireknight
Posts: 1094
Joined: Mon, 9. Feb 04, 21:31
x3tc

Post by shireknight »

fud wrote:One way to do that, is to take the track played in Mars (08508.mp3), copy/paste it, then rename it to one of the main tracks (00019-00040).

That'll get it into a few more sectors, and you won't have to edit anything.

So:

1. \x3 terran conflict\soundtrack
2. Copy/paste 08508.mp3
3. Rename to anything between 00019.mp3 and 00040.mp3.


The new sectors have (fairly) unique tracks to themselves. Renaming something to the 00019-00040 batch is a blanket change, as the other 150 or so sectors share these 20-odd tracks. There are about 5-10 original X3R sectors that had tracks to themselves, Siezewell, Kingdom End, to name a couple.
wow if I read you correctly what your saying is that whenever you enter one of these 150 or so sectors a soundtrack for it is just picked at random from the 19-40 tracks so If I go though all those tracks and copy over the ones I'm not keen on with the tracks I am keen on then my favourite tracks will just start popping up randomly around these 150 odd sectors and Ill be guaranteed to like every one of them.

Wow that's even better than I was hoping for, I thought I'd have to assign a track to each sector one by one -thanks a lot fud :D :D :)
My (new) PC:-

Intel® Core™ i7-4770 processor (3.4 GHz, 8 MB cache)
Microsoft Windows 10
16 GB DDR3 Ram
NVIDIA GeForce GTX 1060 6 GB GDDR5
shireknight
Posts: 1094
Joined: Mon, 9. Feb 04, 21:31
x3tc

Post by shireknight »

Finally got a chance to try this out today fud and it worked exactly as you said it would -I now have a truly glorious soundtrack :D

Cheers again mate :)
My (new) PC:-

Intel® Core™ i7-4770 processor (3.4 GHz, 8 MB cache)
Microsoft Windows 10
16 GB DDR3 Ram
NVIDIA GeForce GTX 1060 6 GB GDDR5
Nanook
Moderator (English)
Moderator (English)
Posts: 28245
Joined: Thu, 15. May 03, 20:57
x4

Post by Nanook »

shireknight wrote:...
wow if I read you correctly what your saying is that whenever you enter one of these 150 or so sectors a soundtrack for it is just picked at random....
Not quite, as I understand it. 'Shared' means that the Universe file assigns the same track to multiple sectors. As far as I can tell, the same track plays whenever you enter any given sector. You don't hear a different one each time. But by modifying the Universe file, and adding enough tracks, every sector can have its own unique soundtrack.

fud or someone else in the know can correct me if I've got something wrong. :wink:
Have a great idea for the current or a future game? You can post it in the [L3+] Ideas forum.

X4 is a journey, not a destination. Have fun on your travels.

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”