Rules and Strategy for our beloved game
I've been messing around trying to get a working offline PHost setup with PList 3.2 and a computer player (any). But I haven't succeeded.
Just wondering if anyone smarter than me out there could build such a setup that works under Win64 (or under WSL2/Ubuntu is fine too)?
I've been messing around trying to get a working offline PHost setup with PList 3.2 and a computer player (any). But I haven't succeeded.
Just wondering if anyone smarter than me out there could build such a setup that works under Win64 (or under WSL2/Ubuntu is fine too)?
PHost itself should be trivial; the Win32 version should run just fine under Win64. If it doesn't, that's a bug.
Computer players are harder because all that I know are 16-bit DOS so we need emulation. In particular script-friendly emulation is hard to come by. This is the main reason why there is no Tim-Host support on PlanetsCentral yet.
I am actually using DOSEMU under Linux to run build scripts. With some trickery, this allows me to run e.g. the compiler to build PCC1, and get output on the console, which is the same technology you'd need for running a host or cplayer. However, DOSEMU seems to be pretty unmaintained and has been removed from Debian, and probably does not run in WSL, so I cannot really recommend that.
I would therefore propose exploring DOSBOX. That runs fine under all operating systems.
One possible setup could be: native PHost, and SpaceLord inside DOSBOX, with a dosbox.conf that just runs SpaceLord and then exits. SpaceLord is unique in that it runs client-side, so you can treat it like any player, and it need not be tightly coupled to host. You run PHost for the turn, then play your turn normally, and run DOSBOX-with-SpaceLord for the opponent turn (commands in [autoexec] section).
Another possible setup could be: PHost for DOS and any cplayer, both inside DOSBOX. You play your turn, and then run DOSBOX-with-host-script-inside for hosting.
--Stefan
PHost itself should be trivial
Trivial if you know how things are supposed to fit together. I'm pretty sure PHost itself will run fine, it's everything that goes around it. Trying to figure out what directory structure things are supposed to have, for example; I find the documentation for various programs somewhat lacking. Couldn't figure out where to get appropriate files for PList 3.2, don't remember if I even got a universe mastered properly. I'm not clear either if wrapped maps are native to PHost or if some add-on is needed.
DOSbox is fine, I use it to play with VPA already so I'm passingly familiar there, and I'm sure once I had a host-side structure set up appropriately it wouldn't be any trouble to run, but it's getting the foundation set up that has got me lost.
PHost itself should be trivial
Trivial if you know how things are supposed to fit together. I'm pretty sure PHost itself will run fine, it's everything that goes around it. Trying to figure out what directory structure things are supposed to have, for example; I find the documentation for various programs somewhat lacking. Couldn't figure out where to get appropriate files for PList 3.2, don't remember if I even got a universe mastered properly.
OK, I had assumed you had already tried this before; before operating systems made running DOS apps complicated ![]()
The official source for AMaster and PList is The Vagabond. PList is also available through the Download Center.
The AMaster archive contains DOS and Linux binaries, no Windows binaries, that would be something you need to invoke from DOSBOX. Maybe that would be an argument for you to do your hosting completely in DOSBOX. If you want to use PMaster, that one has a Windows binary as well. PlanetsCentral uses PMaster for the Titan games, because AMaster cannot do the classic "homeworlds in a circle".
Regarding the actual hosting procedure, there's two sections in the PHost docs:
The normal directory setup is: all programs in one directory (the root directory), all game data files in another, and then invoke tools from the program directory as "phost path/to/game".
Files like xyplan.dat, planet.nm should be in the game directory, but if the are not there, all programs also find them in the root directory.
I'm not clear either if wrapped maps are native to PHost or if some add-on is needed.
Wrapped maps are natively supported, just set AllowWraparoundMaps=Yes (and an appropriate WraparoundRectangle) in pconfig.src and amaster.src. PlanetsCentral's Wrapped Map building block is just that, config options.
Best regards,
Stefan
Note to self: set up CI builds for Windows binaries of PHost utilities
I had assumed you had already tried this before; before operating systems made running DOS apps complicated
I have done this before, albeit with THost... but that was 30 years ago. ![]()
I'll give it another go sometime.
I just noticed here that pdocs41h.zip has a "de" icon on the right, and pdocs41h_de.zip has a "en" icon -- I think these are reversed.
Documenting (mostly for my own reference) what I've done (Win11-64).
All directory references are abbreviated.
Initially following instructions from https://phost.de/phost4doc/hosting.html
Download PHost (Win32) from https://planetscentral.com/download/index.cgi/host/phost/4.1h
Unzip to /phost/Create game subdir /phost/game01/
Copy /phost/config/complete.src /phost/game01/pconfig.src
(edit as desired)Download PList 3.2 from https://planetscentral.com/host/file.cgi/shiplist/plist-3.2/
Copy shiplist.txt /phost/game01/shiplist.txt
Also extract the rest of the PList3.2 .dat files (beamspec.dat, engspec.dat, hullfunc.dat, hullspec.dat, torpspec.dat, truehull.dat) to /phost/game01/Download AMaster v3.10g from https://phost.de/~vagabond/tools/#amaster
Unzip to /phost/amaster/Copy /phost/amaster/dos/config/amaster.src /phost/game01/amaster.src
Launch DOSbox
Run /phost/amaster/dos/bin/amaster -v to make sure it's working
Get stuck with error message Load error: no DPMI - Get cdspmi*b.zip
After some searching find csdpmi7b.zip
Extract \bin\CWSDPMI.EXE from zip to /phost/amaster/
Run CWSDPMI.EXE
Run amaster.exe -v again, more success this time, but complaint about Warning: cannot open swap file c:\cwsdpmi.swp
MOUNT C: U:\ to map DOSbox C: to my ramdrive
Run amaster.exe -v again again, no errors.Copy planet.nm and race.nm from another game to /phost/game01/
Edit /phost/game01/amaster.src change RaceIsPlaying to enable all 11 races (default is Player1-only).
Run amaster -t -d ../../../game01/
Seems to run ok, only thing I notice at the top of amaster.log isCreate universe for PHOST4 game... Reading file : pconfig.src, section : %PCONFIG Reading file : amaster.src, section : %AMASTER Warning: Those parameters were not read from config file. Warning: Setting them to default values.
Not quite sure what that warning is saying, since apparently it does find and read at least amaster.src in the game directory.
Exit DOSbox
Run /phost/phost.exe -r ./game01
to test in read-only modeDespite using /phost/config/complete.src there's a bunch of combat-related settings that default commented-out in pconfig.src leading to lots of WARNING: pconfig.src: default value used: messages:
WARNING: pconfig.src: default value used: 'AllowEngineShieldBonus = False' WARNING: pconfig.src: default value used: 'BayRechargeRate = 52' WARNING: pconfig.src: default value used: 'BayRechargeBonus = 2' WARNING: pconfig.src: default value used: 'BeamRechargeRate = 8' WARNING: pconfig.src: default value used: 'BeamRechargeBonus = 0' WARNING: pconfig.src: default value used: 'TubeRechargeRate = 45' WARNING: pconfig.src: default value used: 'BeamHitFighterCharge = 500' WARNING: pconfig.src: default value used: 'BeamHitShipCharge = 600' WARNING: pconfig.src: default value used: 'TorpFiringRange = 30000' WARNING: pconfig.src: default value used: 'BeamFiringRange = 20000' WARNING: pconfig.src: default value used: 'TorpHitOdds = 65' WARNING: pconfig.src: default value used: 'BeamHitOdds = 100' WARNING: pconfig.src: default value used: 'BeamHitBonus = 0' WARNING: pconfig.src: default value used: 'StrikesPerFighter = 7' WARNING: pconfig.src: default value used: 'FighterKillOdds = 20' WARNING: pconfig.src: default value used: 'FighterBeamExplosive = 2' WARNING: pconfig.src: default value used: 'FighterBeamKill = 2' WARNING: pconfig.src: default value used: 'ShipMovementSpeed = 75' WARNING: pconfig.src: default value used: 'FighterMovementSpeed = 235' WARNING: pconfig.src: default value used: 'BayLaunchInterval = 3' WARNING: pconfig.src: default value used: 'MaxFightersLaunched = 19' WARNING: pconfig.src: default value used: 'AllowAlternativeCombat = No' WARNING: pconfig.src: default value used: 'StandoffDistance = 3000' WARNING: pconfig.src: default value used: 'PlanetsHaveTubes = No' WARNING: pconfig.src: default value used: 'FireOnAttackFighters = No' WARNING: pconfig.src: default value used: 'TorpHitBonus = 0' WARNING: pconfig.src: default value used: 'TubeRechargeBonus = 0' WARNING: pconfig.src: default value used: 'ShieldDamageScaling = 80' WARNING: pconfig.src: default value used: 'HullDamageScaling = 80' WARNING: pconfig.src: default value used: 'CrewKillScaling = 80' WARNING: pconfig.src: default value used: 'ShieldKillScaling = 0' WARNING: pconfig.src: default value used: 'ExtraFighterBays = 3,0,0,0,0,0,0,0,0,0,0' WARNING: pconfig.src: default value used: 'BeamHitFighterRange = 100000' WARNING: pconfig.src: default value used: 'FighterFiringRange = 3000'
There is a default wormholes.txt in the PHost distribution, but at quick glance it seems to contain two hardcoded wormholes as an example. Is there some kind of utility that generates/randomizes wormhole locations? It wouldn't be hard to script something up if there isn't, but I would have thought there was something already available for this?
I also noticed significant differences in the default values between /phost/config/complete.src and /phost/config/simple.src
Best illustrated with an online diff tool: https://www.diffchecker.com/G2zeHj1g/
Obviously there's lots of stuff missing from simple.src but there are several things that are toggled differently by default, a few significant examples:
CPEnableRemote, RoundGravityWells, AllowNoFuelMovement, CloakFailureRate, etc, etc. These kind of settings significantly change how a game plays out and I would have thought that PHost would provide consistent default no matter whether you select simple or complete.
Thanks for you effort.
Run amaster -t -d ../../../game01/
Seems to run ok, only thing I notice at the top of amaster.log isCreate universe for PHOST4 game... Reading file : pconfig.src, section : %PCONFIG Reading file : amaster.src, section : %AMASTER Warning: Those parameters were not read from config file. Warning: Setting them to default values.Not quite sure what that warning is saying, since apparently it does find and read at least amaster.src in the game directory.
If those are combat parameters (e.g. BeamRechargeRate): those are in shiplist.txt. I guess, AMaster does not know that yet. The split into pconfig.src / shiplist.txt was introduced in PHost 4 to make it clear that a particular shiplist should always be played with a particular set of combat parameters - but all other parameters can be freely configured. You need to copy the shiplist.txt file from the PList archive.
This also explains the following warning:
- Despite using /phost/config/complete.src there's a bunch of combat-related settings that default commented-out in pconfig.src leading to lots of WARNING: pconfig.src: default value used: messages:
- There is a default wormholes.txt in the PHost distribution, but at quick glance it seems to contain two hardcoded wormholes as an example. Is there some kind of utility that generates/randomizes wormhole locations? It wouldn't be hard to script something up if there isn't, but I would have thought there was something already available for this?
AMaster can do that (CreateWormholes=Yes, WormholeNumber=xxx); also see here.
I also noticed significant differences in the default values between /phost/config/complete.src and /phost/config/simple.src
Best illustrated with an online diff tool: https://www.diffchecker.com/G2zeHj1g/
Obviously there's lots of stuff missing from simple.src but there are several things that are toggled differently by default, a few significant examples:
It's been a long time that we did this, but one idea was that simple.src should also produce a beginner-friendly game. That is at least the reason for disabling remote-control in simple.src.
--Stefan
You need to copy the shiplist.txt file from the PList archive.
I already did that (item #4 on my list).
It was not clear to me is what amaster is complaining about, but a little digging in amaster.c I think clears up the confusion. A minor grammatical error ("Those" vs "These") changes the whole meaning of the output:
Create universe for PHOST4 game... Reading file : pconfig.src, section : %PCONFIG Reading file : amaster.src, section : %AMASTER Warning: Those parameters were not read from config file. Warning: Setting them to default values. MapManipulativeAlgorithm = No
"Those" would refer to the errors mentioned previously, "These" would refer to the errors following which I think is what amaster is actually trying to say: it's complaining about "MapManipulativeAlgorithm" not being present in the config file(s).
This also explains the following warning
I'm not sure how it does? shiplist.txt is present and everything works, PHost is just (correctly) warning that pconfig.src does not have entries for certain values and the default is being used. This looks like correct behavior to me.
AMaster can do that (CreateWormholes=Yes, WormholeNumber=xxx)
Thanks, I missed that.
SpaceLord inside DOSBOX
SpaceLord isn't playing nice. Running as spacelrd game01 /1 it starts ok then immediately crashes:
Processing data for turn number 1 Spacelord will play for The Solar Federation INFO: Initialising MyPlan1.spl INFO: Initialising MyShip1.spl Runtime error 201 at 0909:13A9.
Any ideas?
This also explains the following warning
I'm not sure how it does? shiplist.txt is present and everything works, PHost is just (correctly) warning that pconfig.src does not have entries for certain values and the default is being used. This looks like correct behavior to me.
Hmmm, PHost should not warn about things in shiplist.txt.
Does your host.log indicate that PHost is reading shiplist.txt? I just checked host.log from North Star 18, there it says "Using custom hull functions defined in 'shiplist.txt'". PlanetsCentral's games do not generate any such warnings.
SpaceLord inside DOSBOX
SpaceLord isn't playing nice. Running as spacelrd game01 /1 it starts ok then immediately crashes:
Processing data for turn number 1 Spacelord will play for The Solar Federation INFO: Initialising MyPlan1.spl INFO: Initialising MyShip1.spl Runtime error 201 at 0909:13A9.Any ideas?
Runtime error 201 is "Range check error". Could it be that SpaceLord does not like ships with more than 10 weapons?
--Stefan
Does your host.log indicate that PHost is reading shiplist.txt? I just checked host.log from North Star 18, there it says "Using custom hull functions defined in 'shiplist.txt'". PlanetsCentral's games do not generate any such warnings.
Yes:
Portable Host version 4.1h for PC Win32/Windows NT
Copyright (c) 1995-2014 Portable Host Project
Invoked with the following parameters:
L:\James\VGAP\phost\phost.exe
./game01
It looks like this game has just been mastered. PHost is
now creating the data files necessary to run the first turn.
Using custom hull functions defined in 'shiplist.txt'
Writing xtrfcode.txt file...
Random seed is 57712
Game name is 'Game01'
This is Turn #1.
Checking host data...
Could it be that SpaceLord does not like ships with more than 10 weapons?
Not impossible. spacelrd.txt does say "What SpaceLord can't do: - PHost is NOT supported (yet !)" It's quite possible there's an expectation of max 10 beams/bays/torps.
I don't suppose there's any source code for any of these computer players floating around.