Jump to content


Photo

AI crashes when playing my new faction.


  • Please log in to reply
13 replies to this topic

#1 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 22 March 2011 - 11:51 AM

I have remade Rohan as a playable faction and have playing as them for days. Every time I finish a new unit of a new structure or whatever, I go and test it. It is all fine as far as I can see. I have made every structure, unit and hero, I have leveled them all to max and with every upgrade and used every ability/button. It all caused no crashes.

I added the faction to the AI and began to test but from the first attempt, the faction crashed 10/15 mins in. I have noticed that if after 5 mins into a game, I send Rohan some money through the Ally window, that they will attempt to spend it on the thing that causes the crash and immediately cause the game to crash.

Has anyone got any idea what could possibly be causeing this?

Thanks a million Guys.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#2 DIGI_Byte

DIGI_Byte

    Unitologist

  • Hosted
  • 1,747 posts
  • Location:Australia
  • Projects:GTFO
  •  Everybody do the Flop!

Posted 22 March 2011 - 12:22 PM

I'm guessing The AI is trying too purchase something that doesn't exist, its not a fault with the faction as you have tested everything manually, the problem lays in the AI code to build something, I suggest going over the code and making sure your spelling is right and everything matches up with the factions assets


Lyon-Fixed.gif
RIP 2323


#3 Elrond99

Elrond99

    title available

  • Hosted
  • 464 posts
  • Location:Austria
  • Projects:None at the moment
  •  Modder without work and time :-S

Posted 22 March 2011 - 02:37 PM

It´s probably the CaH, remove it from skirmishaidata.ini

#4 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 22 March 2011 - 06:58 PM

Thanks for the replies guys.

There's no CaH's in my skirmishaidata.ini, I wonder if you meant in the playertemplate.ini? Also, I have no CaH's on the map setup im using to test everything.

I think its something to do with the Fortress though, I have removed everything else at one point or another and it still crashes. I have removed all the Heroes and it still crashes so think its not them. I think it might be something to do with the ExpansionPads but I cant seem to find any thing there yet.

Added: Righty, I just removed all the commandsets from the ExpansionPads but it still crashed. I then removed all the upgrades from the fortress commandset but that didn't work so now Im well baffeled. Its a reall stumper!!! lol.

Edited by Titan Cronus, 22 March 2011 - 07:26 PM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#5 DIGI_Byte

DIGI_Byte

    Unitologist

  • Hosted
  • 1,747 posts
  • Location:Australia
  • Projects:GTFO
  •  Everybody do the Flop!

Posted 22 March 2011 - 07:43 PM

could the problem be with the map? you can test it by using a different Faction for the AI, one that is stable.

if it doesn't crash then you know for sure its that faction, if you still cant find it then maybe post the code for that faction and its buildings and have others check over it, something is wrong and its hiding in a hard to find place...

could it be a building upgrade? like a level 3 barracks or forge and... no you said you tested it... manually and it all worked for you... well I'm lost, has to be an AI conflict of some sort if its not that map.


Lyon-Fixed.gif
RIP 2323


#6 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 22 March 2011 - 09:02 PM

Cheers for the reply.

No, deff not the map, I have been using this particular map for testing new factions for ages now. The only changes the map has is when I add the new player to the player list.

Yep, the first thing I thought was actually the structure upgrades but I have taken all the structures out one be one. I even took out all the buildings completley (so it was just the fortress) just to make sure.

It's quite strange really, everything is just an edited copy of something else so I know it all should work. It's only the usual things that have been changed, like models, animations and commandsets really. This is like the fifth faction that I have made now so I have a pretty good idea what Im doing but this is just soo oddd.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#7 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 22 March 2011 - 09:33 PM

Could it be a fortress upgrade? ^_^ because lets look at the notes...

1- Has to be the fortress.
2- I didn't see you mention taking out the fortress upgrades.
3- The AI does upgrade its fort sooner or later.
IMPORTANT: 4- It has to do with money because when it gets enough it probable buys the upgrade and when the upgrade is finished it probably makes the game crash.

I am just thinking about it logically... I did see you mention that you took out upgrades but it doesn't say you did it for the fortress... Could it possible be the Hex coding?

Those are my 2 best guesses...

Hopefully this helps... you could also check by going to Playertemplate.ini and change the factions fortress to lets say goblins and see if it still crashes...

Edited by Dragon Rider, 22 March 2011 - 09:35 PM.


#8 Kwen

Kwen

    Vileartist

  • T3A Staff
  • 4,865 posts
  • Location:Korea I wish
  • Projects:It'sa secreeet
  •  T3A's First N00b
  • Division:BFME
  • Job:T3A Expert
  • Donated

Posted 22 March 2011 - 09:51 PM

What makes you assume it has to be the Fortress? He said he thinks it's the Fortress. ^_^

Though you are right, testing the AI with a different fortress would determine if the problem lies there.

                           https://www.twitch.tv/vileartist - Yes shameless self-promotion

          ----------------------------------------------------------------------------------------------------------------------

                            "Old modders never die, they just fade away" ~ Hostile


#9 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 22 March 2011 - 10:07 PM

I removed the upgrade buttons from the fortress commanset so that they couldn't be baught , do you think that would have worked for the IA?

I'll go swap the fortress now and see if that helps.

Thanks a million ; )

Added: I just swapped the fortress for the Angmar one and it still crashed when I gave them some money.
Earlier I was seeing how much money I had to give them before they tried to buy what ever it is thats crashing the game. I waited until they had 500/600 and then would give them another 1000 but this would not cause a crash. I could pretty much see what they spent the money on, the moment I sent the money, the builder would run off and start building something. Sometimes I would see a few hundred get spent and shortly after a unit would emerge. I then tried sending 1500 and that caused a crash.
Sooo.... I reckon that it is quite possible that whatever they're spending it on costs about 1500/2100. The only things that cost that much that I can think off are the rohan heroes but it crashed even with all them removed. I thought of the strusture upgrades again but I removed all the strustures too, and have also seen all of them level up to level2 and some to level3 so really can't be them. I'll just have to keep looking. ^_^

Edited by Titan Cronus, 22 March 2011 - 10:43 PM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#10 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 23 March 2011 - 09:49 PM

Ok, I just commented out every button on the porters commandset execpt the farm and then commented out avsolutly everythng on the fortresses and expansionpads commandsets (so all the ai could was build farms) and it still shat out (crashed).

WTF is going on?! ^_^

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#11 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 25 March 2011 - 12:09 AM

Heres the code from the playertemplate.ini and the skirmishaidata.ini files. If anyone could maybe have a look and see if anything look wrong, I would be very greatful. Like I said before, its only copied and edited code so should work find but maybe theres something conflicting with some old Rohan stuf or something.

ArmyDefinition RohanArmy

	Side = Rohan

	;//
	;// PRODUCTION AI PARAMETERS
	;//

	MustUseCommandPointPercentage_Phase1 = 90%	;// The AI UnitBuilder tries to keep the army at at least this size
	MustUseCommandPointPercentage_Phase2 = 80%
	MustUseCommandPointPercentage_Phase3 = 75%

	StructureRebuildPriorityModifier = 200%

	DefaultUnitPriority = 100.0f;				;// The default build priority for a unit for which there is no ugrency
	FortressRebuildPriority = 1950.0f;			;// Priority at which a fortress will rebuild
	
	LowUnitPriorityModifier_Rush	= 50.0			;// When we are low on units we multiply percentCommandPtsUsed/100 * <this number>
	LowUnitPriorityModifier_MidGame	= 80.0			;//		then add the result to the current unit priority in the build queue
	LowUnitPriorityModifier_EndGame	= 100.0			;//		(the bigger this number is the faster a unit will bubble to the top when
													;//		we're low on units)

	EconomyBuilderMinFarmsOwned = 5
	EconomyBuilderMinMoney = 200
	EconomyBuilderPerFarmValue = 70
	EconomyBuilderPerSecPriorityIncreaseBase = 30.0
	EconomyBuilderMinTimeBetweenFarms_Rush = 15.0f;
	
	PercentToSave_Rush	= 1.0%
	PercentToSave_MidGame	= 3.0%
	PercentToSave_EndGame	= 4.0%

	PhaseDuration_Rush = 270.0	;//amount of time in seconds from the beginning of a match
	PhaseDuration_MidGame = 280.0 ;//amount of time in seconds from end of Rush Phase
	
	ChanceForUnitsToUpgrade 		= 80%
	UpgradeSciencePriorityNormalLow		= 200.0
	UpgradeSciencePriorityNormalHigh	= 700.0
	UpgradeSciencePriorityImportantLow	= 750.0
	UpgradeSciencePriorityImportantHigh	= 1000.0
	UnitUpgradePriorityLow	= 100.0
	UnitUpgradePriorityHigh	= 200.0


	;//
	;// TEAM BUILDER PARAMETERS
	;//

	MaxThreatForOpportunityTargets = 10.0	;//when building a team for opportunity targets, what will the team builder use as
						;//an assumed threat when building the team

	ValueToSetForMaxOnDefenseTeam = 10	;//the max number of each type of unit will get recruited onto a defense team
	
	;//If there are no currently built units of the specific type an AI constructed team is looking for
	;//it can search for replacements of a different type that are already built
	;//these numbers control how deep along the Combat Chain definition the AI will search for replacements
	CombatChainSearchDepthForTeamRecruits_AttackTeams	= 2;
	CombatChainSearchDepthForTeamRecruits_DefenseTeams	= 7;
	CombatChainSearchDepthForTeamRecruits_ExploreTeams	= 7;

	
	;//
	;// TACTICAL AI PARAMETERS
	;//
	
	;// the number and types of targets that the AI is simultaneously interested in at any given point
	TacticalAITargets = DEFENSIVE	ENEMY_STRUCTURE	OPPORTUNITY 	EXPANSION	;//ENEMY_STRUCTURE DEFENSIVE OPPORTUNITY OPPORTUNITY
	MaxTeamsPerTarget = 1		2		1		1

	SecondsTillTargetsCanExpire = 14.0
	ChanceForTargetToExpire = 50%

	MaxBuildingsToBeDefensiveTarget_Small		= 2
	MaxBuildingsToBeDefensiveTarget_Med		= 5
	;// anything bigger than MaxBuildingsToBeDefensiveTarget_Med is considered a Large defensive target

	ChanceToUseAllUnitsForDefenseTarget_Small	= 10%
	ChanceToUseAllUnitsForDefenseTarget_Med		= 25%
	ChanceToUseAllUnitsForDefenseTarget_Large	= 75%
	
	
	;//
	;// ARMY UNIT DEFINITIONS
	;//

	AIEconomyAssigment RohanFarmNew
		TemplateName = RohanFarmNew
	End
	
	AIWallNodeAssignment RohanWallHub
		TemplateName = MiddlemenWallHubSmall	:Need to make Rohan walls!!!
	End

	ArmyMemberDefinition RohanFighterHorde_Member
		Unit			= RohanFighterHorde ;infantry
		PercentageOfArmyPhase1	= 40.0
		PercentageOfArmyPhase2	= 40.0
		PercentageOfArmyPhase3	= 30.0
	End

	ArmyMemberDefinition BRohanArcherHordeNew_Member
		Unit			= RohanArcherHordeNew ;archer
		PercentageOfArmyPhase1	= 35.0
		PercentageOfArmyPhase2	= 35.0
		PercentageOfArmyPhase3	= 35.0
	End

	ArmyMemberDefinition RohanRoyalGuardNewHorde_Member
		Unit			= RohanRoyalGuardNewHorde ;cavalry
		PercentageOfArmyPhase1	= 40.0
		PercentageOfArmyPhase2	= 45.0
		PercentageOfArmyPhase3	= 30.0
	End

	ArmyMemberDefinition RohanSpearmenNewHorde_Member
		Unit			= RohanSpearmenNewHorde ;pikeman
		PercentageOfArmyPhase1	= 25.0
		PercentageOfArmyPhase2	= 25.0
		PercentageOfArmyPhase3	= 25.0
	End
	
	ArmyMemberDefinition RohanEnt_Member
		Unit			= RohanGenericEnt ;siege weapon
		PercentageOfArmyPhase1	= 5.0
		PercentageOfArmyPhase2	= 15.0
		PercentageOfArmyPhase3	= 20.0
	End
	
	ArmyMemberDefinition RohanEnt_Member1
		Unit			= RohanEntFir ;siege weapon
		PercentageOfArmyPhase1	= 5.0
		PercentageOfArmyPhase2	= 5.0
		PercentageOfArmyPhase3	= 10.0
	End
	
	ArmyMemberDefinition RohanEnt_Member2
		Unit			= RohanFirBirch ;siege weapon
		PercentageOfArmyPhase1	= 5.0
		PercentageOfArmyPhase2	= 5.0
		PercentageOfArmyPhase3	= 10.0
	End

	;ArmyMemberDefinition Rohan??????Horde_Member
	;	Unit			= Rohan??????Horde ;elite archer
	;	PercentageOfArmyPhase1	= 0.0
	;	PercentageOfArmyPhase2	= 25.0
	;	PercentageOfArmyPhase3	= 30.0
	;End
	
	;ArmyMemberDefinition Rohan??????Horde_Member
	;	Unit			= Rohan??????Horde ;elite ????? from inn
	;	PercentageOfArmyPhase1	= 10.0
	;	PercentageOfArmyPhase2	= 25.0
	;	PercentageOfArmyPhase3	= 30.0
	;End

	ArmyMemberDefinition RohanRohirrimNewHorde_Member
		Unit			= RohanRohirrimNewHorde ;elite cavalry
		PercentageOfArmyPhase1	= 5.0
		PercentageOfArmyPhase2	= 15.0
		PercentageOfArmyPhase3	= 25.0
	End
	
	;ArmyMemberDefinition Rohan??????Horde_Member
	;	Unit			= Rohan??????Horde ;super elite ?????
	;	PercentageOfArmyPhase1	= 5.0
	;	PercentageOfArmyPhase2	= 10.0
	;	PercentageOfArmyPhase3	= 20.0
	;End

	ArmyMemberDefinition ElvenBattleShip_Member
		Unit			= ElvenBattleShip
		PercentageOfArmyPhase1	= 0.0
		PercentageOfArmyPhase2	= 0.0
		PercentageOfArmyPhase3	= 0.02
	End

	ArmyMemberDefinition  ElvenFireShip_Member
		Unit			= ElvenFireShip
		PercentageOfArmyPhase1	= 0.0
		PercentageOfArmyPhase2	= 0.0
		PercentageOfArmyPhase3	= 0.02
	End

	ArmyMemberDefinition ElvenShoreBombardShip_Member
		Unit			= ElvenShoreBombardShip
		PercentageOfArmyPhase1	= 0.0
		PercentageOfArmyPhase2	= 0.0
		PercentageOfArmyPhase3	= 0.02
	End

	ArmyMemberDefinition ElvenTransportShip_Member
		Unit			= ElvenTransportShip
		PercentageOfArmyPhase1	= 0.0
		PercentageOfArmyPhase2	= 0.0
		PercentageOfArmyPhase3	= 0.0
	End

	;//
	;// HEROES
	;//

	HeroBuildOrder = ElvenGaladriel_RingHero RohanMerry RohanEowyn RohanEomer RohanTheoden 
	OffensiveBuildings = RohanWellNew RohanHeroStatueNew RohanBattleTower
	
End

PlayerTemplate FactionRohan
	Side              = Rohan
	PlayableSide      = Yes
	Evil		  = No
	StartMoney        = 0
	MaxLevelMP	  = #DIVIDE( PLAYER_MAX_PURCHASE_POINTS_DEFAULT PLAYER_PURCHASE_POINTS_GRANTED )
	MaxLevelSP	  = #DIVIDE( PLAYER_MAX_PURCHASE_POINTS_GOOD PLAYER_PURCHASE_POINTS_GRANTED )
	PreferredColor	  = R:43 G:150 B:179
	StartingBuilding  = MenFortress
	
	;------------- NO STARTING UNITS FOR YOU -------
	;StartingUnit0 		= GondorFighterHorde 
	;StartingUnitOffset0 	= X:-60 Y:185 Z:0
	
	
	StartingUnit1 		= RohanPorter 
	StartingUnitOffset1 	= X:30 Y:200 Z:0
	StartingUnit0 		= RohanPorter 
	StartingUnitOffset0 	= X:1 Y:130 Z:0
	
	StartingUnitTacticalWOTR	= RohanPorter			;// This unit is placed in tactical mode when playing WOTR. Add multiple lines for multiple units.
	StartingUnitTacticalWOTR	= RohanPorter
	IntrinsicSciences		= SCIENCE_GOOD
	IntrinsicSciencesMP 		= SCIENCE_MEN
	SpellBook			= GoodSpellBook
	SpellBookMp			= MenSpellBook
	PurchaseScienceCommandSet	= GoodSpellStoreCommandSet
	PurchaseScienceCommandSetMP	= MenSpellStoreCommandSet
	DisplayName			= INI:FactionRohan
	DefaultPlayerAIType		= RohanSkirmishAI
	BeaconName			= MultiplayerBeacon
	LightPointsUpSound		= GondorLightPointsUp
	ObjectiveAddedSound		= Gui_MissionObjectiveNew
	ObjectiveCompletedSound		= Gui_MissionObjectiveCompleted
	InitialUpgrades			= Upgrade_RohanFaction		; Any upgrades this player template is born with.

	// NOTE: It is very important that the create-a-hero be the first buildable hero, to ensure that the create-a-hero and the ring hero are always 
	// attached to the first two buttons in the command set.

	BuildableHeroesMP		= CreateAHero RohanMerry RohanEowyn RohanEomer RohanTheoden ;
	BuildableRingHeroesMP		= ElvenGaladriel_RingHero
	SpellStoreCurrentPowerLabel 	= APT:SpellStoreCurrentEvenstarPower
	SpellStoreMaximumPowerLabel 	= APT:SpellStoreMaximumEvenstarPower
	ResourceModifierObjectFilter 	= RESOURCE_MODIFIER_OBJECT_FILTER
	ResourceModifierValues		= 100 100 100 100 90 85 80 75 71 68 66
	MultiSelectionPortrait		= UPGondor_Army
	LoadScreenMusic			= Shell2MusicForLoadScreen
End



Thanks a Million for looking guys. :)

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#12 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 26 March 2011 - 04:40 PM

Solved!!!

I just canged the faction from Rohan to Rohirrim and it all seems to work now. I wonder if there was some conflict with the old Rohan stuff, who knows. Anyway, its all working now.

Thanks a million guys. :)

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#13 Prolong

Prolong
  • Members
  • 133 posts

Posted 01 May 2011 - 12:44 PM

I removed the upgrade buttons from the fortress commanset so that they couldn't be baught , do you think that would have worked for the IA?

A bit late I know, but this will NOT stop the AI from using the ability. The power does not have to be present in the AI's commandset in order for it to be able to use it! As long as the object has an AISpecialPowerUpdate with a valid commandbutton, then, if I remember correctly, then the AI can activate that commandbutton regardless of its presence in the object's commandset (and regardless of restrictions on that commandbutton; see Sulherokhh's AI Guide this site).

#14 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 03 May 2011 - 06:10 PM

Ahh, thanks a million fella. Thats nice to know for the future.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users