Skip to content

Instantly share code, notes, and snippets.

0: (BITIO:MAKE-BITIO #S(FAST-IO:INPUT-BUFFER :VECTOR NIL :POS 0 :STREAM #<SB-SYS:FD-STREAM for "file /mnt/data/home/porky11/quicklisp/dists/org.borodust.bodge/software/notalone-20171023/assets/images/sho..
1: (PNGLOAD:LOAD-STREAM #<SB-SYS:FD-STREAM for "file /mnt/data/home/porky11/quicklisp/dists/org.borodust.bodge/software/notalone-20171023/assets/images/shotgun_fire.png" {1001A41573}> :DECODE T :FLATTEN ..
2: (OPTICL:READ-PNG-STREAM #<SB-SYS:FD-STREAM for "file /mnt/data/home/porky11/quicklisp/dists/org.borodust.bodge/software/notalone-20171023/assets/images/shotgun_fire.png" {1001A41573}>)
3: (OPTICL:READ-PNG-FILE #P"/mnt/data/home/porky11/quicklisp/dists/org.borodust.bodge/software/notalone-20171023/assets/images/shotgun_fire.png")
4: (CL-BODGE.ASSETS:LOAD-PNG-IMAGE #P"/mnt/data/home/porky11/quicklisp/dists/org.borodust.bodge/software/notalone-20171023/assets/images/shotgun_fire.png")
5: ((LABELS #:DISPATCHED9 :IN TRIVIAL-GAMEKIT::%LOAD-IMAGE))
6: ((FLET CL-BODGE.CONCURRENCY::WRAPPED :IN CL-
@porky11
porky11 / GA
Created January 22, 2018 00:21
Geometric Algebra Products
A B =
( a b + a1 b1 + a2 b2 - a12 b12)
e1 ( a b1 + a1 b - a2 b1 + a12 b2 )
e2 ( a b2 + a1 b12 + a2 b - a12 b1 )
e12 ( a b12 + a1 b2 - a2 b12 + a12 b )
B A =
( a b + a1 b1 + a2 b2 - a12 b12)
e1 ( a b1 + a1 b + a2 b1 - a12 b2 )
e2 ( a b2 - a1 b12 + a2 b + a12 b1 )
(defun id (x)
x)
(defconstant o nil)
(defun bracketless (args &optional level)
(do ((result)
(arg (car args) (car args))
(args (cdr args) (cdr args)))
(nil)

When representing worlds, you normally save a set of objects. The programm will iterate over the objects or tuples of objects very often, so it's necessary to minimize the work. It should also not consume unneccessary memory. There a several ways to represent these sets of objects.

Simple Arrays

The simplest way is just an array of objects. This will require all objects to be the same size. It's also possible to let the objects contain references to other data.

@porky11
porky11 / iterator.sc
Created July 4, 2018 09:48
Convert my Iterator to scopes Generator
typefn& Iterator '__as (self T)
if (T == Generator)
Generator
label (fret fdone val)
if ('next? val)
fret
val
'next val
else
fdone;
# Template file for 'ardor'
pkgname=ardor
version=2.0.14
revision=1
wrksrc="ardor"
hostmakedepends="unzip"
makedepends=""
depends=""
short_desc="The Ardor Platform"
maintainer="Fabio Krapohl <fabio.u.krapohl@fau.de>"
@porky11
porky11 / Connect.txt
Created September 11, 2018 19:40
Connect - Ball connection adventure game
Du bist ein Ball in einer Welt aus Bällen.
Du kannst andere Bälle in deiner Umgebung halten.
Wenn du einen Ball hälst, kannst du ihn in beliebige Richtungen relativ zu dir bewegen.
Je schwerer die Bälle sind, desto mehr wirst du in die entgegengesetzte Richtung geschoben, anstatt den anderen Ball zu bewegen.
Bälle gibt es in sehr unterschiedlichen Größen und mit unterschiedlichen eigenschaften.
Bälle können auch Gravitation haben und wie Planeten wirken, können weich sein und so je nach größe wie Gummi oder Wasser wirken.
Du kannst jeden Ball mit anderen Bällen verbinden. Dadurch lassen sich komplexe Konstrukte bauen, die von selbst zusammen halten. Diese Verbindungen haben ähnliche Physikalische Eigenschaften wie Bälle. Wenn sie nicht zu weich sind, können sie als Brücken und Wände verwendet werden.
Wenn Bälle stark beschleunigt werden, nehmen sie Schaden. Wenn du von weit oben auf einen Planeten fällst oder mehrere Bälle mit hoher Geschwindigkeit aufeinanderwirfst, dann können sie dadurch beschädigt werden.
@porky11
porky11 / Story.scd
Last active October 19, 2018 20:44
Story Engine Presentation

Einführung """"Ein interessanter Aspekt von Spielen sind Geschichten. Besonders interessant sind Geschichten, in denen der Spieler Freiheiten hat. Es gibt verschiedene Freiheiten. Freiheiten Alternativen """"Der Spieler kann den Verlauf der Geschichte selbst beeinflussen Reihenfolge """"Der Spieler kann Teile der Geschichte in beliebiger Reihenfolge erleben Wiederholung

Description of a simple ECS

Requirements

  • seperation between static and dynamic components
  • dynamic components regulary change
  • static components normally don't change
  • static components can be shared between entities
  • when changing a static component, it will change for all components, which share it
  • iteration will only touch the important components
@porky11
porky11 / dynamic.sc
Last active November 13, 2018 16:03
Dynamic bindings in scope
let model model-normal =
static mat4
static mat3
typefn& Node 'render (self)
dynamic-let model model-normal =
'transform model self.transform
'transform model-normal self.transform-normal
if ('is-leaf self)
render-mesh self.mesh model model-normal