in0finite / SanAndreasUnity

Open source reimplementation of GTA San Andreas game engine in Unity
https://discord.gg/p6jjud5
MIT License
2.13k stars 352 forks source link

Suggestion: replace gta wires #82

Closed CrosRoad95 closed 4 years ago

CrosRoad95 commented 4 years ago

Instead of load wires from original gta, i prefer to do wires like on this video https://www.youtube.com/watch?v=UwMDCOuvzFk

in0finite commented 4 years ago

But how do you suggest to do it ? We load original models from the game at runtime. This means that you would need to somehow replace wires through code at runtime.

Also, if we use our own 3d models for wires, than we loose the ability to load mods (modded 3d models).

And how can you detect if 3d model is a wire (in order to replace it with your own) ...

CrosRoad95 commented 4 years ago

this is just an decoration, i could make it by defining static list with all wires on the map, and blacklisting wires models. Also currently they are completly static what with custom wires could make wires move a bit to simulate wind

Crayder commented 4 years ago

Unfortunately, this is quite a bit more complicated than that. The SA electric wires are mostly combined with models like billboard decals, signs, windows, shadows, street stains, and more.

Thus, this task would require editing every model that has wires with it. Either by one, removing the faces from the models manually or two, replacing all of the wire textures. I'm not sure the latter would work since I'm not sure how they are textured, but that would absolutely be the most straight forward way of removing the lines.

For replacing them... You could perhaps iterate through all GTA models, find the ones that have wire-textured faces, figure out the rotation of the texture, and use the data to get "nodes" for the lines. This would probably be the only way and not simple.