Shane: maybe old mystery solved

More
20 years 1 week ago #9784 by Second Chance
Well, don't keep us in suspense. What was the cause?

And did I help with my fascinating info? :D

Oh, and good work. :)

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.

Please Log in or Create an account to join the conversation.

More
20 years 1 week ago #9785 by MajorTom

Originally posted by Second Chance


And did I help with my fascinating info? :D


Sure did, that was the key.

I had written the code for the wing animation before the ship was put in the game and the weapons fired for the first time, so I assumed the weapon nulls were rotated with the wings. (they are so perfectly positioned thanks to the work of our great Mr. Mod Model Maker Man) *pops can of Bud lite*

Anyway, the problem itself is based on some confusion:
The Pog SDK quotes two commands and explains them both with the same text content. They are:

iShip.WeaponTargetsFromContactList(hship ship);
and
iSim.WeaponTargetsFromContactList(hisim sim);

There is a difference, as described in the header files. The iSim call is the one we need.

In the SP game I'm assuming someone was a victim to the same confusion and it's probably imbedded into the iGangster package or or something like that. (unless, of course the occurances Shane observed, were made while running a custom script)

That confusion issue also explains:

REM's, mines, LDSi missiles, etc. have never exhibited this behavior... only dog-fighting missiles.

Because Ai can't handle those weapon types.

Anyhow It's definatly fixed for the MP game









Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
20 years 6 days ago #9792 by MajorTom
It might be possible to fix this in the SP game too, at least temporarily during weapons and launcher rotation testing.

(Shane, specially for you to get some piece of mind.) :D

First I would check the source of any mod scripts running to see if they call iShip.WeaponTargetsFromContactList. If they do, change that to the iSim version of the command.

If you don't find the command in the mod scripts:
You could run a sceduled task say every 10 - 30 sec. and create a list of all ships within say a 200 km radius of the player ship, and then pop each one of them with:[}:)]
iShip.LockDownWeapons( hship ship );
followed by:
iSim.WeaponTargetsFromContactList(hisim sim);

That should revoke the existing command:
iShip.WeaponTargetsFromContactList(hship ship);
on any ships in range and stop the random fireing.

(it might screw up a currently running marauder attack somewheres but what the heck, we're testing here);)

You should also do the same for the player ship too. Once would probably be enough though for the player, unless random firing also happens after a going through an L-point, using LDS or dying, ect.

After many hours of testing yesterday and today, I'm sure (at least in the MP game) the iShip version of the command is the only source of random firing when in autopilot. (regardless if I use rotated weapons nulls or not.)


Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
19 years 11 months ago #9958 by MajorTom
Well, It's back to the drawing board on this now.

iSim.WeaponTargetsFromContactList(hisim sim); also causes problems.
that being specifically:
once you have fired at a target, the player ship will continue to fire "invisible bolts" at the target even if you stop pulling the trigger. The bolts are fired at the refire_rate of the last weapon used and damage counts up at the damage value of the bolt until the target sim explodes. You will see no indication of fireing from your own ship, not even energy consumption in the weapons status bar

The only way to stop the invisible bolts from continually damaging the target is to get out of range or move so an obstacle is between you and your target.
If you call iSim.LockDownWeapons and release them anew with iSim.WeaponTargetsFromContactList(hisim sim); it will cease fire. But, the moment you pull the trigger just once the "invisible fire" starts again.

Doesn't anyone know a command to release weapons that have been locked down [?] [?] [?] [?]

I guess the game expects you to just remove the weapon subsim from the Player ship if you don't want it to fire, but thats definately not easy to do in MP.





Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
19 years 11 months ago #9992 by MajorTom
Well, here we go again. More insight on this issue, and I think we are nearing a real understanding of what is happening.

To make a long story short, I still contend that the correct call to prevent random fireing when you unlock the weapons for both the SP and the MP game is
iSim.WeaponTargetsFromContactList(hisim sim);

To roughly explain what lead me astray on the issue you'll have to read through the (MP) perspective below first, so bear with me:

The problem is the call to release the weapons on the server only. Not on the client!

Normally you have to transmit everything a client does to the server app, copy the event in the servers instance of the game and then send the information on to the other clients so they can copy it as well.
Thats not necessary however, when the client fires a weapon, because the event is transmitted via the iMultiplay package and not via the multiplayer script. i.e, visually speaking: When iMultiplay says "client has fired" the server fires a simulated weapon (using the same .ini data)at the same target the client fired at, in the servers instance of the game .

Therefore it is fully sufficient to lock the guns down on the client only. (because if the client can't fire, iMultiplay cannot transmit the "HasFired" event.)

Apparently, if you lock down the weapons and then release them on the server app, it gets screwed up and fires the gun constantly, because it interprets the command as "fire" and never recieves an input that the simulated weapon being used in the server instance of the game should stop fireing. (even though the client has long since stopped fireing)!

Now, what does this have to do with the SP game? Well, based on many different indications it appears:
The server functionality is also used in the SP game!
You've probably noticed occasionaly, if you have a screwed up .map file you often get an Error message "server could not load world"

Steve also noted once that the incorporation of multiplay functionality was a key development decision for the SP game too, as many functions are necessarily linked to the SP game.

I'm guessing that the interface to the "SP server" runs without the imultiplay functionality but is in many cases closly related (it may even use iMultiplay?). That would explain why the iShip.WeaponTargetsFromContactList function causes the random firing (probably dependent on the game tick in some way too, when, for example, the SP server app is refreshed?)

Maybe someone else can shed more light on this specifically for the SP game?


Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.