Custom music per civilization

ImageImageTalking about Modding for EE2 and EE2 AOS. New maps, patches, programs and Multiplayer scenarios.
Post Reply
User avatar
Gonzalo
Posts: 252
Joined: 24 Aug 2018, 08:56

Custom music per civilization

Post by Gonzalo »

I have tried to add a new region, MiddleAsia, so my Hindi Civ (Babylonian) can have a separate ambient music database. I modded (I think) all db files which affect regions (Regional settings), but still when the human player plays the hindi civilization, the music is fareastern.
Here is my code:

Code: Select all

//===========================================================================
// Copyright 2003 Mad Doc Software, LLC.  All rights reserved.
// $Header: /EE2X/src/EE2/DbHdrs/DbPlayerDefs.h 22    7/01/05 3:42p Dsproul $
//
// DESCRIPTION:   DbPlayerDefs.h has parser-readable player definitions.
//
// AUTHOR:        Rex Bradford
//
//===========================================================================

#ifndef DBPLAYERDEFS_H
#define DBPLAYERDEFS_H
#pragma once

#include "HdrMacros.h"


//	Player types

ENUM ePlayerType {
	kPlayerType_Human,		// human-controlled player
	kPlayerType_Computer,	// AI-controlled player
	kPlayerType_Observer,	// just watching a game @NOTE this is just a hack to facilitate
							// setup of MP games with observers and is distinct from the
							// game ui being in observer mode
							
	kPlayerType_Invalid = -1,	// invalid player type
};

//	Player civilizations
//  @NOTE: IF THIS CHANGES IN SOME WAY, MAKE THE CORRESPONDING CHANGE IN THE CIV ENUM
//  OF  DbTechTreeDefs.h!!!!!  Also there is a routine called CivilizationToRegion in
//	PlayerDefs which would need to be updated.
ENUM ePlayerCivilization {
	// West region
	kPlayerCivilization_German = 0,	//0
	kPlayerCivilization_English,	//1
	kPlayerCivilization_Roman,		//2
	kPlayerCivilization_American,	//3
	kPlayerCivilization_Greek,		//4
	
	// FarEast region
	kPlayerCivilization_Chinese,	//5
	kPlayerCivilization_Korean,		//6
	kPlayerCivilization_Japanese,	//7	@NOTE: IF CHANGING THIS, SEE NOTE ABOVE!!!

	// MiddleEast region
	kPlayerCivilization_Egyptian,	//8
	kPlayerCivilization_Turkish,	//9
	
	// MiddleAsia region
	kPlayerCivilization_Babylonian,	//10

	// MesoAmerican region
	kPlayerCivilization_Inca,		//11
	kPlayerCivilization_Aztec,		//12
	kPlayerCivilization_Mayan,		//13

	// African Region
	kPlayerCivilization_Maasai,		//14
	kPlayerCivilization_Zulu,		//15

	//@EE2X part of the West region.  cannot be stuck with the rest of the west region because EE2 would not be correct anymore
	kPlayerCivilization_French,		//16
	kPlayerCivilization_Russian,	//17

	kNumPlayerCivilization,
	kPlayerCivilization_Random = -1,	// random; list before unused for settings.cfg readability
	//kPlayerCivilization_Unused = -1,

	// @EE2X custom civs are marked thusly
	kPlayerCivilization_Custom = -2,

	//Enumerations to mark the first/last civs in each region:
	
	// western
	// @NOTE be careful when iterating, not all civs are contiguous in EE2X!
	kPlayerCivilization_FirstWestern = kPlayerCivilization_German,
	kPlayerCivilization_LastWestern = kPlayerCivilization_Russian,
	
	// FarEast
	// @NOTE be careful when iterating, not all civs are contiguous in EE2X!
	kPlayerCivilization_FirstFarEast = kPlayerCivilization_Chinese,
	kPlayerCivilization_LastFarEast = kPlayerCivilization_Japanese,
	
	// MiddleEast
	// @NOTE be careful when iterating, not all civs are contiguous in EE2X!
	kPlayerCivilization_FirstMiddleEast = kPlayerCivilization_Egyptian,
	kPlayerCivilization_LastMiddleEast = kPlayerCivilization_Turkish,

	// MiddleAsia
	// @NOTE be careful when iterating, not all civs are contiguous in EE2X!
	kPlayerCivilization_FirstMiddleEast = kPlayerCivilization_Babylonian,
	kPlayerCivilization_LastMiddleEast = kPlayerCivilization_Babylonian,


	// Meso american
	// @NOTE be careful when iterating, not all civs are contiguous in EE2X!
	kPlayerCivilization_FirstMesoAmer = kPlayerCivilization_Inca,
	kPlayerCivilization_LastMesoAmer = kPlayerCivilization_Mayan,

	// African 
	// @NOTE be careful when iterating, not all civs are contiguous in EE2X!
	kPlayerCivilization_FirstAfrican = kPlayerCivilization_Maasai,
	kPlayerCivilization_LastAfrican = kPlayerCivilization_Zulu,

}; // enum PlayerCivilizatio...

// @EE2X not all civs in a region are contiguous, doh!
// how many civs in each region?
const int kNumWesternCivs = 7;
const int kNumFarEastCivs = 3;
const int kNumMiddleEastCivs = 2;
const int kNumMiddleAsiaCivs = 1;
const int kNumMesoAmericanCivs = 3;
const int kNumAfricanCivs = 2;

ENUM myCivs {
	Aleman,
	Ingles,
	Romano,
	Espanol,
	Holandes,
	Chinos,
	Coreano,
	Japones,
	Marruecos,
	Turco,
	Hindu,	
	Inca,
	Azteca,	
	Venezolano,
	Masai,
	Zulu,	
	Frances,
	Ruso,	
};	
	



//---------------------------------------------------------------------------------------------
//@NOTE if someone add a region, do not forget to add a initial for that particular region in:
// SRC\EE2\PLAYER\PlayerCivilisation.h under the function GetRegionalPostFix()
//
ENUM eCivilizationRegion {
	kCivilizationRegion_West = 0,
	kCivilizationRegion_FarEast,
	kCivilizationRegion_MiddleEast,
	kCiviliationRegion_MiddleAsia,
	kCivilizationRegion_MesoAmerican,
	kCivilizationRegion_African,
	

	kNumCivilizationRegion,

	// invalid region!
	// putting this last so we don't screw things up
	kCivilizationRegion_Invalid = -1,
};

//	Player colors

ENUM ePlayerColor {
	kPlayerColor_Blue,
	kPlayerColor_Red,
	kPlayerColor_Green,
	kPlayerColor_Orange,
	kPlayerColor_Magenta,
	kPlayerColor_Cyan,
	kPlayerColor_Yellow,
	kPlayerColor_Lavender,
	kPlayerColor_Purple,
	kPlayerColor_Gold,

	kPlayerColor_LastAvailableToNonWorldPlayer = 9,		// should be same as previous entry

	kPlayerColor_Grey,
	kPlayerColor_WorldPlayerColor = 10,		// should be same as previous entry
	
	kPlayerColor_NativeTribePlayerColor = 10,

	kPlayerColor_Num,
};



#endif // DBPLAYERDEFS_H

Code: Select all

//	DbMusic.ddf - music db records
//	------------------------------
//
//	Shell looping music

DbMusicCtrlLoopSetDef music_fe
{
	filenames = [ "BattleAtWitchCreek.mp3" "BattleAtWitchCreek.mp3"
	]
}

//
//	In-game ambient music
//

DbMusicCtrlGameAmbientDef music_ingame
{
	regionSets = [
	{
	region = West
	filenames = ["amb_we_1.mp3" "amb_we_2.mp3" "amb_we_3.mp3" "amb_we_4.mp3"
			"amb_we_5.mp3" "amb_we_6.mp3" "amb_we_7.mp3"
			"amb_we_8.mp3" "amb_we_9.mp3" "amb_we_10.mp3"
			]
	}
	{
	region = FarEast
	filenames = ["amb_fe_1.mp3" "amb_fe_2.mp3" "amb_fe_3.mp3"
			"amb_fe_4.mp3" "amb_fe_4b.mp3" "amb_fe_5.mp3" "amb_fe_5b.mp3"
			"amb_fe_6.mp3" "amb_fe_6b.mp3" "amb_fe_6c.mp3" 
			"amb_fe_7.mp3" "amb_fe_8.mp3" "amb_fe_9.mp3" 
			"amb_fe_10.mp3" "amb_fe_11.mp3"
			]
	}
	{
	region = MiddleEast
	filenames = ["amb_me_1.mp3" "amb_me_1b.mp3" 
			"amb_me_2.mp3" "amb_me_2b.mp3" "amb_me_2c.mp3" "amb_me_2d.mp3" "amb_me_2e.mp3"
			"amb_me_3.mp3" "amb_me_4.mp3" "amb_me_5.mp3" "amb_me_6.mp3" 
			"amb_me_7.mp3" "amb_me_8.mp3" "amb_me_9.mp3" "amb_me_10.mp3"
			"amb_me_11.mp3" "amb_me_11b.mp3" "amb_me_11c.mp3"
			"amb_me_12.mp3" "amb_me_13.mp3" 
			]
	}
	{
	region = MiddleAsia
	filenames = ["amb_hindi_1.mp3" "amb_hindi_2.mp3" "amb_hindi_3.mp3"
			"amb_hindi_4.mp3" "amb_hindi_4.mp3" "amb_hindi_5.mp3" "amb_hindi_5.mp3"
			"amb_hindi_6.mp3"
			"amb_hindi_7.mp3" "amb_hindi_8.mp3" "amb_hindi_9.mp3" 
			"amb_hindi_10.mp3"
			]
	}
	{
	region = MesoAmerican
	filenames = ["amb_am_1.mp3" "amb_am_1b.mp3" "amb_am_1c.mp3" "amb_am_1d.mp3" "amb_am_1e.mp3" 
			"amb_am_2.mp3" "amb_am_2b.mp3" "amb_am_2c.mp3" "amb_am_2d.mp3" 
			"amb_am_3.mp3" "amb_am_4.mp3" "amb_am_5.mp3" "amb_am_6.mp3" "amb_am_7.mp3" "amb_am_8.mp3"
			]
	}
	// @EE2X @MRC
	// New African region music.
 	{
	region = African
	filenames = ["amb_af_1.mp3" "amb_af_2.mp3" "amb_af_3.mp3" "amb_af_4.mp3" "amb_af_5.mp3" 
			"amb_af_6.mp3" "amb_af_7.mp3" "amb_af_8.mp3" "amb_af_9.mp3" "amb_af_10.mp3" 
			"amb_af_11.mp3" "amb_af_12.mp3" "amb_af_13.mp3" 
			]
	}
	]

	epochSets = [
	{
	epochFirst = Stone
	epochLast = Industrial
	filenames = []		// no early-epoch music
	}
	{
	epochFirst = Modern
	epochLast = Digital
	filenames = ["amb_mid_late_1.mp3" "amb_mid_late_2.mp3" "amb_mid_late_3.mp3" 
			"amb_mid_late_4.mp3" "amb_mid_late_5.mp3" "amb_mid_late_6.mp3" 
			"amb_mid_late_7.mp3" "amb_mid_late_8.mp3"]
	}
	{
	epochFirst = Genetic
	epochLast = Synthetic
	filenames = ["amb_mid_late_1.mp3" "amb_mid_late_2.mp3" "amb_mid_late_3.mp3" 
			"amb_mid_late_4.mp3" "amb_mid_late_5.mp3" "amb_mid_late_6.mp3" 
			"amb_mid_late_7.mp3" "amb_mid_late_8.mp3"]
	}
	]

	fracSilentPieces = 0.5
	timeSilenceLow = 20
	timeSilenceHigh = 30
	numLoopsLow = 2
	numLoopsHigh = 4
}


Any help/hints would be greatly appreciated.

User avatar
Dr.MonaLisa
High Representative
Posts: 8023
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: Custom music per civilization

Post by Dr.MonaLisa »

Is it an April joke on Christmas day?
// MiddleEast
// @NOTE be careful when iterating, not all civs are contiguous in EE2X!
kPlayerCivilization_FirstMiddleEast = kPlayerCivilization_Egyptian,
kPlayerCivilization_LastMiddleEast = kPlayerCivilization_Turkish,

// MiddleAsia
// @NOTE be careful when iterating, not all civs are contiguous in EE2X!
kPlayerCivilization_FirstMiddleEast = kPlayerCivilization_Babylonian,
kPlayerCivilization_LastMiddleEast = kPlayerCivilization_Babylonian,
How the hell is this supposed to work, if it has duplicated entries?

A cherry on a cake is:
ENUM eCivilizationRegion {
kCivilizationRegion_West = 0,
kCivilizationRegion_FarEast,
kCivilizationRegion_MiddleEast,
kCiviliationRegion_MiddleAsia,
kCivilizationRegion_MesoAmerican,
kCivilizationRegion_African,


kNumCivilizationRegion,

// invalid region!
// putting this last so we don't screw things up
kCivilizationRegion_Invalid = -1,
};
Even the line length doesn't match. It's not normal to leave misspellings in game files like this. Then you'll come on Support Chat accusing that the newest Developers Version update "doesn't work" as you usually do?
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
User avatar
IndieRock00
Posts: 50
Joined: 16 Jun 2019, 17:38

Re: Custom music per civilization

Post by IndieRock00 »

InideRock music??
Long life and prosperity. 🖖
User avatar
Gonzalo
Posts: 252
Joined: 24 Aug 2018, 08:56

Re: Custom music per civilization

Post by Gonzalo »

Thanks

Added after 1 hour 25 minutes 12 seconds:
I corrected those mistakes and still babylonian civilization uses middle eastern music in game... =(

Added after 1 minute 20 seconds:
There are some people who are interested in this mod, as I see at discord...

Added after 1 minute 39 seconds:
I am not accusing anyone of anything, not in recent months. I have no actual regret of your patch.
User avatar
Dr.MonaLisa
High Representative
Posts: 8023
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: Custom music per civilization

Post by Dr.MonaLisa »

I don't like to sound conflictive, but there are always "so many people" interested in your mods, and at the end you never share them with others. It's fine to mod for yourself, but then, don't use other people as an argument to get help faster, lol.
I am not accusing anyone of anything, not in recent months. I have no actual regret of your patch.
I wanted to bring your attention on the fact, that such mistakes as visible above are unacceptable for someone who's modding the game for around 10 years now. You should read the changes you made at least 1 time before posting a topic.

I don't know if the things you're doing make any sense.
Regions are hardcoded, there are region bonuses, regional power, regional model suffixes and many other things that I don't remember now. Music is just 1 of those things. How do you expect to modify 2 files and get a new region fully working? It looks for me like you're getting a pleasure from seeing unhandled exception crashes.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
User avatar
Gonzalo
Posts: 252
Joined: 24 Aug 2018, 08:56

Re: Custom music per civilization

Post by Gonzalo »

It's OK. Perhaps regions can't be created or deleted.
Post Reply

Return to “EE2 files, modding, maps, testing, etc.”