.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   SE4Batch status? (http://forum.shrapnelgames.com/showthread.php?t=11799)

Unknown_Enemy April 8th, 2004 09:30 AM

Re: SE4Batch status?
 
Quote:

Originally posted by Master Belisarius:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by Unknown_Enemy:
Not much sense with ruatha's little batch.You only need to add a auto backup every xx turn and you have a new SE4BATCH file.
http://forum.shrapnelgames.com/images/icons/icon7.gif

<font size="2" face="sans-serif, arial, verdana">I had problems to solve it when some years a go, wanted to use a Bat file like it...
At least in Win98, the Bat file runned se4 in simultaneous, without wait until the previous turn is finished.
Example, if I setted the bat file to run 5 turns, then, it runned SE4 FIVE times at the same time, without wait the first turn finished...
I did several test but never was able to run it well...
Maybe in XP/Win2000 this is different, but in Win98, the Bat file was not the solution.
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Urgh.
I'll have to test that. My MS scripting knowledge is not that good. http://forum.shrapnelgames.com/images/icons/icon9.gif

Ruatha April 8th, 2004 12:30 PM

Re: SE4Batch status?
 
Hmm, Yes I didn't think of that.


In WinXp it should wait until the app is executed.

In Win98 etc I guess you could insert

Start /W
before the se4 line, like

Start /W c:\spel\Se IV Gold/Seiv.exe "c:\ ....

(Instead of /W you can write /Wait to make it more obvious what it does. )

[ April 08, 2004, 11:52: Message edited by: Ruatha ]

BBegemott April 8th, 2004 03:42 PM

Re: SE4Batch status?
 
Dumb question:
What is the batch file supposed to do? Load saved games? But is it any better than SE4 Launcher utility?

Ruatha April 8th, 2004 03:47 PM

Re: SE4Batch status?
 
It's for testing Ai's and setting up scenarios.
It runs the game X number of turns and then stops, making backups at intevals set in the game.
Without human intervention.
If you want to see like Master B which AI is best, you set the game to run for 500 turns, and then you check which AI has survived.
Imagine pressing "End turn, wait for it to process, load game as master and repeat, 500 times... Better to let it run over the night by itself.

(Master B does much more in his AI competitions, the reports are really interesting to read when he has a competition running). http://forum.shrapnelgames.com/images/icons/icon7.gif

[ April 08, 2004, 14:49: Message edited by: Ruatha ]

Master Belisarius April 11th, 2004 05:40 AM

Re: SE4Batch status?
 
Quote:

Originally posted by Ruatha:
Hmm, Yes I didn't think of that.


In WinXp it should wait until the app is executed.

In Win98 etc I guess you could insert

Start /W
before the se4 line, like

Start /W c:\spel\Se IV Gold/Seiv.exe "c:\ ....

(Instead of /W you can write /Wait to make it more obvious what it does. )

<font size="2" face="sans-serif, arial, verdana">Hey, thanks Ruatha!!! The "Start /Wait" worked very well! Would liked to have your advice 2 years ago!!! http://forum.shrapnelgames.com/images/icons/icon7.gif

Still I'm having problems with the line
"set /a counter=%counter%+1"
Seems to be that Win98 doesn't recognize the command...

I have removed the @echo off to see what's happening, and the IF looks something like:
IF "" == 5

Then, I have included a SET into the Bat to see the variables, and the variables looks like:

Counter = 0
/A COUNTER = + 1

Have you an idea if it's only a Win98 problem? And the work around?

Thanks!

PD: with a loop without turn limits, the bat is working pretty well.

Ruatha April 11th, 2004 11:27 AM

Re: SE4Batch status?
 
Yep, that don't work in win9x.

a more bothersame method is this:

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">@echo off &gt;NULL
set n=%1
set i=
:loop
set i=%i%!
echo Running automated turn number %counter% now.
Gamepath\Se4.exe &quot;Game&quot; &quot;password&quot; &quot;0&quot; &quot;modname&quot;
if %i%==%n% goto ****
goto loop
:****</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">and then start it with test !!!!!!!!!!!!!!!!!!
and one ! for each loop, not good for long loops, in that case there are two ways.
One is to use nestled loops as that one above, for example a H for hundreds a T for tens and a ! for ones, ie
running a loop 134 times would call the batch file:
test HTT!!!
and then you make three loops within each other.

A better way if you have the FIND.EXE command on your computer is to make a new line in a temporary counter file for each loop turn and then count the lines with the FIND command, redoing the loop until the number of lines matches the parameter sent with the command line.

[ April 11, 2004, 11:26: Message edited by: Ruatha ]

Ruatha April 11th, 2004 12:24 PM

Re: SE4Batch status?
 
Ok, found a good way for win9x, don't have that os so I can't test it (but it works ok on my win XP):

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> @echo off &gt;NULL
if not [%1]==[] goto Okay
echo Syntax: %0 Number
goto End
:Okay

if [%2]==[::] goto 2nd time around
if [%3]==[::] goto 3rd time around
if [%4]==[::] goto 4th time around
if [%5]==[::] goto 5th time around
%comspec% /e:2048 /c %0 %1 ::
goto End
:2nd time around
for %%v in (0 1 2 3 4 5 6 7 8 9) do call %0 %1 %%v ::
goto End
:3rd time around
for %%v in (0 1 2 3 4 5 6 7 8 9) do call %0 %1 %2 %%v ::
goto End
:4th time around
for %%v in (0 1 2 3 4 5 6 7 8 9) do call %0 %1 %2 %3 %%v ::
goto End
:5th time around
echo %2%3%4
if [%1]==[%4] exit
if [%1]==[%3%4] exit
if [%1]==[%2%3%4] exit
start /w Gamepath\Se4.exe &quot;Game&quot; &quot;password&quot; &quot;0&quot; &quot;modname&quot;
:End</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Call it with
AUTO 12 (or whatever you've saved it as!)
for 12 loops

It's a nice self calling batch file.

Found this nice solution here:
http://www.pressroom.com/~tglbatch/counting.html

[ April 11, 2004, 13:09: Message edited by: Ruatha ]

Master Belisarius April 11th, 2004 02:47 PM

Re: SE4Batch status?
 
Hey, THANKS Ruatha!
The new .Bat worked without problems in Win98!
Seems like I will need to take a look into the website you suggested, because seems chinese to me! http://forum.shrapnelgames.com/images/icons/icon7.gif

Aiken April 11th, 2004 06:00 PM

Re: SE4Batch status?
 
Really great script Ruatha. Thank you.
And to make it complete: how can we add "backup every x turns" feature into this? Sometimes it's really usefull.
And the Last one http://forum.shrapnelgames.com/images/icons/icon7.gif - is where any way to grab turn date from .gam file to insert it to the backup name?

Would appreciate your help.

Fyron April 11th, 2004 10:14 PM

Re: SE4Batch status?
 
Doesn't MB's program do that anyways? http://forum.shrapnelgames.com/images/icons/icon12.gif


All times are GMT -4. The time now is 07:33 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.