detecting shiplimit

Kero

Distinguished
Apr 10, 2004
29
0
18,530
Archived from groups: alt.games.vga-planets (More info?)

I want to detect (on the hosting side) whether the shiplimit is reached.

The principle seems simple: count the number of ships in ship.hst and if
it is 500, shiplimit is reached.

1) is there a better way?
2) easiest for me is to do this after the entire hostrun, which would
leave auxhost2 to thwart me. Are there addons that remove ships from
game that are typically ran in the auxhost2 phase?

Bye,
Kero.

+--- Kero ----------------------- kero@chello@nl ---+
| all the meaningless and empty words I spoke |
| Promises -- The Cranberries |
+--- M38c --- http://httpd.chello.nl/k.vangelder ---+
 
G

Guest

Guest
Archived from groups: alt.games.vga-planets (More info?)

Kero wrote:
> I want to detect (on the hosting side) whether the shiplimit is reached.
>
> The principle seems simple: count the number of ships in ship.hst and if
> it is 500, shiplimit is reached.
>
> 1) is there a better way?

Define 'better'.

You could also look at the scores. Doesn't work with score blankers, though.

You could look for starbases with pending build orders. In this case,
the ship limit was exceeded. This has the additional advantage of also
working in Host999 games :) But it doesn't deal with cloning, though
(e.g. if there are 500 ships and someone wants to clone, this is not
detected as "shiplimit exceeded"). For PHost, you'd look into the build
queue in auxdata.hst (or, into the build queue reports in util.dat).

But otherwise it depends on what you actually want to achieve.

> 2) easiest for me is to do this after the entire hostrun, which would
> leave auxhost2 to thwart me. Are there addons that remove ships from
> game that are typically ran in the auxhost2 phase?

You could as well hook your own program into auxhost2, I assume.


Stefan
 

Kero

Distinguished
Apr 10, 2004
29
0
18,530
Archived from groups: alt.games.vga-planets (More info?)

>> I want to detect (on the hosting side) whether the shiplimit is reached.
>>
>> The principle seems simple: count the number of ships in ship.hst and if
>> it is 500, shiplimit is reached.
>>
>> 1) is there a better way?
>
> You could also look at the scores. Doesn't work with score blankers, though.

Too client-side, indeed.

> You could look for starbases with pending build orders. In this case,
> the ship limit was exceeded. This has the additional advantage of also
> working in Host999 games :) But it doesn't deal with cloning, though
> (e.g. if there are 500 ships and someone wants to clone, this is not
> detected as "shiplimit exceeded"). For PHost, you'd look into the build
> queue in auxdata.hst (or, into the build queue reports in util.dat).
>
> But otherwise it depends on what you actually want to achieve.

It will be a flag to switch to another hosting schedule and #trns missed
before the site kicks players. The flag will be visible for the players.
If it flags one turn late, that's not a problem. The less code I have to
write, the better.

Pending ship-builds feels good. I can always add the clone-check later.
I'd very much prefer to be host-version independent.

>> 2) easiest for me is to do this after the entire hostrun, which would
>> leave auxhost2 to thwart me. Are there addons that remove ships from
>> game that are typically ran in the auxhost2 phase?
>
> You could as well hook your own program into auxhost2, I assume.

If it were code I could run in dosemu...
(probably the C code from K-Util could do that, with djgpp available. hm.)

Thanks!

wanna keep developing software?
http://swpat.ffii.org/

+--- Kero ----------------------- kero@chello@nl ---+
| all the meaningless and empty words I spoke |
| Promises -- The Cranberries |
+--- M38c --- http://httpd.chello.nl/k.vangelder ---+
 
G

Guest

Guest
Archived from groups: alt.games.vga-planets (More info?)

Kero wrote:
>>>I want to detect (on the hosting side) whether the shiplimit is reached.
>>>
>>>The principle seems simple: count the number of ships in ship.hst and if
>>>it is 500, shiplimit is reached.
[snip]
> Pending ship-builds feels good. I can always add the clone-check later.
> I'd very much prefer to be host-version independent.

Okay. In this case, simply looking for bases with nonzero build orders
should be the way to go.

Additional advantages are that it doesn't matter what your actual ship
limit is (999 vs. 500, or even more odd numbers with PHost 4.x).

The disadvantages are that you will not recognize if all pending build
orders are clone orders. For PHost, you'd solve that by looking into
auxdata.hst. I think, for HOST you cannot solve that. However, I guess
it happens very rarely that there are only clone orders around and no
normal build orders :)

>>>2) easiest for me is to do this after the entire hostrun, which would
>>> leave auxhost2 to thwart me. Are there addons that remove ships from
>>> game that are typically ran in the auxhost2 phase?
>>
>>You could as well hook your own program into auxhost2, I assume.
>
> If it were code I could run in dosemu...
> (probably the C code from K-Util could do that, with djgpp available. hm.)

For small things I use Turbo C 2.0 which I downloaded from Borland's
museum website. It makes nice small .exes.


Stefan
 

TRENDING THREADS