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

0 Members and 1 Guest are viewing this topic.

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
I think I solved the double-fighter bug..
« on: July 24, 2004, 09:14:11 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


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

Offline FVA_C_ Blade_ XC

  • Forum Czar
  • Administrator
  • Admiral
  • *
  • Posts: 55845
  • Gender: Male
  • Yep,I did it.
Re: I think I solved the double-fighter bug..
« Reply #1 on: July 24, 2004, 09:34:02 pm »
 :notworthy:
FVA_C_Blade_XC
XenoCorp Fleet Operations
www.xenocorp.net
ISC Race Moderator
Visioneer
S.S.Blade


See Wade,See Wade post like an arse,See Wade get banned.
Dont be a Wade!

Offline Durin

  • Lt. Junior Grade
  • *
  • Posts: 139
  • Gender: Male
Re: I think I solved the double-fighter bug..
« Reply #2 on: July 24, 2004, 09:38:37 pm »
 :rwoot: :woot: :rwoot: :rwoot: :rwoot:

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #3 on: July 24, 2004, 09:42:38 pm »
Note: I think this also serves for the double-damage bug, which in my opinion is one and the same..  I will of course need someone to put up a test server.. ;D


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

Offline Green

  • I'm not a
  • Commander
  • *
  • Posts: 3004
Re: I think I solved the double-fighter bug..
« Reply #4 on: July 24, 2004, 09:45:27 pm »
Green looks left towards J'inn, tilts head, scratches ear.  Green look right towards Hooch, tilts head, scratches ear.  Green looks back towards Krueg, tilts head, scratches ear.

What is a "shipScriptDescription.fClassName.c_str(),"?

Receives a bunch of hunched shoulders and 'ida know' replies ... "but it looks to be a good thing."


Offline Strafer

  • Lt. Junior Grade
  • *
  • Posts: 428
  • Gender: Male
Re: I think I solved the double-fighter bug..
« Reply #5 on: July 24, 2004, 09:51:26 pm »
What is a "shipScriptDescription.fClassName.c_str(),"?

A function requiring no parameters within a C++ Class, itself being passed as a parameter to another function.  :P
--
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 Green

  • I'm not a
  • Commander
  • *
  • Posts: 3004
Re: I think I solved the double-fighter bug..
« Reply #6 on: July 24, 2004, 09:55:20 pm »
What is a "shipScriptDescription.fClassName.c_str(),"?

A function requiring no parameters within a C++ Class, itself being passed as a parameter to another function.  :P

Green looks back at same audience, receives same response.  But knows whatever these magical words are that have been spoken are good. ;)

Offline FPF-DieHard

  • DDO Junkie
  • Captain
  • *
  • Posts: 9461
Re: I think I solved the double-fighter bug..
« Reply #7 on: July 24, 2004, 10:38:35 pm »
I guess there will be a new dowload fo the GW3 test server.

J'inn, reply to your email.

Karnak, will this fix work in your scripts?
Who'd thunk that Star-castling was the root of all evil . . .


Offline Lepton

  • Lt. Commander
  • *
  • Posts: 1620
Re: I think I solved the double-fighter bug..
« Reply #8 on: July 24, 2004, 11:09:37 pm »
So the opposing AI's "state" was being set up twice before and this prevents that??


System Specs:

Dell Dimension E521
AMD64x2 5000+
2G DDR2 RAM
ATI Radeon HD 4850 512MB GDDR3
250GB SATA HD

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #9 on: July 24, 2004, 11:15:33 pm »
So the opposing AI's "state" was being set up twice before and this prevents that??

Technically, this was not "Double", it was "Multiplied by as many live players there are in the game". But in essence, yes. All non-hosts had their own sets of weapons and fighters on AI units. This seems to prevent that to happen. 


Edit: To make this a bit clearer..
.. each player's machine Always had and always will have their own version of each ship while in game, but only the host's should be the one used (and active).  It's like when you capture a carrier: it can spew out a bunch of fresh fighters.

Well.. that's because YOUR machine just took over and by its calculations, all the fighters are still inside. Proper capture code should be added to prevent this from happening.. but that's not something I want to get into..   The code for that exists in Coopace and I hope NuclearWessels or someone else could pick up on that.

-- 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 Capt_Bearslayer_XC

  • "Sorry I haven't been around much lately. I'm easily distracted by shiney things."
  • XenoCorp® Member
  • Captain
  • *
  • Posts: 9558
  • Gender: Male
  • Virtute non verbis
Re: I think I solved the double-fighter bug..
« Reply #10 on: July 25, 2004, 07:46:04 am »
Damn fine job, FS.

Thank you.
Political Correctness is really Political Censorship

A tax code should exist to procure the funds necessary for the operation of government, not to manipulate human or business behavior.

A nocens dies in loricatus est melior quam a bonus dies procul opus.

A bad peace is even worse than war."  --  Tacitus

"We thought we could resolve the system's problems by rationing services or injecting massive amounts of new money into it" -Claude Castonguay

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: I think I solved the double-fighter bug..
« Reply #11 on: July 25, 2004, 08:42:25 am »
Good work FireSoul!

Quote
Well.. that's because YOUR machine just took over and by its calculations, all the fighters are still inside. Proper capture code should be added to prevent this from happening.. but that's not something I want to get into..   The code for that exists in Coopace and I hope NuclearWessels or someone else could pick up on that.

So when can we expect say a half-dozen "Evil-Luc" D2 mission scripts? ;)

Offline Strafer

  • Lt. Junior Grade
  • *
  • Posts: 428
  • Gender: Male
Re: I think I solved the double-fighter bug..
« Reply #12 on: July 25, 2004, 08:53:04 am »
So when can we expect say a half-dozen "Evil-Luc" D2 mission scripts? ;)

I suggested a handful of builds to have other test them, but more in an -AC Alan Cox fashion. Wouldn't want a repeat of the whole OPPLUS 4.0 thingie...
--
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 FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #13 on: July 25, 2004, 09:06:27 am »
Good work FireSoul!

Quote
Well.. that's because YOUR machine just took over and by its calculations, all the fighters are still inside. Proper capture code should be added to prevent this from happening.. but that's not something I want to get into..   The code for that exists in Coopace and I hope NuclearWessels or someone else could pick up on that.

So when can we expect say a half-dozen "Evil-Luc" D2 mission scripts? ;)

My personal preference would be for NuclearWessels to update his, but otherwise I want nothing else than updated missions for our servers.... especially the ones I will be playing on.   :D


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

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: I think I solved the double-fighter bug..
« Reply #14 on: July 25, 2004, 09:12:59 am »
Good point Strafer, naming and permissions should be considered carefully. This is exactly why NW released his latest sources though, I'm sure he wouldn't mind -  but should certainly be asked for permission to release modified versions of his scripts (as opposed to "original" scripts implemented like this). I'm j/k about the "Evil-Luc" part...

Cool FireSoul, I was under the impression dave had set aside his D2 scripts for now, but  its definitely better for the original author to modify them, I agree. But as you suggest, if Dave doesn't get around to it I'd be happy to give any scripts you produce a whirl!  (Thanks for the hard work on this - I noted the "since tuesday" part...)

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #15 on: July 25, 2004, 09:21:03 am »
(Thanks for the hard work on this - I noted the "since tuesday" part...)

Yeah..

.. I was down to doing it with the scientific method:
1- Hypothesis
2- Experiment
3- Results
4- Conclusion

I tried a great many things until I was down to "trying anything that could even remotely make sense", and this was one of them. The obvious things didn't work, so I tried other options.

-- 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 KBFLordKrueg

  • Commander
  • *
  • Posts: 3733
  • KBF CO
Re: I think I solved the double-fighter bug..
« Reply #16 on: July 25, 2004, 10:39:47 am »
This indeed is good news, FS.
We all appreciate your untiring efforts with SFC!
 :notworthy: :notworthy:
Lord Krueg
KBF CO
We are the Dead

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 #17 on: July 25, 2004, 03:02:38 pm »
Very Cool FS!

Yes, I'll update the pack - I'm in the process of cleaning up a bunch of other bugs and irritants, so will go through and incorporate that as well.

(Hopefully will have the revisions posted by Friday.)

Thanks heaps!
dave

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Re: I think I solved the double-fighter bug..
« Reply #18 on: July 25, 2004, 03:06:18 pm »
Very Cool FS!

Yes, I'll update the pack - I'm in the process of cleaning up a bunch of other bugs and irritants, so will go through and incorporate that as well.

(Hopefully will have the revisions posted by Friday.)

Thanks heaps!
dave


I'm almost done compiling the packs with just this fix myself.. I will make it public so that we can get a test server up and know for sure that it worked.. what do you think? I'll make sure that it's not going to be confused as being one of your own releases.

-- 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 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 #19 on: July 25, 2004, 03:13:08 pm »

Sure thing - thanks again!

dave