luv

Workshop wiki

gameplay-actions.lisp

captures/gameplay-actions.lisp

system luv/showcase · 11 definitions · on GitHub

in-package#:luv.showcase

Two authored play sequences through the ordinary centre-ray edit verb. The wall and scaffold are merely deterministic terrain; every filmed removal and placement still crosses luvcraft's player mutation, particle, lighting, mesh-publication, and checkpoint-notification path. #B4K7WR #P3L8YX

defparameter*gameplay-smash-targets*'
14311
15311
16311
16211
15211
14211
14111
15111
16111
"The brick panel swept from top left to bottom right by the mining film."
defparameter*gameplay-arch-targets*'
13111
17111
13211
17211
13311
17311
13411
14411
15411
16411
17411
"The two posts and lintel placed by the building film, in play order."
defunmake-gameplay-action-yard

Make the fully resident grass yard shared by the two action films.

let
dotimes
chunk-x2
loopforxbelow32do
loopforzbelow16do
setfluvcraft::*grass-block*
world
defunmake-gameplay-smash-wall-world

Make a stone wall with one contrasting three-by-three brick panel.

let
loopforxfrom12to18do
loopforyfrom1to5do
setfluvcraft::*stone-block*
dolist
destructuring-bind
xyz
coordinate
setfluvcraft::*bricks-block*

The opening reveals a luminous landmark instead of undifferentiated empty ground after the brick panel is gone.

setfluvcraft:*crystal-block*
world
defunmake-gameplay-arch-world

Make an open yard with an arch-shaped wooden placement scaffold.

let

Each wood cell is exactly one cell behind its eventual brick. A ray from the authored play camera therefore hits its front face and asks edit-luvcraft-block to place the brick at Z=11. The doorway's centre has no scaffold, so it remains genuinely open in the finished shot.

dolist
destructuring-bind
xyz
coordinate
setfluvcraft::*wood-block*
setfluvcraft:*crystal-block*
world
defungameplay-action-camera-pose
targetsframefirst-action-frameframes-between-actions

Pan the first-person camera smoothly between centre-ray targets.

let*
last-index
1-
lengthtargets
position
min
coercelast-index'double-float
max0d0
/
-framefirst-action-frame
coerceframes-between-actions'double-float
left-index
right-index
minlast-index
1+left-index
amount
-positionleft-index
left
elttargetsleft-index
right
elttargetsright-index
flet
blend
index
+
nthindexleft
*amount
-
nthindexright
nthindexleft
0.5d0
defunwait-for-gameplay-action-publication
sessiontitle&key
timeout10d0

Drive owner-side publication, reporting once a second until settled.

let
deadline
+
get-internal-real-time
round
*timeoutinternal-time-units-per-second
next-report
+
get-internal-real-time
internal-time-units-per-second
loop

film-luvcraft-session calls this helper between encoded frames. An edit has dirtied lighting at that point, but no ordinary frame can reconcile it until BEFORE-FRAME returns. Give the canvas owner the same refresh turn explicitly, then inspect the resulting boundary.

luv:request-canvas-frame
luvcraft:luvcraft-session-canvassession
lambda
timestamp
declare
ignoretimestamp
let
when
plusp
getfstate:errors
error"Capture ~A production failed while publishing: ~S"titlestate
when
>=
get-internal-real-time
next-report
formatt"capture ~A: publishing (~D outstanding, ~D staged)...~%"title
getfstate:outstanding
getfstate:staged
finish-output
incfnext-reportinternal-time-units-per-second
when
>=
get-internal-real-time
deadline
error"Capture ~A did not publish within ~,2F seconds: ~S"titletimeoutstate
sleep0.01
defunperform-gameplay-centre-edit
sessionactionexpected-coordinatetitle

Perform and verify one ordinary player action at expected-coordinate.

multiple-value-bind
coordinatestatus
unless
and
eqstatus:edited
coordinate
=
luvcraft::world-coordinate-xcoordinate
firstexpected-coordinate
=
luvcraft::world-coordinate-ycoordinate
secondexpected-coordinate
=
luvcraft::world-coordinate-zcoordinate
thirdexpected-coordinate
error"Capture ~A expected ~S at ~S, got ~S at ~S."titleactionexpected-coordinatestatus
andcoordinate
list
luvcraft::world-coordinate-xcoordinate
luvcraft::world-coordinate-ycoordinate
luvcraft::world-coordinate-zcoordinate
formatt"capture ~A: ~(~A~) at (~{~D~^, ~}); publishing...~%"titleactionexpected-coordinate
finish-output

Do not let worker timing choose which filmed frame first contains the edit. The owner publishes the complete current mesh cohort before this action's next frame is encoded.

formatt"capture ~A: edit published~%"title
finish-output
coordinate
defuncall-with-gameplay-action-session
functiontitleworldinitial-pose&keyselected-block

Call function in one fully resident gameplay-shaped hidden session.

call-with-gallery-session
lambda
session
whenselected-block
setf
luvcraft:luvcraft-session-selected-blocksession
selected-block
funcallfunctionsession
:titletitle:worldworld:camera:sky-clock:sky-profile:width+gallery-landscape-width+:height+gallery-landscape-height+:residency-radius0:clean-pnil:exposure0.50:bloom-gain0.20:shaft-gain0.22
luv:define-capturegameplay-smash-wall
:figurep3l8yx:kind:video:extension"mp4":description"First-person mining opens a brick panel with ordinary fragment bursts."
pathname
let
seconds7
first-action-frame20
frames-between-actions10
call-with-gameplay-action-session
lambda
session
luvcraft:film-luvcraft-sessionsessionpathname:secondsseconds:frame-rateframe-rate:include-hud-pt:include-viewmodel-pt:before-frame
lambda
luvcraft::set-camera-pose
luvcraft:luvcraft-session-camerasession
gameplay-action-camera-pose*gameplay-smash-targets*framefirst-action-frameframes-between-actions
luvcraft::advance-luvcraft-session-tosession
/frame
coerceframe-rate'double-float
when
and
>=framefirst-action-frame
zerop
mod
-framefirst-action-frame
frames-between-actions
let
action-index
/
-framefirst-action-frame
frames-between-actions
when
perform-gameplay-centre-editsession:remove"gameplay-smash-wall"
when
zerop
modframeframe-rate
formatt"capture gameplay-smash-wall: second ~D/~D~%"
1+
/frameframe-rate
seconds
finish-output
"gameplay-smash-wall"
gameplay-action-camera-pose*gameplay-smash-targets*0first-action-frameframes-between-actions
luv:define-capturegameplay-build-brick-arch
:figurep3l8yx:kind:video:extension"mp4":description"First-person placement raises two brick posts and closes their lintel."
pathname
let
seconds8
first-action-frame20
frames-between-actions10
scaffold-targets
mapcar
lambda
coordinate
list
firstcoordinate
secondcoordinate
1+
thirdcoordinate
*gameplay-arch-targets*
call-with-gameplay-action-session
lambda
session
luvcraft:film-luvcraft-sessionsessionpathname:secondsseconds:frame-rateframe-rate:include-hud-pt:include-viewmodel-pt:before-frame
lambda
luvcraft::set-camera-pose
luvcraft:luvcraft-session-camerasession
gameplay-action-camera-posescaffold-targetsframefirst-action-frameframes-between-actions
luvcraft::advance-luvcraft-session-tosession
/frame
coerceframe-rate'double-float
when
and
>=framefirst-action-frame
zerop
mod
-framefirst-action-frame
frames-between-actions
let
action-index
/
-framefirst-action-frame
frames-between-actions
when
perform-gameplay-centre-editsession:place"gameplay-build-brick-arch"
when
zerop
modframeframe-rate
formatt"capture gameplay-build-brick-arch: second ~D/~D~%"
1+
/frameframe-rate
seconds
finish-output
"gameplay-build-brick-arch"
gameplay-action-camera-posescaffold-targets0first-action-frameframes-between-actions
:selected-blockluvcraft::*bricks-block*