Topic: Controlling Spacedock  (Read 8180 times)

0 Members and 1 Guest are viewing this topic.

nx_adam_1701

  • Guest
Controlling Spacedock
« on: February 01, 2004, 05:22:17 am »
How can I control the amount of ships generated by the spacedock during the campaign, I was reading in the DITL and saw this
NCC 71099 USS Challenger
(NCC 1701-D USS Enterprise)
NCC 70637 USS Galaxy
USS Magellan
 (NCC 71832 USS Odyssey)
NCC 71867 USS Trinculo
NCC 71854 USS Venture
(NCC 71807 USS Yamato)
 
plus 10 others built in total. 4 have been lost in all. The class remains in production.


I want in my mod for it to be hard to obtain a Galaxy, not only a high BVP, but also very limited in the spacedock, I have other ships to I want to make difficult to get and etc..., so how can I accomplish this, thanks guys



adam out

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #1 on: February 01, 2004, 06:33:22 am »
Anyone???

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #2 on: February 01, 2004, 07:54:34 am »
Is this SFC3? What is the "DITL"?  

The shipyards are notoriously hard to control. Not sure about the gfs for SFC3, but to control the probability that a ship will be produced in EAW or OP edit the values under [Cost/Ship/Build] in Economy.gf. The empire's economy as determined from the map must be sufficient to produce the desired ships, but exactly how all this works is pretty much a black box. I imagine most of this has carried over to SFC3.

If you want to explicitly control the shipyards then run on SQL, turn off the shipyards altogether, construct the ship records from the shiplist (or capture from the db while the server's shipserver is enabled) then populate the shipyards when and how you desire using a script or program you have written.  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #3 on: February 01, 2004, 08:00:24 am »
SFC2 OP DITL Daystrom Institute Technical Library

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #4 on: February 01, 2004, 08:09:33 am »
Oh, you mean: Daystrom Institute Technical Library , thanks - I was confused and thought you were talking about SFC3 and that the DITL was part of SFC3... oops!. In which case my comments on controlling the OP shipyard is the info you are looking for I think.
« Last Edit: February 01, 2004, 08:10:59 am by Bonk »

Toten

  • Guest
Re: Controlling Spacedock
« Reply #5 on: February 01, 2004, 08:24:15 am »
First off I hope you are referring to OP or EAW for D2 play.  What you ask is not possible with SFC3 as it currently exists.

It really sounds like your trying to instill an OOB (Order of Battle), in other words the maximum amount of ships of a class that can be generated by the game logic during a campaign, barring losses.  Correct ?

So for instance if the klingons only ever built one B10, then ONE and ONLY ONE B10 will be available EVER in the campaign?

If this is what you are looking for then the only way to attempt to do this now is as follows...(and its not perfect as the game mechanics dont allow for OOB, we have been trying to replicate one for years now)

1) players are restricted to who can fly what.  In other words, BCH's and bigger can be assigned ships and only certain players can fly them.  When they go poof they ARE NOT ALLOWED to be REPURCHASED regardless if they show in the shipyards or not.  (read here they cant buy a new one till the VC round changes, if your doing that, or some agreed upon conditon happens, like a key planet  for mining of dilithium is found and captured for your race)

2) Ships of a certain type are made rediculously expensive to limit who can afford to buy what.  This is especially painful and effective when ship replacement trade in is set very low.  ie you could lose 100,000 PP when dying in or selling off one DN to get another.  (this tends to lower the "fun factor" however especially with hand of bethke crashes)

3) Play with the ship lists to addend the FYA and LYA (first year available and last year available) to make ships go obsolete in a timely fashion (however the game generated AI doesnt play by the rules no matter how many times you complain to the AI race moderators)

4) Between game rounds (if you set a server up this way) addend the shiplist to REMOVE or ADD ships between rounds to make certain they only exist in the game when you want them to exist.

If you are familiar with the ADB game Federation and Empire (F&E) then OOB is the heart of that game.  An OOB is a relative holy grail for modders for a more realistic game situation to more accurately represent canon SFB general war (or other such campaigns as ISC pacification or the andromedan invasion or the early fed klink wars or etc)  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #6 on: February 01, 2004, 08:58:35 am »
WOW, that was alot to grasp lol lol, but i think i get, wait no i dont, im not going to lie to you im completely lost lol lol, i do want to control how many ships are generated in the spacedock during a campaign, I definitely dont want to see 6 defiants and by defiant i mean the one with the cloaking device, not the general ones that were highly produced during the Dominion wars, meanwhile there should only be one of those thru out the game, but im still alittle confused

adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #7 on: February 01, 2004, 09:18:06 am »
This kind of control is just not possible unless you use SQL as outlined above (not released yet...).

You can edit the shiplist. (remove ships, restrict ships, edit dates available etc...) and edit the values under [Cost/Ship/Build] in Economy.gf. That is all the control over the shipyard that is available without SQL.  

Toten

  • Guest
Re: Controlling Spacedock
« Reply #8 on: February 01, 2004, 09:21:29 am »
Quote:

WOW, that was alot to grasp lol lol, but i think i get, wait no i dont, im not going to lie to you im completely lost lol lol, i do want to control how many ships are generated in the spacedock during a campaign, I definitely dont want to see 6 defiants and by defiant i mean the one with the cloaking device, not the general ones that were highly produced during the Dominion wars, meanwhile there should only be one of those thru out the game, but im still alittle confused
adam out  




Adam,

I am trying to be helpful to you.  Can you rephase what your need is please?  What specificallly about the base generation do you want to control.

If you refer to the ships that show up during say a "base defense" mission on your side then you are out of luck as the game script selects the ships that show.  It is hard coded into the mission scripts (actually what shows in some scripts is based upon some factor related to the current BPV of the ship you are currently when u run the mission).  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #9 on: February 01, 2004, 09:29:48 am »
Okie dokie, ok lets say when you start a campaign, and you click on shipyard, the ships listed there, the ones you can purchase, is there a way to control the ships on that list

adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #10 on: February 01, 2004, 09:46:27 am »
Yes, if you do not want them to appear at all you can restrict them or remove them from the shiplist. If you want to control when they can appear then edit the years available in the shiplist for the ship concerned.

There is no way to guarantee that a ship in the shiplist will indeed show up in the yards or how many times. To control the odds that a ship of a particular class type will be produced edit the values under [Cost/Ship/Build] in Economy.gf. The odds of a ship being produced then depend on these values and the economy of the empire concerned.

As far as I know, that is all you can do.

OoB servers on the flatfile have been achieved by admins sitting in front of the accelerated and unrestricted shipyard for hours at end to purchase the ships assigned to particular characters.

The only way to control the shipyard exactly is to turn off the ship server in the serverkit while running on SQL and edit the shipyards in the db directly. But we cannot do this until Empires has finished and Dave is satisfied with the data collected, at which time the SQL serverkit for OP will be released. This will not help with the singleplayer game however.    

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #11 on: February 01, 2004, 09:58:26 am »
ahhhh ha, I got it, thanks bonk, and  you too toten, i apprecaite your patience, i know i could be confusing at time lol,   thanks


adam out

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #12 on: February 01, 2004, 10:09:08 am »
BONK, how does the shipcost and balance thing work out in the shiplist, whats the mathematics and stuff, basically how is it calculated, i would like to know because I just realized in my mod, that the BVP of my Akira Class is higher than that of my Excelsior Class, but when it comes to buying the ships, the Excelsior is more expensive than that of the Akira which to me makes no sense because the Akira is much more powerful, ok I went rambling of there, lol so....


adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #13 on: February 01, 2004, 10:32:32 am »
Here is the code to determine the price of a ship from one of my php scripts:

 Code:
// Price calc notes: *$MinimumBidFactor is from mapcfg.php/economy.gf 
// and the *$Cost_Difficulty is from mapcfg.php/economy.gf
echo ("<br>Next Bid: ");
If($IsInAuction[$i] ==0) {
$bid = intval($BPV[$i]*$classcostmod[$ClassType[$i]]*$MinimumBidFactor*$Cost_Difficulty) + 5;
echo $bid;  



Allow me a few moments to translate...
« Last Edit: December 31, 1969, 06:00:00 pm by Bonk »

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #14 on: February 01, 2004, 10:33:52 am »
np, thx

seems complicated

adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #15 on: February 01, 2004, 10:42:43 am »
...here ya go:

Price (PP) = (BPV * ClassCostModifier * MinimumBidFactor * Cost_Difficulty) + 5

Where:

BPV = self explanatory

ClassCostModifier = modifier for the cost of a ship based on the ship's class as specified under [Cost/Ship/ClassType] in Economy.gf

MinimumBidFactor = MinimumBidFactor from Economy.gf under [General]

Cost_Difficulty  = the cost multiplier for the server's difficulty setting as specified under [Cost/Difficulty] in Economy.gf

The +5 is there to mimic the "+5" bid button in the shipyard.  

Toten

  • Guest
Re: Controlling Spacedock
« Reply #16 on: February 01, 2004, 10:55:23 am »
Adam,

I would suggest u email pelican or read some of his posts (hes a genious).

He has spent significant time and effort to play with just these settings, also you could ask the FLUFBOT2004.

That said....

Ships generated come in the yards based upon several factors that are driven by the server pack.  (now from my understandings, not complete of course)

First CLASS
we have FF DD CL CA DN BB and BASE
each of these has a base number for the hull type this is a settable number (eg a FF may be 1000 but a DN 1000000)
this number is multiplied by factors for that hull as set out in the xxxItems.gf files this gives a SALE price for the ship
each class has so many models associated with it (eg u may have 20 FF models but 1 BB model)

Second GENERATION of SHIPS
each empire has an economy associated with it at any point in time (ie how may hexes does it own and what are they worth as set out in how you configure ur map, eg an asteroid hex could be econ 1000 but a colony planet econ 10
this econ is totalized by the server pack each sweep for restocking the yards for that empire, the number of ships of each CLASS attempted is a setable factor.
the generation of ships is by CLASS with a factor that is setable assigned to it (eg for FF class it could be 0.1 but DN could be 0.0001)  so a FF slot on the yards would be "made" 10% of the time the yards refresh
you can see this if you give a high PP starting to people and let them "buy" out the yards (this is a tactic used by some to turn over the yards quicker to make slots fill up faster)
these factors by CLASS are multiplied by the econ to give the chance of a ship CLASS being produced
the TYPE of ship WITHIN the CLASS made is a function of how many ships are in the class, so if you have 20 FF models in the game then if a FF is made then each FF model has a 5% chance of being the ONE made for that generation, if you only have one BB model then every time a BB is successfully generated it will be of the only BB model, a reman BB for example.
there are more factors here but you should be getting the jist

Third GENERATION SITES
AI will spawn based upon the numbers of available planets and Star Bases, and there is other factors that can be adjusted for aggression, and spawn rates

Fourth Availabilitiy
SFC3 (unlike SFC2 EAW or OP) does not have dates when models become active or inactive (the aforementioned FYA and LYA) as such ANY ship within the CLASS models is up for generation.  So if you have superior and inferior DNs for example expect the players to migrate as they become available towards the better hulls within the class.  Why fly a Galaxy when u can fly a Sov?
this was the intent of the bidding buttons in the yards, however organized players DO NOT OUT BID each other for purchase of these hulls, as it only hurts your empire by wasting PP



The long and short is....

Maps drive econ which drives probability chance slots to generate ship hulls of the classes on planets or bases.

You cannot restrict the chance of making a hull within a CLASS but you have the ability to restrict the probability of making the hull CLASS itself, not quite the same but equally effective.

You can restrict the econ.  You can restrict the slots.  You cannot restrict what the game fills those slots with within a class.


If you wish to limit your campaign OOB then the only way you can do so now is to have breaks within the campaign (we tend to use the babble speak "VC rounds" Victory Conditions).

During the break between rounds post a new ship listing for download, reset the server and let the fun begin anew.  As you can reset and tweak all the ship generation and availability settings.

HOWEVER ALL PLAYERS WILL LOSE THEIR ACCOUNTS (this is not so bad if you spot everyone say 100,000 PP instead of a lower PP from the previous rounds).  That way they can buy immediately the newly avaible BCH or what ever that they "upgraded" from in the previous rounds.

EG....
Round one - the game is played out for a finite period of time and the victory conditions are counted to declare a round one winner.
The ONLY klingon DN in round one is a C5 that is available for purchase

Round two - server is reset and eveyone is spoted 100K, the C5 is removed fromt the ship listings and is replaced with the C9.  The C5 is no longer available as it has been removed from the server settings and will not be available for generation in the yards, but the C9 would be.

Round three - again reset server n spot everyone say 200K, the C9 is removed and replaced with the C19.

What this would do is replicate weapons systems progression (the actual weapons effectiveness and other settings could actually be changed also).  Ship hull design progression.  The creative licence opportunities are endless.

hope this helps somewhat.  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #17 on: February 01, 2004, 11:46:05 am »
I think I got it, but can you give like an example of a ship and stuff pretty please  

thanks


adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #18 on: February 01, 2004, 12:20:18 pm »
Lets see, using the Fed CA from the stock shiplist at a BPV of 125 and a class of HEAVY_CRUISER using the default Economy.gf settings in the stock serverkit  on a server set to commodore difficulty (1) would cost:

Price (PP) = (BPV * ClassCostModifier * MinimumBidFactor * Cost_Difficulty) + 5

Price (PP) = (125 * 2.0 * 6.0 * 1.0) + 5 = 1505 PP

 

Toten

  • Guest
Re: Controlling Spacedock
« Reply #19 on: February 01, 2004, 01:19:58 pm »
Adam,

I am at work right now (yeah I know sunday) and am doing this from memory.

I would suggest that you email pelican and as him for some examples, or email Fluf.  They would be in a position to answer some questions for you today.  

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #20 on: February 01, 2004, 01:23:47 pm »
Ya, don't listen to Bonk - he hasn't got a clue... (J/K Toten... but you gotta admit it pretty much reads that way...)  

Toten

  • Guest
Re: Controlling Spacedock
« Reply #21 on: February 01, 2004, 01:37:06 pm »
Bonk,

Sorry I am running in and out of the plant supervising contractors today and had the post started when u sqeezed yours in there.

I only saw after words that u had put up a response.

No offence intended.  

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #22 on: February 01, 2004, 01:41:42 pm »
Thanks Toten - I was pretty sure that wasn't the intention. 'scuse my paranoia... (not that Fluf or Pelican's advice wouldn't be very helpful too!)  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #23 on: February 01, 2004, 02:43:30 pm »
lol, I think I get it, thanks guys, you were great help today

adam out

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #24 on: February 01, 2004, 03:04:48 pm »
Ok I tested this out with my shiplist and its perfect, only thing I noticed is that if your playing single-player, the fomula changes in that you dont add 5, bc your not bidding, thanks this helped so much


adam out

Toten

  • Guest
Re: Controlling Spacedock
« Reply #25 on: February 01, 2004, 04:13:38 pm »
ur welcome adam.

btw i want to learn more of this myself so i can eventually try to do my own server.

scratches chin

hmmm methinks I need to suck up to the flufbot for info.  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #26 on: February 01, 2004, 04:21:42 pm »
B4 you leave, lol lol can anyone explain how this works out

// This is the basic chance that a ship will be made by the empire
[Cost/Ship/Build]
Freighter         = 0.03
Frigate            = 0.06
Destroyer         = 0.08
LightCruiser      = 0.10
WarDestroyer      = 0.15
HeavyCruiser      = 0.20
NewHeavyCruiser      = 0.30
HeavyBattlecruiser   = 0.40
Carrier            = 0.50
Dreadnought         = 0.60
Battleship         = 0.75
BaseStation         = 0.20
BattleStation      = 0.50
StarBase         = 0.75


adam out

Toten

  • Guest
Re: Controlling Spacedock
« Reply #27 on: February 01, 2004, 04:37:15 pm »
Quote:

B4 you leave, lol lol can anyone explain how this works out

// This is the basic chance that a ship will be made by the empire
[Cost/Ship/Build]
Freighter         = 0.03
Frigate         = 0.06
Destroyer         = 0.08
LightCruiser                           = 0.10
WarDestroyer      = 0.15
HeavyCruiser      = 0.20
NewHeavyCruiser      = 0.30
HeavyBattlecruiser                        = 0.40
Carrier         = 0.50
Dreadnought         = 0.60
Battleship         = 0.75
BaseStation         = 0.20
BattleStation                           = 0.50
StarBase         = 0.75

adam out  





I believe the lower the number the more likely a slot will be filled during the regeneration of the ship yards.  To confirm the effect save the file then set all but one to 0.99 and one to 0.01,  then obeserve the effect upon the shipyard generations over a few turns.  The units with 0.99 should show rarely and the unit CLASS with 0.01 should show up alot.  (as I was babling above in a previous post).
 

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #28 on: February 01, 2004, 04:39:50 pm »
Yes, that's the section in Economy.gf that I was referring to.

I assume that when a class is set to 0 it will not be built and the closer to 1.0 the more likely it wll be built (though I may have that reversed). But I admit I have never tinkered with these settings as others have tried and not had much luck. Perhaps Fluf, Castrin, DH, CaptJeff, Pelican or other D2 admins could tell you about their experiences with it.

The best way to know for sure is test it. Play with the settings and accelerate the time in Time.gf then sit in front of the shipyard for a while to see what is produced. (Decrease the milliseconds per turn in time.gf and change the TurnFrequency to 1 in Economy.gf - remember to set them back to normal for playing...)  
« Last Edit: December 31, 1969, 06:00:00 pm by Bonk »

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #29 on: February 01, 2004, 05:03:21 pm »
Ok but the time thing got me confuded, I had no idea I could accelerate the time, hoe does this work, be specific, I dont usually mess with these files, therefore, I have no idea how to define certain things in there

adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #30 on: February 01, 2004, 05:21:51 pm »
Oops, probably too much info sorry.
You don't have to accelerate the time to test this but it will make things a lot faster.


Singleplayer Time.gf:

 Code:
 Name = "Time"

[Clock]

TurnsPerYear         = 5
MilliSecondsPerTurn      = 60000    // (60000)
DelayBeforeFirstTurn   = 10000
TimeStopWhenInTactical   = 1      // (0) ALWAYS 0 for Server!

[Clock/StartingDate]
BaseYear   = 2263
0         = 0
1         = 10
2         = 20
3         = 40
 



To accelerate the time in a campaign just decrease the MilliSecondsPerTurn (60000 is 1 minute).

However I just noticed that the turn length for singleplayer is already only 1 minute (10 minute default for D2 servers).
You could try decreasing it further say to 30 seconds (30000) if your PC has the guts to handle it.

If you want to have the shipyard run every turn then edit TurnFrequency in Economy.gf from 2 to 1.

Remember to change these settings back when finished testing.  

DH123

  • Guest
Re: Controlling Spacedock
« Reply #31 on: February 04, 2004, 12:34:30 pm »
Quote:


The only way to control the shipyard exactly is to turn off the ship server in the serverkit while running on SQL and edit the shipyards in the db directly. But we cannot do this until Empires has finished and Dave is satisfied with the data collected, at which time the SQL serverkit for OP will be released. This will not help with the singleplayer game however.    




Bump.   Hey Bonk, how do I do this?  

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #32 on: February 04, 2004, 08:10:13 pm »
 
Quote:

Bump. Hey Bonk, how do I do this?  




Oh dear, it's not very simple... but a rough outline:

In your ServersSetup.gf, under [Launch] set ShipServer = 0

Now comes the tough part. You need to construct the records for each ship as they would appear in the "ship" table and store them elsewhere (another table or as individual .sql queries perhaps - depends on your external shipyard design). You can do this one of two ways: wait for every ship in the list to pass through the yards with the shipserver on and capture the records (as Kel has done) -- or construct the records for each ship from the shiplist directly. To do this you need to know how to construct the binary blob data for each ship. I think these blob structures have been decoded but perhaps not fully yet. (Damage, Stores and Officers). I have info on these somewhere... Search here for "blob" as well. Sigh, I wish the blobs had been removed... (have they? - I actually havent gotten a chance to look at the OP SQL kit yet - busy evaluating   other software...)

Once you have all the desired ship records constructed, now you need to come up with a design for your shipyards. Do you want to use the internal shipyard (normal bidding) and control its population externally? Or do you want ships only to be available through an external interface such as Kel's IRC workaround. If you will use the internal bidding system its pretty simple from here, you just need to write a script or program to purge and fill the shipyards on the desired schedule with the desired ships. If you wish to use a completely external shipyard you will also need to figure out (or get from Kel) the structure of the shipcachevector blob in the character table so that when a character purchases a ship you can edit the ship table to make him the owner (or construct a query to add the purchaser as owner to the record added to the ship table in one operation). But for the character to actually own the ship you must correctly edit the shipcachevector blob (I have not determined its structure yet.. but perhaps Kel has...) Alternatively you can pass the ship through the biditem table as an instant purchase and have the server kit make its arcane edits to the shipcachevector blob. (ship must be present in the ship table and set to in auction...) and the appropriate biditem record entered.

As you can see it is not very simple because of the blob remnants of the flatfile (relational structure and linked tables would be so much nicer... but enough bitching, I'm glad to get this at least....).

I have not actually tested the kit with the ShipServer off yet, but have managed to create bids on ships not in the yard (captured from previous ship table records) from php scripts - passing them through the biditem table because I have not managed to decode the shipcachevector yet...

A lot of the decoding of the flatfile that NW did for his EDDBEDIT.exe will apply here. If you have the source for that app it may help, there was a thread disudssing this recently, NW said he'd look into it to refresh his memory. I have the source for this app but have not examined it closely enough yet to help be decode the blobs which must be edited or created to do this job. (Kinda busy with paying work right now...). I can send it to you or find the link if you do not have it.
(Edit: here's the link: http://www3.telus.net/NuclearWessels/sfc/downloads/dbeditor_sourcecode.zip )

Definitely solicit Kel's input here, he has actually gotten further with this than I have but is capturing ship records from the live shipyard. Ideally we should be able to create ship records with only the information in the shiplist, but we need to be absolutely sure of these blob structures to be able to do that.

I wish I could get into this now but I just don't have the time at the moment to take up where I left off. I may get a chance to look at the new kit this weekend.

NW has the keys to the kingdom here I think, as long as the blob structures are the same as found in the flatfile, if not then some additional decoding and confirmation will be necessary. I have most of the structures of these blobs decoded but until they are complete, nothing can be done.

So as you see, its still somewhat of a "flatfile" - no relational structure, and choc full of binary data. I may sound discouraging here, but I know this can be done - It'll just take a little work.    
« Last Edit: February 04, 2004, 08:29:28 pm by Bonk »

DH123

  • Guest
Re: Controlling Spacedock
« Reply #33 on: February 05, 2004, 04:30:43 pm »
My head is really starting to hurt  

But the possibilites are so fricking cool!  

NuclearWessels

  • Guest
Re: Controlling Spacedock
« Reply #34 on: February 05, 2004, 05:15:33 pm »

Bonk - I have managed to generate ships (on the flatfile DB) by constructing their entry based on the shiplist information.  So far it seems to work, but there are still a few bytes in the ship description where I'm just kind of winging it.

After I get through fixing some big boo-boos in the mission pack I'll dig out the blueprints I've got for the DB layout.  It looks like the blobs match the flatfile layout pretty closely (crosses fingers).

dave
 

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #35 on: February 05, 2004, 09:39:31 pm »
That'd be too cool NW. Between that and what I have collected already it shouldn't be too hard to to populate the shipyards externally once I get a chance to give it a go. (Others are more than welcome to beat me to it! There will be lots of approaches to it once the basic mechanics of it are worked out.)

It occurs to me however, what will happen when a players ship is destroyed with the ShipServer turned off...? May or may not be a problem... easy to test however and no need to complete an external shipyard to do so. That should be tested first so that it can be accounted for in the external shipyard design if necessary:
If we need to leave the ShipServer on to account for this, then I guess the strategy would be to schedule a script to purge the ships generated by the serverkit as soon as they are produced and replace them with the desired ships. Or probably better to set the probablilty of construction to zero for all classes if the ShipServer must be left on, and simply fill the yards as desired. I think that'd be the way to go, effectively disabling the built in shipyards.

Then the only trick would be the shipcachevector blob which would be necessary for automated account creation and completely external shipyards. Well at least for automated account creation... (administrated or auctioned OoBs) ... I just thought of a workaround for a completely external shipyard without knowing the shipcachevector blob structure - if setting the probablility of construction to zero for all classes actually leaves the yards empty, then ships can only be added to the ship and biditem table externally... and instant bids can take care of the rest. (This approach should allow "automated" / external account creation as well.)

>> I get the feeling it may be necessary to leave the ShipServer on to handle AI ships generated and destroyed by mission scripts as well. (with "dead" AI ships and characters from crashed missions being cleaned out regularly of course...)

Come to think of it, it seems to me I have the shipcachevector blob structure somewhere... or at least a detailed discussion of it.

Sorry to ramble again, just brainstorming a bit here.    

DH123

  • Guest
Re: Controlling Spacedock
« Reply #36 on: February 05, 2004, 11:09:00 pm »
Basic questrion here, the "Ship" table is every ship in play AND in the shipyard?  

NuclearWessels

  • Guest
Re: Controlling Spacedock
« Reply #37 on: February 05, 2004, 11:31:29 pm »
Yes,  all the ships in the shipyard appear exactly like player owned ships, they just have no owner id associated with them (the owner id is probably 0 in the table IIRC)

dave
 

DH123

  • Guest
Re: Controlling Spacedock
« Reply #38 on: February 06, 2004, 12:26:33 am »
Quote:

Yes,  all the ships in the shipyard appear exactly like player owned ships, they just have no owner id associated with them (the owner id is probably 0 in the table IIRC)

dave
   




And "Ship Cache Vector" Determines the "Stats" of the ship?  

NuclearWessels

  • Guest
Re: Controlling Spacedock
« Reply #39 on: February 06, 2004, 08:46:10 am »
Here is the order of stats in the flatfile - but you'll have to check how this lines up with the start of the data sequence in the ship blob (haven't checked if this lines up with the start of the ship blob, or if there are a handful (say 1-9) bytes of other stuff at the beginning of it)

Each of these fields are 1 byte, so two hex digits
Code:

   Right warp total (damaged + undamaged)
   Right warp current
   Left warp total
   Left warp current
   Center warp total
   Center warp current
   Impulse total
   Impulse current
   Apr total
   Apr current
   Bridge total
   Bridge current
   Sensor total
   Sensor current
   Scanner total
   Scanner current
   DamCon total
   DamCon current
   Repair total
   Repair current
   Fwd hull total
   Fwd Hull current
   Aft hull total
   Aft hull current
   Center hull total
   Center hull current
   Tractor total
   Tractor current
   Excess dam total
   Excess dam current
   Transporters total
   Transporters current
        ??? total
        ??? current
   Battery total
   Battery current
   Labs total
   Labs current
   Cargo total
   Cargo current
   Armour total
   Armour  current
   Cloak total
   Cloak current
   Probe total
   Probe current
   Barracks total
   Barracks current

        Then there are 25 pairs, one for each weapons hardpoint,
                Weapons on hardpoint i total
                Weapons on hardpoint i current

         Then we get 11 bytes of ???

         Then a burst covering drones:
         Drone type
         Drone speed
         Drone reloads
         ???
         Drone racks
         ???
         Max drones
         Then 4 bytes of ???
         Current drones
         Then 4 bytes of ???

         Heh, then it gets a little tricky
         For each of the 25 hardpoints, there are 4 entries of 2 bytes each
               current number of drones in the hardpoint
               current number of racks in the hardpoint
               size/type of drone rack in the hardpoint
               and 2 bytes of ???

        Then we get a big chunk of ???
        However, 325 bytes past the RWtotal, we get
              Shuttles max, then
              Shuttles curr

   Then another glorious whack of ???,
             until, 440 bytes past the RWtotal, we get
   Marines max
        Marines current
        Marines current again?
        Tbombs max
        Tbombs current
        Tbombs current again?
        Spares max
        Spares current
        Spares current again?

        Finally, we get the information on the four fighter bays
        For each bay:
               Total fighters in the bay
                Current fighters in the bay
                Default number of fighters in the bay
                One byte of ????
                4 bytes telling you how long the string for the fighter type is
                      followed by the actual fighter type currently loaded (e.g.  H-Hornet-1 or whatever)
                 4 bytes telling how long the string for the default fighter type is
                       followed by the default fighter type for that bay (from the shiplist)




loads o' fun
dave
 

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #40 on: February 06, 2004, 04:56:06 pm »
Cool Dave that ought to help some. But I have some really neato cool real work to do, and RDSL starts tomorrow!!! Aggh! "It never rains around here..."

 
Quote:

 And "Ship Cache Vector" Determines the "Stats" of the ship?  




The shipcachevector blob is in the servcharacter table and describes the ships in the possesion of the character.

i.e. If I change the Owner of a ship in the ship table to my character's ID, I do not get the ship. The shipcachevector blob for my character record must also be edited to show that I own the ship. (Thus I have passed them through the biditem table to make the ship actually owned by the character - as recommended by DarkElf...) It would be nice not to have to use the biditem table and instant purchases however, for the reasons mentioned.

All the appropriate "stats" for each ship are stored in the ship table in the "Damage", "Stores" and "Officers" blobs. (oh how I wish they were in linked tables of their own...) The remaining information for each ship that is necessary is gathered from the shiplist when needed I imagine.

 
Quote:

 Yes, all the ships in the shipyard appear exactly like player owned ships, they just have no owner id associated with them (the owner id is probably 0 in the table IIRC)




Correct, except that the state of the blobs will differ for player and AI owned ships as they are dmaged and resupplied etc...
(useful to decode the blob structures, this is how weve done most of it - by comparing the unowned ship to ships we've damaged or supplied to various states... - [we refers to txtanker, UDF_Intruder and I]... search on those usernames here for more info and I sincerely apologise for the fact that a search on the Anonymous username will be of no assistance... )

I will gather and post the blob structure work from those threads and correspondence shortly...  

some threads with hints and some data:
http://forums.taldren.com/ubbthreads/showflat.php?Cat=&Board=UBB2&Number=14992
(just remembered the pertinence of the OpenShipBids blob in the servcharacter table here too...)
« Last Edit: February 06, 2004, 05:22:45 pm by Bonk »

nx_adam_1701

  • Guest
Controlling Spacedock
« Reply #41 on: February 01, 2004, 05:22:17 am »
How can I control the amount of ships generated by the spacedock during the campaign, I was reading in the DITL and saw this
NCC 71099 USS Challenger
(NCC 1701-D USS Enterprise)
NCC 70637 USS Galaxy
USS Magellan
 (NCC 71832 USS Odyssey)
NCC 71867 USS Trinculo
NCC 71854 USS Venture
(NCC 71807 USS Yamato)
 
plus 10 others built in total. 4 have been lost in all. The class remains in production.


I want in my mod for it to be hard to obtain a Galaxy, not only a high BVP, but also very limited in the spacedock, I have other ships to I want to make difficult to get and etc..., so how can I accomplish this, thanks guys



adam out

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #42 on: February 01, 2004, 06:33:22 am »
Anyone???

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #43 on: February 01, 2004, 07:54:34 am »
Is this SFC3? What is the "DITL"?  

The shipyards are notoriously hard to control. Not sure about the gfs for SFC3, but to control the probability that a ship will be produced in EAW or OP edit the values under [Cost/Ship/Build] in Economy.gf. The empire's economy as determined from the map must be sufficient to produce the desired ships, but exactly how all this works is pretty much a black box. I imagine most of this has carried over to SFC3.

If you want to explicitly control the shipyards then run on SQL, turn off the shipyards altogether, construct the ship records from the shiplist (or capture from the db while the server's shipserver is enabled) then populate the shipyards when and how you desire using a script or program you have written.  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #44 on: February 01, 2004, 08:00:24 am »
SFC2 OP DITL Daystrom Institute Technical Library

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #45 on: February 01, 2004, 08:09:33 am »
Oh, you mean: Daystrom Institute Technical Library , thanks - I was confused and thought you were talking about SFC3 and that the DITL was part of SFC3... oops!. In which case my comments on controlling the OP shipyard is the info you are looking for I think.
« Last Edit: February 01, 2004, 08:10:59 am by Bonk »

Toten

  • Guest
Re: Controlling Spacedock
« Reply #46 on: February 01, 2004, 08:24:15 am »
First off I hope you are referring to OP or EAW for D2 play.  What you ask is not possible with SFC3 as it currently exists.

It really sounds like your trying to instill an OOB (Order of Battle), in other words the maximum amount of ships of a class that can be generated by the game logic during a campaign, barring losses.  Correct ?

So for instance if the klingons only ever built one B10, then ONE and ONLY ONE B10 will be available EVER in the campaign?

If this is what you are looking for then the only way to attempt to do this now is as follows...(and its not perfect as the game mechanics dont allow for OOB, we have been trying to replicate one for years now)

1) players are restricted to who can fly what.  In other words, BCH's and bigger can be assigned ships and only certain players can fly them.  When they go poof they ARE NOT ALLOWED to be REPURCHASED regardless if they show in the shipyards or not.  (read here they cant buy a new one till the VC round changes, if your doing that, or some agreed upon conditon happens, like a key planet  for mining of dilithium is found and captured for your race)

2) Ships of a certain type are made rediculously expensive to limit who can afford to buy what.  This is especially painful and effective when ship replacement trade in is set very low.  ie you could lose 100,000 PP when dying in or selling off one DN to get another.  (this tends to lower the "fun factor" however especially with hand of bethke crashes)

3) Play with the ship lists to addend the FYA and LYA (first year available and last year available) to make ships go obsolete in a timely fashion (however the game generated AI doesnt play by the rules no matter how many times you complain to the AI race moderators)

4) Between game rounds (if you set a server up this way) addend the shiplist to REMOVE or ADD ships between rounds to make certain they only exist in the game when you want them to exist.

If you are familiar with the ADB game Federation and Empire (F&E) then OOB is the heart of that game.  An OOB is a relative holy grail for modders for a more realistic game situation to more accurately represent canon SFB general war (or other such campaigns as ISC pacification or the andromedan invasion or the early fed klink wars or etc)  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #47 on: February 01, 2004, 08:58:35 am »
WOW, that was alot to grasp lol lol, but i think i get, wait no i dont, im not going to lie to you im completely lost lol lol, i do want to control how many ships are generated in the spacedock during a campaign, I definitely dont want to see 6 defiants and by defiant i mean the one with the cloaking device, not the general ones that were highly produced during the Dominion wars, meanwhile there should only be one of those thru out the game, but im still alittle confused

adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #48 on: February 01, 2004, 09:18:06 am »
This kind of control is just not possible unless you use SQL as outlined above (not released yet...).

You can edit the shiplist. (remove ships, restrict ships, edit dates available etc...) and edit the values under [Cost/Ship/Build] in Economy.gf. That is all the control over the shipyard that is available without SQL.  

Toten

  • Guest
Re: Controlling Spacedock
« Reply #49 on: February 01, 2004, 09:21:29 am »
Quote:

WOW, that was alot to grasp lol lol, but i think i get, wait no i dont, im not going to lie to you im completely lost lol lol, i do want to control how many ships are generated in the spacedock during a campaign, I definitely dont want to see 6 defiants and by defiant i mean the one with the cloaking device, not the general ones that were highly produced during the Dominion wars, meanwhile there should only be one of those thru out the game, but im still alittle confused
adam out  




Adam,

I am trying to be helpful to you.  Can you rephase what your need is please?  What specificallly about the base generation do you want to control.

If you refer to the ships that show up during say a "base defense" mission on your side then you are out of luck as the game script selects the ships that show.  It is hard coded into the mission scripts (actually what shows in some scripts is based upon some factor related to the current BPV of the ship you are currently when u run the mission).  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #50 on: February 01, 2004, 09:29:48 am »
Okie dokie, ok lets say when you start a campaign, and you click on shipyard, the ships listed there, the ones you can purchase, is there a way to control the ships on that list

adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #51 on: February 01, 2004, 09:46:27 am »
Yes, if you do not want them to appear at all you can restrict them or remove them from the shiplist. If you want to control when they can appear then edit the years available in the shiplist for the ship concerned.

There is no way to guarantee that a ship in the shiplist will indeed show up in the yards or how many times. To control the odds that a ship of a particular class type will be produced edit the values under [Cost/Ship/Build] in Economy.gf. The odds of a ship being produced then depend on these values and the economy of the empire concerned.

As far as I know, that is all you can do.

OoB servers on the flatfile have been achieved by admins sitting in front of the accelerated and unrestricted shipyard for hours at end to purchase the ships assigned to particular characters.

The only way to control the shipyard exactly is to turn off the ship server in the serverkit while running on SQL and edit the shipyards in the db directly. But we cannot do this until Empires has finished and Dave is satisfied with the data collected, at which time the SQL serverkit for OP will be released. This will not help with the singleplayer game however.    

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #52 on: February 01, 2004, 09:58:26 am »
ahhhh ha, I got it, thanks bonk, and  you too toten, i apprecaite your patience, i know i could be confusing at time lol,   thanks


adam out

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #53 on: February 01, 2004, 10:09:08 am »
BONK, how does the shipcost and balance thing work out in the shiplist, whats the mathematics and stuff, basically how is it calculated, i would like to know because I just realized in my mod, that the BVP of my Akira Class is higher than that of my Excelsior Class, but when it comes to buying the ships, the Excelsior is more expensive than that of the Akira which to me makes no sense because the Akira is much more powerful, ok I went rambling of there, lol so....


adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #54 on: February 01, 2004, 10:32:32 am »
Here is the code to determine the price of a ship from one of my php scripts:

 Code:
// Price calc notes: *$MinimumBidFactor is from mapcfg.php/economy.gf 
// and the *$Cost_Difficulty is from mapcfg.php/economy.gf
echo ("<br>Next Bid: ");
If($IsInAuction[$i] ==0) {
$bid = intval($BPV[$i]*$classcostmod[$ClassType[$i]]*$MinimumBidFactor*$Cost_Difficulty) + 5;
echo $bid;  



Allow me a few moments to translate...
« Last Edit: December 31, 1969, 06:00:00 pm by Bonk »

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #55 on: February 01, 2004, 10:33:52 am »
np, thx

seems complicated

adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #56 on: February 01, 2004, 10:42:43 am »
...here ya go:

Price (PP) = (BPV * ClassCostModifier * MinimumBidFactor * Cost_Difficulty) + 5

Where:

BPV = self explanatory

ClassCostModifier = modifier for the cost of a ship based on the ship's class as specified under [Cost/Ship/ClassType] in Economy.gf

MinimumBidFactor = MinimumBidFactor from Economy.gf under [General]

Cost_Difficulty  = the cost multiplier for the server's difficulty setting as specified under [Cost/Difficulty] in Economy.gf

The +5 is there to mimic the "+5" bid button in the shipyard.  

Toten

  • Guest
Re: Controlling Spacedock
« Reply #57 on: February 01, 2004, 10:55:23 am »
Adam,

I would suggest u email pelican or read some of his posts (hes a genious).

He has spent significant time and effort to play with just these settings, also you could ask the FLUFBOT2004.

That said....

Ships generated come in the yards based upon several factors that are driven by the server pack.  (now from my understandings, not complete of course)

First CLASS
we have FF DD CL CA DN BB and BASE
each of these has a base number for the hull type this is a settable number (eg a FF may be 1000 but a DN 1000000)
this number is multiplied by factors for that hull as set out in the xxxItems.gf files this gives a SALE price for the ship
each class has so many models associated with it (eg u may have 20 FF models but 1 BB model)

Second GENERATION of SHIPS
each empire has an economy associated with it at any point in time (ie how may hexes does it own and what are they worth as set out in how you configure ur map, eg an asteroid hex could be econ 1000 but a colony planet econ 10
this econ is totalized by the server pack each sweep for restocking the yards for that empire, the number of ships of each CLASS attempted is a setable factor.
the generation of ships is by CLASS with a factor that is setable assigned to it (eg for FF class it could be 0.1 but DN could be 0.0001)  so a FF slot on the yards would be "made" 10% of the time the yards refresh
you can see this if you give a high PP starting to people and let them "buy" out the yards (this is a tactic used by some to turn over the yards quicker to make slots fill up faster)
these factors by CLASS are multiplied by the econ to give the chance of a ship CLASS being produced
the TYPE of ship WITHIN the CLASS made is a function of how many ships are in the class, so if you have 20 FF models in the game then if a FF is made then each FF model has a 5% chance of being the ONE made for that generation, if you only have one BB model then every time a BB is successfully generated it will be of the only BB model, a reman BB for example.
there are more factors here but you should be getting the jist

Third GENERATION SITES
AI will spawn based upon the numbers of available planets and Star Bases, and there is other factors that can be adjusted for aggression, and spawn rates

Fourth Availabilitiy
SFC3 (unlike SFC2 EAW or OP) does not have dates when models become active or inactive (the aforementioned FYA and LYA) as such ANY ship within the CLASS models is up for generation.  So if you have superior and inferior DNs for example expect the players to migrate as they become available towards the better hulls within the class.  Why fly a Galaxy when u can fly a Sov?
this was the intent of the bidding buttons in the yards, however organized players DO NOT OUT BID each other for purchase of these hulls, as it only hurts your empire by wasting PP



The long and short is....

Maps drive econ which drives probability chance slots to generate ship hulls of the classes on planets or bases.

You cannot restrict the chance of making a hull within a CLASS but you have the ability to restrict the probability of making the hull CLASS itself, not quite the same but equally effective.

You can restrict the econ.  You can restrict the slots.  You cannot restrict what the game fills those slots with within a class.


If you wish to limit your campaign OOB then the only way you can do so now is to have breaks within the campaign (we tend to use the babble speak "VC rounds" Victory Conditions).

During the break between rounds post a new ship listing for download, reset the server and let the fun begin anew.  As you can reset and tweak all the ship generation and availability settings.

HOWEVER ALL PLAYERS WILL LOSE THEIR ACCOUNTS (this is not so bad if you spot everyone say 100,000 PP instead of a lower PP from the previous rounds).  That way they can buy immediately the newly avaible BCH or what ever that they "upgraded" from in the previous rounds.

EG....
Round one - the game is played out for a finite period of time and the victory conditions are counted to declare a round one winner.
The ONLY klingon DN in round one is a C5 that is available for purchase

Round two - server is reset and eveyone is spoted 100K, the C5 is removed fromt the ship listings and is replaced with the C9.  The C5 is no longer available as it has been removed from the server settings and will not be available for generation in the yards, but the C9 would be.

Round three - again reset server n spot everyone say 200K, the C9 is removed and replaced with the C19.

What this would do is replicate weapons systems progression (the actual weapons effectiveness and other settings could actually be changed also).  Ship hull design progression.  The creative licence opportunities are endless.

hope this helps somewhat.  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #58 on: February 01, 2004, 11:46:05 am »
I think I got it, but can you give like an example of a ship and stuff pretty please  

thanks


adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #59 on: February 01, 2004, 12:20:18 pm »
Lets see, using the Fed CA from the stock shiplist at a BPV of 125 and a class of HEAVY_CRUISER using the default Economy.gf settings in the stock serverkit  on a server set to commodore difficulty (1) would cost:

Price (PP) = (BPV * ClassCostModifier * MinimumBidFactor * Cost_Difficulty) + 5

Price (PP) = (125 * 2.0 * 6.0 * 1.0) + 5 = 1505 PP

 

Toten

  • Guest
Re: Controlling Spacedock
« Reply #60 on: February 01, 2004, 01:19:58 pm »
Adam,

I am at work right now (yeah I know sunday) and am doing this from memory.

I would suggest that you email pelican and as him for some examples, or email Fluf.  They would be in a position to answer some questions for you today.  

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #61 on: February 01, 2004, 01:23:47 pm »
Ya, don't listen to Bonk - he hasn't got a clue... (J/K Toten... but you gotta admit it pretty much reads that way...)  

Toten

  • Guest
Re: Controlling Spacedock
« Reply #62 on: February 01, 2004, 01:37:06 pm »
Bonk,

Sorry I am running in and out of the plant supervising contractors today and had the post started when u sqeezed yours in there.

I only saw after words that u had put up a response.

No offence intended.  

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #63 on: February 01, 2004, 01:41:42 pm »
Thanks Toten - I was pretty sure that wasn't the intention. 'scuse my paranoia... (not that Fluf or Pelican's advice wouldn't be very helpful too!)  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #64 on: February 01, 2004, 02:43:30 pm »
lol, I think I get it, thanks guys, you were great help today

adam out

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #65 on: February 01, 2004, 03:04:48 pm »
Ok I tested this out with my shiplist and its perfect, only thing I noticed is that if your playing single-player, the fomula changes in that you dont add 5, bc your not bidding, thanks this helped so much


adam out

Toten

  • Guest
Re: Controlling Spacedock
« Reply #66 on: February 01, 2004, 04:13:38 pm »
ur welcome adam.

btw i want to learn more of this myself so i can eventually try to do my own server.

scratches chin

hmmm methinks I need to suck up to the flufbot for info.  

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #67 on: February 01, 2004, 04:21:42 pm »
B4 you leave, lol lol can anyone explain how this works out

// This is the basic chance that a ship will be made by the empire
[Cost/Ship/Build]
Freighter         = 0.03
Frigate            = 0.06
Destroyer         = 0.08
LightCruiser      = 0.10
WarDestroyer      = 0.15
HeavyCruiser      = 0.20
NewHeavyCruiser      = 0.30
HeavyBattlecruiser   = 0.40
Carrier            = 0.50
Dreadnought         = 0.60
Battleship         = 0.75
BaseStation         = 0.20
BattleStation      = 0.50
StarBase         = 0.75


adam out

Toten

  • Guest
Re: Controlling Spacedock
« Reply #68 on: February 01, 2004, 04:37:15 pm »
Quote:

B4 you leave, lol lol can anyone explain how this works out

// This is the basic chance that a ship will be made by the empire
[Cost/Ship/Build]
Freighter         = 0.03
Frigate         = 0.06
Destroyer         = 0.08
LightCruiser                           = 0.10
WarDestroyer      = 0.15
HeavyCruiser      = 0.20
NewHeavyCruiser      = 0.30
HeavyBattlecruiser                        = 0.40
Carrier         = 0.50
Dreadnought         = 0.60
Battleship         = 0.75
BaseStation         = 0.20
BattleStation                           = 0.50
StarBase         = 0.75

adam out  





I believe the lower the number the more likely a slot will be filled during the regeneration of the ship yards.  To confirm the effect save the file then set all but one to 0.99 and one to 0.01,  then obeserve the effect upon the shipyard generations over a few turns.  The units with 0.99 should show rarely and the unit CLASS with 0.01 should show up alot.  (as I was babling above in a previous post).
 

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #69 on: February 01, 2004, 04:39:50 pm »
Yes, that's the section in Economy.gf that I was referring to.

I assume that when a class is set to 0 it will not be built and the closer to 1.0 the more likely it wll be built (though I may have that reversed). But I admit I have never tinkered with these settings as others have tried and not had much luck. Perhaps Fluf, Castrin, DH, CaptJeff, Pelican or other D2 admins could tell you about their experiences with it.

The best way to know for sure is test it. Play with the settings and accelerate the time in Time.gf then sit in front of the shipyard for a while to see what is produced. (Decrease the milliseconds per turn in time.gf and change the TurnFrequency to 1 in Economy.gf - remember to set them back to normal for playing...)  
« Last Edit: December 31, 1969, 06:00:00 pm by Bonk »

nx_adam_1701

  • Guest
Re: Controlling Spacedock
« Reply #70 on: February 01, 2004, 05:03:21 pm »
Ok but the time thing got me confuded, I had no idea I could accelerate the time, hoe does this work, be specific, I dont usually mess with these files, therefore, I have no idea how to define certain things in there

adam out

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #71 on: February 01, 2004, 05:21:51 pm »
Oops, probably too much info sorry.
You don't have to accelerate the time to test this but it will make things a lot faster.


Singleplayer Time.gf:

 Code:
 Name = "Time"

[Clock]

TurnsPerYear         = 5
MilliSecondsPerTurn      = 60000    // (60000)
DelayBeforeFirstTurn   = 10000
TimeStopWhenInTactical   = 1      // (0) ALWAYS 0 for Server!

[Clock/StartingDate]
BaseYear   = 2263
0         = 0
1         = 10
2         = 20
3         = 40
 



To accelerate the time in a campaign just decrease the MilliSecondsPerTurn (60000 is 1 minute).

However I just noticed that the turn length for singleplayer is already only 1 minute (10 minute default for D2 servers).
You could try decreasing it further say to 30 seconds (30000) if your PC has the guts to handle it.

If you want to have the shipyard run every turn then edit TurnFrequency in Economy.gf from 2 to 1.

Remember to change these settings back when finished testing.  

DH123

  • Guest
Re: Controlling Spacedock
« Reply #72 on: February 04, 2004, 12:34:30 pm »
Quote:


The only way to control the shipyard exactly is to turn off the ship server in the serverkit while running on SQL and edit the shipyards in the db directly. But we cannot do this until Empires has finished and Dave is satisfied with the data collected, at which time the SQL serverkit for OP will be released. This will not help with the singleplayer game however.    




Bump.   Hey Bonk, how do I do this?  

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #73 on: February 04, 2004, 08:10:13 pm »
 
Quote:

Bump. Hey Bonk, how do I do this?  




Oh dear, it's not very simple... but a rough outline:

In your ServersSetup.gf, under [Launch] set ShipServer = 0

Now comes the tough part. You need to construct the records for each ship as they would appear in the "ship" table and store them elsewhere (another table or as individual .sql queries perhaps - depends on your external shipyard design). You can do this one of two ways: wait for every ship in the list to pass through the yards with the shipserver on and capture the records (as Kel has done) -- or construct the records for each ship from the shiplist directly. To do this you need to know how to construct the binary blob data for each ship. I think these blob structures have been decoded but perhaps not fully yet. (Damage, Stores and Officers). I have info on these somewhere... Search here for "blob" as well. Sigh, I wish the blobs had been removed... (have they? - I actually havent gotten a chance to look at the OP SQL kit yet - busy evaluating   other software...)

Once you have all the desired ship records constructed, now you need to come up with a design for your shipyards. Do you want to use the internal shipyard (normal bidding) and control its population externally? Or do you want ships only to be available through an external interface such as Kel's IRC workaround. If you will use the internal bidding system its pretty simple from here, you just need to write a script or program to purge and fill the shipyards on the desired schedule with the desired ships. If you wish to use a completely external shipyard you will also need to figure out (or get from Kel) the structure of the shipcachevector blob in the character table so that when a character purchases a ship you can edit the ship table to make him the owner (or construct a query to add the purchaser as owner to the record added to the ship table in one operation). But for the character to actually own the ship you must correctly edit the shipcachevector blob (I have not determined its structure yet.. but perhaps Kel has...) Alternatively you can pass the ship through the biditem table as an instant purchase and have the server kit make its arcane edits to the shipcachevector blob. (ship must be present in the ship table and set to in auction...) and the appropriate biditem record entered.

As you can see it is not very simple because of the blob remnants of the flatfile (relational structure and linked tables would be so much nicer... but enough bitching, I'm glad to get this at least....).

I have not actually tested the kit with the ShipServer off yet, but have managed to create bids on ships not in the yard (captured from previous ship table records) from php scripts - passing them through the biditem table because I have not managed to decode the shipcachevector yet...

A lot of the decoding of the flatfile that NW did for his EDDBEDIT.exe will apply here. If you have the source for that app it may help, there was a thread disudssing this recently, NW said he'd look into it to refresh his memory. I have the source for this app but have not examined it closely enough yet to help be decode the blobs which must be edited or created to do this job. (Kinda busy with paying work right now...). I can send it to you or find the link if you do not have it.
(Edit: here's the link: http://www3.telus.net/NuclearWessels/sfc/downloads/dbeditor_sourcecode.zip )

Definitely solicit Kel's input here, he has actually gotten further with this than I have but is capturing ship records from the live shipyard. Ideally we should be able to create ship records with only the information in the shiplist, but we need to be absolutely sure of these blob structures to be able to do that.

I wish I could get into this now but I just don't have the time at the moment to take up where I left off. I may get a chance to look at the new kit this weekend.

NW has the keys to the kingdom here I think, as long as the blob structures are the same as found in the flatfile, if not then some additional decoding and confirmation will be necessary. I have most of the structures of these blobs decoded but until they are complete, nothing can be done.

So as you see, its still somewhat of a "flatfile" - no relational structure, and choc full of binary data. I may sound discouraging here, but I know this can be done - It'll just take a little work.    
« Last Edit: February 04, 2004, 08:29:28 pm by Bonk »

DH123

  • Guest
Re: Controlling Spacedock
« Reply #74 on: February 05, 2004, 04:30:43 pm »
My head is really starting to hurt  

But the possibilites are so fricking cool!  

NuclearWessels

  • Guest
Re: Controlling Spacedock
« Reply #75 on: February 05, 2004, 05:15:33 pm »

Bonk - I have managed to generate ships (on the flatfile DB) by constructing their entry based on the shiplist information.  So far it seems to work, but there are still a few bytes in the ship description where I'm just kind of winging it.

After I get through fixing some big boo-boos in the mission pack I'll dig out the blueprints I've got for the DB layout.  It looks like the blobs match the flatfile layout pretty closely (crosses fingers).

dave
 

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #76 on: February 05, 2004, 09:39:31 pm »
That'd be too cool NW. Between that and what I have collected already it shouldn't be too hard to to populate the shipyards externally once I get a chance to give it a go. (Others are more than welcome to beat me to it! There will be lots of approaches to it once the basic mechanics of it are worked out.)

It occurs to me however, what will happen when a players ship is destroyed with the ShipServer turned off...? May or may not be a problem... easy to test however and no need to complete an external shipyard to do so. That should be tested first so that it can be accounted for in the external shipyard design if necessary:
If we need to leave the ShipServer on to account for this, then I guess the strategy would be to schedule a script to purge the ships generated by the serverkit as soon as they are produced and replace them with the desired ships. Or probably better to set the probablilty of construction to zero for all classes if the ShipServer must be left on, and simply fill the yards as desired. I think that'd be the way to go, effectively disabling the built in shipyards.

Then the only trick would be the shipcachevector blob which would be necessary for automated account creation and completely external shipyards. Well at least for automated account creation... (administrated or auctioned OoBs) ... I just thought of a workaround for a completely external shipyard without knowing the shipcachevector blob structure - if setting the probablility of construction to zero for all classes actually leaves the yards empty, then ships can only be added to the ship and biditem table externally... and instant bids can take care of the rest. (This approach should allow "automated" / external account creation as well.)

>> I get the feeling it may be necessary to leave the ShipServer on to handle AI ships generated and destroyed by mission scripts as well. (with "dead" AI ships and characters from crashed missions being cleaned out regularly of course...)

Come to think of it, it seems to me I have the shipcachevector blob structure somewhere... or at least a detailed discussion of it.

Sorry to ramble again, just brainstorming a bit here.    

DH123

  • Guest
Re: Controlling Spacedock
« Reply #77 on: February 05, 2004, 11:09:00 pm »
Basic questrion here, the "Ship" table is every ship in play AND in the shipyard?  

NuclearWessels

  • Guest
Re: Controlling Spacedock
« Reply #78 on: February 05, 2004, 11:31:29 pm »
Yes,  all the ships in the shipyard appear exactly like player owned ships, they just have no owner id associated with them (the owner id is probably 0 in the table IIRC)

dave
 

DH123

  • Guest
Re: Controlling Spacedock
« Reply #79 on: February 06, 2004, 12:26:33 am »
Quote:

Yes,  all the ships in the shipyard appear exactly like player owned ships, they just have no owner id associated with them (the owner id is probably 0 in the table IIRC)

dave
   




And "Ship Cache Vector" Determines the "Stats" of the ship?  

NuclearWessels

  • Guest
Re: Controlling Spacedock
« Reply #80 on: February 06, 2004, 08:46:10 am »
Here is the order of stats in the flatfile - but you'll have to check how this lines up with the start of the data sequence in the ship blob (haven't checked if this lines up with the start of the ship blob, or if there are a handful (say 1-9) bytes of other stuff at the beginning of it)

Each of these fields are 1 byte, so two hex digits
Code:

   Right warp total (damaged + undamaged)
   Right warp current
   Left warp total
   Left warp current
   Center warp total
   Center warp current
   Impulse total
   Impulse current
   Apr total
   Apr current
   Bridge total
   Bridge current
   Sensor total
   Sensor current
   Scanner total
   Scanner current
   DamCon total
   DamCon current
   Repair total
   Repair current
   Fwd hull total
   Fwd Hull current
   Aft hull total
   Aft hull current
   Center hull total
   Center hull current
   Tractor total
   Tractor current
   Excess dam total
   Excess dam current
   Transporters total
   Transporters current
        ??? total
        ??? current
   Battery total
   Battery current
   Labs total
   Labs current
   Cargo total
   Cargo current
   Armour total
   Armour  current
   Cloak total
   Cloak current
   Probe total
   Probe current
   Barracks total
   Barracks current

        Then there are 25 pairs, one for each weapons hardpoint,
                Weapons on hardpoint i total
                Weapons on hardpoint i current

         Then we get 11 bytes of ???

         Then a burst covering drones:
         Drone type
         Drone speed
         Drone reloads
         ???
         Drone racks
         ???
         Max drones
         Then 4 bytes of ???
         Current drones
         Then 4 bytes of ???

         Heh, then it gets a little tricky
         For each of the 25 hardpoints, there are 4 entries of 2 bytes each
               current number of drones in the hardpoint
               current number of racks in the hardpoint
               size/type of drone rack in the hardpoint
               and 2 bytes of ???

        Then we get a big chunk of ???
        However, 325 bytes past the RWtotal, we get
              Shuttles max, then
              Shuttles curr

   Then another glorious whack of ???,
             until, 440 bytes past the RWtotal, we get
   Marines max
        Marines current
        Marines current again?
        Tbombs max
        Tbombs current
        Tbombs current again?
        Spares max
        Spares current
        Spares current again?

        Finally, we get the information on the four fighter bays
        For each bay:
               Total fighters in the bay
                Current fighters in the bay
                Default number of fighters in the bay
                One byte of ????
                4 bytes telling you how long the string for the fighter type is
                      followed by the actual fighter type currently loaded (e.g.  H-Hornet-1 or whatever)
                 4 bytes telling how long the string for the default fighter type is
                       followed by the default fighter type for that bay (from the shiplist)




loads o' fun
dave
 

Bonk

  • Guest
Re: Controlling Spacedock
« Reply #81 on: February 06, 2004, 04:56:06 pm »
Cool Dave that ought to help some. But I have some really neato cool real work to do, and RDSL starts tomorrow!!! Aggh! "It never rains around here..."

 
Quote:

 And "Ship Cache Vector" Determines the "Stats" of the ship?  




The shipcachevector blob is in the servcharacter table and describes the ships in the possesion of the character.

i.e. If I change the Owner of a ship in the ship table to my character's ID, I do not get the ship. The shipcachevector blob for my character record must also be edited to show that I own the ship. (Thus I have passed them through the biditem table to make the ship actually owned by the character - as recommended by DarkElf...) It would be nice not to have to use the biditem table and instant purchases however, for the reasons mentioned.

All the appropriate "stats" for each ship are stored in the ship table in the "Damage", "Stores" and "Officers" blobs. (oh how I wish they were in linked tables of their own...) The remaining information for each ship that is necessary is gathered from the shiplist when needed I imagine.

 
Quote:

 Yes, all the ships in the shipyard appear exactly like player owned ships, they just have no owner id associated with them (the owner id is probably 0 in the table IIRC)




Correct, except that the state of the blobs will differ for player and AI owned ships as they are dmaged and resupplied etc...
(useful to decode the blob structures, this is how weve done most of it - by comparing the unowned ship to ships we've damaged or supplied to various states... - [we refers to txtanker, UDF_Intruder and I]... search on those usernames here for more info and I sincerely apologise for the fact that a search on the Anonymous username will be of no assistance... )

I will gather and post the blob structure work from those threads and correspondence shortly...  

some threads with hints and some data:
http://forums.taldren.com/ubbthreads/showflat.php?Cat=&Board=UBB2&Number=14992
(just remembered the pertinence of the OpenShipBids blob in the servcharacter table here too...)
« Last Edit: February 06, 2004, 05:22:45 pm by Bonk »