View unanswered posts | View active topics It is currently Sun Sep 15, 2019 1:26 am



Reply to topic  [ 5 posts ] 
 Timers for V1 CPC 
Author Message
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post Timers for V1 CPC
In reference to: viewtopic.php?f=52&t=33014
--------------------------------------
Here is the code I used, for any scripters that want to adapt it to there own command set. I'd be happy to help anyone in regards to capturing there favorite dynamic or set of dynamics once I get my V1 re-installed (VMWARE) for testing purposes.

Many thanks to Dynarri for guidance in the below scripts as well as testing various aspects of TWGS timings throughout the last 3 or so years.
------------------------------------

Advanced command set test
Code:
setVar $file GAMENAME & "_Seconds.txt"
send "tnt1*cb20000*y"
getTimer $startTicks
Waitfor "Command [TL=00:00:00]:[20000]"
#SetVar $TargetMac " n * m" & "5501" & "* a " & "60000" & " * * f  z  1  *  z  c  d  *  < r z a " & "60000" & " * n n * m z " & "4918" & "*yy* "
#SetVar $TargetMac "n*mz" & "5501" & "*nn*za" & "60000" & "**fz1*zcd*<rza" & "60000" & "*nn*mz" & "4918" & "*yy*"
#SetVar $TargetMac "m5501z*z*za60z*z*f1z*cdz*<nnz*m4918z*yyz*"
SetVar $TargetMac "z*z*mz5501z*za60000*z*fz1z*zcdz*<rza60000z*nnz*mz4918z*yyz*"

Send $TargetMac
Waitfor "Command [TL=00:00:00]:[4918]"
getTimer $stopTicks
setVar $durationTicks ($stopTicks - $startTicks)
setPrecision 18
setVar $seconds ($durationTicks / 2000000000)
setPrecision 0
echo ANSI_15 & "**Time lapse in Seconds: " $seconds "*"
send "l2*"
Write $file $seconds & " 99 CPC overload on Z buffering v2"

----------
Colonizer Timer

Code:
#-------------INT Variables--------------
SetVar $Idx 1
setVar $file GAMENAME & "_Seconds.txt"
Delete $file
#------------Check to see if we can start-----
:LetsGo
Gettime $StartDaTest
ReplaceText $StartDaTest ":" " "
Getword $StartDaTest $Started 2
SetDelaytrigger EMCPU :EMCPU 100
pause

:EMCPU
Gettime $StartDaTest
ReplaceText $StartDaTest ":" " "
Getword $StartDaTest $Started2 2

If ($Started = $Started2)
Echo ANSI_15 "* Waiting to go!"
  goto :LetsGo
End
Echo ANSI_12 "* Started The Test!!!!"


GetTime $StartedTest

Gettime $Stop
Replacetext $Stop ":" " "
Getword $Stop $Stoploop 2

#--Change this variable to increase time of test---
Add $Stoploop 10

#------------While Start-------------------
While ($whileloop < $stoploop)
:Start
Send "L 1 * "
Waitfor "There are currently"
Getword CURRENTLINE $Timed 4
Send "q"
Send "L 1 * "
Waitfor "There are currently"
Getword CURRENTLINE $Timed2 4

If ($Idx = 1)
SetVar $StartColo $Timed
end

Send "q"
If ($Timed = $Timed2)
goto :Start
  else
   goto :Cont
end

:Cont
If ($Timed <> $Timed2)
Gettime $start s:zzz
SetVar $Timed3 ($Timed2+1)
While ($Timed2 <= ($Timed3))
  Send "L 1 * "
   Waitfor "There are currently"
   Getword CURRENTLINE $Timed2 4
  Send "q"
end
Gettime $stop s:szzz
end

Replacetext $Start ":" " "
Replacetext $Stop ":" " "

Getword $start $SecTimer 1
Getword $start $MilliSecTimer 2
Getword $stop $SecTimer2 1
Getword $stop $MilliSecTimer2 2

setVar $SecDuration ($SecTimer2 - $SecTimer)
SetVar $MilliSecDuration ($MilliSecTimer2 - $MilliSecTimer)
Divide $SecDuration 2
Divide $MilliSecDuration 2
Write $file "Time lapsed " & $SecDuration & ":"  & $MilliSecDuration
Add $Idx 1

GetTime $Check
Replacetext $check ":" " "
Getword $Check $Whileloop 2
END

#-------------Ended While Loop Spit out the Results---------------------
SetVar $StopColo $Timed2
GetTime $EndedTest
echo ANSI_15 "* " ($StopColo - $StartColo) " :Total Colos Regened" "*"
echo ANSI_12 "*" $StartedTest "*" $EndedTest
Halt

----------------------------
Basic command test
Code:
setVar $file GAMENAME & "_Seconds.txt"
SetVar $MAC "#cf1*2*f2*1*f1*2*@q"
Send $Mac
Waitfor "Who's Online"
getTimer $startTicks
Waitfor "Average Interval Lag:"
getTimer $stopTicks
setVar $durationTicks ($stopTicks - $startTicks)
setPrecision 18
setVar $seconds ($durationTicks / 2000000000)
setPrecision 0
echo ANSI_15 & "**Time lapse in Seconds: " $seconds "*"
Send "*"
Write $file $seconds & " 99 CPC Basic CF Macro " & $MAC


Attachments:
ColoTimer2.ts [2.01 KiB]
Downloaded 140 times
CPCTest.ts [870 Bytes]
Downloaded 150 times
CPCcfTest.ts [438 Bytes]
Downloaded 131 times

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."
Thu Mar 15, 2012 6:10 pm
Profile ICQ
Ambassador
User avatar

Joined: Wed Nov 12, 2008 8:57 am
Posts: 3545
Location: Long Beach, CA
Unread post Re: Timers for V1 CPC
Excellent work. I have v1.03 set up in a VM with the exact same settings as my v2.x vm server.

I am running 2 WinXPsp3 vmware machines with 8gig hdds on a windows 7 64 bit machine with 8gigs of ram.

How many cycles should we be running for each test? 100? 1000? more?

H

_________________
Helix
Do I really look like a guy with a plan? You know what I am? I'm a dog chasing cars.
Lest we forget
TTW TWGS v2 twgs.ddns.net:2002
I had to ask myself WWSGD?


Thu Mar 15, 2012 6:20 pm
Profile WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Timers for V1 CPC
Well, the balance is getting enough cycles that you get an accurate average time, but not so much that it takes too long to run a single test. These things run fast enough that I'd think thousands would be fast and still give good statistical results.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Thu Mar 15, 2012 6:39 pm
Profile WWW
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post Re: Timers for V1 CPC
Helix wrote:
Excellent work. I have v1.03 set up in a VM with the exact same settings as my v2.x vm server.

I am running 2 WinXPsp3 vmware machines with 8gig hdds on a windows 7 64 bit machine with 8gigs of ram.

How many cycles should we be running for each test? 100? 1000? more?

H


That really depends on your desired sample size. When Dynarri and I were testing for advanced script design we ran usually about 100. Youll start to see patterns after about 10, imo the third routine is the most solid and one of my later revisions. Whereas the second routine shows a good set for timing, and the first works but if i was to rewrite it i would use @ instead of a sector #.

Adapt as needed.

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Last edited by Kaus on Thu Mar 15, 2012 6:43 pm, edited 1 time in total.



Thu Mar 15, 2012 6:41 pm
Profile ICQ
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Timers for V1 CPC
I think this is obvious, but just in case, these timings should be measured on a local connection, because we don't want to factor in connection speeds. I don't think CPU speed is that important, but it's probably best to use a machine that's pretty standard for the last year or two as opposed to something out dated or top of the line today.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Thu Mar 15, 2012 6:43 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.