max_defense_ships and max_scavengers in 1.69.1.1?

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

max_defense_ships and max_scavengers in 1.69.1.1?

Post by Commander McLane »

Can anybody explain the discrepancy between the following two pieces of code? The first one is part of the shipdata-definition of a Generation Ship that I have made dockable by setting the isCarrier-key. But I don't want any ships to launch from it. So to prevent at least a launch of those I set max_defense_ships and max_scavengers both to 0.

Code: Select all

	<key>ghost-from-past-2</key>
	<dict>
		<key>ai_type</key>
		<string>ghostGenship2AI.plist</string>
		<key>equivalent_tech_level</key>
		<integer>0</integer>
		<key>escort-role</key>
		<string>ghost_genship_escort</string>
		<key>escorts</key>
		<integer>6</integer>
		<key>isCarrier</key>
		<true/>
		<key>like_ship</key>
		<string>ghost-from-the-past-genship</string>
		<key>max_defense_ships</key>
		<integer>0</integer>
		<key>max_flight_speed</key>
		<real>50</real>
		<key>max_scavengers</key>
		<integer>0</integer>
		<key>name</key>
		<string>Generation Ship</string>
		<key>roles</key>
		<string>ghost_from_past_2</string>
		<key>subentities</key>
		<array>
			<string>ghost-genship-dock 0 -284 0 1 0 0 0</string>
			<string>ghost-genship-cylinder 0 0 -25 1 0 0 0</string>
			<string>ghost-genship-cylinder 0 0 -6775 1 0 0 0</string>
			<string>ghost-genship-cylinder 0 0 -13525 1 0 0 0</string>
			<string>ghost-genship-cylinder 0 0 -20275 1 0 0 0</string>
			<string>ghost-genship-frame 0 0 -6050 1 0 0 0</string>
			<string>ghost-genship-frame 0 0 -12800 1 0 0 0</string>
			<string>ghost-genship-frame 0 0 -19550 1 0 0 0</string>
			<string>ghost-genship-thruster 0 0 -26300 1 0 0 0</string>
			<string>ghost-genship-name 0 0 0 1 0 0 0</string>
		</array>
	</dict>
The second one is a state dump of this very ship in flight. Interesting are the last lines starting with [dumpState.stationEntity].

Code: Select all

[dumpState]: State for <StationEntity Generation Ship 225>:
  [dumpState.entity]: Universal ID: 225
  [dumpState.entity]: Scan class: CLASS_NEUTRAL
  [dumpState.entity]: Status: STATUS_IN_FLIGHT
  [dumpState.entity]: Position: (3.48722e+06, -469.717, 497825)
  [dumpState.entity]: Orientation: (0.506512 - 0.505482i + 0.493428j + 0.494432k)
  [dumpState.entity]: Distance travelled: 12956
  [dumpState.entity]: Energy: 500000 of 500000
  [dumpState.entity]: Mass: 9.46689e+11
  [dumpState.entity]: Flags: isShip, isStation, hasMoved, isSunlit
  [dumpState.shipEntity]: Name: Generation Ship
  [dumpState.shipEntity]: Roles: ghost_from_past_2
  [dumpState.shipEntity]: Subentity count: 11
  [dumpState.shipEntity]: Time since shot: 100260
  [dumpState.shipEntity]: Behaviour: BEHAVIOUR_FLY_TO_DESTINATION
  [dumpState.shipEntity]: Destination: (-33413.2, -72264.6, 491040)
  [dumpState.shipEntity]: Other destination: (0, 0, 0)
  [dumpState.shipEntity]: Waypoint count: 0
  [dumpState.shipEntity]: Desired speed: 50
  [dumpState.shipEntity]: Fuel: 0
  [dumpState.shipEntity]: Fuel accumulator: 1
  [dumpState.shipEntity]: Missile count: 0
  [dumpState.shipEntity.ai]: AI:
    [dumpState.ai]: State machine name: ghostGenship2AI.plist
    [dumpState.ai]: Current state: CONTINUE_JOURNEY
    [dumpState.ai]: Next think time: 284.451
    [dumpState.ai]: Next think interval: 284.451
  [dumpState.shipEntity]: Frustration: 0
  [dumpState.shipEntity]: Success factor: 3.52137e+06
  [dumpState.shipEntity]: Shots fired: 0
  [dumpState.shipEntity]: Hull temperature: 60
  [dumpState.shipEntity]: Heat insulation: 1
  [dumpState.shipEntity]: Flags: has_ecm, escortsAreSetUp
  [dumpState.stationEntity]: Alert level: green
  [dumpState.stationEntity]: Max police: 8
  [dumpState.stationEntity]: Max defence ships: 3
  [dumpState.stationEntity]: Police launched: 0
  [dumpState.stationEntity]: Max scavengers: 3
  [dumpState.stationEntity]: Scavengers launched: 0
  [dumpState.stationEntity]: Docked shuttles: 2
  [dumpState.stationEntity]: Docked traders: 8
  [dumpState.stationEntity]: Equivalent tech level: 2147483647
  [dumpState.stationEntity]: Equipment price factor: 1
  [dumpState.stationEntity]: Flags: none
It seems to have defense ships (not defence, by the way), scavengers and on top of that police as well. I have given it no AI-commands to launch any of these, but would it, if I did? Is their number 0, as I put it in the shipdata, or 3, as the dump indicates?

Confused :?

And what about the third-to-last line, indicating an equivalent_tech_level of 2147483647 (which BTW is again 2^31-1, a number we met somewhere else as well)?

Oh, and last but not least, its escorts are not there. The complete entity-dump suggests that they are somewhere in the system, using route1patrolAI in the state HEAD_FOR_WITCHPOINT. By chance I stumbled across one of them, but the six escorts weren't even together.

Code: Select all

  [universe.objectDump]: -> Ent:5		<ShipEntity Bixeinian Escort 231> mass 26715.86 <AI 0x6d8690>{'route1patrolAI.plist' in state: 'HEAD_FOR_WITCHPOINT' for Bixeinian Escort 231}
  [universe.objectDump]: -> Ent:6		<ShipEntity Bixeinian Escort 230> mass 26715.86 <AI 0x1055cd20>{'route1patrolAI.plist' in state: 'HEAD_FOR_WITCHPOINT' for Bixeinian Escort 230}
  [universe.objectDump]: -> Ent:7		<ShipEntity Bixeinian Escort 229> mass 26715.86 <AI 0x10563850>{'route1patrolAI.plist' in state: 'HEAD_FOR_WITCHPOINT' for Bixeinian Escort 229}
  [universe.objectDump]: -> Ent:8		<ShipEntity Bixeinian Escort 227> mass 26715.86 <AI 0x105aac40>{'route1patrolAI.plist' in state: 'HEAD_FOR_WITCHPOINT' for Bixeinian Escort 227}
  [universe.objectDump]: -> Ent:9		<ShipEntity Bixeinian Escort 228> mass 26715.86 <AI 0x1054e6b0>{'route1patrolAI.plist' in state: 'HEAD_FOR_WITCHPOINT' for Bixeinian Escort 228}
  [universe.objectDump]: -> Ent:10		<ShipEntity Bixeinian Escort 226> mass 26715.86 <AI 0x10527750>{'route1patrolAI.plist' in state: 'HEAD_FOR_WITCHPOINT' for Bixeinian Escort 226}
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: max_defense_ships and max_scavengers in 1.69.1.1?

Post by JensAyton »

Commander McLane wrote:
It seems to have defense ships (not defence, by the way), scavengers and on top of that police as well. I have given it no AI-commands to launch any of these, but would it, if I did? Is their number 0, as I put it in the shipdata, or 3, as the dump indicates?
It will use three. The shipdata.plist entries max_scavengers, max_defense_ships and max_police are ignored due to a bug probably introduced between 1.68 and 1.69. Thank you for alerting me to this.

Edit: This affected equivalent_tech_level and equipment_price_factor too. Bug #11684 closed.
Commander McLane wrote:
And what about the third-to-last line, indicating an equivalent_tech_level of 2147483647 (which BTW is again 2^31-1, a number we met somewhere else as well)?
This is “NSNotFound”, a general placeholder value, meaning no equivalent_tech_level was found in the plist entry. A quick search of the source seems to indicate that this will result in a tech level of 6 being used for purposes of selecting defense, patrol and police ships, and the system’s tech level being used for equipment and ship trade.
Commander McLane wrote:
Oh, and last but not least, its escorts are not there. The complete entity-dump suggests that they are somewhere in the system, using route1patrolAI in the state HEAD_FOR_WITCHPOINT. By chance I stumbled across one of them, but the six escorts weren't even together.
There is a known bug where only some spawned escorts actually sign up for escort duty with the parent ship. I haven’t looked into the reason yet.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Today I played the groundbattle of my slavemission under oolite 1.69.1 It behaved a little bit different than under version 1.65.

First of all there is a bug in the coloring of the sky. Under version 1.65 the stars fade away near the planet surface, but with version 1.69.1 they get a big square border and are more visible than before. I do not know if this was mentioned before.

Then the battle itself. I placed 4 satellites in a square close to the surface. I gave them "illegally" a secondary role of "station". This had two advantages for me. By just adding hem they all four had a random orientation. The secondary role of station gave then all the same orientation. And with the role of station I could let them "talk" together by changing the alert levels that only stations can have.

The challenge of this part of the mission is finding them on a vast surface. The satellites are so tiny that your hight indicator must be halfway before you start seeing them. On radar you could see them on much greater distance, but I disabled the radar detection by using military jammers. (Under version 1.65 you could also disable the radar by illegally using scanClass: CLASS_NO_DRAW, but with version 1.69 this does not work anymore). For finding the satellites without problems you must navigate with the advanced_space_compass.

So far everything was OK in oolite version 1.65 but with version 1.69 my "stations" start launching ships although they do not have a docking slit and no stationAI. This problem was also mentioned in another posting that if you design an abandoned station it still launched system ships. Or if you design a pirate only station it will also generate normal ships.
In my case the problem was that those launched ships are visible on radar and my station location can now be spotted from a long distance.
(In my OXP version 1.1.1 I also anticipated that the player itself ends inside the stations if he uses his escapepod)

A real problem was the prevention of launching ships not. I set in the shipdata.plist all max_police, max_defense_ships and max_scavengers at 0. This fixed the problem for me and the stations became abandoned again. I hope other with the same problem can use this info.
Ahruman wrote:
It will use three. The shipdata.plist entries max_scavengers, max_defense_ships and max_police are ignored due to a bug probably introduced between 1.68 and 1.69. Thank you for alerting me to this.
I saw an effect with changing max_ships.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Should this go in the scriptors cove Sticky Thread in the Expansion pack forum?
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

TGHC wrote:
Should this go in the scriptors cove Sticky Thread in the Expansion pack forum?
No. None of this thread is about scripting.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

So that's where I've been going wrong!
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Eric Walch wrote:
<some other stuff>

I saw an effect with changing max_ships.
Hey, and another method/command/key formerly completely unknown to me (and not documented in the wiki). I'll try it out on my problem at once.

Eric, I have a formal request to you: Could you be so kind as to put all findings of yours, as far as existing methods, keys and commands are concerned, in the wiki? That would make my life (and that of some other scripters, I guess) so much easier! :)

******

Oh, and:
First of all there is a bug in the coloring of the sky. Under version 1.65 the stars fade away near the planet surface, but with version 1.69.1 they get a big square border and are more visible than before. I do not know if this was mentioned before.
Yes, it was here.
Last edited by Commander McLane on Wed Sep 12, 2007 8:09 am, edited 1 time in total.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Hmmm. I put an additional

Code: Select all

		<key>max_ships</key>
		<integer>0</integer>
in my Generation Ship's shipdata.

However its entity-state-dump still reads (the relevant part only)

Code: Select all

  [dumpState.stationEntity]: Max police: 8
  [dumpState.stationEntity]: Max defence ships: 3
  [dumpState.stationEntity]: Police launched: 0
  [dumpState.stationEntity]: Max scavengers: 3
  [dumpState.stationEntity]: Scavengers launched: 0
  [dumpState.stationEntity]: Docked shuttles: 2
  [dumpState.stationEntity]: Docked traders: 8
So it looks as if max_ships has no effect as well in my 1.69.1.1.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

about the escorts:
Did you do a setUpEscorts in the setup_actions?
This should spawn the required number of escorts (minus one or two) near the mother and have them apply for a job.

For me these things never work either. ;)
Riding the Rocket!
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

McLane wrote:
Eric, I have a formal request to you: Could you be so kind as to put all findings of yours, as far as existing methods, keys and commands are concerned, in the wiki? That would make my life (and that of some other scripters, I guess) so much easier!
That is also my opinion. There are so many hidden features you never would gues without documentation. I uploaded it at Station Ships . I linked it from the relevant part in shipdata.plist ans the "How to AI" page

But reading this code today I noticed that versions 1.65 and 1.69.0 explicit check with trader and shuttle launch that scanClass not equal CLASS_ROCK ( is not a rock-hermit). In version 1.65 I never saw traders coming out of a rock hermit. The next version I installed was 1.69.1 That one launched traders from a Hermit. I find it cool, but launching of shuttles from anything than an station orbitting a planet is wrong.

Today I examined a Behemoth. That one also launched traders I never noticed before. But when the Behemoth was on full speed the slow trader launched and was hit from behind by the Behemoth. And trader and shuttle counts can not be set to zero.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

isCarrier should block traffic from being launced.
excepting explicit AI/escort launches of defence-ships and such.

(docking should be possible, if I understand correctly docked_ships are remembered.)

isStation should enable traffic.
Riding the Rocket!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Arexack_Heretic wrote:
isCarrier should block traffic from being launced.
excepting explicit AI/escort launches of defence-ships and such.

(docking should be possible, if I understand correctly docked_ships are remembered.)

isStation should enable traffic.
Hmmm. According to the documentation isCarrier is just an alternative to putting carrier among the roles, and therefore shouldn't do anything else than that. And something like isStation doesn't exist.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

I thought they were flags.
And I'm not describing anything real, just how I think it should work. :oops:
Riding the Rocket!
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

McLane wrote:
Hmmm. According to the documentation isCarrier is just an alternative to putting carrier among the roles, and therefore shouldn't do anything else than that. And something like isStation doesn't exist.
That is right. isStation only exist inside the code. But if "station" or "carrier" is listed among the shipdata roles the isStation flag is internaly set. The same applys for isCarrier. This also sets internally the isStation status. So the documentation is correct. IsCarrier is just a way to let a ship behave like a station in some ways and allow for the docking protocols.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Eric Walch wrote:
But reading this code today I noticed that versions 1.65 and 1.69.0 explicit check with trader and shuttle launch that scanClass not equal CLASS_ROCK ( is not a rock-hermit). In version 1.65 I never saw traders coming out of a rock hermit. The next version I installed was 1.69.1 That one launched traders from a Hermit. I find it cool, but launching of shuttles from anything than an station orbitting a planet is wrong.
I’m not entirely clear on what all of that means, but it looks like something that could do with a proper bug report. Hint, hint.
Post Reply