Unvanquished / Unvanquished

An FPS/RTS hybrid game powered by the Daemon engine (a combination of ioq3 and XreaL)
https://unvanquished.net
Other
992 stars 160 forks source link

Some Tremulous maps have shader name conflicts with Unvanquished player assets #2799

Open ghost opened 1 year ago

ghost commented 1 year ago

2023-10-04

While I do not know what this should look like, the behavior is very close to what can be seen in @cu-kai 's station12-b5 map, which should look like this:

2023-10-04_000

but really looks like that:

2023-10-04_001

I could hackily "fix" that map ported by @sweet235 by modifying the bsp with an hexadecimal editor. Can you see the change in this screenshot? You should, it's rather obvious.

2023-10-04_002

I also renamed files in the dpk:

map-station12-b5_src.dpkdir% find -iname '*level9*'
./models/players/level9
./models/players/level9/level9adv.tga
./models/players/level9/level9.tga

and modified "random" files:

map-station12-b5_src.dpkdir% grep -r level9
models/players/level9/nonseg_default.skin:level9,models/players/level9/level9.tga
models/players/level9/nonseg_adv.skin:level9,models/players/level9/level9adv.tga
models/players/level9/animation.cfg:// Tremulous: level9 alien

The problem appears on other maps, such as AMP's "example" map where flame files are "missing" (not in the correct place, really) and probably several other ones that I don't remember right now. Any map using baked-in model of stuff from tremulous or textures from tremulous is likely to be affected in various unpredictable ways.

slipher commented 1 year ago

A models/players/level3/level3 shader is defined for our Unvanquished dragoon model. The basepak is loaded first and the map last, so the Unvanquished one wins. As it should be: the alternative bug of having the map override Unvanquished assets would be much worse!

ghost commented 1 year ago

As it should be

Not really, as models are baked into bsp files and can't be modified without resorting to ugly hacks like I did.

the alternative bug of having the map override Unvanquished assets would be much worse!

I would argue that the problem comes from unvanquished using the same names for models, in addition of models not embedding their textures. If unvanquished used a "namespace" or a prefix (let's say, randomly, "unv_" then there would not be any collision.

sweet235 commented 1 year ago

I don't get it. Why is only the dragoon texture flipped/rotated, but not the other ones?

slipher commented 1 year ago

I don't get it. Why is only the dragoon texture flipped/rotated, but not the other ones?

It depends on whether there are name conflicts with Unvanquished assets

illwieckz commented 1 year ago

This is because Tremulous name model textures like this:

And Unvanquished name model textures like this:

It would have been better if that was done instead:

The res-tremulous package moved Tremulous conflicting model textures to model/tremulous to avoid breaking the game models: choice was made to break legacy Tremulous model textures instead of letting legacy Tremulous maps break the game.

I would like to move specific unvanquished things to models/unvanquished and I may have a branch for that but that's a lot of work.

illwieckz commented 1 year ago

The alternative was that every time you loaded a legacy Tremulous map relying on res-tremulous packages you would have stock Unvanquished players, buildables and weapons models as broken as this.

illwieckz commented 1 year ago

I don't get it. Why is only the dragoon texture flipped/rotated, but not the other ones?

It happens that sometime, new models/textures are using some other name for various reasons, for example the previous lucifer canon was named pulse because it was initially modeled to be a pulse rifle, and tremulous never had models/weapons/lcannon/pulse texture so there could have been no conflicts.

DolceTriade commented 1 year ago

Should we just rename the unv textures to something else so they don't conflict with legacy textures?

illwieckz commented 1 year ago

Yes but it's better if we do this the reliable way, like adding a prefix folder.

Adding a prefix folder is a kind of renaming, but with an agreed convention.