Repository navigation
feat(items): things on bones as data, with a live preview in the Style Editor (looks in data, PR 4) - #178
Open
Mosch0512 wants to merge 47 commits into
Open
feat(items): things on bones as data, with a live preview in the Style Editor (looks in data, PR 4)#178Mosch0512 wants to merge 47 commits into
Mosch0512 wants to merge 47 commits into
Conversation
…e game's own effect lists, marked for the view (L51)
…p with the preview's time (L54); where the preview creates and draws them
…t, lightning as pairs (L55)
… bones (L57); the things on bones format
…preview (L58); pull requests 2 and 3 are done
…rticles, lightning and effects at bones, between pairs or at the origin, with chances and groups (L55, L56)
…talogue doesn't have, a bone an item's model doesn't have
…in the update, at the item's posed bones, with its chances; types are resolved when the effect table is built
…the update, and the baseline of the 9 item effects with things on bones, recorded from their code
…e data (wingsOfDarkness, wingOfStorm, wingOfEternal, wingOfIllusion, wingOfRuin, wingOfDimension), created as their code created them
…t on their scaled bones (L57); no item effect is code any more
…: their drawings with a darken blend and the item's value times a number (L59), their things on bones and animation as item effects of their names (L29)
… item effect's animation speed read and write back
…es live (FX1.7c, design section 7a, L51 to L54) Each view of the Style Editor's preview keeps its own copy of the item at the player's character and, in a new editor hook in the game's update (Core::EffectSpawnHook, after the world's effects moved), creates the things its item effect creates there with the game's own calls. The slots they fill carry the view's mark (Render::Effects::PreviewSlots): the world's draw loops skip them, CullEffects counts a marked effect as seen, and each view draws only its own right after its item, with its camera moved to the character and no culling against the world's view. While the preview's time is stopped the game moves none of a view's things and the view creates only its sprites and light. A view's things are removed when its item, pose or effect changes, when it is no longer drawn, and when the world is cleared; views create nothing while a list is three quarters full, and keep together to a quarter of each list. The things play no sound. The item's pose moves out of EffectPreviewScene::DrawItem into PosePreviewItem, so the views spawn from the pose they draw. RenderParticles no longer needs the option window, as RenderSprites.
…stops the lightning that lives a frame Each view forgot the slots its things had ended in only in its own turn, after the views before it had created: a view's new lightning could land in a slot another view's had left, and that view took it for its own. The views then showed different amounts (the first fewest). Now every view forgets what ended before any creates. The Wings of Darkness' lightning lives a frame and is made anew each frame. The view stopped its things only in the update after Stop time was ticked, when the game's move had already ended them, so the lightning went away. The view's draw now stops them at once, and a view that has made nothing yet (its item, pose or effect changed while stopped) makes its effect once to stop on.
…on bones too Its preview is a fourth view of the bone things preview (design section 7a), with the item effect its item runs and no stopped time. The design's Time bullet now says what Stop time does since the fix before.
…elf, not in SaveCameraPerspective's one slot
…and animation speed, shows the item's bones and picks them in the preview (L58) An item effect's list gets the animation speed and its "On bones" entries, with Add, Copy, Move up, Move down and Remove. An entry's fields: at bones, between bones or at the item's place, its bones as number fields (the bone a field points at is ringed in the preview with its number), its chance, Together, and its things with kind, type from the effect catalogue, SubType, scale, color, a sprite's rotation, lightning's direction and, in a group, their own chance. "Show bones" draws every bone of the previewed item as a dot with its number and name on hover; "Pick in the preview" adds or takes out a bone with a click on its dot, and picks lightning pairs start first.
…a record doesn't depend on what ran before it
…slot its own lightning left A view's lightning lives a frame. When the game created its own lightning of the same type in a slot a view's lightning had just left, the view kept that slot as its own: it drew the game's lightning, cast elsewhere, above its item, and the world lost it. Each create call now takes the preview mark off the slot it fills (PreviewSlots::Born); a view forgets the slots that no longer carry its mark before anything else, and takes its mark off the slots it no longer keeps, so the marks stay from one update to the next.
…ose bones, in both poses and turned
…ne it hangs on, and the picked entry's bones carry their numbers
…rken blend and animation speed; the Style Editor's fields, live preview and bones for item effects
…r takes 0 to 199, and a bone the model doesn't have creates nothing
…ite's rotation and lightning's direction, which the other kinds can't have
…eep to what the files take, from the reader's own limits
…an't have: it rolls once each time the group's chance holds
…have is logged when the game loads its data, not only named by Data Checks
… the bone its first click picked, as a mesh pick does
…the item's times a number, as one the look sets
… it: the effect table hands out its own entry
…ch frame instead of making them anew
…eview's creates and the moves of its slots
…st the Style Editor's view count when built
…n the item has bones, so naming them allocates nothing
…ces, also after a thing before it failed
… as Data Checks does, with its place in a group and its kind
…r all, which its fields don't show there
… bones once it is chosen, before the first pair
…its own, BoneMarks::PickTakeBack, tested without ImGui
…d direction; the change is a function of its own
… chance, and what a bone the model doesn't have and an unknown type do
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The fourth pull request of the looks-in-data design (sven-n#954), steps 2 and 3. The things item effects create on an item's bones every frame (sprites, particles, lightning and effects) move from code into data, and the Style Editor shows them live and edits them. The nine item effects that still had things on bones in code (six wings, Rena, the Devil's Key and Invitation) and the Pumpkin of Luck and Cursed Castle Water are data now; no item effect is code any more, and only
helperNpcPlate, which lights the helper NPC, stays a render style in code (it moves with the monsters' looks). Each moved effect was run with its old code and with its data in the same build, and what it created was recorded and compared before the code was deleted.What it does
docs/item-data.md→ Render styles and item effects): an item effect's"onBones"lists things by their effect catalogue name and kind ("sprite","particle","joint"for lightning,"effect") with asubType, at a list of bones ("bones": [22, 21]), between pairs of bones for lightning ("between": [[30, 22]]) or at the item's own place ("at": "origin"), with scale, color, a sprite's rotation and lightning's direction as numbers or shapes. A chance is once in N frames at the game's reference frame rate or a plain draw, for each bone or once; a"together"group shares its places and chance, so the Wings of Darkness' two lightnings strike together, and a thing inside can roll again (the Wing of Storm's thunder).wingsOfDarkness,wingOfStorm,wingOfEternal,wingOfIllusion,wingOfRuin,wingOfDimension,rena,devilsKeyanddevilsInvitation, and the Pumpkin of Luck and the Cursed Castle Water with their drawings, things on bones and animation (L29).{"itemTimes": 1.5}, L59), a darken blend (the Pumpkin of Luck's reflection), and an item effect's animation speed (the Cursed Castle Water's ground item).tests/data/baseline/ItemEffectSpawns.txt, 94 lines) was recorded from the old code. The recorders now clear the effect lists' objects whole, so a record doesn't depend on what ran before it.docs/item-data.md(things on bones,itemTimes, the darken blend, animation speed, the Style Editor's fields, live preview and bones), and the design document's decisions L51 to L59 (Q-L39 to Q-L47) with the FX1.7c design (section 7a).Tests
render_style_tests(90 cases): things on bones read and written, the checks, the spawn baseline of the moved effects (equal to the old code's records but the Devil items' sparks, L57), the preview's marks in the draw and move loops, a view's life cycle (created at the character, drawn only by its view, stopped with the time, removed when its item, pose or effect changes, when it is no longer drawn and when the world is cleared), each view keeping its own lightning when other views' and the game's lightning of the same type take the slots it left, the bone marks (projection, pick rules, the skeleton's parents) and the marks sitting exactly where a view creates its things, in both poses and turned.549e87eec: the Windows Release editor build and the whole ctest run, 4202 of 4206 pass. The 4 that fail don't come from this branch:ci_build_plan, which can't run its PowerShell script on this machine;write_git_commitandensure_submodule_leaves_history_out, which pass when run again alone; and the per-map file lists test, because main'sShared.jsonlacksData/Items/Options/OptionRules.json(from the item options pull requests); rewritten, the lists change only that line. The rebase had a conflict in the editor texts, where main added the NPC rule texts; both are kept.549e87eecbuilt and passedrender_style_tests, the editor's look, Style Editor, item effect and Data Checks cases (105 at the head) andtest_item_database(278); the 10 commits that change only docs were skipped. Linux found that the spawn recorder's digest of the random engine was not the same on every platform (it hashed the engine's written state withstd::hash, and both differ between MSVC and libstdc++); it is now taken from the engine's next numbers and hashed with FNV-1a, and the baseline was recorded again, the Devil items' lines before L57 from their old code. The records themselves were the same on both platforms, field for field.src/sourceare clean.Not checked yet
Not in this pull request
helperNpcPlate: with the monsters' looks (MN8).Related issues
Pull request 4 of the plan in sven-n#954 (0 was the design, 1 the mesh list, sven-n#970, 2 the first 96 looks, sven-n#1022, 3 the looks with conditions, item effects, shines and part models, sven-n#1050).
Checklist
docs/CODING_RULES.md.docs/build/README.md).