TeamSpen210 / HammerAddons

Useful tweaks and content for Source Engine Games
123 stars 36 forks source link

Expand complete FGD system to better account for leftover/useless features #225

Open vrad-exe opened 1 year ago

vrad-exe commented 1 year ago

There are a number of entities which were only designed for a specific Source game, but internally are available in some other games as well, where they may be broken or useless. For example, logic_autosave exists in multiplayer games like TF2 despite being completely useless to mappers since saving is disallowed in MP. For this example, we can set the FGD tags so the entity shows up in singleplayer games always, but requires complete FGD mode to show up in multiplayer games: appliesto(HL2, P1, P2, complete).

However, there is another case that the tags system currently cannot handle properly: entities which are present but useless in some games, but completely absent in others. One example of this is logic_playerproxy: The entity is only present in HL2, P1, P2, Alien Swarm, and CS:GO, but in the latter two games it is completely non-functional. The correct behavior here is for the entity to always show up in HL2/P1/P2, show up with complete mode in ASW/CS:GO, and not show up at all elsewhere, but currently there is no good way to accomplish this:

There are 2 different solutions I had in mind for this.

Option 1: Nested tags

Allowing tags to be "nested" would probably be the cleanest solution to this problem. Surrounding a set of tags in parentheses would cause them to be evaluated independently of other tags, then the result of that treated like a single tag. So for the playerproxy example above, you could do: appliesto(HL2, P1, P2, (ASW, CSGO, +complete)).

The main advantage of this is it could be used with any set of tags, rather than being special cased for complete, but it would probably be harder to implement.

Option 2: Expand complete tag to game specific versions

This would be the easier but less flexible solution. When building an FGD with the complete tag and another game tag, it could be automatically expanded to include a version specific to that game; e.g. unify_fgd exp P2 complete would also match the tag complete_p2. For the playerproxy example above, this means the tags would be appliesto(HL2, P1, P2, complete_ASW, complete_CSGO).

TeamSpen210 commented 1 year ago

The second is probably simplest, we're already expanding inputted tags into the since/until ones. Though, one thing in regards to this is that we definitely need to define a SP/MP tag, for games that only allow one mode.

vrad-exe commented 1 year ago

Probably yeah, though there is some weirdness with games which are only designed around one mode but technically allow the other, like how you can do P1 multiplayer or HL2DM singleplayer.