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

Live Edit Functionality #1457

Open
31 of 32 tasks
vchelaru opened this issue Aug 17, 2024 · 2 comments
Open
31 of 32 tasks

Live Edit Functionality #1457

vchelaru opened this issue Aug 17, 2024 · 2 comments
Labels
edit mode huge This issue may take many days or even weeks of work. PriorityHigh Higher priority than normal issues, but not a blocker

Comments

@vchelaru
Copy link
Owner

vchelaru commented Aug 17, 2024

This issue lists all live edit functionality which is expected to work, will never work (with explanation) and things to do. For this card, the term "dynamic" refers to something that has been created while live edit was running. Dynamic objects will not have codegen available, so they must be handled by the editor. For example, if the user adds a new CircleInstance to an entity, that is a dynamic object.

Startup

  • Starting the game in edit mode when nothing is selected, right when FRB launches should select the current screen

Display

Screens

  • Pressing delete when an entity instance is selected in a screen list should delete the instance.

Entities

  • Copy/Paste of entire entity should allow editing the newly-created entity. I tried this with an entity that has a sprite and circle, but I could not select the circle in the new entity. In fact, the new entity would never show up.
  • Rename Entity should allow to continue editing the new entity and seeing the changes in live edit
  • Renaming Entity should properly use the new element including changes on the renamed element on existing (code generated) instances
  • Renaming Entity should properly use the new element on dynamic instances added before rename
  • Renaming Entity should properly use the new element on dynamic instances added after rename

Files

  • Changing .achx should update relative frames immediately and relative positions

Objects

  • Create new instances by drag+dropping
    • Instances in an entity appear on instances of that entity in a screen
  • Create new instances by copy/paste
  • Editing points on an existing polygon by drag+moving should apply to polygon Glue JSON
  • Editing points on an existing polygon by drag+moving should apply to instances of the entity that contains the polygon
  • Adding dynamic polygon to entity and editing the points should apply to instances of the entity that contains the polygon
  • Adding a dynamic polygon to an entity, adding an instance of that to the screen, then deleting the instance should delete the polygon. This works if no changes are made to the points, but if we make it a rectangle, resize points, deselect the entity (unload it) then reload it, deleting does not remove the polygon.
  • Adding instance, making changes to the instance, renaming instance, make more changes to the instance. Deselect/reselect screen that contains instance should show all changes that were made before and after the rename.

Variables

  • Assign existing variables on objects
  • Create new tunneled variable
  • Create new tunneled variable which displays as absolute (X, Y, Z, RotationZ), but modifies relative values (RelativeX, RelativeY, RelativeZ, RotationZ)
  • Tunneled variables can be set on instances of the entity that has the tunneled variable
  • Create dynamic non-tunneled variables - These won't do anything in game until the game is rebuilt, but there's no reason to stop the game when it's created.
  • Dynamic non-tunneled variables should be assignable on instances
  • Dynamic entity, dynamic sprite (created in initial popup), add texture, tunnel Sprite Alpha, change sprite alpha should update on entity preview. Works fine after restart.
  • Dynamic entity, dynamic sprite, add texture, tunnel sprite alpha. Create instances of the entity in a screen, set sprite alpha at the screen level. Go back to entity level and change alpha. The changes at the NOS level should not apply on the instances that have set the variable at the instance level.

States and Categories

  • Including an existing variable to a state should allow previewing that state by changing its value
  • Adding included variables on a category should show up when previewing the state
  • Including a dynamic variable on dynamic object then assigning this on a state should allow previewing in the entity
  • Including a dynamic variable on dynamic object then assigning this on a state should show up on instances. This ultimately requires being able to apply states dynamically rather than through codegen. Adding this as a feature...
  • Create a new category, add new states to the category, modify the states, add a new variable to the entity of type state, set the new variable on instances of the entity, the state should show
  • Make default on dynamic state in dynamic entity with dynamic variable assignments results in exception:
System.MemberAccessException: LateBinder could not find a field or property by the name of CurrentSizeCategoryState in the class LiveEditTest.Entities.SpriteEntity.  Check the name of the property to verify if it is correct.
   at FlatRedBall.Instructions.Reflection.LateBinder`1.SetProperty[K](Object target, String propertyName, K value) in C:\Users\Owner\Documents\GitHub\FlatRedBall\Engines\FlatRedBallXNA\FlatRedBall\Instructions\Reflection\LateBinder.cs:line 510
   at FlatRedBall.Instructions.Reflection.LateBinder`1.SetValue(Object target, String name, Object value) in C:\Users\Owner\Documents\GitHub\FlatRedBall\Engines\FlatRedBallXNA\FlatRedBall\Instructions\Reflection\LateBinder.cs:line 378
   at FlatRedBall.Instructions.Reflection.LateBinder.SetValueStatic(Object target, String name, Object value) in C:\Users\Owner\Documents\GitHub\FlatRedBall\Engines\FlatRedBallXNA\FlatRedBall\Instructions\Reflection\LateBinder.cs:line 52
   at FlatRedBall.Screens.Screen.ApplyVariable(String variableName, Object value, Object container) in C:\Users\Owner\Documents\GitHub\FlatRedBall\Engines\FlatRedBallXNA\FlatRedBall\Screens\Screen.cs:line 676
   at GlueControl.Editing.VariableAssignmentLogic.SetValueOnObjectInElement(Object variableValue, GlueVariableSetDataResponse response, Screen screen, String instanceName, String variableName, INameable targetInstance) in C:\Users\Owner\Documents\FlatRedBallProjects\LiveEditTest\LiveEditTest\GlueControl\Editing\VariableAssignmentLogic.Generated.cs:line 603
   at GlueControl.Editing.VariableAssignmentLogic.SetValueOnObjectInScreen(String variableName, Object variableValue, GlueVariableSetDataResponse response, Screen screen) in C:\Users\Owner\Documents\FlatRedBallProjects\LiveEditTest\LiveEditTest\GlueControl\Editing\VariableAssignmentLogic.Generated.cs:line 317
String:
"this.SpriteEntity1.CurrentSizeCategoryState="

Known not implemented

  • Adding excluded variables on a category should show up when previewing the state - this currently requires a restart because it would take a bit of work to detect if a state already had a value compiled in
@vchelaru vchelaru pinned this issue Aug 17, 2024
@profexorgeek
Copy link
Collaborator

The Live Edit portion doesn't always fill the entire available space in Glue as demonstrated here. This is reproduceable in Nardiak and I think it has to do with the game's resolution settings because the rendered portion is the same size as the resolution the game runs at. Glue should override the game's max resolution when displaying within Glue.

image

@vchelaru
Copy link
Owner Author

As mentioned in the original description, this was caused by using a render target. More info here: https://docs.flatredball.com/flatredball/glue-reference/enable-live-edit/render-targets

@vchelaru vchelaru added edit mode huge This issue may take many days or even weeks of work. PriorityHigh Higher priority than normal issues, but not a blocker labels Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edit mode huge This issue may take many days or even weeks of work. PriorityHigh Higher priority than normal issues, but not a blocker
Projects
None yet
Development

No branches or pull requests

2 participants