Forum Index
SUBSIM Forum Search

The Web's #1 BBS for all submarine and naval simulations!
[ SUBSIM Review ] [ SUBSIM STORE ]
Current Forum | Archives 2002-2003 |

Can PACG be tweaked by the player/user?
Goto page Previous  1, 2, 3  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> SH2 Pacific Aces
View previous topic :: View next topic  
Author Message
MarkShot



Joined: 07 Jul 2002
Posts: 491

PostPosted: Sun May 29, 2005 4:31 pm    Post subject: Reply with quote

Here is an example of the controlling data file:

* MKPACGPROC (PACG post processor) Data File
*
* Lines 01-16 Comments
* Line 17 Campaign directory path
* Line 18 Number of file iterations
* Line 19 Blank line
*
* Repeating blocks
* Line +1 Search string
* Line +2 Substitute ("yes"|"no")
* Line +3 AirProbability value
* Line +4 Timer value
* Line +5 Blank line
*
* Line Last "*DONE*"

C:\user\mk\Software\Games\SH2\Dev\Test Files\
3

;Carrier Base
yes
150
160

;Column Base
no
n/a
n/a

;Patrol Bomber Base
no
n/a
n/a

;Small Craft Base
yes
170
180

;Merchant Base
no
n/a
n/a

;Tanker Base
no
n/a
n/a

;Patrol Base
no
n/a
n/a

;Q-Ship Base
no
n/a
n/a

;Jap Submarine Base
no
n/a
n/a

;Contact Base
no
n/a
n/a

*DONE*
Back to top
View user's profile Send private message Send e-mail
MarkShot



Joined: 07 Jul 2002
Posts: 491

PostPosted: Sun May 29, 2005 4:33 pm    Post subject: Reply with quote

Here is the main processing script (formatting will probably be lost):

;*****************************************************
; Pacific Aces 1.1 Post Processing Base Tweak Facility
;
; Mark Kratzer on 05/29/05; modified 05/29/05
;*****************************************************

; -----------------------------------------
; ----- Open Data File and Initialize -----
; -----------------------------------------

DataFile = FileOpen("MKPACGPROC.TXT", "READ")
LinesToSkip = 16
GoSub SkipLines
CampDirPath = FileRead(DataFile)
FileIterations = FileRead(DataFile)
;Message("Debug - CampDirPath", CampDirPath)
;Message("Debug - FileIterations", FileIterations)
FileClose (DataFile)

CountFiles = 0
CountBlocks = 0
CountStrings = 0

;------------------------------------------------
; ----- Process Each PACG Patrol File (SDF) -----
;------------------------------------------------

For IFile = 1 to FileIterations

; Form file name and process

NumStr = StrFixLeft(IFile, "0", 3)
SDFName = StrCat(CampDirPath, "Pacg_", NumStr, ".sdf")
;Message("Debug - SDFName", SDFName)

If FileExist(SDFName) Then

;Message("Debug - SDFName Exists", SDFName)
CountFiles = CountFiles+1
wFileOpen(SDFName)
;Message("Debug - Pause", "Buffer Open")

; Open the SDF into an editor buffer

DataFile = FileOpen("MKPACGPROC.TXT", "READ")
LinesToSkip = 19
GoSub SkipLines

; ------------------------------------
; ------- Process Each Base Block ----
; ------------------------------------

SearchString = "ForceEntry"
While SearchString <> "*DONE*"

SearchString = FileRead(DataFile)
;Message("Debug - SearchString", SearchString)

If SearchString <> "*DONE*" Then ; Process the block

Substitute = FileRead(DataFile)
AirProbabilityValue = FileRead(DataFile)
TimerValue = FileRead(DataFile)
BlankLine = FileRead(DataFile)

If Substitute == "yes" Then
CountBlocks = CountBlocks+1
wTopOfFile() ; position cursor
wFind(SearchString,1,0,0,0)
If WGetLineNo() <> 1 Then
CountStrings = CountStrings+2
wFind("AirProbability",1,0,0,0)
wHome()
wInsString(";")
WEnd()
wInsString(" ; MKPACGPROC Original Value")
wNewLine()
wInsString("AirProbability = ")
wInsString(AirProbabilityValue)
wInsString(" ; MKPACGPROC New Value")
wFind("Timer",1,0,0,0)
wHome()
wInsString(";")
WEnd()
wInsString(" ; MKPACGPROC Original Value")
wNewLine()
wInsString("Time = ")
wInsString(TimerValue)
wInsString(" ; MKPACGPROC New Value")
EndIf
EndIf

EndIf

EndWhile

; Close the modified SDF and reset the data file

wFileSave()
wWinClose()
FileClose (DataFile)

EndIf

Next

; -------------------------------------------
; ----- Report Final Processing Results -----
; -------------------------------------------

FinalStats = ""
FinalStats = StrCat(FinalStats, "SDF Files Processed = ", CountFiles, @CR)
FinalStats = StrCat(FinalStats, "Block Substitutions Processed = ", CountBlocks, @CR)
FinalStats = StrCat(FinalStats, "String Substitutions Processed = ", CountStrings)
Message("MKPACGPROC Completion", FinalStats)
Exit

; ----------------------------------
; ----- Subroutine definitions -----
; ----------------------------------

; ##### Skip Lines #####

:SkipLines
For ILine = 1 to LinesToSkip
IgnoreLine = FileRead(DataFile)
Next
Return
Back to top
View user's profile Send private message Send e-mail
MarkShot



Joined: 07 Jul 2002
Posts: 491

PostPosted: Sun May 29, 2005 4:35 pm    Post subject: Reply with quote

Here is a sample modified parameter block taken from an SDF during a test run:

[BASE1]
;Carrier Base
Alignment = ALLIES
Location = 0,0
AirRadius = 50000.000000
;AirProbability = 0.70000 ; MKPACGPROC Original Value
AirProbability = 150 ; MKPACGPROC New Value
;Timer = 35.000000 ; MKPACGPROC Original Value
Timer = 160 ; MKPACGPROC New Value
Group=15
NightAir=FALSE
Oneshot=FALSE
Back to top
View user's profile Send private message Send e-mail
Hitman



Joined: 14 Sep 2002
Posts: 3059
Location: Spain

PostPosted: Mon May 30, 2005 3:17 am    Post subject: Reply with quote

This modified one will cause the base to ALWAYS spawn an aircraft when the timer kicks in....weren't you looking for the opposite?

In any case, this one is probably -unless I'm wrong- the airbase linked to carriers, so it had a default high probability and low radius.
Back to top
View user's profile Send private message Send e-mail
MarkShot



Joined: 07 Jul 2002
Posts: 491

PostPosted: Mon May 30, 2005 8:12 am    Post subject: Reply with quote

The 150 and 160 you see there are just test values which I was using. My script will take whatever values I put in the configuration file and use them for the replacement.

I understand that: 1.0 = 100% and 0.10 = 10% and 0.01 = 1%. I will probably change the value on things like tankers from 0.03 to 0.005 (a 1/6 reduction). Later, I may increase patrol frequency and/or do something else to put two destroyers in a patrol.

Basically my goals are:

(1) Finding a lone tanker should be a rare and uncommon lucky break.

(2) Finding and avoiding patrols should be a regular and common reality.

(3) If you want to sink ships, you have to deal with screens and after the attack evasion/escape.

Thanks.
Back to top
View user's profile Send private message Send e-mail
MadMike



Joined: 22 Nov 2002
Posts: 533

PostPosted: Fri Aug 05, 2005 7:53 am    Post subject: Reply with quote

So... would it possible to create an "Aces" style campaign as in SH2?

Yours, Mike

IYAAYAS!
Back to top
View user's profile Send private message
Chapeau



Joined: 17 Oct 2005
Posts: 38
Location: near USS Constellation

PostPosted: Wed Nov 02, 2005 11:31 pm    Post subject: Usual dumbass question Reply with quote

What is PACG?
Back to top
View user's profile Send private message Send e-mail
TLAM Strike



Joined: 30 Apr 2002
Posts: 4866
Location: Rochester, New York

PostPosted: Wed Nov 02, 2005 11:43 pm    Post subject: Re: Usual dumbass question Reply with quote

Chapeau wrote:
What is PACG?
Pacific Aces Campaign Generator
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Chapeau



Joined: 17 Oct 2005
Posts: 38
Location: near USS Constellation

PostPosted: Wed Nov 02, 2005 11:49 pm    Post subject: Reply with quote

I guess by now you guys have figured out that I tend to ask questions first and *then* look for the answers that are right in front of me.

So now, where can I get it? This isn't the usual "ask first and then look for it" lazy-bonehead question. I have looked for it and not found it. Thanks very much.
Back to top
View user's profile Send private message Send e-mail
MarkShot



Joined: 07 Jul 2002
Posts: 491

PostPosted: Thu Nov 03, 2005 10:12 am    Post subject: Reply with quote

PACG is part of the whole PA install.

PACG is just one component that creates a new campaign each time you run it so that you don't end up replaying the same campaign over and over again.
Back to top
View user's profile Send private message Send e-mail
Floater



Joined: 14 Sep 2002
Posts: 2300
Location: England

PostPosted: Thu Nov 03, 2005 5:54 pm    Post subject: Reply with quote

PACG itself will run with any SH2 installation, and was designed and written to be as moddable as possible (within reason), in anticipation of people wanting to use it for other projects. You can even skin it if you want - as much as possible is held externally in config and graphics files.

The hard part is setting up the data - groups, units, weather, etc. Hitman did a wonderful job of working out the formats and creating the PA data, but AFAIK there isn't really anything in the way of user documentation on either that side or for the generator itself.

If I can be of any help (I wrote the software to Hitman's data design), let me know.
Back to top
View user's profile Send private message Send e-mail
The Old Man



Joined: 12 Jul 2003
Posts: 181
Location: Dallas, Tx.

PostPosted: Thu Nov 03, 2005 6:12 pm    Post subject: Reply with quote

So now, where can I get it? This isn't the usual "ask first and then look for it" lazy-bonehead question. I have looked for it and not found it. Thanks very much.


You could order the super cd
or download the lite version if you already own Destroyer Command?
Roy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Chapeau



Joined: 17 Oct 2005
Posts: 38
Location: near USS Constellation

PostPosted: Fri Nov 04, 2005 3:37 am    Post subject: Reply with quote

See? What'd I tell you? The answer was right in front of me. I have the Super CD.

Why couldn't God have made me smart and rich instead of just incredibly good-looking? Confused
Back to top
View user's profile Send private message Send e-mail
Chapeau



Joined: 17 Oct 2005
Posts: 38
Location: near USS Constellation

PostPosted: Fri Nov 04, 2005 3:44 am    Post subject: Reply with quote

Floater wrote:
The hard part is setting up the data - groups, units, weather, etc. Hitman did a wonderful job of working out the formats and creating the PA data, but AFAIK there isn't really anything in the way of user documentation on either that side or for the generator itself.

If I can be of any help (I wrote the software to Hitman's data design), let me know.


If I can come to understand the generator and the formats, etc., then I can write the documentation - I did it for some years for the DoD. Looks like I'm going to drop whatever else I'm doing and study PACG. I'll be in touch.
Back to top
View user's profile Send private message Send e-mail
The Old Man



Joined: 12 Jul 2003
Posts: 181
Location: Dallas, Tx.

PostPosted: Fri Nov 04, 2005 10:03 am    Post subject: Reply with quote

Why couldn't God have made me smart and rich instead of just incredibly good-looking?

LOL
I hear you
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> SH2 Pacific Aces All times are GMT - 5 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group