KEMBAR78
NUVIE: Fix Ultima 6 projectile collision by PushmePullyu · Pull Request #4838 · scummvm/scummvm · GitHub
Skip to content

Conversation

@PushmePullyu
Copy link
Contributor

Make the line drawing algorithm used in projectile collision detection operate in screen space to match the original game.

Before this change the calculation was done in tile space, which caused incorrect results.

Note that the modified method Map::lineTest() is also used in other parts of the code unrelated to projectiles. Regressions are possible. If it breaks anything projectiles might need to be handled separately.

To reproduce the incorrect behavior :

  1. Get a ranged weapon (e.g. Iolos crossbow)
  2. Stand directly left of the SW pillar S of the throne room
  3. Attack tiles/targets to the NE

In the original game the pillar will block the shots.

Make the line drawing algorithm used in projectile collision detection
operate in screen space to match the original game.

Before this change the calculation was done in tile space, which caused
incorrect results.
@PushmePullyu PushmePullyu marked this pull request as draft March 26, 2023 01:15
@PushmePullyu
Copy link
Contributor Author

Found a regression: The castle drawbridge crank can no longer be used when standing on the tile to the NE of it. Converting to draft for now.

Fix regressions by only scaling coordinates when handling projectiles.
@PushmePullyu
Copy link
Contributor Author

Changed to affect projectiles only.
@dreammaster This is ready for review.

Thanks for the quick merges btw (I see you are quite busy with MM1 already).

@PushmePullyu PushmePullyu marked this pull request as ready for review March 27, 2023 10:47
@dreammaster
Copy link
Member

No problem. I've been delighted that someone's had the interest to take on giving the Nuvie code some TLC, just like Ultima 8 has had.

@dreammaster dreammaster merged commit 05c9ad1 into scummvm:master Apr 1, 2023
@PushmePullyu PushmePullyu deleted the fix-u6-projectile-collision branch May 16, 2023 23:17
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 this pull request may close these issues.

2 participants