-
Notifications
You must be signed in to change notification settings - Fork 23
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
Machine readable format #84
Comments
Something like this might have been useful 15 years ago, but now that almost everything is already written, I don't see anyone gaining anything by rewriting all the parsers, writing generators and rewriting the way the data is stored. On the IESDP side of things the last part may still happen though, since it could then convey the data better (eg. #6 #19 #26). |
MLS isn't, hence this issue. @lynxlynxlynx let me put it like this: if a such pull request was coming your way, would you be opposed to it? |
Depends on what everything you'd stick in it. Eg. if you want to make the file formats machine readable, that's great and wouldn't need to affect deployment, since jekyll has the needed support: https://jekyllrb.com/docs/datafiles/ |
Do you want to define a format for, say, opcodes? Or I should do that myself? |
I don't know what you mean, since the opcodes are already easily machine readable. Everything is parametrized and the description is plain html most of the time (a few liquid tags here and there). |
Well, html with liquid parts is not exactly machine readable. To make an example, maybe something like this - n: 0
name: AC vs. Damage Type Modifier
type: stat
param1: AC Modifier
param2: Type
bg1: 1
bg2: 1
bgee: 1
iwd1: 1
iwd2: 0
pst: 1
doc: |
Applies the modifier value specified by the 'AC Modifier' field to the category specified
by the 'Type' field.
Known values for 'Type' are:
- 0 All
- 1 Crushing
- 2 Missile
- 4 Piercing
- 8 Slashing
- 16 Base AC setting (sets the targets AC to the value specified by the 'AC Modifier' field.
If the targets AC is already 'AC Modifier' or below, this effect will do nothing).
Each modifier type to AC from this opcode is capped to the range [-20, 20]. Each AC type total is capped to the range [-32768,32767].
notes:
- |
IWD1 and PST use a slightly different version. The "Base AC" sets to **field - 1** instead.
IWD2 uses different parameters altogether. |
The "Known values" can also be one of yaml key with values, right? |
The notes are sometimes interspersed in the description, not always at the end. And there can be several of different severities, so the proposed format is not good enough. I also see no way to avoid needing to clean up the descriptions on the user side of things, eg. to get rid of broken links. And I'm definitely opposed to cramming them all into one file. That's a simple step users can do if they need it. |
Right, but I'm not sure if will be possible to parametrize them and keep current html layout unchanged. And I don't know how I'd use this data yet. If anyone needs it, they are welcome to chime in.
Severity is easy to deal with, adding a separate stanza ( Could you clarify the bit about broken links? Which ones do you mean, why are they broken?
Jekyll can read data from dirs, something like |
Links: opcodes link to each other via anchors, so you'd end up with broken links unless you replicated the naming and therefore layout (all in one file). Actions and triggers won't be much better; except for less data, the same problems apply. |
Depending on how this works out, links might be kept and lead back to IESDP: Maybe it's better to start with something else than opcodes, indeed. Here, I took a shot at actions. Sample data is stored in the data files. |
Looks good. From what I can tell, action descriptions only use colors (can be replaced) and links (markdownify takes care of that?) on top of what's shown above. |
Loaded BG2 actions. If all's good, next step would be to load actions from other files, run comm/md5 to find and delete the identical ones, then some diffs to find and combine those that only differ in wording, then move all the rest as variants. |
Sounds good, but let's resolve #85 first, so it's clearer how some of the more interesting actions turn up (since you skipped a few). |
I didn't skip anything on purpose, could you point out some? |
Most for #85, but also 349 that doesn't have any colouring. Do something like |
These were missed due to a mistake in the script, now included. Count won't match anyway, since there are gaps (NID*). |
NIDSpecial1 and co are not a gap, just useless to the modder. |
Well, they are counted as one "action" as far as Jekyll is concerned. Otherwise, they'd produce a full list of "not working" actions, so I thought to keep them combined. |
It doesn't matter for the output, but for people like you that want it as data, it makes no sense to jumble them together. |
I'm not sure what use they are, only completeness. Certainly no point in adding them to completion, everything not working will be skipped. |
Yes, just for consistency. |
All right. I will do that at manual stage. Anything else? |
Nothing comes to mind, except that let's do plain bg2 first and iron any problems out before continuing. Also, another PR is open that touches the ee action list and it would just cause conflicts if it wasn't merged first. |
You mean merge upstream? If just BG2 has manual updates applied and merged, that'll make it a little harder to search for differences later. Also, there won't be links to variants, since that data doesn't exist yet. One more thing I'd like to point out, currently action aliases are added to the same file, how's that? |
Ok, then wait a bit, since @4Luke4 is almost done. Aliases I don't like that way, since I think eg. the RES variants are present in some games without the default version, so it would complicate the layout logic to iterate properly. Just keep it KISS and create a separate file. |
I would like to avoid duplicating descriptions in data and displaying duplicates too, but not sure how to do that while allowing for variants. I'll think about that meanwhile. Edit: ah, current version doesn't have variant links too, so my second point about merging is moot. |
Ideally the descriptions wouldn't be duplicates anyway, since they should explain the parameters used. |
There's many Dialogue/Dialog synonyms, though. |
Is it rendered somewhere? |
No, but I can set it up, will share a link. |
looks fine 👍 |
Added itm v1, eff v1 and v2. Feature blocks seem to be identical except some spelling, so I just symilinked itm to spl one. Next I plan to try an import, see if any issues come up, maybe some adjustments will be needed. Then send a pull, after it's merged I'll be able to make a real import and publish a release. And then make an announcement on the forum, see if anyone else wants to jump in. Much of the text is still duplicated between formats (target type, timing, resistance, etc) and probably could be externalized into includes too, but that would make importing somewhat harder. If you ever get to that, please notify. |
itmv1 lost the "Melee animation" link. Feature block looks worse due to removal of spacing around =. And timing mode info is better in itm (and target type). It might be better to link it the other way around, but it's now simpler just to add the missing info. eff look fine. |
Addressed all, also applied the same style to Spell type. |
Target type and timing mode still lost some info. |
Ah, sorry, missed that. |
type: sure, be conservative |
Cool, added the missing lines. |
Nice, feel free to go ahead. :) |
Simple script to convert offsets table into yaml: offsets_to_yaml.py.zip File naming example: Format reference: - desc: | # required - markdown
Attack type
- 0 = None
- 1 = Melee
type: char # required.
length: 1 # optional, if not specified, size inferred from type. Known types: char, byte, word, dword, resref, strref
offset: 0x1 # optional, if specified, current offset is checked against this value, if not equal, an error is raised
mult: 3 # optional, allows to do stuff like "2*3 (word)"
unknown: 1 # optional, applies "unknown" style span
unused: 1 # optional, appends " (unused)" to description and applies "unknown" style span |
While researching for the recent opcode regression, I came across a new liquid link tag. Unfortunately it doesn't look like it supports creating relative paths: |
Something I came by recently: https://kaitai.io/. |
Looks familiar, but I don't think it's feasible. There are so many exceptions, dependencies between fields and special treatment needed besides the fact that we'd need per-game-version copies of many of the formats. |
Is there any system to parameter naming in actions and triggers? There are also multiple discrepancies like
where the same resref paramerters are referred to differently. And
where it's under another alias. The result is, the doc seems like a C-engine internal reference. Yes, resref is actually a string, and you can compile a baf with pretty much any string. But from scripter's point of view, resref is a distinct type, and the expected API would look more like this
Does that make sense? Would it be prudent to try and make it more consistent, as well as more scripter/modder-oriented? |
The parameter prefix (I, O, P, S) seems to be hardcoded and determines the parameter type. The actual parameter name is mostly* arbitrarily chosen. I'm not so sure about the trailing asterisk, except that it separates the parameter name from an optional IDS file reference. Some definitions in The actual number (and order) of parameters is also relevant, as all triggers and actions must conform to the BCS format specification. *) From what I can gather from these notes the engine hardcoded at least some parameter names (e.g. |
I don't think it makes sense to try to clean this up: since all the other tools use the provided strings, it could appear that the updated signatures are for distinct things instead. |
Sorry, use how? Any examples? |
I doubt anyone parses the names, I meant display (e.g. tooltip in NI). But like @Argent77 already said, the prefix part is crucial for the engines to interpret them correctly anyway, so at best the names could be changed. |
I don't think there are tooltips in NI? Do you mean warnings? And the reason NI is able to show them is because it's actually correctly distinguishes strings from resrefs, and further segregates different resources types. |
When you hover over an action, trigger or object, it shows the signature in a tooltip. It has nothing to do with types. |
It doesn't for me. Is there a setting or something? |
NVM, I can see it now. First appearance has some delay, following ones show up instantly. |
I'm thinking that it could be beneficial to have IESDP data in machine readable format. Currently there are multiple tools all parsing and reading IE files on their own: DLTCEP, NearInfinity, iesh, probably others. Inevitably, differencies and inconsistencies arise. But if file formats were described in a structured way, we could have a single, truly definitive source of information, and pull updates from it (semi)automatically. (Which is my ulterior motive for BGforge MLS.)
As an example, take a look at sfall docs: functions listed in a yaml file, with some python scripting it converted to markdown, and markdown is published with jekyll, resulting in a nice site.
If you look at opcode description, it's already basically yaml, with html additions. Could probably converted into true yaml semi-automatically.
To be clear, this is not about IESDP looks, just internal data representation: binary file formats, script actions/triggers, effects.
Tagging @Argent77, @4Luke4, @AvengerTeamBG, @FredrikLindgren, @ALIENQuake.
The text was updated successfully, but these errors were encountered: