Player/coders: How can the devs empower you to create scripts that enhance the the Flash game?

  • 2
  • Question
  • Updated 3 years ago
  • (Edited)
The dev team is actively pursuing various pathways for giving Eterna player/coders a more open development platform.  You'll be hearing more about this in the weeks leading up to, and at, Eternacon.

At the moment, the active development is a framework for executing player-written EternaScripts from within the RNA design mode of the flash app.  These scripts could vary in complexity from a generalized stamper tool to an interactive RNA design bot that allows the player to make a few basic decisions and then does all the computational grunt work of filling in the details of making the design work.

The most basic API functions that the Flash app needs to provide are
  • get_sequence: get the current design sequence
  • set_sequence ( <sequence string>): replace the current design sequence.
But this is only the beginning.  What else do you want?
Photo of Omei Turnbull

Omei Turnbull, Player Developer

  • 980 Posts
  • 308 Reply Likes
  • excited

Posted 3 years ago

  • 2
Photo of LFP6

LFP6, Player Developer

  • 613 Posts
  • 109 Reply Likes
Here's my immediate thoughts.

Wishlist of library functions (mostly what's in EternaScript Lib, but a couple extra things that I feel are missing):
  • Set/Get Sequence per state
  • Set (where applicable)/Get Target structure per state
  • Get natural structure per state
  • Set/Get Energy Model
  • Get free energy per state
  • Get constraints & which are passing and failing (all states?)
  • Get mappings of pairs (i.e. base 5 is paired to base 10) per state
  • Get other EternaScript
  • Submit? Maybe?
Also would like a way to create a UI for I/O with the user, thinking something like in Foldit's scripting (though not necessarily exactly): http://foldit.wikia.com/wiki/Foldit_Lua_Functions#dialog_functions
(Edited)
Photo of mat747

mat747

  • 130 Posts
  • 38 Reply Likes
That would get the science moving. I enjoyed the Foldit's scripting and it spread the knowledge.
Photo of Omei Turnbull

Omei Turnbull, Player Developer

  • 980 Posts
  • 308 Reply Likes
@LFP6:  Until you had embedded the flash app into an EternaScript for the purpose of generating predicted foldings, I hadn't put 2 and 2 together.  But we already have a very powerful, mature,  UI capability for EternaScript -- HTML. 

For those who haven't seen it yet, check out http://www.eternagame.org/web/script/7049401/. It  appends HTML input controls to the window containing the flash app to provide a very useful tool.  When nando and caleb work out the rest of the details for "boosters", it will be possible to invoke it on demand from within the app, rather than having to run it from the EternaScript section.
Photo of whbob

whbob

  • 193 Posts
  • 58 Reply Likes
Nice :)
Photo of LFP6

LFP6, Player Developer

  • 613 Posts
  • 109 Reply Likes
@Omei: Yes, but it would also be nice to give players an easy way to use UI elements like those used on the Eterna site, to help improve the visual "comfort" of using the tools a bit.
Photo of Omei Turnbull

Omei Turnbull, Player Developer

  • 980 Posts
  • 308 Reply Likes
To write scripts that respond to keyboard and mouse activity, we would need to be able to install event handlers for those.
Photo of Omei Turnbull

Omei Turnbull, Player Developer

  • 980 Posts
  • 308 Reply Likes
I'd also want to be able to query some of the flash apps UI state.  Take for example a script that will create a static hairpin out of the bases between positions x and y.  While we could prompt the user for x and y, it would be nicer for the user to select the sequence (perhaps with the existing shift-drag action), and click on a "make hairpin" icon.
Photo of Omei Turnbull

Omei Turnbull, Player Developer

  • 980 Posts
  • 308 Reply Likes
I realize there is a legitimate use for being able to set UI state (r.g. the black markers, blue glue, shifter) as well.
Photo of LFP6

LFP6, Player Developer

  • 613 Posts
  • 109 Reply Likes
Currently, the approach being taken for interacting with the applet requires checks and timeouts in order to use any applet functions. I would prefer if all applet functions could be synchronous, so get_sequence would just run, without the scripter needing to do anything else.
Photo of Omei Turnbull

Omei Turnbull, Player Developer

  • 980 Posts
  • 308 Reply Likes
How about just adding an applet.ready event, analogous to the window.ready event?
Photo of LFP6

LFP6, Player Developer

  • 613 Posts
  • 109 Reply Likes
That would be a great start, but there seems to be a common failure with functions like the existing get_full_structure and set_full_structure.
Photo of LFP6

LFP6, Player Developer

  • 613 Posts
  • 109 Reply Likes
Assuming these will be through EternaScript, there should be a separate category for these (as-is, there aren't enough categories, ie all the constraints should be in a category, in general there should be a better way to find out what scripts exist, for example using "folders", but that's not really critical for this topic).
(Edited)
Photo of Omei Turnbull

Omei Turnbull, Player Developer

  • 980 Posts
  • 308 Reply Likes
The current EternaScript timeout mechanism prevents a booster from using non-modal dialogs, unless the booster loading script does something to disable the timeout mechanism.

By non-modal dialog, I'm not referring to a new library feature, as LFP proposed.  Rather, I envision these as simply being normal HTML controls, either added to the existing window containing the flash player or in a newly created window.  Any code executed from these controls would be run long after the original booster script completed, yet the timeout code "automagic" added to the script will still stop the code from running if it has any loops.
Photo of LFP6

LFP6, Player Developer

  • 613 Posts
  • 109 Reply Likes
That timeout functionality could be an issue. Definitely cool if theres some overlay or something that could be just customized with HTML, and Im thinking of making an EternaScript UI library anyhow.