Topic: Controlling Spacedock  (Read 8151 times)

0 Members and 2 Guests are viewing this topic.

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?