Jump to content


Photo

How to have an ALL AI battle + Super Fast Game Speed, etc.


110 replies to this topic

#1 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 11 December 2006 - 04:16 PM

Firstly, create a text file in the root of your \<Dark Crusade folder> or \<Soul Storm folder> and call it:

autoexec.lua

In this autoexec.lua put this into it and save it:

run = Cpu_ControlLocalPlayer()
run = setsimrate(35)
run = fog_toggle()
run = FOW_RevealAll()

bind("F1","setsimrate(5)") 
bind("F2","setsimrate(12)")
bind("F3","setsimrate(20)")
bind("F4","setsimrate(30)")
bind("F5","test()")
bind("F6","test1()")

function test()
local count=World_GetPlayerCount()
g_Player1=World_GetPlayerAt(0);
if count>1 then
g_Player2=World_GetPlayerAt(1);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player2,0);
end
if count>2 then
g_Player3=World_GetPlayerAt(2);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player3,0);
end
if count>3 then
g_Player4=World_GetPlayerAt(3);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player4,0);
end
if count>4 then
g_Player5=World_GetPlayerAt(4);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player5,0);
end
if count>5 then
g_Player6=World_GetPlayerAt(5);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player6,0);
end
if count>6 then
g_Player7=World_GetPlayerAt(6);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player7,0);
end
if count>7 then
g_Player8=World_GetPlayerAt(7);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player8,0);
end

Player_SetResource(g_Player1,RT_Requisition,9999);
Player_SetResource(g_Player1,RT_Power,9999);
end

function test1()
local count=World_GetPlayerCount()
g_Player1=World_GetPlayerAt(0);
if count>1 then
g_Player2=World_GetPlayerAt(1);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player2,0);
end
if count>2 then
g_Player3=World_GetPlayerAt(2);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player3,0);
end
if count>3 then
g_Player4=World_GetPlayerAt(3);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player4,0);
end
if count>4 then
g_Player5=World_GetPlayerAt(4);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player5,0);
end
if count>5 then
g_Player6=World_GetPlayerAt(5);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player6,0);
end
if count>6 then
g_Player7=World_GetPlayerAt(6);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player7,0);
end
if count>7 then
g_Player8=World_GetPlayerAt(7);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player8,0);
end

Player_SetResource(g_Player2,RT_Requisition,9999);
Player_SetResource(g_Player2,RT_Power,9999);
Player_SetResource(g_Player3,RT_Requisition,9999);
Player_SetResource(g_Player3,RT_Power,9999);
Player_SetResource(g_Player4,RT_Requisition,9999);
Player_SetResource(g_Player4,RT_Power,9999);
end

bind("shift+tab", "toggle_screenmode()")
screenmode = 0
function toggle_screenmode()
if screenmode == 0 then
taskbar_hide()
message_hide()
ingame_select_ui_toggle()
ingame_stats_toggle()
screenmode = 1
else
taskbar_show()
message_show()
ingame_select_ui_toggle()
ingame_stats_toggle()
screenmode = 0
end
end

So now an explaination of the above:

run = Cpu_ControlLocalPlayer()
Sets Player0, usually reserved for the human, as the AI

run = setsimrate(35)
Automatically sets game speed in super-turbo mode.. set that # to anything higher if you wish. You can set the # as high as you want but it depends on your CPU, Mobo, and Ram speed. Otherwise, it could crash the game. :p

run = FOW_RevealAll()
Disabled FogOfWar immediately so the entire map is revealed!

bind("F1","setsimrate(5)")
bind("F2","setsimrate(12)")
bind("F3","setsimrate(20)")
bind("F4","setsimrate(30)")
bind("F5","test()")
bind("F6","test1()")

For above.. assigns F1-F4 for various game speeds as seen with "run = setsimrate(35)" from above.
F5 gives Player0 (now assigned for AI) 99999 req and 99999 power.
F6 does the same as F5 but for Player1.
Shift+Tab keys are now assigned so you can easily take good screenshots without the UI or other annoying on-screen annoyances. Its a toggle so use Shift+Tab to switch between and back modes.

Now, Secondly..

Edit your DarkCrusade or Soulstorm desktop shortcut or which ever one you plan to do AI testing for (you can also do this for the Dawn of Skirmish AI one as well) and change the TARGET LOCATION of where it launches from and add: -dev as part of the target in the shortcut. This will set the game into "developer mode". This is the ONLY way for the autoexec.lua to become active as it cannot be active during a normal game as it would de-synch online play.


BONUS - Excellent customized DoW Camera settings (which allow for some better zoom in and outs)

Make a text file in \<Dark Crusade folder>\Engine\Data folder or or \<Soul Storm folder>\Engine\Data folder and call it: camera_high.lua

Now copy the following text into it and, once done, run the game to enjoy better camera functionality:
--	General camera parameters
FieldOfView = 60.000000
ClipNear = 0.1
ClipFar = 9600

TerrainClip = 1.0

--	Interpolation in camera motion and camera snapping
--
--	Rate = rate to interpolate
--	Base = base to perform interpolation in (2.71828 for linear, must be >1)
--	Threshold = threshold to start performing interpolation
--

--	  Controls pan speed
SlideTargetRate = 4
SlideTargetBase = 2
--SlideTargetThreshold = 1

--	  Controls zoom speed
SlideDistRate = 2
SlideDistBase = 5
--SlideDistThreshold = 1

--	  Controls orbit speed
SlideOrbitRate = 10
SlideOrbitBase = 1.01
--SlideOrbitThreshold = 1

--	  Controls declination speed
SlideDeclRate = 4
SlideDeclBase = 1.01
--SlideDeclThreshold = 1

--	Controls the speed of the zoom with the double button press
DistRateMouse = 0.50

--	Controls the speed of the zoom on the wheel
DistRateWheelZoomIn = 0.7
DistRateWheelZoomOut = 1.45

--	Distance range in metres
DistMin = 1.0
DistMax = 78.0

--	Declination speed
DeclRateMouse = -5

--	Declination range : angle range you can look at a target
DeclMin = 0.0
DeclMax = 80.0

--	Mouse orbit speed
OrbitRateMouse = -4


--	Default camera parameters
DefaultDistance = 58
DefaultDeclination = 45
DefaultOrbit = 55

--	Minimum eye height
DistGroundHeight = 2.0


--	Pan velocity scaling
--	Panning speed at the default/min height
PanScaleMouseDefZ = 500

PanScaleKeyboardDefZ = 175
PanScaleKeyboardMinZ = 35

PanScaleScreenDefZ = 150
PanScaleScreenMinZ = 30

-- Panning acceleration
-- To turn acceleration off, use the following values:
--	 PanAccelerate = 0.0
--	 PanStartSpeedScalar = 1.0
PanAccelerate = 0.0
PanStartSpeedScalar = 0.5
PanMaxSpeedScalar = 1.0


--	Enable/disable declination
DeclinationEnabled = 1.0

--	Enable/disable rotation
OrbitEnabled = 1.0

Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#2 Simo

Simo
  • New Members
  • 2 posts

Posted 25 January 2007 - 11:09 AM

For some reason mine doesn't work.

I copied and pasted the code above into a notepad document and called it autoexec.lua. I then saved this notepad document into my Dark Crusade folder - C:\Program Files\THQ\Dawn of War - Dark Crusade. I then renamed the "Dark Crusade" shortcut on my desktop so that it read "Dark Crusade-dev", and since this didn't work i also tried renaming it "Dark Crusade -dev". However none of these were succesful. I tried playing the game and going skirmish but there was nothing suggesting that i could switch myself into an AI player.

Please help as i have no idea what i might be doing wrong.

Thanks, Simo.

#3 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 25 January 2007 - 05:10 PM

No no.. don't rename the shortcut name itself.. change its TARGET! Its in the commandline when you do a PROPERTIES on the shortcut.

The -dev in your commandline MUST be outside the quotes so it looks like:

DarkCrusade.exe" -dev

Thats how it looks at the end of it btw in the shortcut commandline. Otherwise it MUST work.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#4 Simo

Simo
  • New Members
  • 2 posts

Posted 26 January 2007 - 12:25 AM

Ok thanks for that Thudo and sorry for my stupidity lol.

Thanks again, Simo.

#5 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 26 January 2007 - 04:42 AM

No sir thats what we're hear for as a team. The above way is a good way to test out brand new faction mods or watching general AI naked in action. :) :thumbsupsmiley: ^_^ ^_^ :) :)
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#6 etherdragn

etherdragn
  • New Members
  • 4 posts

Posted 06 February 2007 - 02:34 AM

Wow Thudo thanks! I think I've been missing out, relying on the relic forums for info.

You surely already know this but your script works with the campaign! This is a lifesaver for me as I'm testing settings for army strengths 11+ for my mod.

#7 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 06 February 2007 - 02:42 AM

Yes it also works for the campaigns but thats a dangerous proposition especially if the AI causes you to loose your commander. :O
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#8 Psychobabas

Psychobabas
  • Members
  • 20 posts

Posted 17 May 2007 - 01:50 PM

Hello,

Is it possible to have an all-Ai battle on DoS2.3? Because I seem to have trouble doing so.

First of all I copied the code onto notepad and then saved it as a text document, with name: autoexec.lua
Then I placed it in the Dark Crusade Folder. I then right clicked and went into properties where I added -dev (with a space) right next to the "darkcrusade.exe".

so I had "darkcrusade.exe" -dev in the Target

I assume the above is all corrent. But now what do I do? Do I just go into skirmish and play? Because when I do that (I select a 2player map) its just a normal me vs the DoS2.3 Ai.

Please Help! :p

#9 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 17 May 2007 - 03:14 PM

You run the shortcut you edited then just play a game. Done! The AI will be in control of you.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#10 Dralafi_XIII

Dralafi_XIII
  • Members
  • 15 posts

Posted 19 May 2007 - 04:35 PM

In 1v1s. I've noticed that the A.I. player playing as you ( :) ) has a tendency of moving much slower. As far as guessing goes, my guess is no resource buff to the formerly human controlled player? Anyone have any ideas?

#11 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 19 May 2007 - 04:44 PM

When playing all AIs *DO NOT* play on any skill level except HARD skill. Player0 is normally the human player but when you apply the AI skills Player0 is always working as HARD so if you play as HARDER or up then Player1 (the normal AI player) will be tougher and work faster.

So when testing all AI battles ALWAYS play on HARD skill for all AIs.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#12 Dralafi_XIII

Dralafi_XIII
  • Members
  • 15 posts

Posted 19 May 2007 - 04:56 PM

When playing all AIs *DO NOT* play on any skill level except HARD skill. Player0 is normally the human player but when you apply the AI skills Player0 is always working as HARD so if you play as HARDER or up then Player1 (the normal AI player) will be tougher and work faster.

So when testing all AI battles ALWAYS play on HARD skill for all AIs.


Ahhh I gotcha. Well then is this speed increase due to an invisible resource buff? And besides this, is the only differences in difficulty beyond hard determined by the A.I. control panel or are they innate in the code?

#13 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 19 May 2007 - 04:59 PM

No. The speed increase is artificially accelerating the game speed to insane levels. Excellent for testing!

Hard and Up are the same in the Control Panel but in the game the Harder and Insane AIs get automatic resource bonuses.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#14 Dralafi_XIII

Dralafi_XIII
  • Members
  • 15 posts

Posted 19 May 2007 - 05:19 PM

So except for the resource bonuses they're pretty much the same. I gotcha. Thanks for the quick responses!

#15 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 19 May 2007 - 05:29 PM

EASY and STANDARD AI skills are slower to tech and generally for novice players

HARD and up have everything churned up to their max, Control Panel-wise. Harder and Up have a game-set Resource bonus. Hard does not. Hard is true 1:1 so thats why I test on HARD always!
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#16 Psychobabas

Psychobabas
  • Members
  • 20 posts

Posted 25 May 2007 - 02:06 PM

OK I think I knnow what I did wrong, although I admit I havent tested it yet (no internet at my house yet :sleep: ).

I essentially had a file that was "autoexec.lua.txt" meaning that it was essentially a word document and not a .lua file. So I renamed it as plain "autoexec.lua", even though I was prompted that the file might become unusable. I'm going to try it and see what happens.

Thanks for your reply.

BTW: I absolutely hate Space Marines on the DoS2.3!! Is it me or are they the toughest race to play against!? (I'm IG and Tau)

#17 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 26 May 2007 - 03:19 AM

Actually, Necrons and Tau are still the MOST brutal although Necrons are frick'n ANIMALS !!!!!!!!!!!!!! Ughhhh! There is ALOT of praise for 2.30 AI..
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#18 fbcoach

fbcoach
  • New Members
  • 3 posts

Posted 30 June 2007 - 10:21 PM

Thudo you're the best thanx for the great A.I.!!!

But I am retarded and cant get my autoexec.lua to work.

I copied, pasted, called it autoexec.lua, added -dev after darkcrusade.exe" and still nothing.

Ive tried it with wordpad note pad and just creating a new file in prog.files\thq\dow-dark crusade.

the file sits in my main the directory where all the modules are and the dxp2, w40k files are.

What am i doing wrong?????

I really, really, really, want this to work becuase sometimes I play 5 man maps w/ 3 teams and kill myself immediately just so i can watch the computer duke it out. I would love to watch the computer go all out in a 3v3 mode.

Thanks.

#19 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,166 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 02 July 2007 - 09:06 PM

Ya sure yer running in "developer mode" with the -dev switch correctly? The autoexec.lua has the correct text in it as mentioned above and its in the root of your \DC folder? Show me you warning.log file after running a game with the -dev switch and with the autoxec.lua supposedly running.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#20 fbcoach

fbcoach
  • New Members
  • 3 posts

Posted 17 August 2007 - 09:23 PM

Thudo,

Thanx for the reply.

I figured it out! :good:

When copy and saving to a notepad file I had to change the SAVE FILE TYPE from TEXT to ANY FILE!

Now Im Rockin!

I also just Dwnloaded 2.5! Fixin Check it out!

YOU GUYS ROCK!!!!!!!!!!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users