Topic: I think I solved the double-fighter bug..  (Read 28396 times)

0 Members and 3 Guests are viewing this topic.

Offline GDA-S'Cipio

  • Brucimus Maximus
  • Captain
  • *
  • Posts: 5749
  • Gender: Male
  • If I took the bones out, it wouldn't be crunchy.
Re: I think I solved the double-fighter bug..
« Reply #60 on: July 26, 2004, 05:19:43 pm »
OK, I've posted updated packs for

Core missions
Total War missions
The whole shebang

though the big one says it still has about 20 minutes to go on the upload

These include Firesoul's fix for the double-fighter bug, plus a host of minor other fixes (incorrect reporting of  some mission results, the stupid routine that named AI ships things like .I.II.III, etc etc)

thanks again FS!
dave



I've never run the total war pack, but I know some have.  Is it absolutely impossible to draft an ally in the Total War pack even if you want to, or does the DV shift just not get mucked up if you happen to draft an enemy as an ally?

-S'Cipio
"I cannot undertake to lay my finger on that article of the Constitution which granted a right to Congress of expending, on the objects of benevolence, the money of their constituents."  - James Madison (chief author of the Constitution)

-----------------------------------------
Gorn Dragon Alliance member
Gorn Dragon Templar
Coulda' used a little more cowbell
-----------------------------------------


Offline NuclearWessels

  • Evil Dave
  • Serverkit Development Team
  • Lt. Commander
  • *
  • Posts: 1249
  • Scripter and general nuisance
    • NukeDocs
Re: I think I solved the double-fighter bug..
« Reply #61 on: July 26, 2004, 05:21:47 pm »
<scratches head>

DH .... I think that was one of the "10" patrols , but can't remember which one (Met_NW10PatrolEnemy or Met_NW10PatrolEnemy_tw ??)

Scippy ... the TW pack will only draft your own race on your side, and will only draft from your "worst enemy" for the opposition side

dave

EDIT: the whole shebang seems to have completed uploading now

Offline FPF-DieHard

  • DDO Junkie
  • Captain
  • *
  • Posts: 9461
Re: I think I solved the double-fighter bug..
« Reply #62 on: July 26, 2004, 05:51:03 pm »
<scratches head>

DH .... I think that was one of the "10" patrols , but can't remember which one (Met_NW10PatrolEnemy or Met_NW10PatrolEnemy_tw ??)

Scippy ... the TW pack will only draft your own race on your side, and will only draft from your "worst enemy" for the opposition side

dave

EDIT: the whole shebang seems to have completed uploading now

Yup, testing now.

Dod you have any patrols that do not start the players in motion?
Who'd thunk that Star-castling was the root of all evil . . .


Offline NuclearWessels

  • Evil Dave
  • Serverkit Development Team
  • Lt. Commander
  • *
  • Posts: 1249
  • Scripter and general nuisance
    • NukeDocs
Re: I think I solved the double-fighter bug..
« Reply #63 on: July 26, 2004, 06:02:35 pm »

Yup, testing now.

Dod you have any patrols that do not start the players in motion?

Damn!  Knew there was something else I wanted to do - I was going to add a setting so admins could turn that off if they wanted to.

I'll add and test that over the next week or so,
Doh!

dave

Offline FPF-DieHard

  • DDO Junkie
  • Captain
  • *
  • Posts: 9461
Re: I think I solved the double-fighter bug..
« Reply #64 on: July 26, 2004, 06:05:40 pm »
You rock!

What about AI-stripping and base busting?  Have those been fixed? 

Tell me exactly what you need tested, I will get it done.
Who'd thunk that Star-castling was the root of all evil . . .


Offline NuclearWessels

  • Evil Dave
  • Serverkit Development Team
  • Lt. Commander
  • *
  • Posts: 1249
  • Scripter and general nuisance
    • NukeDocs
Re: I think I solved the double-fighter bug..
« Reply #65 on: July 26, 2004, 06:24:05 pm »
You rock!

What about AI-stripping and base busting?  Have those been fixed? 

Tell me exactly what you need tested, I will get it done.

The AI stripping still isn't up to snuff - I've got a fix, but it's a longer term deal (need to change a bunch of things in the way I'm generating AI to get that right, so it will also wind up needing more extensive testing)

I'm pretty sure I fixed the base busting, but will have to go back and double-check - it was in progress, but I can't remember if I finished testing it or not

For the testing, look for anything you remember that bugs ya, make a list, and let me know.   No promises of course, but I'll see what I can do [EDIT: keeping in mind that I can't do much about Hexx ;) ]

dave



Offline [RK] Castrin

  • Avatar of the Silent Majority
  • Global Moderator
  • Lt. Junior Grade
  • *
  • Posts: 99
  • Gender: Male
    • Order of the Empyrean Shield
Re: I think I solved the double-fighter bug..
« Reply #66 on: July 26, 2004, 06:29:14 pm »
Great work FS!!  :thumbsup: :thumbsup:


Karnak, I think FS meant that he wanted the mission developer to modify the script, rather than tamper with it himself.
Just talking out of my ass here but I think FS is very sensitive about designer's rights and didn't want to step on anyone's toes.
NW has been the only scripter posting recently (yourself and Tracey being absent) so he addressed it to NW.
Once again, just my impression but I do not think any insult was intended.



Umm...No.  It's no secret that FS does not like me or EEK scripts and I don't like people that back-stab.

Since he wants only NW scripts updated then I think I'll oblige him.

This community really sucks to see such garbage posted. End of Story.

Not worth my time anymore.

Geeez, did you even read the FIRST post he made?

Now, I'm gonna try to compile as many missions as possible, but can someone get NuclearWessels and Karnak to see this? Thanks.

-- Luc

Karnak, I'm sad you feel it nessisary to post things like this.

  :(
"Mr. Knowledge" -- Wildcard

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #67 on: July 26, 2004, 06:38:13 pm »
OK, I've posted updated packs for

Core missions
Total War missions
The whole shebang



I'm fetching the missions now, also. Seems that you have your coding hat back well back on now. :)


Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer: SFC-EAW for OP Campaigns
Kitbash: SFC2 models

Offline Strafer

  • Lt. Junior Grade
  • *
  • Posts: 428
  • Gender: Male
Re: I think I solved the double-fighter bug..
« Reply #68 on: July 26, 2004, 06:40:54 pm »
OK, I've posted updated packs for

Core missions
Total War missions
The whole shebang



I'm fetching the missions now, also. Seems that you have your coding hat back well back on now. :)


...staple gun, anyone?  ;D
--
Code: [Select]
Lineage II
Server                           Sieghardt                    deviantrealms.com (dead)
Chars       Strafer          L24 Rogue                  L64 Hawkeye
                StrayFar       L64 Tyrant                  L51 Tyrant
                StrawFur      L37 Scavenger            L49 Bounty Hunter
                StraightFour L62 Shillen Elder         L53 Shillen Elder

Offline NuclearWessels

  • Evil Dave
  • Serverkit Development Team
  • Lt. Commander
  • *
  • Posts: 1249
  • Scripter and general nuisance
    • NukeDocs
Re: I think I solved the double-fighter bug..
« Reply #69 on: July 26, 2004, 06:41:05 pm »

I'm fetching the missions now, also. Seems that you have your coding hat back well back on now. :)

Nothing like a break to give you a fresh batch of enthusiasm!  Of course, it also doesn't hurt that the mrs is quite distracted setting up some consultancy work right now ;)

dave

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: I think I solved the double-fighter bug..
« Reply #70 on: July 26, 2004, 09:10:28 pm »
OK, I've posted updated packs for

Core missions
Total War missions
The whole shebang

though the big one says it still has about 20 minutes to go on the upload

These include Firesoul's fix for the double-fighter bug, plus a host of minor other fixes (incorrect reporting of  some mission results, the stupid routine that named AI ships things like .I.II.III, etc etc)

thanks again FS!
dave



I've never run the total war pack, but I know some have.  Is it absolutely impossible to draft an ally in the Total War pack even if you want to, or does the DV shift just not get mucked up if you happen to draft an enemy as an ally?

-S'Cipio


The total war pack is intended for servers with no allies. If you use the regular missions you end up getting allied enemy ships (if that makes any sense.. lol), thus the total war pack... I'll give the new set a whirl on the Gravity Well tomorrow.

Thanks Dave!

el-Karnak

  • Guest
Re: I think I solved the double-fighter bug..
« Reply #71 on: July 26, 2004, 11:05:52 pm »
You see that topic? That's right. I really do think I've solved it. My tests show that I have. ;)

Setup: 3 PCs. 1 as my own D2 server, and the other 2 as clients.
Time it took: Been trying all sorts of things since Tuesday..
Mission: Met_17PatrolEnemy  (found to cause it)

I'm sure some of you spotted the "Luc's Test Server" lately. This is what it was for.. and guess what, I think I fixed it.


Now, pay attention.. ;)
Anywhere you have a ship creation like this...

-------------------------------------
   mCreateShip( typeid( tAttackTeamShip ),
             shipScriptDescription.fClassName.c_str(),
             kStartPosition_W,
             shipScriptDescription.fMetaDatabaseID,
             gWC.fNWCustID++, 0, 0, -1, -1,
             shipScriptDescription.fCustomName.c_str(),
             static_cast<eShipOptions>( option | kCanBeCarrier | kStartPositionCanBeOffset ) );
-------------------------------------

.. you gotta find the file that handles the typeid.. (in this case, AttackTeamShip.cpp).
In there,  look for the mSetupState function and change it to something more restrictive:

-------------------------------------
void tAttackTeamShip::mSetupState()
{
   tTeamInfo* ti = fMissionInfo->mGetTeamHandle( mGetTeam() );
   if (ti)
   {
      if (! ( (!ti->mIsTeamHumanControlled()) && (!gScriptInterface.mIsHost()) ) )
      {

         mRegisterState( new tAttackTeamShipInitialState( ) );
         mGotoState( typeid( tAttackTeamShipInitialState ) );
      }
   }

}
-------------------------------------


Prevent NON-hosts from setting up the TeamState IF it's also an AI. If it's a player, you need the TeamState for the nonhost.


Now, I'm gonna try to compile as many missions as possible, but can someone get NuclearWessels and Karnak to see this? Thanks.

-- Luc

This code fix won't work for stand-alone AI creation routines like this:

void   mCreateShip( const type_info& ShipClass, int32 TotalBPV, eClassTypes SmallestHullSize, eClassTypes LargestHullSize, int32 VariantPercent, int32 Position, int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions );

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #72 on: July 26, 2004, 11:49:06 pm »
Quote
void   mCreateShip( const type_info& ShipClass, int32 TotalBPV, eClassTypes SmallestHullSize, eClassTypes LargestHullSize, int32 VariantPercent, int32 Position, int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions );

Yes it does. ShipClass, the first parameter, is present. Here's the prototype of the function that I used in my example:

void   mCreateShip( const type_info& ShipClass, const char* ClassName, int32 Position, int32 MetaDatabaseID, int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions );

All of the mCreateShip functions use it. Basically, you just have to figure out where the ShipClass used is located, and make sure only the host can register the TeamState for the AIs.

.. thankfully, the default ShipClass "typeid( tShipInfo )", which is hosted from within the API,  does not register a team state, so we don't have to worry about it.  That covers about all bases.

-- Luc


Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer: SFC-EAW for OP Campaigns
Kitbash: SFC2 models

Offline Julin Eurthyr

  • Veltrassi Ambassador at Large
  • Lt. Commander
  • *
  • Posts: 1057
  • Gender: Male
  • Back in Exile due to Win 7 - ISC RM/Strat Com.
Re: I think I solved the double-fighter bug..
« Reply #73 on: July 26, 2004, 11:53:41 pm »
[EDIT: keeping in mind that I can't do much about Hexx ;) ]

Couldn't you write a routine along the lines of:

If host=Hexx then
X=rand (100)
If X > 90 then fill map with T-bombs
endif
endif

And put it into every mission?  :D  :P   8)

Just a little reminder of what he'll have to face every mission with an ally...

AKA: Koloth Kinshaya - Lord of the House Kinshaya in the Klingon Empire
S'Leth - Romulan Admiral
Some anonymous strongman in Prime Industries

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #74 on: July 27, 2004, 12:03:51 am »
[EDIT: keeping in mind that I can't do much about Hexx ;) ]

Couldn't you write a routine along the lines of:

If host=Hexx then
X=rand (100)
If X > 90 then fill map with T-bombs
endif
endif

And put it into every mission?  :D  :P   8)

Just a little reminder of what he'll have to face every mission with an ally...


heh..

.. nope.. we don't have access to the player names, the current hex, or even the stardate.. sorry. ;)
.. think! It woulda been done LONG ago! :)


Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer: SFC-EAW for OP Campaigns
Kitbash: SFC2 models

el-Karnak

  • Guest
Re: I think I solved the double-fighter bug..
« Reply #75 on: July 27, 2004, 01:21:39 am »
Quote
void   mCreateShip( const type_info& ShipClass, int32 TotalBPV, eClassTypes SmallestHullSize, eClassTypes LargestHullSize, int32 VariantPercent, int32 Position, int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions );

Yes it does. ShipClass, the first parameter, is present. Here's the prototype of the function that I used in my example:

void   mCreateShip( const type_info& ShipClass, const char* ClassName, int32 Position, int32 MetaDatabaseID, int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions );

All of the mCreateShip functions use it. Basically, you just have to figure out where the ShipClass used is located, and make sure only the host can register the TeamState for the AIs.

.. thankfully, the default ShipClass "typeid( tShipInfo )", which is hosted from within the API,  does not register a team state, so we don't have to worry about it.  That covers about all bases.

-- Luc

Nope. It does not work. The mCreateShip function is:

void   mCreateShip( const type_info& ShipClass, int32 TotalBPV, eClassTypes SmallestHullSize, eClassTypes LargestHullSize, int32 VariantPercent, int32 Position, int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions );

Not the one you use in ::CreateNewShip function.

Try it out before you post next time, wonder-boy.

Offline Cleaven

  • Lt. Junior Grade
  • *
  • Posts: 375
  • Gender: Male
Re: I think I solved the double-fighter bug..
« Reply #76 on: July 27, 2004, 02:30:47 am »

Try it out before you post next time, wonder-boy.

Nothing has changed. Not one single solitary thing.

Not sure I can be bothered, but as you are the Doc, can you run an AI standard patrol in 2 minutes in a KRC? If so, there is no problem and I am utterly wrong. If you cannot, then the KRC is a worse ship for AI missions than ones I know can.

Offline FPF-DieHard

  • DDO Junkie
  • Captain
  • *
  • Posts: 9461
Re: I think I solved the double-fighter bug..
« Reply #77 on: July 27, 2004, 07:35:40 am »
karnak, play nice. 
Who'd thunk that Star-castling was the root of all evil . . .


Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #78 on: July 27, 2004, 08:05:31 am »
*sigh*

From the API, there are 4 mCreateShip functions. Here are their prototype, with the important bit in red.

TeamInfo.h:
Quote
   void   mCreateShip( const type_info& shipClass, const tShipInGame& ShipData);
   void   mCreateShip( const type_info& ShipClass, const char* ClassName, int32 Position, int32 MetaDatabaseID, int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions ); // The only one used
   void   mCreateShip( const type_info& ShipClass, int32 TotalBPV, eClassTypes ShipType, int32 VariantPercent, int32 Position, /*int32 MetaDatabaseID,*/ int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions, eRace Race = kNoRace );

   void   mCreateShip( const type_info& ShipClass, int32 TotalBPV, eClassTypes SmallestHullSize, eClassTypes LargestHullSize, int32 VariantPercent, int32 Position, int32 CustomID, int32 StartX, int32 StartY, int32 EndX, int32 EndY, const char* CustomName, eShipOptions ShipOptions );

They all use the shipClass param which allows you to define your own ShipInfo code. Within the ShipInfo file is where the problem is, so the issue is not[/red] the mCreateShip function.

But I'll play along.  ::)

  • The first mCreateShip listed here, above, calls mCreateTeamShip to do the final work.
  • The 2nd comes from my original example. It also  calls mCreateTeamShip to do the final work
  • The 3rd comes from your complaint. Within the API I see that that one calls
    mCreateFleet, which in turn calls mCreateTeamFleet, which in turn calls mCreateTeamShip within its loop.
  • The 4th mCreateShip also calls mCreateFleet, and follows the same path as the 3rd one.

So. They all use the parameter which defines the shipClass to use. You use that to track down the bug within the source, where the Registeration of TeamState is, and you make it more restrictive to prevent the double-fighters/weapons.. .. and they all end up within the same function of the API.

I would like to point out that other functions, such as mCreateTeamFleet and mCreateCPUFleet, also do this.


Edit: Oh! NOTE:
If you're Registering the TeamState elsewhere, for whatever reason you need to do this, then you need to add the restriction that only the host should Register that State for the AI ships. The focus is the State: make sure it's not run on all machines.
« Last Edit: July 27, 2004, 08:21:03 am by FireSoul »


Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer: SFC-EAW for OP Campaigns
Kitbash: SFC2 models

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #79 on: July 27, 2004, 08:08:27 am »
*back from shower* ..

.. forget about the mCreateShips. You just need some focus towards the goal.

Just locate everywhere the Team States are being registered, and prevent non-hosts from registering the state for AI teams. The mCreateShip functions will help you find these, and that was stated in the first post.

It can be anywhere in the code that can access functions in the ShipInfo class. It is possible to register a new state from within a state overriding to original one.
« Last Edit: July 27, 2004, 08:38:15 am by FireSoul »


Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer: SFC-EAW for OP Campaigns
Kitbash: SFC2 models