Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DamageImpactGenerator, Damager, DamageForwarder] Close to fubar #575

Open
mrzzzrm opened this issue Apr 6, 2014 · 5 comments · May be fixed by #603
Open

[DamageImpactGenerator, Damager, DamageForwarder] Close to fubar #575

mrzzzrm opened this issue Apr 6, 2014 · 5 comments · May be fixed by #603

Comments

@mrzzzrm
Copy link

mrzzzrm commented Apr 6, 2014

So I tried to implement shields and stumbled upon quite a lot of things that shouldn't have been dug up.

  • When two WorldObjects collide they receive different DamageImpact::damage(). As I get it, when two objects collide, they receive equal impacts in opposite directions.
  • The Damager::dampDampImpact() expects(=should get) a factor in the sense of [0...1] but actually receives the damped damage. This leads to way to high new (damped)DamageImpact...
  • ...who aren't used, because instead of passing the dampedDamageImpacts to the DamageForwarder, the WorldLogic passed the undamped deadlyDamageImpacts to the DamageForwarder
  • When the mox collides with the normandy it receives around 500k damage. yep. With our voxels having 50 hp it would take 10k voxels to compensate this damage. The reason this doesn't destroy the whole mox is that DamageForwarder::forwardDamageImpacts() looses around 50% of each DamageImpacts damage when forwarding it to the neighbours. Reasons remain unknown to me so far, probably because forwardFactor is broken.

Does anyone feel like doing a frustrating job?

@mrzzzrm
Copy link
Author

mrzzzrm commented Apr 6, 2014

Also, I have no idea if the accumulation of fieldOfDamage (in DamageImpact::add()) is correct. I feel like there is no correct way to to accumulate two FoD without loosing data. @psieg?

@psieg
Copy link
Contributor

psieg commented Apr 6, 2014

  • I think it is correct that the two objects receive different impacts based on speed and mass
  • Seems we have a double implementation of the dampening here, as in damped DamageImpacts (with a single incorrect downscaling factor) from the damager and damped DamageImpacts (with range, neighborhood consideration and FoD) during DamageForwarding... I don't think forwardDamageImpacts is broken here, it seems more detailed than the damager one - and the class name is DamageForwarder....
  • the 500k damage are the initial impact I assume? The Normandy has ~4k voxels with mass 1, the resulting damage depends on the impact speed... The damageForwarder lowers damage for diagonal voxels and based on the dotProduct aka. the direction of the impact vs the direction of the forwarding (this might be duplicating...), not sure what impact the FoD has on "losing" damage
  • combining two DamgeImpacts with differet FoDs is done by glm::mix-ing the FoDs taking the respective damage as measure. Since FoD is an "artifical" value that's not physically correct this is probably what comes closest to a reasonable approach. The main point here is FoD can die with the re-planned Shockwave for which it was a hacky replacement
    => Probably dealing damage to voxels should be rethought as shockwaves would be hard to implement in this chain atm?

@mrzzzrm
Copy link
Author

mrzzzrm commented Apr 6, 2014

  • Have to look this one up to be perfectly sure, but what speaks for my point is, that when two objects hit in real life it doesn't matter which one was standing still and which one was moving, the resulting damage will be the same.
  • The dampening in the Damager is done via the voxels HP. The "dampening" in the forwarder should not happen, in that sense that one DamageImpact X should be split into n new DamageImpact Y1...Yn so that: Y1.damage() + Y2.damage() + ... + Yn.damage() = X.damage()
  • yes, initial impact. there is something wrong here as that would mean that flying against a planet (mass~= infinite) very slowly would mean complete destruction for the ship.
  • okay, we'll scrap the fieldOfDamage at some point and take the approx. accumulation method for now. I think I have a nice approach for shockwaves in my head.

@psieg
Copy link
Contributor

psieg commented Apr 6, 2014

  • Seems we have a conceptual problem here. While it may not apply to the damge, it certainly applies to the speed which we calculate from the damageimpacts....
  • You designed the forwarding so I'm not going to argue here, but there should only be one point that makes several Impacts from one, splitted or dampened
  • It would, but thats probably a design problem. In reality after the first voxel is destroyed your speed would slow and the following collisions would be slower. DamageForwarding, or rather the entire approach simulates the whole process in one frame, meaning the initial speed is applied to the whole ship.
  • I'm not saying I have a better idea, but probably we should rethink the whole collision->damage concept? (rather than adding shockwaves to the already-complex-wordlogic-damage-and-impact-mechanism)

@mrzzzrm
Copy link
Author

mrzzzrm commented Apr 6, 2014

yes, a lot of this is probably my fault :D
I vote for a subteam to discuss this, no need to waste 4 peoples resources.
@gersseba @xchrdw leave your opinions here, but I'll also put it on the meeting agenda

@mrzzzrm mrzzzrm linked a pull request May 3, 2014 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants