| From: | streu |
|---|---|
| Thread: | Offline PHost game hosting package |
| Forum: | Planets |
| In reply to: | Re: Offline PHost game hosting package |
| Date: | Mon, 2025-11-17 20:35 GMT |
Would I be completely insane to consider writing my own computer player?
In PHP, the only language I code fluently, but has the advantage of being very portable.
The mechanics of reading and writing data files is relatively trivial (I've already got half that code written for tools on vgaplanets.ca), but the "AI" part of it intimidates me somewhat, how to make it decide what to do. Still, making it do something (e.g. randomly build and move ships) shouldn't be hard, it's just making it play well that would be tricky.
I wouldn't call you insane for that, but it might come close for some ![]()
For one, parsing data is way more than just parsing files, it's also a matter of keeping history ("I have seen this planet three turns ago") and dealing with incomplete data ("messages told me that a meteor hit that planet and dropped 3500N on it, but I don't know anything else"). Actually, my goal for the PCC2 scripting language is to make it possible to implement a computer player in it, so PCC does the file parsing and you can concentrate on the actual logic. I'd even say the language is in a state making this possible already (i.e. it has arrays, structures and functions), but it's certainly not as much fun as developing in a popular language with full IDE support.
For another, during all those years, nobody has managed to produce a really good AI. So, it seems to be hard to do that. SpaceLord was unique in that it worked client-side when all others worked host-side and most of them cheated.
In my digital basement, I found two CPlayer source codes that I parked here temporarily:
These probably do not serve as examples for a powerful AI, but more as examples of how simple something can be to still be considered a computer opponent ![]()
If I see that correctly, neither supports PList, because they have ship properties built in. Maybe some logic to classify ship types would be a good brain-teaser for a start; you probably don't want an EXTERMINATOR as initial scout, but also not try to defend against incoming DEATH STARs with freighters.
--Stefan