Jump to content


Photo

[BFME2] Make AI work with the BFME I bases


  • Please log in to reply
69 replies to this topic

#21 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 09 November 2009 - 07:11 PM

Test number One:
Changed MordorCastleSW: Called one BuildingFoundation "Bauplatz"

Added Skript to MordorAI in folder: Player -> AI Mordor -> Production Buildings

*** IF ***
True.
*** THEN ***
Null operation. (Does nothing.)
Build building 'MordorOrcPit' at a foundationUnit 'Bauplatz'

Loaded a map where Mordor AI gets an MordorCampSW

AI does still build nothing.

2nd test:
*** IF ***
True.
*** THEN ***
Set timer 'Timer2' to expire in 30.00 seconds.

*** IF ***
Timer 'Timer2' has expired.
*** OR ***
*** THEN ***
Find unnamed 'MordorBuildingFoundation' Owned by Player '<This Player>' nearest team Team 'teamPlayer' and reference as UnitRef 'BUILDPLOT'
Enable Script 'TESTSKRIPT'.

skript2 (deaktiviert):
*** IF ***
True.
*** THEN ***
Build building 'MordorOrcPit' at a foundationUnit 'BUILDPLOT'

AI still does build nothing.

3rd Try:
*** IF ***
True.
*** THEN ***
Set timer 'Timer2' to expire in 30.00 seconds.

*** IF ***
Timer 'Timer2' has expired.
*** OR ***
*** THEN ***
Find unnamed 'MordorBuildingFoundation' Owned by Player '<This Player>' nearest team Team 'teamPlayer' and reference as UnitRef 'BUILDPLOT'
Enable Script 'TESTSKRIPT'.

skript2 (deaktiviert):
*** IF ***
True.
*** THEN ***
Unit 'BUILDPLOT' use Ability 'Command_ConstructMordorOrcPit'.

AI builds nothing.

Edited by MotWlRimli, 09 November 2009 - 08:17 PM.


#22 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 09 November 2009 - 08:46 PM

I took a closer look how the AI in BFME1 builds its buildings and started a BFME1 Skirmish and let the AI do the scripts step-by-step.

Result: At first the AI gets its base and the starting units etc.

Interesting ist step 6. Then the AI builds the first buidlings:
6 Run script - Player_2/a_Skirmish - Init Build - Balanced
6 Run script - Player_2/Enable Veterancy
6 Run script - Player_2/ee_Check Current Construction Site
6 Run script - Player_2/g_Defense - Disable Gate Scripts
6 Run script - Player_2/g_Init - Recruit Spellbook Team
6 Player_2/AI Spellbook - creating team instance.

The 1rst script is interesting. The ai_mordorskirmish.map says to this script:
[ns A D] [H]a_Skirmish - Init Build - Balanced:
*** IF ***
	Timer 'gt_Init_Window' has expired.
	*AND* Counter 'g_Skirmish_Random_AI_Type' IS Equal To  2 
	*AND*  Can player Player '<This Player>' build at base Unit 'AI_CURRENT_CONSTRUCTION_SITE'
*** THEN ***
   Player '<This Player>' gets $ 900 
  Build building 'MordorOrcPit' at a foundation that is the most near, relative to the object of type, 'Center1' which is part of the base named, Unit 'AI_CURRENT_CONSTRUCTION_SITE' ... then finally reference the new building as: UnitRef 'AI_BARRACKS_1' .
  Build building 'MordorHaradrimPalace' at a foundation that is the most near, relative to the object of type, 'Center1' which is part of the base named, Unit 'AI_CURRENT_CONSTRUCTION_SITE' ... then finally reference the new building as: UnitRef 'AI_PALACE_1' .
  Build building 'SlaughterHouse' at a foundation that is the most far, relative to the object of type, 'Center1' which is part of the base named, Unit 'AI_CURRENT_CONSTRUCTION_SITE' ... then finally reference the new building as: UnitRef 'SLAUGHTER_HOUSE_1' .
  Build building 'SlaughterHouse' at a foundation that is the most far, relative to the object of type, 'Center1' which is part of the base named, Unit 'AI_CURRENT_CONSTRUCTION_SITE' ... then finally reference the new building as: UnitRef 'SLAUGHTER_HOUSE_2' .

I wonder why the AI does not build in BFME2. I suppose the condition "Can player Player '<This Player>' build at base Unit 'AI_CURRENT_CONSTRUCTION_" is not true. But why it is not? I don't know ...

Comparison: In BFME2 the AI just searches for an object with kindof "BASE_FOUNDATION". It seems not to understand that there is already a base where it could build ...
6 Advancing SeqScript 'mpe_Spawn - Disband' on Start Team - Mordor -- Team Team '<This Team>' will move to the nearest object of kindof Kind is 'BASE_FOUNDATION'.
6 Advancing SeqScript 'mpe_Spawn - Disband' on Start Team - Mordor -- Set Team '<This Team>' to be assimilated by the first walk on army.
6 Advancing SeqScript 'mpe_Spawn - Disband' on Start Team - Mordor -- Team Team '<This Team>' will move to the nearest object of kindof Kind is 'BASE_FOUNDATION'.
6 Generic script 'mp_Spawn - Disband' run on team Start Team - Mordor
6 Generic script 'mp_Spawn - Disband' run on team Start Team - Mordor


#23 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 09 November 2009 - 09:23 PM

This must be awful testing work. Reading, writing and rewriting scripts is difficult. EA did provide a script editor with WB but i would have preferred to be able to edit the scripts with a text editor. I sincierly hope i will have some time getting into what you are currently doing. Right now i have a lot of stuff on my plate finishing the S.E.E. Beta.

Anyway, the only experience i have with the scripts is the following:
- Repair scripts
- SpecialPower execution (Heroes/Spellbook) and object/horde/Team movement.
- SpellPurchase and Music triggers
- Activating Camera Angles and playing movies full screen and palantir
- Using boolean and numerical counters
- Use of the script tags (Subroutine, scriptactivation, difficulty levels etc.)
- Science and Upgrades

With some of them i encountered difficulties mainly because skirmishAI_2 was hijacking the objects/teams in question. I could manipulate EyeOfSauron, the Spellbooks, any non-combat structures, but conversely any combat teams or anything an AIupdate (for the execution of sequential scripts) was in comflict with one of the new AImodules (like wallhubs) was a no go.

Keep up the work, the results will be very significant for AI-modding BfMe2.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#24 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 22 November 2009 - 08:43 PM

Looked the scripts again.

The conditions for the script which starts building in BMFE1 are:
Timer 'gt_Init_Window' has expired.
*AND* Counter 'g_Skirmish_Random_AI_Type' IS Equal To  2 
*AND*  Can player Player '<This Player>' build at base Unit 'AI_CURRENT_CONSTRUCTION_SITE'

I found the scripts which should ensure these conditions:
[ns A D] [H]g_Init - Initialize Global AI Values:
//:This script initializes the global base values for the AI.  They are as such: g_Economy_Ugency: How important is economy in the early going?  g_Attack_Ugency: How important is attacking early on?  g_Defense_Ugency: How important is defending early on?  g_Attack_OwnedTeamValue: How much will 2 attack units contribute to the AI's urgency to attack? g_AttackTimeMaxValue: Where will time stop mattering to the Attack Urgency?  Setting this low will make the AI attack more based on army size instead of just how long its been in the map.:
*** IF ***
	True.
*** THEN ***
  Set timer 'gt_Init_Window' to expire in 1.00 seconds.
  Set Counter 'g_Skirmish_Random_AI_Type' randomly between  1  and  4 .
  Set Flag named 'AI_On' to TRUE
  Set 'g_Economy_Urgency' to  400 
  Set 'g_Attack_Urgency' to  200 
  Set 'g_Defense_Urgency' to  500 
  Set 'g_Attack_TimeMaxValue' to  400 
  Set 'g_Urgency_Change_Low' to  2 
  Set 'g_Urgency_Change_Med' to  50 
  Set 'g_Urgency_Change_High' to  100 
  Set 'g_ATTACK_URGENCY_CHANGE_LOW' to  2 
  Set 'g_ATTACK_URGENCY_CHANGE_MED' to  35 
  Set 'g_ATTACK_URGENCY_CHANGE_HIGH' to  100


[ns A D] [E N H]g_Init - Unpack Base for AI 1:
*** IF ***
	 Unit 'BASE_FLAG_1' is owned by Player '<This Player>'
*** THEN ***
  Instantly unpack the free base: Unit 'BASE_FLAG_1'and reference it as UnitRef 'AI_BASE'.
  Set UnitRef 'AI_CURRENT_CONSTRUCTION_SITE' to reference unit Unit 'BASE_FLAG_1'
  Control of Team 'PlyrCivilian/Player_1_Inherit' transfers to Player '<This Player>'
*** ELSE ***
  Disable Script 'g_Init - Unpack Base for AI 1'.

It seems the second one makes trouble. The AI in BFME2 only runs this script all time:
[S A nd] [E N H]mpe_Spawn - Disband:
*** IF ***
	True.
*** THEN ***
  Set Team '<This Team>' to be assimilated by the first walk on army.
  Team Team '<This Team>' will move to the nearest object of kindof Kind is 'BASE_FOUNDATION'.
   Team '<This Team>' stops, then disbands.


#25 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 22 November 2009 - 10:14 PM

It's a subroutine, so the script is either called by another script (in which case you need to check out which and why) OR it is called by one of the teams the faction starts with on the map. And i don't mean the starting teams from 'playertemplate.ini'. BfMe1's starting teams where called by script within the same library that also handled the starting positions und the unpacking of the starting bases.

Check them out and see if there are actually any starting units being set-up.
Check out if the starting teams actually have members (hordes) whose Object-names correspond to existing horde-Objects.
The contents of the teams should be listed in the library (load with wb, --> edit teams) or possibly in the one named something like 'human_player_MP' or so.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#26 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 23 November 2009 - 05:36 PM

Good point.

I already noticed that with the scripts there are additional starting units besides the one from the playertemplate.ini

There are actually 4 battaillons of orcs though in the playertemplate there are only two battaillions of mordorfighters listed.

So two of them are from the scripts. But these battaillons are bugy. They are always moving in the camp a little bit but you cannot give them orders, e.g. to move out of the base. They do nothing.

Perhaps this causes bugs. Will look at it.


I also thinked of stopping to try to revive the BFME1 AI and ajust the BFME2 AI that the AI uses the porter to build buildings in their base. But then the AI would not be able to have economy-plot farms or expansions.
Would be no good solution ... :(

Edited by MotWlRimli, 23 November 2009 - 05:39 PM.


#27 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 23 November 2009 - 07:23 PM

Hopefully EA finished the new scripts for BfMe2. There are some referring to porter functions.
BfMe2 has it's own set of unscripted priorities (Base layout and skirmishAIdata.ini). Don't mix them with scripted teambuilding/purchase-priorities. SkirmishAI2 will steamroller any script in it's way. :p

Don't give up.


Edit:

[S A nd] [E N H]mpe_Spawn - Disband:
*** IF ***
	True.
*** THEN ***
  Set Team '<This Team>' to be assimilated by the first walk on army.
  Team Team '<This Team>' will move to the nearest object of kindof Kind is 'BASE_FOUNDATION'.
   Team '<This Team>' stops, then disbands.
[/quote]

I think the team of starting units (two hordes) is running the script (referenced in the team's list of scripts).
'Set Team '<This Team>' to be assimilated by the first walk on army.': It's quite possible that BfMe2 doesn't inherit stuff by WalkOnArmy anymore. I noticed that when converting maps from BfMe1 to BfMe2, all the old inherit scripts are supposed to be removed. Probably that's why those neutral (not yet inherited) starting units can't be controlled. They never are yours.
'Team Team '<This Team>' will move to the nearest object of kindof Kind is 'BASE_FOUNDATION'.': Since the team is never really dissolved, it always gets the order to move (every frame, every second, whatever it actually says in the script), which makes it twitch every once in a while.
'Team '<This Team>' stops, then disbands.': And it looks like stopping and disbanding is not a working function of BfMe2 anymore, probably because the new SkirmishAI_2 Teambuilder is able to do all of the team stuff (recruiting, pushing production, stealing from other teams, define team's objective) without those scripts, and sadly without anyone being able to modify it. I was hoping that by deactivating the new Teambuilder, all the old Team scripts could be reinserted. I really hope i am not wrong and that the scripts problem lies somewhere else.

Edited by Sûlherokhh, 23 November 2009 - 07:38 PM.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#28 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 23 November 2009 - 08:04 PM

Hmm if it was true that BFME2 cannot handle with teamscripts it would be useless to try to put the BFME1-AI over BFME2.

I would have to arrange with the BFME2 AI and use your tricks to make the AI to do what I want.

I could make new BFME2 bases where the AI is said to build their buildings right over the building plots from their base where human players build their buildings.

But there would be several problems:
- When I reactivate the BFME2 AI the AI would again get not bases as the scrips which unpack the base for each player would also be deactivated.

- The AI would always use a very poor strategy as it could only build at one base and not expand (as it does not understand how to claim new baseflags)

- The AI could not develop a sort of "mapcontrol" as it could not use ECONOMY_PLOTS. (But i already watched a mordor AI in my BFME2 mod which build a lumber mill on an economy plot when it attacked with it recruited heroes and (playertemplate.ini)starting units ... Actually, the AI does now not build heroes anymore but I temporary changed the AI back to BFME2 in the meantime. Could be that I had set something else before than it is now ...)

Edited by MotWlRimli, 23 November 2009 - 08:11 PM.


#29 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 23 November 2009 - 08:35 PM

Are you using the scripting setup of BfMe1 when designing the test map? I do know that there are a lot of differences between the two game's map creation, mainly regarding the setting up of the PLAYERS and their SkirmishAI. Make sure you are using a BfMe1 setup, which i am sure is needed for the inherit scripts to even have a chance of working. Take care to have the starting positions (BaseFlags) belonging to the inherit-PLAYERS.


Edit: It is kind of strange talking about this stuff when the last time i even opened a script is almost a year ago. Hopefully i'll get around to it in Spring. I got to set up a new AI for S.E.E. anyways, so maybe i'll find the time to experiment a bit.

Edited by Sûlherokhh, 23 November 2009 - 08:38 PM.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#30 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 23 November 2009 - 09:11 PM

Yeah, I am always testing with the rohan map from BFME1. Changed just little things like adding a skybox and gollum scripts.

Testing with a BFME2 map would not do anyway because there are no base flags.

#31 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 25 November 2009 - 09:12 PM

Dumped the BFME1 AI now, it does not lead to anything since I did not understand why the scripts do not work ... :-/

Problems with BFME2 AI:
Acutally, the BFME2 AI seems not to use their AI-Base referred in the skirmishaidata.ini when it has already a BFME1 base (castle, camp, explansionflag) unpacked.

Tried different things:
- Gave AI back their fortress as starting building and gave it no BFME1 castle anymore (removed the castleflag from the AI start point on the testmap)
- fortress now unpacks the castle_men_ne
- New AI base -> AI builds now where the buildingplots would be
- forced AI to use EconomyPlotFlags: placed farmtemplates next to EconomyPlotFlag and let AI build there a fake farm. This fake farm spawns a builder which claims the economyplot:
//########FakeFarm.ini##############
Object FakeFarmGeneric
	EditorSorting   = SYSTEM
	
	
	Draw = W3DScriptedModelDraw ModuleTag_01
	
		ExtraPublicBone = SPAWNBONE01

		DefaultModelConditionState
			  Model = None
		End
		
		ModelConditionState = WORLD_BUILDER
			Model = NBasePin
		End
	End
	
	VisionRange		 = 160.0; Shroud clearing distance	
	
	Body				= StructureBody ModuleTag_05
		MaxHealth		 			  = 1
		MaxHealthDamaged			  = 1
		MaxHealthReallyDamaged 		= 1
	End
	
	KindOf = SELECTABLE IMMOBILE NO_COLLIDE
	
	//Funktioniert NICHT, da ein Object, das durch einen SpawnPoint gespawnt wird, nie wirklich "frei" ist und eine Führerschaft wirken lassen kann
; Behavior = SpawnPointProductionExitUpdate ModuleTag_ProductionExit
; SpawnPointBoneName = SPAWNBONE //SuM nummeriert die Bones durch: 01, 02, ...
; End
	
	Behavior = SlowDeathBehavior ModuleTag_SlowDeathWithoutRubble
		DestructionDelay  = 500
	End
	
	Behavior = QueueProductionExitUpdate ModuleTag_11
		UnitCreatePoint			= X:0.0 Y:0.0 Z:0.0
		NaturalRallyPoint		= X:-28.6 Y:52.9 Z:0.0
		ExitDelay				= 300
	End

	Behavior = SpawnBehavior ModuleTag_Spawn
		SpawnNumber								= 1  
		InitialBurst							= 1
		OneShot		   = Yes
		SpawnTemplateName						= MenPorterForUnpacking
		CanReclaimOrphans						= Yes
	End
End

;--------------------------------------------------------

ChildObject MenPorterForUnpacking MenPorter
	Draw = W3DTruckDraw ModuleTag_01
		DefaultModelConditionState
			Model					= GUPorter_SKN
			Skeleton				= GUPorter_SKL
		End
	End
	KindOf = PRELOAD SELECTABLE DOZER CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE THROWN_OBJECT PORTER IGNORES_SELECT_ALL NONCOM UNATTACKABLE
	ShockwaveResistance = SHOCKWAVE_RESISTANCE_IMMUNE

  Behavior = AttributeModifierAuraUpdate ModuleTag_Leadership
		StartsActive	= Yes;If no, requires upgrade to turn on.
		BonusName		= AIPorterLeadership;-> grants Upgrade_TriggerAIUnpack for nearby objects
		RefreshDelay	= 2000
		Range			= 200
		ObjectFilter	= ANY +EconomyPlotFlagMuliplayer +GondorBuildingFoundation
	End	
	
	Behavior = LifetimeUpdate ModuleTag_HatchTrigger
		MinLifetime = 5000.0
		MaxLifetime = 5000.0
	End
End


;---------------------------------------------
;------------------------------------------------------------------------------
ChildObject EconomyPlotFlagMuliplayer EconomyPlotFlag
  
  Behavior = CastleBehavior ModuleTag_castle
		  CastleToUnpackForFaction  = Men			Farm_Men			200
		  CastleToUnpackForFaction  = Elves		Farm_Elves			200;Änderung
		  CastleToUnpackForFaction  = Dwarves		Farm_Dwarves		200
   		CastleToUnpackForFaction  = Isengard	Lumbermill_Isengard	200
 		CastleToUnpackForFaction  = Mordor		Lumbermill_Mordor	200
		  CastleToUnpackForFaction  = Wild		Lumbermill_Wild		200

	FilterCrew				= ANY +MONSTER 																					;MONSTER is for Ents, dude. -MLo
	FilterValidOwnedEntries = ANY +STRUCTURE +WALK_ON_TOP_OF_WALL +BASE_FOUNDATION +TACTICAL_MARKER +MONSTER;Anything that does not fit this filter will be given to the neutral player, so the template can have rocks and props.

	CrewReleaseFX = FX_EntMootRelease		
	CrewPrepareFX = FX_EntMootPrepare		
	CrewPrepareInterval 12000; six second interval

;	MaxCastleRadius = 100.0
  End
  
  Behavior = DoCommandUpgrade Module_DoCommandUpgrade	
		TriggeredBy = Upgrade_TriggerAIUnpack
		GetUpgradeCommandButtonName = Command_UnpackEconomyPlot
  End

End

Screen:
Posted Image

But there are now several problems:
- The map should have Castle/Campflags on every Player_Start waypoint, in Multiplayer every human player needs obviously a base
- BUT the BFME2 AI does not do anything when it has a BFME1 base at the beginning (I think the BFME1 base prevents that the AI base from skirmishaidata.ini is used)
- AI would never expand from their starting base and claim new castles/camps/expansion_flags

Edited by MotWlRimli, 25 November 2009 - 09:26 PM.


#32 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 26 November 2009 - 12:33 PM

Regarding the disbanded SkirmishAI_1 only project:

What sort of skirmishAI have you installed on your testmap? Did you use the 'Add_Skirmish_Players'-Button from WorldBuilder2 (for BfMe2) or did you install the PLAYERS by hand like in Worldbuilder1 (for BfMe1)?

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#33 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 26 November 2009 - 07:30 PM

When I tested with the BFME1 AI the map had the settings as needed in BFME1:
The Player_x_Inherit were added by hand.
Partly I tested with the BFME1 AI on original EA BFME1 Maps, e.g. Rohan.

Does anyone have an idea with the problems when using the BFME2 AI?
It is very difficult actually, neither the BFME1 nor the BFME2 AI is working at the moment ...

#34 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 17 December 2009 - 07:23 PM

I had developments using and manipulating the BFME2 AI.

With scripts on my testmap I could make the BFME2 AI to unpack an Base from their BASE_FLAG AND to use their porter to build referring to a normal BFME2 AI base.
With a new AI base the AI builds now exactly where the buildplots would be.

But I have problems:
BFME1 maps seem to be different to BFME2 maps!

On EA BFME1 maps the men faction ai runs scripts from the multiplayer_human library though it must not do this according to their playeraitypes.ini entrys.
Neither the mordor faction does this on a EA BFME1 map nor does the men faction does this on custom BFME1 maps. It occurs only when the combination men faction and EA BFME1 map is set.

But this occurs problems:
The men faction gets its base unpacked from the script in the multiplayer_human library. I need this script for human player (they should have a base at the beginning) but the AI must not have a base at the beginning, as the AI then does not use their porter (I think the AI base is not loaded properly as the space is blocked by the base ...) -> The AI has to unpack their base right after the beginning with my specific map script on my testmap, so that the AI base can load and the AI uses their porter.

Other problem:
I want to make the BFME2 AI to use economyplots using a little hack.
Behavior = DoCommandUpgrade Module_DoCommandUpgrade	
		TriggeredBy = Upgrade_TriggerAIUnpack
		GetUpgradeCommandButtonName = Command_UnpackEconomyPlot
  End
This works on EA and custom BFME1 maps but not on BFME2 maps. But it should work on all maps or i cannot use the hack. :(

Note:
The description "EA BFME1 map", "EA BFME2 map" etc. always refers to the conditions the map was at first created. All maps were edited and saved with the BFME2 worldbuilder in the meantime.
But this seems not to affect the strange qualities of the different maps which occur these phenomena.

Result: There seem to be slight differences between the maps of the two games and if the map is an original EA map or an custom map. Does anyone know something about this or has any ideas?

Edited by MotWlRimli, 17 December 2009 - 07:25 PM.


#35 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 19 December 2009 - 06:12 AM

Sup guys,

I've been gone for a long time now.
Finals just finished and now I back to modding :huh:.

I was actually going to post a simlar question (and probably still will) regarding BFME 1 map issues in BFME2.


Anyway, I've had some experience in the past 'converting' bfme 1 maps to work in bfme2; particualarly in Rob's mod RJ-Rotwk.


Its been a problem since bfme2 came out making bfme1 maps work in bfme2/rotwk. The main problem was 'supposedly' that EA just left the code in there from BFME1 which is why some things worked and some things didn't.

The Problems:
When you open a BFME1 map in BFME2, you have a number of issues.
i) The bfme1 base simply starts building and then just dissapears.
ii) When the base builds, some parts of the base is missing (walls build plots, etc.).

I am told that these problems are due to some geometry overlap and some left out code, but upon further postings on how to get the bfme maps working, I've gotten no answer. I was going to try asking here again. Its been like a year, so hopefully someone can tell me how to do it.


There is a way to get the bases working though. I know this because they got it working in rj's mod. You can download his mod in the rotwk forum. I have more or less successfully managed to get bfme1 maps working in his mod. However, there is still a problem.

The only bases that build correctly in his mod are the ones that he (rob) coded. So only the castle plots, and the Men farm and Mordor Slaughter house build correctly. I wanted to work on getting the other bases (camps, outposts, etc.) working correctly. Unfortunately, for those who knew rob, he was too busy to write a tutorial or to tell me how to do this.


One thing that might be your problem (not sure if/how ur bases work properly) is that the ai might actually start building the base, but then it disappears. So even if u had ur AI code imported right from bfme1, your Map will fail to work because the base unloads properly.


One thing you can try to do is to try to test your BFME1 maps via RJ's mod. You should know there are a few things you need to do to convert a normal bfme1 map to work in RJ's mod. I believe I wrote a tutorial on it a long time ago. I also posted two BFME1 maps that work in RJ's mod. These posts should be in RJ's section if you want to search for them.


You can try using the map he already has in the mod 'buildplot fords of isen', and then just do ur ai modifications from there.
It should be noted that he replaces the BFME1 castle plot foundation with his own castle plot foundation, and uses his 'corrected' castle bse files.

Anyway, if you, or anyone here knows how to get BFME1 - like bases working in BFME2, please let me know.

Hope this helps.
Posted Image

#36 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 19 December 2009 - 12:12 PM

Hi lotrfan!

I know your thread in the forum and have already read it.

The good message:
I succeeded in making BFME1 bases work in BFME2 without restrictions for human players.
You can find screens here.
The point are the geometries: They must not overlap or the object will not be loaded, so you have holes in your wall etc.
I solved it using a geometry update: While unpacking the wall has a very small 1.0*1.0*1.0 geometry and after the base is build the original geometries are loaded. But it is important, that the bases have space to unpack, so the faction must not have an starting building in their playertemplate.ini anymore.
But the problem is the AI since it seems not to be able to use the buildingplot scripts from BFME1 anymore. EA seems to have spoilt the AI too much. ^^
So I now use a similar AI RJ does in this mod - with the problems descriped above.

If you have further questions write me a P.M. but please understand that I don't want to discuss this in this topic, it should be only about the AI with BFME1 bases.

#37 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 20 December 2009 - 03:38 AM

Thanks dude.

I'll definately send you a pm later.
I have a lot of questions, but I have to figure out what I want to do exactly in the meantime.

Anyway, with regard to AI, I am actually playing RJ's mod right now doing some beta testing. In his map, 'buildplot fords of isen', he actually has the AI working for Gondor if you place gondor as your enemy at the bottom spot. I also remember seeing some scripts in the map itself which dealt with the AI (i think). He seems to have the basic structure down of how to get them doing stuff. I believe if you follow/understand his syntax, you can get your thing to work. I can tell you, right now I am versing them on hard, and they are actually beating me (lol), but this is after I mad some modifications. They are definately building using the buildplots, and are definately moving out and attacking. The problem is that the AI is not fully done yet. But it is good that at least there is one AI working. I use it to test how balanced the changes I made to the game are (as I am doing now).


Hope this helps.
Posted Image

#38 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 20 December 2009 - 02:35 PM

Thanks for the hint.

Just started the buildplot map and the AI really uses the buildplots. Will take a closer look to the scripts. :p

EDIT:
Fixed the problem with the multiplayer_human-stuff.
I only forgot to add the Skirmish_Men player, so the game thought it was a human player.

Edited by MotWlRimli, 20 December 2009 - 04:38 PM.


#39 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 20 December 2009 - 08:35 PM

AI uses now BuildingPlots if they are referenced.

But there are problems if a building is destroyed and has to be rebuild.
How can I make the AI to check if there is no building at the buildingplot and if the AI can build a building (could be missing money or citadell could be destroyed etc.) until the AI can rebuild successfully?

This does not work:
GROUP Gondor Plot 3
[ns A D] [E N H]Gondor Plot 3 - Build Gondor Barracks:
*** IF ***
	True.
*** THEN ***
   Player '<This Player>' gets $ 300 
  Build building 'GondorBarracks' at a foundationUnit 'Gondor_Player_1_BP_3'
  Set timer 'gondor_name_plot_3' to expire in 30.00 seconds.
  Set timer 'gondor_rebuild_plot_3' to expire in 60.00 seconds.
  Find unnamed 'GondorBarracks' Owned by Player '<This Player>' nearest team Team '<This Team>' and reference as UnitRef 'Player_1_Building_Plot_3'

[ns A D] [E N H]Gondor Plot 3 - Activate Rebuild:
*** IF ***
	Timer 'gondor_rebuild_plot_3' has expired.
*** THEN ***
  Enable Script 'RebuildBarracksNew'.
  Show military briefing Localized String: 'script laeuft' for 5.00 seconds.

[ns na nd] [E N H]Gondor Plot 3 - Rebuild Barracks:
*** IF ***
	 NOT  Unit 'Player_1_Building_Plot_3' exists and is alive.
*** THEN ***
  Build building 'GondorBarracks' at a foundationUnit 'Gondor_Player_1_BP_3'
  Find unnamed 'GondorBarracks' Owned by Player '<This Player>' nearest team Team '<This Team>' and reference as UnitRef 'Player_1_Building_Plot_3'

[ns A nd] [E N H]Sell_After_Time:
*** IF ***
	Counter 'Seconds_Past' IS Greater Than  30 
  *** OR ***
*** THEN ***
  Sell anything on foundation named Unit 'Gondor_Player_1_BP_3'

END GROUP Gondor Plot 3

The AI builds every 60 seconds a barrack though there is already a barrack at the building plot -> there are more than 1 barracks on one building plot. :(

Any ideas?

#40 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 20 December 2009 - 10:58 PM

I think this happens because the script trigger
*** IF ***
	 NOT  Unit 'Player_1_Building_Plot_3' exists and is alive.
does not work (something to do with the NOT bit).

Try using a trigger such as
Unit 'Player_1_Building_Plot_3' is dead and has finished dying.

Edited by Puzzler33, 20 December 2009 - 11:04 PM.

Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users