szapp / GothicFreeAim

Free aiming for the video game series Gothic
https://gfa.szapp.de
MIT License
34 stars 4 forks source link

[Gothic Multiplayer] AimRay intersection with player's camera bbox #202

Closed Pone4ka closed 9 months ago

Pone4ka commented 1 year ago

When Player 2 casts a spell in Player 1 direction I guess the game starts to think that Player 1 cast it, and binds the effect to Player 1's AimVob https://www.youtube.com/watch?v=mNRk3P-D24k - video demonstration

szapp commented 1 year ago

I am surprised to see that you got it working in a multiplayer project. Did this require a lot of adjustments?

Your hunch might be correct. The aiming feature was not implemented with more than one player in mind. A singleton aim-vob is used for aiming and thus is shared if there are multiple players.

To correct this issue, it would be necessary to tie a unique aim-vob to each individual player and it should be identifiable as such.
Additionally, aim-vobs must then be garbage-collected when players leave the server to avoid adding an infinite amount of aim-vobs.

On a technical level, this requires to edit the retrieval of the aim-vob which is fortunately supplied through a centralized function. The logic of the function should be easy to adjust. Furthermore, the creation of the aim-vob must be altered. The only fundamental new thing would be the garbage-collection.

Pone4ka commented 1 year ago

"Did this require a lot of adjustments?" Not really, it just works out of box except this trouble with PFX Scripters from Eskalon online GMP project somehow ajust your masterpiece to work without Union or Ninja, on ingame functions. Now I try to understand how. I'll report if I'll found something. Guess it's close to impossible to create unic aim-vob for every player inside gothic, because of Gothic dont rather sees difference between two players. GMP tells client who is who.

szapp commented 1 year ago

somehow ajust your masterpiece to work without Union or Ninja, on ingame functions. Now I try to understand how.

If the core mechanics work, this should be no hurdle: GFA is a script package. It has nothing to do with Union or Ninja. They are not not required (GFA was even created before either of them).

Guess it's close to impossible to create unic aim-vob for every player inside gothic, because of Gothic dont rather sees difference between two players. GMP tells client who is who.

I assume, at some point, the GMP or client will have to communicate with Gothic to infer who is the player and how to interact with the world. This interface may be necessary there to allow uniquely identifying the aim-vob.

szapp commented 9 months ago

Close stale issue