The Wayback Machine - https://web.archive.org/web/20210619071011/https://github.com/github/linguist/pull/5413
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Source Engine formats (.vcd, .cfg, .fgd, .vmf, .vmt, .qc) #5413

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

@moofemp
Copy link

@moofemp moofemp commented Jun 8, 2021

Add six Source Engine formats which are part of Valve Data Format (.vdf):
Valve Choreography Data (.vcd), Valve Configuration File (.cfg), Valve Hammer Definition File (.fgd), Valve Map Format (.vmf), Valve Material Type (.vmt), Valve Model Source (.qc)

Description

Relevant about Valve/Source Engine data types: https://developer.valvesoftware.com/wiki/Notepad%2B%2B_VDF_languages
which links to grammars for Notepad++: https://github.com/ReverendV92/NotepadPP-VDF-Languages

Out of these formats:
VCD files are usually made with FacePoser and VMF files are usually made with Hammer, though both are plaintext and can be written with a text editor
CFG, FGD, VMT, and QC files are usually written with a text editor

I used the official Source Engine branding colour for Valve Map File and created my own colour scheme for the rest: https://moofemp.com/image/source-colour-scheme.png

Checklist:

@moofemp moofemp requested a review from github/linguist as a code owner Jun 8, 2021
Copy link
Contributor

@Nixinova Nixinova left a comment

A 114K line file is too much for a sample (mapbase_demo01)

@moofemp
Copy link
Author

@moofemp moofemp commented Jun 8, 2021

A 114K line file is too much for a sample (mapbase_demo01)

Replaced with instance_tutorial_button from maplabstemplate content (325 lines) 18dafeb

@moofemp moofemp changed the title Source Engine formats Add Source Engine formats (.vcd, .cfg, .fgd, .vmf, .vmt, .qc) Jun 8, 2021
Copy link
Contributor

@Nixinova Nixinova left a comment

I feel like these should all just be added as new extensions to the VDF entry since they're not a different language. Though, Linguist does sometimes differentiate between different uses of the same language, but not sure if that's the best option here as there are quite a few.

Copy link
Contributor

@Nixinova Nixinova left a comment

I don't think the Valve CFG file should be added as .cfg is an already generic format used for many things.

extensions:
- ".vdf"
- ".cfg"

This comment has been minimized.

@Nixinova

Nixinova Jun 9, 2021
Contributor

Is .cfg actually VDF? From the sample it looks like it is just a list of commands and not actually VDF.

This comment has been minimized.

@moofemp

moofemp Jun 9, 2021
Author

Just made the last couple commits when I saw the suggestion to... without seeing the edits, or thoroughly considering it myself, oops.

I don't believe CFG is the same as VDF, as it doesn't use the same sort of object/keyvalues structure that's seen in the other VDF style formats. CFG is essentially a batchfile for the Source Engine's console; in my experience it's usually used for custom keybindings and optimisation settings.

This comment has been minimized.

@lildude

lildude Jun 9, 2021
Member

This is a very generic extension that will clash and cause a lot of misidentification. To prevent this, you will need to identify a lot more users of it and add support for all the most popular users of this extension as part of this PR.

This comment has been minimized.

@moofemp

moofemp Jun 12, 2021
Author

This sounds like far more work than it's worth to include a relatively unimportant extension among the other Source Engine languages, so I've reverted this commit a965690

@moofemp
Copy link
Author

@moofemp moofemp commented Jun 9, 2021

I feel like these should all just be added as new extensions to the VDF entry since they're not a different language. Though, Linguist does sometimes differentiate between different uses of the same language, but not sure if that's the best option here as there are quite a few.

It seems to me that's what the group field is for in languages.yml? I defined all of the Source Engine languages with group: Valve Data Format thinking that's for cases like this, although I may have misinterpreted.

These formats aren't interchangeable though; a VMT and QC file for example are distinguishable at a glance due to the differing structure and keywords.

@Nixinova
Copy link
Contributor

@Nixinova Nixinova commented Jun 9, 2021

It seems to me that's what the group field is for in languages.yml? I defined all of the Source Engine languages with group: Valve Data Format thinking that's for cases like that, although I could have misinterpreted.
These formats aren't interchangeable though; a VMT and QC file for example are distinguishable at a glance due to the differing structure and keywords.

Group is for variants of a language, like JSX for JavaScript. So if there are indeed differences in the language format then it may be warranted but if it's just a different extension for VDF it should go under it.

@moofemp
Copy link
Author

@moofemp moofemp commented Jun 9, 2021

Group is for variants of a language, like JSX for JavaScript. So if there are indeed differences in the language format then it may be warranted but if it's just a different extension for VDF it should go under it.

I'm not quite sure what quantifies being "a different extension for VDF" - the syntax for each is the same, but the use case, structure, and library of keywords differ. It's worth mentioning that the Notepad++ VDF plugins I linked have separate languages for CFG, FGD, VMT, QC, and "misc VDF" (likely because VCD and VMF aren't usually edited in a plaintext editor). I would consider each one a distinct child of VDF.

@Nixinova
Copy link
Contributor

@Nixinova Nixinova commented Jun 9, 2021

but the use case, structure, and library of keywords differ

I think if that's the case having child languages would fit.

Copy link
Member

@lildude lildude left a comment

Sample license(s): SOURCE 1 SDK LICENSE https://github.com/ValveSoftware/source-sdk-2013/blob/master/LICENSE

I'm not going to even try reviewing this whilst we have samples under this licence. We can not accept any files covered by such a licence.

@lildude lildude dismissed their stale review Jun 9, 2021

Oh wait. NM, I forgot we don’t ship the full samples. Ignore this.

@moofemp moofemp requested a review from lildude Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants