Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: tnathan475 on March 23, 2008, 11:25:02 pm

Title: Max ships?
Post by: tnathan475 on March 23, 2008, 11:25:02 pm
What is the maximum number of ships that can be added to to the ships.tbl? and is this changable so it is higher?
Title: Re: Max ships?
Post by: blowfish on March 23, 2008, 11:32:59 pm
130 is the limit for non-inferno builds (which is basically almost everything).  That includes the ones that are already in there (I forget the exact number), but I think you have somewhere around 20 ships breathing room.  This can be changed via code (actually its relatively simple), but I've heard it does weird things to pilot files.
Title: Re: Max ships?
Post by: Hellstryker on March 23, 2008, 11:41:27 pm
Theres a simple answer... just use an inf build  :cool:
Title: Re: Max ships?
Post by: blowfish on March 23, 2008, 11:44:14 pm
Theres a simple answer... just use an inf build  :cool:

Difficult for those of us who aren't on windows...
Title: Re: Max ships?
Post by: Droid803 on March 23, 2008, 11:46:17 pm
So...how exactly do you get an inf build anyway? (or where is the code that controls the the limit?)
Title: Re: Max ships?
Post by: blowfish on March 23, 2008, 11:50:51 pm
Search in Recent Builds for an Inferno build.

Before worrying about code, you must make sure you are set up to compile (with all the source from SVN etc ... if you don't know what I'm talking about, you are not prepared to start changing code).  IIRC it is in globals.h and should look something like this:

Code: [Select]
#ifdef INFERNO(or something like that)
    #define MAX_SHIP_CLASSES 200
#else
    #define MAX_SHIP_CLASSES 130
#endif

Basically you need to change that 130 number to something larger.  I have no idea what adverse effects this could have on everything else though.
Title: Re: Max ships?
Post by: Goober5000 on March 24, 2008, 12:00:44 am
You can't simply change the number of ships, you have to activate the INFERNO compile-time variable.  This triggers a number of checks and balances in the code to deal with bumped limits.
Title: Re: Max ships?
Post by: blowfish on March 24, 2008, 12:27:46 am
Are those checks and balances specific to 200 ships, or could the limit for Inferno builds be expanded?  And why hasn't this been done for regular builds as well (you don't have to post a detailed answer as it will probably just lead to more questions)?
Title: Re: Max ships?
Post by: Scooby_Doo on March 24, 2008, 02:42:11 am
/me patiently waits for dynamic ship class count.  ;)
Title: Re: Max ships?
Post by: Titan on March 24, 2008, 06:59:36 am
if you put the original ships.tbl in your mod's folder, you can delete any extra ships that won't be used (knossos, meson bomb, etc) to make extra room for your ships. just put the tbl data directly into the above-mentioned tbl file.
Title: Re: Max ships?
Post by: Getter Robo G on March 24, 2008, 09:08:03 am
Here's a good counter question noe one has asked.

For everyone who says "Just use an Inferno build"... WHAT do you lose by doing so (if anything) by not using 3.6.9 or 3.6.10??

Is the max ship number the only difference between builds?
I'd like to have that answered by a SCP person...

If that's the case then I will switch to that, as long as no errors pop up during testing. (I had a bazillion of them trying to swtich to 3.6.9 from 3.6 and had to start over from scratch! I'm not looking forward to another such restart.)
Title: Re: Max ships?
Post by: Goober5000 on March 24, 2008, 09:44:31 am
Are those checks and balances specific to 200 ships, or could the limit for Inferno builds be expanded?  And why hasn't this been done for regular builds as well (you don't have to post a detailed answer as it will probably just lead to more questions)?
Inferno has 400 ships, not 200.  And no, it can't be bumped without causing the same problems that led to the Inferno build in the first place.

Bumping is not a trivial matter, in this case, because it breaks EVERYTHING.  (Well, not everything, but most things.)  It's nowhere near as simple as, say, bumping SEXP_NODES (which have been made dynamic anyway).  The two major problems are the pilot files are rendered incompatible and multiplayer doesn't work.  However there are a bunch of other seemingly unrelated issues that follow from these.

As for why haven't these problems been fixed yet -- the answer is that we've been trying to.  Taylor, bless him, has been working on the 3.7 code for probably over two years now.  When 3.7 is ready, ship limits will be obsolete.  Until then, you'll have to live with what you've got.


Here's a good counter question noe one has asked.

For everyone who says "Just use an Inferno build"... WHAT do you lose by doing so (if anything) by not using 3.6.9 or 3.6.10??

Is the max ship number the only difference between builds?
I'd like to have that answered by a SCP person...
Well, you can't interchange Inferno pilots and regular pilots, for one thing.  Inferno not only bumps ship limits, it bumps weapon limits too, and a few others, I think.

We really need an SCP FAQ somewhere.  This question has been asked before, but every six months a new group of people comes along who haven't heard the old answer. ;)

EDIT: I know.  Somebody should do a search for the common SCP questions and post them up on the Wiki. :)
Title: Re: Max ships?
Post by: tnathan475 on March 24, 2008, 10:11:31 am
thanks for all the info guys, guess ill just have to clean out my ship.tbl for things that i know i wont use for now.  how far along is version 3.7?
Title: Re: Max ships?
Post by: Droid803 on March 24, 2008, 12:20:05 pm
There's a weapon limit? SH*T! I have a feeling I'm going to hit that too...soon... >.<

Oh well *starts clearing ships.tbl of redundant entries*...*waits for 3.7*
Title: Re: Max ships?
Post by: Titan on March 24, 2008, 02:09:24 pm
There's a weapon limit? SH*T! I have a feeling I'm going to hit that too...soon... >.<

Oh well *starts clearing ships.tbl of redundant entries*...*waits for 3.7*

my advice is actually being used?  :eek:
Title: Re: Max ships?
Post by: Droid803 on March 24, 2008, 03:29:15 pm
Yup, sicne its basically the best way to do this without screwing around with stuff that I don't want messed up.

What is the weapon limit anyway? 130? less? more?
Title: Re: Max ships?
Post by: blowfish on March 24, 2008, 05:40:33 pm
Weapon limit is 200, 300 in Inferno builds.
Title: Re: Max ships?
Post by: Whitelight on March 24, 2008, 08:20:38 pm
Inferno ship limit is not 200, its 250.  :p
Title: Re: Max ships?
Post by: blowfish on March 24, 2008, 08:29:17 pm
I just saw that.  I was closer than Goober though.
Title: Re: Max ships?
Post by: Goober5000 on March 24, 2008, 08:52:28 pm
Gah.  I looked at the code too quickly. :rolleyes:

Here it is:

Code: [Select]
// from ship.h
#define MAX_SHIPS 400 // max number of ship instances there can be.DTP; bumped from 200 to 400
#define SHIPS_LIMIT 400 // what MAX_SHIPS will be at release time (for error checking in debug mode); dtp Bumped from 200 to 400

// ****************************************************************
// DO NOT CHANGE THIS - IT WILL LIKELY BREAK FREESPACE2 PXO SUPPORT
// TALK TO DAVE B FIRST
// ****************************************************************
#define MAX_SHIP_CLASSES_MULTI 130

#ifdef INF_BUILD
#define MAX_SHIP_CLASSES 250
#else
#define MAX_SHIP_CLASSES 130
#endif
Title: Re: Max ships?
Post by: blowfish on March 24, 2008, 10:13:29 pm
OK so I looked at the tables and found that there are 113 ship classes and 90 weapon classes.  This gives you 17 ships to add (unless you delete some or use ship templates) and 110 weapons to add (do countermeasures count?).  Not a lot of breathing room in the ship department.
Title: Re: Max ships?
Post by: Whitelight on March 24, 2008, 10:19:41 pm
Tis alright Goob, i`ve made mistakes in more than a few instances.  :D
Title: Re: Max ships?
Post by: Rico on March 25, 2008, 06:09:50 pm
So to allow more ships we need to use the Inferno build? Why hasnt SCP fixed this, I personally would have considered it a priority if I was editing the game  :nervous:
Title: Re: Max ships?
Post by: blowfish on March 25, 2008, 06:32:37 pm
So to allow more ships we need to use the Inferno build? Why hasnt SCP fixed this, I personally would have considered it a priority if I was editing the game  :nervous:

Bumping is not a trivial matter, in this case, because it breaks EVERYTHING.  (Well, not everything, but most things.)  It's nowhere near as simple as, say, bumping SEXP_NODES (which have been made dynamic anyway).  The two major problems are the pilot files are rendered incompatible and multiplayer doesn't work.  However there are a bunch of other seemingly unrelated issues that follow from these.
Title: Re: Max ships?
Post by: Rico on March 25, 2008, 06:57:07 pm
And upping the number kills MP how  :wtf: makes no sence why that happens. :(
Is someone trying to fix it or has every1 just given up on the subject  :nervous:
Title: Re: Max ships?
Post by: Scooby_Doo on March 25, 2008, 09:44:44 pm
And upping the number kills MP how  :wtf: makes no sence why that happens. :(
Is someone trying to fix it or has every1 just given up on the subject  :nervous:

I'm guessing the packet format for the server gets out of synch.  It expects to see X number of bytes for ship class id, but sees Y.
Title: Re: Max ships?
Post by: Flaming_Sword on March 25, 2008, 10:28:04 pm
Maybe I should check out the sources and see for myself...
Title: Re: Max ships?
Post by: Goober5000 on March 26, 2008, 08:58:38 am
Scooby Doo's answer is essentially correct.

Hi Rico.  Enjoy your new title.
Title: Re: Max ships?
Post by: Flipside on March 26, 2008, 09:01:19 am
Always remember, Goober hates you all ;)
Title: Re: Max ships?
Post by: Goober5000 on March 26, 2008, 10:48:33 am
Not really.  I just practice tough love. :D