Jumping to the end is more of a summary experience. This is the entire code of my submission to Lispgamejam2025. This was an exploration of possibilities in my knowledge representation.
With some apologies, this emacs eev-mode markdown file using my KRF in gnu clisp is the jam submission! It works on my machine <3. You have no choice but to talk to me personally to learn how to trivially run it on your machine. Inb4 typos.
I frittered the lispgamejam week away (busy! Deep emacs rerealizations! Live interview!) but it won me some scattered realizations.
Software-individuals
’ entities must specifically and just be entities.nil
entities (which in my software-individuals is anything currently having the type
property nil
) are a useful natural answer to(case (get thing type)
(plant (do-plant-things))
(insect (do-insect-things))
(t (do-nothing)))
case
over a type property instead of a typecase
over a lisp type.plant
s and insect
s can be removed by setting their type to nil.loadk
ed,entityfile
is written the entity is not writtenentityfile
is loaded, the entity
is just gone.case
organism
’s belief about where it is is separate data from the ground-it-is-standing-on’s belief about where it ist1
of an entityfile of ground tiles can be interpreted as a 2D grid by row-major-aref
if order is preservednil
s produced by this without explicit handling are more-or-less correct.I cannot say that I am particularly proud of my jam compared to everyone else! However a teacher I had, (Ernie Kalnins) used to tell me, specifically about me, that his view of examinations was that putting a student essentially in a crisis where the class subject was their only hope of survival leads their knowledge to suddenly crystalize in a way that routine daily study does not result in. Cruel/old-fashioned, but the game jam has certainly helped me think things through.
And there is still practically five hours left, so let us see what we can do. Forgive the repetitive portions.
Using emacs eev, though you knew that!
(eepitch-shell)
cd
git clone https://codeberg.org/tfw/pawn-75.git Pawn-75
mkdir -p ~/leocommunity
cp -r Pawn-75/Pawn-75 ~/leocommunity/Plant-insect-gamer
(setq inferior-lisp-program "clisp -E ISO-8859-1 -modern")
(slime)
(setq eepitch-buffer-name "*slime-repl clisp*")
(require "asdf")
(uiop:chdir "~/leocommunity/Plant-insect-gamer/demus/Process/main/")
(load #p"../../../remus/Startup/cl/acleo.leos")
(cle)
crek game-kb
loadk game-kb
setk game-kb
crefil types-and-fun
loadk types-and-fun
put organism type thingtype
put organism attributes {row col map sensor-range}
addmember (get types-and-fun contents) organism
put plant type thingtype
put plant attributes {row col map sensor-range}
put plant subsumed-by {organism}
addmember (get types-and-fun contents) plant
put insect type thingtype
put insect attributes {row col map sensor-range}
put insect subsumed-by {organism}
addmember (get types-and-fun contents) insect
put tile type thingtype
put tile attributes {row col contains}
addmember (get types-and-fun contents) tile
writefil types-and-fun
loadk types-and-fun
Note that even though plant is subsumed-by
organism
, I have individually set plant
and organism
s attributes. My current understanding is that subsumed-by
states a belief that this type
is thought to also reflect some definitions of the subsuming type
s in a defeasible sense. WIP
crefil organisms
loadk organisms
put dandelion-01 type plant
put dandelion-01 row 1
put dandelion-01 col 2
put dandelion-01 map test-map
addmember (get organisms contents) dandelion-01
writefil organisms
In common lisp.
crefil test-map
loadk test-map
. (defparameter *tiles-in* (loop :for idx :below 25 :for (row col) := (multiple-value-list (truncate idx 5)) :collect (intern (format nil "tile-~d-~d" row col))))
. ;; cle uses readline. Sorry about the one-liners.
. (loop :for tile :in *tiles-in* :do (setf (get tile 'type) 'tile))
. (setf (get 'test-map 'contents) `(seq& ,(append '(test-map) *tiles-in*)))
. (loop :for idx :from 0 :for (row col) := (multiple-value-list (truncate idx 5)) :for tile :in *tiles-in* :do (setf (get tile 'row) row (get tile 'col) col))
writefil test-map
At this point, I got kicked out of the library where I was writing this because, as a librarian I had not met told me, someone who looked like me had to go sit with the group of other rough looking men (whom appeared to know each other, and were minding their own business) or leave! Stranger than fiction. At least the librarians to whom I am a daily face looked remorseful (quietly).
put living-life type lispdef
addmember (get types-and-fun contents) living-life
writefil types-and-fun
---------------------------------------------------------
-- living-life
[: type lispdef]
[: latest-rearchived nil]
(leodef live-life live-life ()
(loop :for organism :in (cdadr (get 'organisms 'contents))
:do
(case (get organism 'type)
(plant
(let* ((new-name (gensym "dandelion-"))
(prev-row (get organism 'row))
(prev-col (get organism 'col))
(tile (intern
(format nil "tile-~d-~d"
prev-row
prev-col)))
(new-row (+ prev-row
(1- (random 3))))
(new-col (+ prev-col
(1- (random 3))))
(new-tile
(intern
(format nil "tile-~d-~d"
new-row
new-col))))
(when (and (get new-tile 'type)
(null
(get new-tile
'contains)))
(setf
(get new-tile 'contains)
new-name
(get new-name 'row) new-row
(get new-name 'col) new-col
(get new-name 'type) 'plant)
(nconc
(cadr (get 'organisms 'contents))
`(,new-name))))))))
put render type lispdef
addmember (get types-and-fun contents) render
writefil types-and-fun
---------------------------------------------------------
-- render
[: type lispdef]
[: latest-rearchived nil]
(leodef do-render do-render ()
(loop :for tile :in (cadr (get 'test-map 'contents))
:for idx :from 0
:for (row col) :=
(multiple-value-list
(truncate idx 5))
:for thing := (get tile 'contains)
:when (zerop col) :do
(terpri)
:when thing :do
(princ "*")
:else :do
(princ #")
:finally (terpri)))
and
loadk types-and-fun
ses.052) do-render
""*"*
*****
**""*
*""""
*""""
"
ses.053)
I guess the stars are dandelions. I ran it a few times.
. (loop :repeat 5 :do (live-life))
or something will work. Mnemonically, the double quotes would be grass.
Well, I included none of the intended features- I will add them after the jam. On the other hand, I did write random-walking dandelion propagation on a finite arbitrary game grid, using an entityfile test-map
of tile
entities for the game grid and an entityfile organisms
for just plant
s.
plant
s are subsumed-by
organism
.
All the draft writing material was fundamentally useful to me to begin learning how I can represent grid-based games in my software-individual
knowledge representation framework, and is a move towards more general introductory material for it.
The consequences of modelling a game inside the knowledge representation framework will begin to be explored in my post-mortem. Basically sitcalc modeling over real and imaginary game state timepoints. It would be nice to have an old-fashioned way of consuming common game mechanics and using them to reason about unknowns games (a model learning to play games a common research area).
The jam submission is just this markdown file indicating the more-or-less concision and literacy of the KRF.