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

Potato farming #3230

Draft
wants to merge 72 commits into
base: develop
Choose a base branch
from
Draft

Potato farming #3230

wants to merge 72 commits into from

Conversation

nat-goodspeed
Copy link
Collaborator

No description provided.

nat-goodspeed and others added 24 commits October 1, 2024 16:35
The coro.lua module was an experiment predating fiber.lua. These days coro.lua
is mostly misleading, and it does not integrate with fiber.lua. The only
reason it still exists is because of its convenience wrapper around
`coroutine.resume()`.

`util.callok()` is simpler than `coro.resume()` because it accepts all return
values from one of `pcall()`, `xpcall()` or `coroutine.resume()`, all of which use
that (`false`, error) vs. (`true`, values...) return protocol. So instead of using
`table.pack()` and `unpack()`, it can directly use the '...' expression.

In fiber.lua, replacing `coro.resume(co)` with `util.callok(coroutine.resume(co))`
allows us to get rid of the coro.lua module.
The idea is that as long as a running Lua script calls `LL.yield()` from time
to time, we presume it's still making progress.

`LL.yield()` calls the new `LuaState::yield()` method, which calls
`llcoro::suspend()` if the Lua script has been running too long between other
operations that suspend its execution. We don't want every `LL.yield()` call
to suspend the C++ Lua coroutine for a frame; that would be a disincentive to
frequent calls. This `yield()` method is integrated with the infinite loop
detection mechanism.

Make Lua `fiber.yield()` function call `LL.yield()`. We want to encourage a
long-running Lua script to call `fiber.yield()`, allowing other Lua fibers in
the same script to run, as well as keeping the viewer happy.

Inject a couple `fiber.yield()` calls into the `inspect` module. Empirically,
we've seen our infinite-loop detection erroneously terminate a hard-working
`inspect()` call.

Remove `LL.sleep()`: if a Lua script wants a timed pause, it should instead
call `timers.Timer(seconds, 'wait')`. Replace a couple existing `LL.sleep()`
calls.
This was only used by the deleted DESTRINGIZE() macro.
…ct."

This reverts commit ae3d19e.

The nat/lua-eventstream branch does not contain this 'git revert', for when we
want to pick up that work again.
Don't doubly wrap the Lua result_view returned by
LLAgent.getNearbyAvatarsList() and getNearbyObjectsList(). Make
LLAgent.result() just use LL.setdtor() on the passed result, but don't wrap it
in an extra table. Fix comments for getNearby{Avatars,Objects}List().
Until we defend against circular require() calls, making inspect.lua require
fiber.lua is bad news.
We were stopping the listener, but not canceling the timer in the C++ viewer.
This demo script teleports to the Boston Lab platform, looks for a suitable
chair and walks over to it. It makes the avatar do a little dance, then (tries
to sit down on the chair) (sits near it). It then engages (a version of) the
Eliza program, conducted over local chat, until the user says "bye".
nat-goodspeed and others added 16 commits December 11, 2024 10:13
Convert the rest of the existing Lua class definitions to use util.class().
more commands in test_LLChatListener.lua
next_event() avoids each inline() caller having to invent a trivial function
that returns non-nil to stop inline() after the next event. In fact the
requisite function isn't quite so trivial, since it must guarantee not to
return nil.
the complement to LLDebugSettings.setGraphicsQuality().
Also add localToGlobalVector() and globalToLocalVector() that return Luau
vectors, instead of our conventional {x, y, z} tables. The idea is that you
can select the appropriate return type, instead of possibly requiring
unnecessary double conversions between table and vector.

These are in LLAgent because the Lua API we use to discover the world position
of the current region (the essential ingredient for these conversions) is the
'LLAgent' op 'getPosition', which returns both global and region positions.
The difference between these two is the corner of the current region.

Arguably we should instead use LLFloaterAbout.getInfo().POSITION and
POSITION_LOCAL, and move these conversion functions into the util module.
We can already get that by querying the 'RenderQualityPerformance' setting.

This reverts commit 1128d3d.
Add photo-demo.lua to take snapshots at various graphics quality settings
@github-actions github-actions bot added the llui label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants