-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtiny terrarium.p8
1738 lines (1647 loc) · 62.8 KB
/
tiny terrarium.p8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
pico-8 cartridge // http://www.pico-8.com
version 41
__lua__
-- tiny terrarium
-- by helado de brownie
-- this source code is designed
-- to be read in the pico-8
-- code editor. if you don't
-- otherwise have access to it,
-- try the education edition:
-- https://www.pico-8-edu.com/
-- the code is written
-- according to the following
-- style conventions.
-- line length:
-- each line must be at most 31
-- columns wide. this means all
-- code can be read and written
-- without having to scroll the
-- screen horizontally. some
-- glyphs, such as 🅾️ and ❎,
-- are two columns wide; what
-- matters is the total width,
-- not the number of glyphs.
-- breaking lines:
-- lines may be broken after
-- symbols, such as = and +.
-- the part after the break
-- must be indented one more
-- place. if the line is broken
-- immediately after paired
-- syntax, the pair must be on
-- the same indent. e.g.:
--
-- print(foo + bar * baz)
--
-- print(foo +
-- bar * baz)
--
-- print(
-- foo + bar + baz
-- )
-- multi-line table literals:
-- when a table literal is
-- broken across lines, each
-- line should generally
-- correspond to one field,
-- which ends in a comma. this
-- means not having to edit
-- previous lines when adding
-- new fields. e.g.:
--
-- local t={
-- a=0,
-- b=1,
-- c=2,
-- }
-- function declarations:
-- a line break must go between
-- the function keyword and the
-- name of the function. this
-- ensures there's enough room
-- to comfortably fit the name
-- and parameters on the same
-- line in most cases. e.g.:
--
-- function
-- foo(argument1,argument2)
-- -- implementation
-- end
-->8
-- glossary
-- this section lists the terms
-- used in the source code and
-- in the game, in alphabetical
-- order.
-- atom:
-- an independently simulated
-- particle. every atom has an
-- element, which determines
-- how it behaves. atoms have
-- no identity; every atom of a
-- given element behaves the
-- same as every other. the
-- color of an atom is based
-- completely on its element.
-- atoms are just a convenient
-- abstraction; they aren't
-- represented directly. the
-- "movement" of an "atom" is
-- just the changing of the
-- element associated with one
-- or more tiles.
-- board:
-- the place where the
-- simulation happens. it takes
-- up the entire screen and is
-- a rectangular grid of tiles,
-- each of which contains
-- exactly one atom, no more or
-- less.
-- element:
-- a type of atom. the element
-- of an atom determines how it
-- behaves. these behaviors are
-- implemented in the
-- simulation_screen.update
-- function's main loop. each
-- element directly corresponds
-- to a unique pico-8 color, or
-- equivalently, an integer at
-- least 0 and less than 16.
-- move:
-- to move from a source tile
-- to a destination tile means
-- to attempt an interaction
-- between the atoms in those
-- tiles. the result of the
-- interaction is determined by
-- the source atom's element.
-- often, the result of a move
-- is that the tiles swap what
-- atoms are in them. this is
-- the case with clay and air,
-- for example. if there is no
-- specific interaction between
-- the two elements, the move
-- is said to fail, and the
-- atoms remain unchanged. an
-- atom that has already moved
-- this turn cannot move again.
-- out of bounds (oob):
-- the area outside the board.
-- any coordinate that doesn't
-- correspond to a real tile is
-- out of bounds. oob atoms can
-- be interacted with but never
-- changed individually. all of
-- them can be changed at once
-- in the options.
-- tile:
-- a place on the board. it is
-- identified by a pair of
-- coordinates, integers that
-- are at least zero and at
-- most one less than the
-- respective dimension of the
-- board. a tile always has
-- exactly one atom in it.
-- turn:
-- one logical frame, which
-- happens about thirty times
-- per second. the board state
-- advances once per turn. this
-- is when all the rules and
-- relations between atoms are
-- checked.
-->8
-- optimization
-- this section describes the
-- strategies used to make the
-- game run at an acceptable
-- frame rate.
-- at a 32x32 board size, there
-- are 1024 atoms that need to
-- be simulated each frame.
-- this means there's very
-- little time to waste in the
-- simulation logic, which is
-- in simulation_screen.update.
-- the most important metric of
-- speed is cpu time. if the
-- game is over 100% cpu, then
-- it can't reliably capture
-- the pause button, which is
-- how the options screen is
-- accessed.
-- while in the game, press
-- ctrl+p to open the cpu
-- monitor. if the middle and
-- right numbers read as less
-- than 1.00, then the game is
-- running at an acceptable
-- speed.
-- the following strategies are
-- used to write code that uses
-- less cpu time.
-- cache global variables:
-- accessing global variables
-- is slower than doing so with
-- local ones. if a global is
-- to be used more than once in
-- a function, it can save time
-- to assign its value to a
-- local and use that instead.
-- if the global is a constant,
-- i.e., never needs to be
-- written back to, then
-- speeding up the code can be
-- as simple as, e.g.,
--
-- local air=air
--
-- without any other changes.
-- reuse information:
-- if the result of a check or
-- an expression is needed in
-- more than one place, compute
-- it once and then pass that
-- information on, e.g., by
-- passing it as an argument to
-- the function that needs it.
-- if even this would be too
-- expensive, design functions
-- so that they assume ahead of
-- time anything they need to,
-- and so don't need to check;
-- instead, the call site only
-- calls them if it's sure it's
-- safe to do so.
-- inline:
-- while writing functions as
-- separate units is extremely
-- useful for organization,
-- calling functions has a cost
-- that may not be worth the
-- performance tradeoff. in
-- these cases, and only in
-- these cases, consider taking
-- out any functions that are
-- too expensive and putting
-- their logic at the call
-- sites instead. in some cases
-- this may lead to duplicated
-- logic, which also incurs a
-- maintenance cost, so use
-- this sparingly.
-->8
-- constants
-- board sizes larger than
-- 64x64 cause glitches because
-- they overlap the section of
-- the sprite sheet that the
-- move function uses for
-- metadata.
board_width,board_height=32,32
-- each element *is* its color.
-- atoms contain no data other
-- than this.
air =12 -- light blue
block= 5 -- dark gray
clay = 4 -- brown
sand =15 -- tan
water= 1 -- dark blue
oil =13 -- lavender
plant=11 -- light green
egg = 6 -- light gray
bug =14 -- pink
fire3=10 -- yellow
fire2= 9 -- orange
fire1= 8 -- red
spout= 7 -- white
-- when the "spout" setting is
-- set to "random", these are
-- the elements that will be
-- emitted at random.
spoutables={
block,
clay,
sand,
water,
oil,
plant,
egg,
fire3,
}
-- when music mode is set to
-- "fun", these instruments
-- will play to represent the
-- given elements.
-- negative numbers are custom
-- instruments; add 8 to get
-- the actual index.
instruments={
[air] = 0, -- triangle
[block]=-8,
[clay] = 1, -- tilted saw
[sand] =-4,
[water]=-6,
[oil] =-7,
[plant]= 5, -- organ
[egg] =-3,
[bug] =-5,
[fire3]= 6, -- noise
[fire2]= 6, -- noise
[fire1]= 6, -- noise
[spout]=-2,
}
-->8
-- state
-- the board state is the
-- section of the sprite sheet
-- starting at (0,0) and sized
-- based on the board_width and
-- board_height constants.
-- the move state is the same
-- size as the board state but
-- begins at (64,0).
-- the cursor location is where
-- the player affects the board
-- when placing or erasing
-- atoms. it starts in the
-- center of the board.
cursor_x,cursor_y=
board_width\2,board_height\2
-- the following variables are
-- set based on options that
-- the player can configure.
-- this happens when the game
-- loads and when the options
-- screen is closed.
-- although this is a no-op,
-- they are set to nil here to
-- make it clear that they
-- exist and are used.
-- the element that will be
-- placed when the player
-- presses 🅾️.
-- valid values are all defined
-- elements.
draw_element=nil
-- the size of the area that
-- the player draws each frame.
-- valid values are sequences
-- of two positive integers no
-- larger than the respective
-- board dimensions.
brush=nil
-- if true, all elements except
-- bug will be overwritten by
-- drawing; otherwise, only air
-- will be.
-- valid values: true, false
overdraw=nil
-- if true, erasing only works
-- on the currently selected
-- element (draw_element).
-- valid values: true, false
erase_selected=nil
-- the function used to receive
-- input from the player.
-- example values: btn, btnp
get_input=nil
-- how fast the simulation
-- proceeds. larger is slower.
-- nil means time is stopped.
-- valid values are positive
-- integers and nil.
time_speed=nil
-- the element that fills the
-- out of bounds (oob) area.
-- oob atoms aren't affected by
-- time and can't individually
-- change, but in bounds atoms
-- can interact with them. see
-- the move function.
-- valid values are all defined
-- elements.
out_of_bounds=nil
-- the element that will be
-- generated by spout atoms.
-- valid values are all defined
-- elements, or nil for random.
spout_element=nil
-- whether and how to play
-- background music. the modes
-- are off, on, and fun mode.
-- if off, no music plays. if
-- on, the bgm plays with the
-- default instrumentation. if
-- fun mode, the voicing varies
-- based on what atoms are on
-- the board.
-- valid values are 0 for off,
-- 1 for on, and 2 for fun.
bgm_mode=nil
-- whether to play a sfx when
-- drawing or erasing.
-- valid values are true and
-- false.
sfx_mode=nil
-->8
-- setup
function
_init()
-- load any saved options and
-- begin on the simulation
-- screen.
cartdata'helado_tinyterrarium'
update_options(false)
set_screen(simulation_screen)
end
-- change what "screen" the
-- game is on by swapping out
-- the _update and _draw
-- functions.
-- the given table should have
-- fields 'update' and 'draw'.
function
set_screen(screen)
_update=screen.update
_draw=screen.draw
end
-- as a consequence of the
-- custom menu existing, it's
-- necessary to prevent button
-- presses from "leaking"
-- across screens. this is
-- handled by "locking" each
-- button until it's been
-- released at least once since
-- changing screens. look for
-- references to this variable
-- to see everywhere that needs
-- to be aware of this logic.
-- a more robust implementation
-- is possible, but was not
-- necessary for our purposes.
input_lock={}
-- btn_ and btnp_ behave just
-- like their namesakes btn and
-- btnp, except they are aware
-- of the input locking logic.
function
btn_(b)
local held=btn(b)
if not held then
input_lock[b]=nil
end
return
held and
not input_lock[b]
end
function
btnp_(b)
local held=btnp(b)
if not held then
input_lock[b]=nil
end
return
held and
not input_lock[b]
end
-->8
-- simulation
simulation_screen={}
tick=-1
function
simulation_screen.update()
-- the pause button opens the
-- options screen.
if btnp(6) then
poke(0x5f30,1)
set_screen(options_screen)
return
end
local bw,bh=
board_width,board_height
local air=air
local clay=clay
local sand=sand
local water=water
local oil=oil
local plant=plant
local egg=egg
local bug=bug
local fire3=fire3
local fire2=fire2
local fire1=fire1
local spout=spout
local spoutables=spoutables
local spout_element=
spout_element
-- slow time speed is handled
-- by skipping simulation
-- every so many frames. if
-- time is stopped, simulation
-- is always skipped. in any
-- case, the player still gets
-- to do things to the board
-- afterwards.
local time_speed=time_speed
local t=tick
if(time_speed==nil)goto after
t=(t+1)%time_speed
tick=t
if(t~=0)goto after
-- simulate each atom.
for y=0,bh-1 do
for x=0,bw-1 do
local atom=sget(x,y)
-- water falls straight down
-- if able, or else moves
-- left or right or stays
-- still at random.
-- it passes through air and
-- oil, and combines with
-- sand into clay.
if atom==water then
local function
react(atom1,atom2)
if
atom2==air or
atom2==oil
then
return atom2,atom1
elseif atom2==sand then
return air,clay
end
end
if
not move(x,y,x,y+1,react)
then
local side=flr(rnd(3))-1
move(x,y,x+side,y,react)
end
-- oil falls straight down
-- if able, or else moves
-- left or right or stays
-- still at random.
-- it passes through air.
elseif atom==oil then
local function
react(atom1,atom2)
if atom2==air then
return atom2,atom1
end
end
if
not move(x,y,x,y+1,react)
then
local side=flr(rnd(3))-1
move(x,y,x+side,y,react)
end
-- egg falls straight down,
-- left, or right at random,
-- or may hatch.
-- it passes through air,
-- water, and oil.
elseif atom==egg then
local function
react(atom1,atom2)
if
atom2==air or
atom2==water or
atom2==oil
then
return atom2,atom1
end
end
local side=flr(rnd(3))-1
local moved=
move(x,y,x+side,y+1,react)
if
not moved and
flr(rnd(3600))==0
then
place(x,y,bug)
sset(x+64,y,1)
end
-- spout stays in place but
-- generates a certain
-- element in a random
-- adjacent tile, based on
-- the spout setting.
elseif atom==spout then
local function
react(atom1,atom2)
if
atom2~=spout and
atom2~=bug and
flr(rnd(10))==0
then
local to_spout=
spout_element
if to_spout==nil then
local index=
flr(rnd(#spoutables))+1
to_spout=
spoutables[index]
end
return atom1,to_spout
end
end
local sidex=flr(rnd(3))-1
local sidey=flr(rnd(3))-1
move(
x,y,
x+sidex,y+sidey,
react
)
-- bug falls straight down,
-- or may move in a random
-- direction. it may lay an
-- egg if there's room,
-- especially in plant.
-- it passes through air
-- when falling, and
-- anything but block or
-- spout when moving with
-- purpose.
elseif atom==bug then
local function
react_fall(atom1,atom2)
if atom2==air then
return atom2,atom1
end
end
local function
react_dig(atom1,atom2)
if
atom2==block or
atom2==spout
then
return
end
local atom2_=atom2
if
(atom2==plant and
flr(rnd(12))==0) or
(atom2==air and
flr(rnd(120))==0)
then
atom2_=egg
end
return atom2_,atom1
end
if
not move(
x,y,
x,y+1,
react_fall
) and
flr(rnd(15))==0
then
local sidex=flr(rnd(3))-1
local sidey=flr(rnd(3))-1
move(
x,y,
x+sidex,y+sidey,
react_dig
)
end
-- plant may grow in a
-- random direction if there
-- is water there.
elseif atom==plant then
local function
react(atom1,atom2)
if
atom2==water and
flr(rnd(120))==0
then
return atom1,atom1
end
end
local sidex=flr(rnd(3))-1
local sidey=flr(rnd(3))-1
move(
x,y,
x+sidex,y+sidey,
react
)
-- clay falls straight down.
elseif atom==clay then
local function
react(atom1,atom2)
if
atom2==air or
atom2==water or
atom2==oil
then
return atom2,atom1
end
end
move(x,y,x,y+1,react)
-- sand falls straight down,
-- left, or right at random.
elseif atom==sand then
local function
react(atom1,atom2)
if
atom2==air or
atom2==oil
then
return atom2,atom1
elseif atom2==water then
return air,clay
end
end
local side=flr(rnd(3))-1
move(x,y,x+side,y+1,react)
-- fire rises, sets things
-- on fire, and may decay.
elseif
atom==fire3 or
atom==fire2 or
atom==fire1
then
local function
react(atom1,atom2)
if atom2==air then
return atom2,atom1
elseif
atom2==plant or
atom2==oil or
atom2==egg or
atom2==bug
then
return atom1,fire3
end
end
local sidex=flr(rnd(3))-1
local sidey=flr(rnd(3))-1
local decay=flr(rnd(2))==0
if decay then
local atom_=atom-1
if(atom_==7)atom_=air
place(x,y,atom_)
end
if
sget(x+sidex,y+sidey)~=air
then
move(
x,y,
x+sidex,y+sidey,
react
)
else
move(
x,y,
x+sidex,y-1,
react
)
end
end
end
end
-- we're done moving things;
-- forget this turn's moves.
poke(0x5f55,0x00)
rectfill(64,0,128,64,0)
poke(0x5f55,0x60)
::after::
-- respond to player input.
-- ⬅️➡️⬆️⬇️ move the cursor.
local btn=get_input
local cx,cy=cursor_x,cursor_y
local brw,brh=
brush[1],brush[2]
local seeking=brush.seeking
if(btn(⬅️))cx-=1
if(btn(➡️))cx+=1
if(btn(⬆️))cy-=1
if(btn(⬇️))cy+=1
cx,cy=
mid(0,cx,bw-brw),
mid(0,cy,bh-brh)
cursor_x,cursor_y=cx,cy
-- with the seeking brush,
-- pressing 🅾️ or ❎ plays the
-- bgm starting from the
-- selected row.
if seeking then
if
bgm_mode~=0 and
(btn(🅾️) or btn(❎))
then
music(cy)
end
return
end
-- with the ordinary brushes,
-- 🅾️ replaces the atom under
-- the cursor with the
-- selected atom if:
-- - overdraw is enabled; or
-- - the atom under the cursor
-- is air.
-- ❎ replaces the atom under
-- the cursor with air if:
-- - erase_selected is enabled
-- and the atom is the same
-- as the selected atom; or
-- - erase_selected is
-- disabled.
-- in addition, bug atoms are
-- not removable either by
-- drawing or erasing. they
-- can however be removed by
-- the simulation, such as by
-- falling off the edge or
-- being burned up.
local atom
if(btn(🅾️))atom=draw_element
if(btn(❎))atom=air
if atom~=nil then
for x=cx,cx+brw-1 do
for y=cy,cy+brh-1 do
local atom_here=sget(x,y)
if(atom_here==bug)goto next
if atom==air then
if
erase_selected and
atom_here~=draw_element
then
goto next
end
else
if
atom_here~=air and
not overdraw
then
goto next
end
end
place(x,y,atom)
::next::
end
end
if(sfx_mode)sfx(7)
end
end
function
simulation_screen.draw()
local bw,bh=
board_width,board_height
-- fill the screen with the
-- board. because normally
-- nothing will show through,
-- we don't need to clear the
-- screen explicitly.
sspr(
-- sprite sheet position
0,0,
-- sprite size
bw,bh,
-- screen position
0,0,
-- screen size
128,128
)
-- draw the cursor.
local brw,brh=
brush[1],brush[2]
-- compute width and height
-- based on screen and board
-- sizes.
local seeking=brush.seeking
local cw,ch=
128/bw,128/bh
-- compute screen position
-- based on logical position
-- and cursor size.
local csx,csy=
cursor_x*cw,cursor_y*ch
-- draw it as a black outline
-- if the normal cursor, or
-- purple for the seeking one.
rect(
csx-1,csy-1,
csx+cw*brw,csy+ch*brh,
seeking and 2 or 0
)
-- if fun mode is on, indicate
-- what note is playing by
-- drawing a single dot on top
-- of the corresponding tile.
if bgm_mode==2 then
local x,y=stat(50),stat(54)
pset((x+0.5)*cw,(y+0.5)*ch,0)
end
end
-- move the atom at (x1,y1) to
-- (x2,y2). the result of this
-- depends on the interactions
-- specified by the logic for
-- each element, but broadly
-- speaking either ends up
-- changing the two atoms or
-- doing nothing.
-- precondition: (x1,y1) is in
-- bounds.
-- return whether the move
-- succeeded, i.e., there was
-- a specific interaction that
-- was performed. the move can
-- fail either because the
-- elements don't interact or
-- because one of the atoms has
-- already moved this turn.
-- element logic can use this
-- to try multiple behaviors in
-- sequence until one succeeds.
function
move(x1,y1,x2,y2,react)
-- moving behaves a little
-- differently depending on
-- whether the destination is
-- in bounds.
local in_bounds2=
0<=x2 and x2<board_width and
0<=y2 and y2<board_height
-- do nothing if either atom
-- has been moved this turn.
if
sget(x1+64,y1)~=0 or
(in_bounds2 and
sget(x2+64,y2)~=0)
then
return false
end
local atom1=sget(x1,y1)
-- if atom2 is out of bounds,
-- it's assumed to be of a
-- specific type of atom.