Author Topic: Patch for Mantis 2493 (?) I AM NOOB  (Read 3971 times)

0 Members and 1 Guest are viewing this topic.

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Patch for Mantis 2493 (?) I AM NOOB
So I uh "fixed" the bug I found.

I just moved player damage scaling to the bottom of the calculation sequence because its a multiplier.
Maybe someone with more coding skill than me can implement the features that control when its scaled...

...the issue is that it might be doing something different from retail now.
also I may not have actually gotten all the damage calculation areas but since me is noob I donno where else to look D:

Code: [Select]
Index: shiphit.cpp
===================================================================
--- shiphit.cpp (revision 7694)
+++ shiphit.cpp (working copy)
@@ -639,12 +639,7 @@
 
  // if we're not in CLIENT_NODAMAGE multiplayer mode (which is a the NEW way of doing things)
  if ( (damage_to_apply > 0.1f) && !(MULTIPLAYER_CLIENT) )
- {
- // Decrease damage to subsystems to player ships.
- if (ship_obj->flags & OF_PLAYER_SHIP){
- damage_to_apply *= The_mission.ai_profile->subsys_damage_scale[Game_skill_level];
- }
-
+ {
  // Goober5000 - subsys guardian
  if (subsys->subsys_guardian_threshold > 0)
  {
@@ -684,6 +679,12 @@
  damage_to_apply = Armor_types[subsys->armor_type_idx].GetDamage(damage_to_apply, dmg_type_idx);
  }
 
+ // Decrease damage to subsystems to player ships.
+ //  Droid803 - Moved to the back so it doesn't mess up armor.tbl ****, should be a multiplier, should be inconsequential
+ if (ship_obj->flags & OF_PLAYER_SHIP){
+ damage_to_apply *= The_mission.ai_profile->subsys_damage_scale[Game_skill_level];
+ }
+
  subsys->current_hits -= damage_to_apply;
  if (!(subsys->flags & SSF_NO_AGGREGATE)) {
  ship_p->subsys_info[subsys->system_info->type].aggregate_current_hits -= damage_to_apply;

I AM NOOB SO GO EASY ON ME

[attachment deleted by ninja]
(´・ω・`)
=============================================================

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
im working on code to let you explicitly set how to apply damage scaling is applied for each damage type. just an fiy.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Patch for Mantis 2493 (?) I AM NOOB
cool much better than this hack XD
(´・ω・`)
=============================================================

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
your patch is proving key in figuring out what exactly i need to be looking at. so it aint that bad.
the way im planning on doing this is with an extra argument to ArmorType::GetDamage(), which only appears to be called 4 times only in shiphit.cpp.
problem is there are a lot of other calculations that seem to be happening between theese two calls. and im going to have to be very careful about it so that i dont break any gameplay features.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
k this patch may fix the issue, but then again it may turn out to be an abomination. test thoroughly.
it also adds a bunch of new features that i was implementing when i discovered i could fix this.
see here for details

*edit*
patch updated get new patch here
http://www.hard-light.net/forums/index.php?topic=78277.0

« Last Edit: September 16, 2011, 03:47:46 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Patch for Mantis 2493 (?) I AM NOOB
it also adds a bunch of new features that i was implementing when i discovered i could fix this.
My understanding is that a patch should only include enough changes to fix the issue at hand, and that any new features should be implemented in either a separate patch or in multiple separate patches. If that's the case, you may want to simplify your patch so that it just fixes the issue and nothing else.

Of course, SCP coders or others can/should correct me if I'm wrong.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Patch for Mantis 2493 (?) I AM NOOB
Hey Nuke, since you are trying to fix this armor.tbl issue, could you maybe take a look at issue 2494 too?
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
im curious if it hasn't been fixed already. difficulty scaling had been applied to shileds, same as the hull/subsystems i wonder if that code just didnt make the value infinitesimal. regardless the difficulty scaling is now passed to the armor table. shiphit.cpp is a very scary piece of code to work with. il take a look but i really need this build tested, i havent even had a chance to run the exe yet.

also i need some serious code review, especially in shiphit.cpp. i may have inadvertently broke something.
« Last Edit: September 15, 2011, 11:24:03 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Patch for Mantis 2493 (?) I AM NOOB
Tried your build, my issue is still not fixed :(
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Patch for Mantis 2493 (?) I AM NOOB
I don't think your issue even exists, because shield armor types clearly do work for me.
Might just be multiplicative :/

I shall verify....sec


Verified.

Issue does not exist. (with my patch at least)
+Calculation: Multiplicative
+Value: 500.0

I explode on contact with a projectile.

Q.E.D.

Spoon, we talk on IRC. You probably doing it horribly wrong or something O_o.
Might be them spaces in your Armor Type names...I don't have any of those, but that's the only difference I see between our armor tables at first glance.

The hell was I smoking when I said that, I have "STRKCRFTArmor 25"...
It continues to puzzle...
« Last Edit: September 15, 2011, 11:00:24 pm by Droid803 »
(´・ω・`)
=============================================================

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
id run a debug build and see if you dont get any armor related glitches, such as having the damage type spelled different in your ship/weapon entries than in your armor table. its easy to miss name mismatches if error messages are suppressed. also its very easy to fail at math. you could easily make the number go negative, or become so small that it becomes irrelevant.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Patch for Mantis 2493 (?) I AM NOOB
Oh wait, let me verify (AGAIN)

OH look. Guess what
Issue does STILL ****ING exist
Shield armor ****ing doesn't work when I assign it to the player's ship. Period. Dot. Final.
Am I cranky? Yes. **** yes I am. Why? Because I wake up, look in this topic with the hope that my issue finally gets fixed only to see you flat out saying that my whole problem is just some fiction inside of my own mind.

Yes I've run debug, no debug doesn't return anything. (I mean, its not like I'm an experienced modder or anything right? It would never occure to me to run debug or anything, nope.)
I've changed the shield armor type in the tables, I've changed the armor tables, I've double checked that **** twenty times. I've got a whole test setup in fred that can change armor classes which clearly shows that shield armor works for A.I. and DOESN'T work for player ship shields. And if I change the sexp from shield to hull, the whole bloody set up works fine.
So please, less denying that my issue is real. Cause this ****ing bug is pissing me right the **** off.  :mad:
« Last Edit: September 16, 2011, 07:56:38 am by Spoon »
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Patch for Mantis 2493 (?) I AM NOOB
I can confirm everything Spoon is saying. And no, I have no clue either why it's not working.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Patch for Mantis 2493 (?) I AM NOOB
So I tested like 100 more things and in the end I completely lost track what was working when and what wasn't working.

By the looks of it shield armor does work now, but I dont even ****ing know what is left or right at this moment anymore.
So frustrated.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
il look into the shield bug a bit more. ive seen the part of the code that checks shield armor and implemented optional difficulty scaling there. armor is applied 4 times in shiphit.cpp, once for shields, once for hull in ship_do_damage(), and twice in do_subobj_hit_stuff() for subsystems (im not sure why, one call is before any difficulty scaling is done, so the scale factor is set to 1.0f for that call, i did that so as not to break existing behavior). it seems nothing different is done for player shields here. it would get scaled by the difficulty factor when it goes through armor computation. you could try running it on insane to make sure this factor is 1, also make sure shields aren't being pierced by your weapon. you can also use the feature that fixes 2493 and set where the scaling is done.

say you had an input of 10 damage, running on easy mode that would be 2 damage, and if your shield armor reduced damage by another 2, it could result in 0 shield damage. im wondering if it isnt the same bug manifested in a different way. you could try setting +Difficulty Scale Type: last, as well and see if the shield armor is still not working. and Spoon, if you felt like i was taking Droid803 word over yours, its because he presented me with more data, and if i came off as rude in my previous post it was because i was really really tired :D

regardless this thread is about fixing 2493, not 2494, though i am interested in squashing that bug as well. but first im primarily concerned with this:
is 2493 fixed?
is there any change to retail behavior?
and secondarily:
do my new features work as advertised?

*edit*
found a bug where if no armor type was applied (for example retail) difficulty scaling would not be factored in (will be fixed in next build).
« Last Edit: September 16, 2011, 02:14:49 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Patch for Mantis 2493 (?) I AM NOOB
Well I should probably apologize for posting in the morning. For I am nothing but a big ball of hatred when I just wake up  :p
I think right now the armor for the player shields are working but I dare not say if its because of this build or because of something else. I've changed and tested so many things related to this that I went from frustration to rage to confusion to frustration again and have now reached the stage of 'I dunno why but I think it works and I just stopped giving enough of a **** to care why this is.' ¯\_(ツ)_/¯

Can't help you with 2493 though, since im not using cutoff value armor anywhere. So i'm just going to quietly back out of this thread now.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
from reading that part of the code it kinda looks like it works. you might consider doing the difficulty scale last though. because easy difficulty instantly multiplies damage by 0.2 (default for easy, for insane it is 1) before armor computations (also default). its important to understand that this is going on because it can seriously effect your computations. you can use the new features to apply it last or factor it in manually if it helps make the armor work as desired.

but anyway im having some problems building new versions based on my most recent patch, thanks to some changes to speech (so i need to download and then hack an sdk before i can compile new builds). see this thread for most the recent patch and builds (when i can compile them). i spotted some rather major bugs that i introduced where difficulty scaling would not be applied if you were running without armor or damage types (such as in retail). this is fixed in the most recent patch. so dont go using the current build for mod development.
« Last Edit: September 16, 2011, 04:54:29 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Patch for Mantis 2493 (?) I AM NOOB
will test right away
(´・ω・`)
=============================================================

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Patch for Mantis 2493 (?) I AM NOOB
from now on post all debug information in the thread in test builds. that will be the primary testing thread from here on out, new builds and patches will be posted there.
also new build and patch available.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN