This is the cl-fast-ecs Reference Manual, version 0.2.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Fri Sep 15 03:53:04 2023 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-fast-ecs
Blazingly fast Entity-Component-System microframework.
Andrew Kravchuk <awkravchuk@gmail.com>
MIT
0.2.2
alexandria
(system).
trivial-garbage
(system).
src
(module).
Modules are listed depth-first from the system components tree.
cl-fast-ecs/src
cl-fast-ecs
(system).
package.lisp
(file).
components.lisp
(file).
entities.lisp
(file).
hooks.lisp
(file).
storage.lisp
(file).
systems.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-fast-ecs/cl-fast-ecs.asd
cl-fast-ecs/src/package.lisp
cl-fast-ecs/src/components.lisp
cl-fast-ecs/src/entities.lisp
cl-fast-ecs/src/hooks.lisp
cl-fast-ecs/src/storage.lisp
cl-fast-ecs/src/systems.lisp
cl-fast-ecs/src/components.lisp
hooks.lisp
(file).
src
(module).
*component-defined-hook*
(special variable).
*component-redefined-hook*
(special variable).
*component-storage-grown-hook*
(special variable).
defcomponent
(macro).
make-component
(generic function).
%accessor-decls
(function).
%defsoa
(macro).
*component-registry*
(special variable).
*component-registry-length*
(special variable).
cl-fast-ecs/src/entities.lisp
components.lisp
(file).
hooks.lisp
(file).
storage.lisp
(file).
src
(module).
*entity-storage-grown-hook*
(special variable).
delete-entity
(function).
entity-valid-p
(function).
make-entity
(function).
make-object
(compiler macro).
make-object
(function).
array-pop
(macro).
array-push-extend
(macro).
maybe-check-entity
(macro).
new-capacity
(function).
cl-fast-ecs/src/hooks.lisp
src
(module).
adjust-array*
(macro).
defhook
(macro).
run-hook
(function).
cl-fast-ecs/src/storage.lisp
hooks.lisp
(file).
src
(module).
entity
(type).
make-storage
(function).
%make-storage
(function).
component-soa
(structure).
component-soa-allocated
(reader).
(setf component-soa-allocated)
(writer).
component-soa-exists
(reader).
(setf component-soa-exists)
(writer).
component-soa-max-entity
(reader).
(setf component-soa-max-entity)
(writer).
component-soa-min-entity
(reader).
(setf component-soa-min-entity)
(writer).
copy-storage
(function).
make-component-soa
(function).
storage
(structure).
storage-component-dirty-bits
(reader).
(setf storage-component-dirty-bits)
(writer).
storage-component-storages
(reader).
(setf storage-component-storages)
(writer).
storage-deleted-entities
(reader).
(setf storage-deleted-entities)
(writer).
storage-deleted-entities-count
(reader).
(setf storage-deleted-entities-count)
(writer).
storage-entities-allocated
(reader).
(setf storage-entities-allocated)
(writer).
storage-entities-count
(reader).
(setf storage-entities-count)
(writer).
storage-p
(function).
cl-fast-ecs/src/systems.lisp
entities.lisp
(file).
storage.lisp
(file).
src
(module).
defsystem
(macro).
run-systems
(function).
%rebuild-entities-bitmap
(function).
*initial-dirty-bits*
(special variable).
*system-registry*
(special variable).
Packages are listed by definition order.
cl-fast-ecs
**NOTE: this software is of alpha quality, and the API is
subject to change.**
‘cl-fast-ecs‘ is a Common Lisp library providing an
implementation of the Entity-Component-System pattern, primarily focused
on speed and interactive development.
ECS is an architectural data-oriented design pattern that allows for the
effective processing of a large number of in-game objects while keeping the
code and data separated. This provides flexibility in the way that game
objects are built at runtime.
NOTE: to get the maximum performance, but loose the ability to interactively redefine components in the storage, add ‘:ECS-UNSAFE‘ keyword into ‘*FEATURES*‘ before loading the library.
ecs
common-lisp
.
*component-defined-hook*
(special variable).
*component-redefined-hook*
(special variable).
*component-storage-grown-hook*
(special variable).
*entity-storage-grown-hook*
(special variable).
defcomponent
(macro).
defsystem
(macro).
delete-entity
(function).
entity
(type).
entity-valid-p
(function).
hook-up
(macro).
make-component
(generic function).
make-entity
(function).
make-object
(compiler macro).
make-object
(function).
make-storage
(function).
run-systems
(function).
unhook
(macro).
%accessor-decls
(function).
%defsoa
(macro).
%make-storage
(function).
%rebuild-entities-bitmap
(function).
*component-registry*
(special variable).
*component-registry-length*
(special variable).
*initial-dirty-bits*
(special variable).
*system-registry*
(special variable).
adjust-array*
(macro).
array-pop
(macro).
array-push-extend
(macro).
component-soa
(structure).
component-soa-allocated
(reader).
(setf component-soa-allocated)
(writer).
component-soa-exists
(reader).
(setf component-soa-exists)
(writer).
component-soa-max-entity
(reader).
(setf component-soa-max-entity)
(writer).
component-soa-min-entity
(reader).
(setf component-soa-min-entity)
(writer).
copy-storage
(function).
defhook
(macro).
make-component-soa
(function).
maybe-check-entity
(macro).
new-capacity
(function).
run-hook
(function).
storage
(structure).
storage-component-dirty-bits
(reader).
(setf storage-component-dirty-bits)
(writer).
storage-component-storages
(reader).
(setf storage-component-storages)
(writer).
storage-deleted-entities
(reader).
(setf storage-deleted-entities)
(writer).
storage-deleted-entities-count
(reader).
(setf storage-deleted-entities-count)
(writer).
storage-entities-allocated
(reader).
(setf storage-entities-allocated)
(writer).
storage-entities-count
(reader).
(setf storage-entities-count)
(writer).
storage-p
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Called when a new component is defined with ‘DEFCOMPONENT‘ macro. Arguments
for the call are the index in the component registry and the constructor
function for component storage (not to be called directly by user).
See ‘HOOK-UP‘.
Called when an existing component is redefined with ‘DEFCOMPONENT‘ macro. Arguments for the call are the index in the component registry and the constructor function for component storage (not to be called directly by user).
See ‘HOOK-UP‘.
Called after the component storate capacity is increased due to the component
being added to the new entity. Arguments for the call are the index in the
component registry and the new storage capacity.
Note: this is a good place to call for a full GC cycle to collect old storage
arrays.
See ‘HOOK-UP‘.
Called after the entity storate capacity is increased due to new entity being
added. Argument for the call is the new storage capacity.
Note: this is a good place to call for a full GC cycle to collect old storage
arrays.
See ‘HOOK-UP‘.
Defines component structure with ‘NAME‘ and ‘SLOTS‘, allowing optional
docstring, just like ‘DEFSTRUCT‘. To be called from a top-level. Allows
redefinition of component with the same ‘NAME‘ but different set of ‘SLOT‘s;
all necessary storage will be properly reallocated.
This macro defines a following set of operations for given ‘NAME‘ *name*:
* an internal structure called ‘name-SOA‘ with its required internal machinery;
* a constant ‘+name-COMPONENT-INDEX‘ to access component data within a storage;
* a component data accessors ‘name-slotName-AREF‘ and
‘(SETF name-slotName-AREF)‘ for every slot on a component, with *O(1)*
complexity (their usage is discouraged though because of poor caching
performance, in favour of defining a new system with ‘DEFSYSTEM‘);
* a component constructor aptly named ‘MAKE-name‘, which adds the component
being defined to the given ‘ENTITY‘ within given ‘STORAGE‘, with *O(k)*
complexity, where *k* is the number of slots on the component;
* specialization of ‘MAKE-COMPONENT‘ generic on a component being defined;
* a predicate called ‘HAS-name-P‘ testing whether given ‘ENTITY‘ has the
component being defined within given ‘STORAGE‘, with *O(1)* complexity;
* a component destructor called ‘DELETE-name‘, removing the component being
defined from the given ‘ENTITY‘ within given ‘STORAGE‘ in *O(k)* complexity,
where *k* is the number of slots on the component;
* a convenience macro ‘WITH-name‘ akin to ‘WITH-SLOTS‘;
* some internal helper macros.
Also runs hook ‘*COMPONENT-DEFINED-HOOK*‘ or ‘*COMPONENT-REDEFINED-HOOK*‘ when called, depending on circumstances.
Defines a system with a given ‘NAME‘ and component sets ‘COMPONENTS-RO‘ and
‘COMPONENTS-RW‘ with read-only and read-write access to component slots,
respectively. Can be called from a top-level or embedded into other
form. Allows redefinition of system with the same ‘NAME‘ but different ‘BODY‘
or set of components.
Note that requested components should be defined with ‘DEFCOMPONENT‘ before
defining the system.
The ‘BODY‘ of forms (with optional docstring) would be run for every entity
containing all of the components from the given set, having the following
bindings:
* ‘STORAGE‘ — storage being acted upon;
* ‘ENTITY‘ — the entity being processed;
* ‘ComponentName-SlotName‘ for every slot of every component specified.
See also ‘RUN-SYSTEMS‘.
Hooks up the function ‘FN‘ on the ‘HOOK‘.
Complexity: *O(m)*, where *m* is the number of functions on a given hook.
See also ‘UNHOOK‘.
Unhooks the function ‘FN‘ from the ‘HOOK‘.
If the function wasn’t registered with ‘HOOK-UP‘ on a given hook, this
function has no effect.
Complexity: *O(m)*, where *m* is the number of functions on a given hook.
Delete given ‘ENTITY‘ from given ‘STORAGE‘.
Complexity: *O(m)*, where *m* is the number of defined components.
Return ‘T‘ if entity is valid.
Complexity: *O(1)*.
Creates and returns a new componentless entity in given ‘STORAGE‘.
Complexity: amortized *O(1)*.
See also ‘DELETE-ENTITY‘.
Creates and returns a new object (that is, an entity with a set of
components) in a given ‘STORAGE‘ following specification ‘SPEC‘ structured as
follows:
“‘
’((:component-name1 :component-slot1 "value1" :component-slot2 2.0)
(:component-name2 :component-slot 42)
;; ...
)
“‘
Complexity: *O(m)*, where *m* is the number of components in the given ‘SPEC‘.
Not recommended for using in a tight loops such as systems, see ‘DEFCOMPONENT‘
documentation for alternatives.
See also ‘MAKE-ENTITY‘, ‘DELETE-ENTITY‘.
Creates and returns a new storage instance.
Runs all of the systems registered with ‘DEFSYSTEM‘ with given ‘STORAGE‘.
Create a component on a given ‘ENTITY‘ in generic fashion.
Not recommended for using in a tight loops such as systems, see ‘DEFCOMPONENT‘ documentation for alternatives.
Re-creates array with a new size, keeping it simple.
Add element to the end of simple array, growing the array as needed. Very much like using the manual fill pointer.
structure-object
.
simple-bit-vector
cl-fast-ecs:entity
array-dimension-limit
cl-fast-ecs:entity
-1
alexandria:array-length
0
structure-object
.
alexandria:array-length
0
alexandria:array-length
0
(simple-array cl-fast-ecs:entity (*))
alexandria:array-length
0
(simple-array cl-fast-ecs::component-soa (*))
simple-bit-vector
Jump to: | %
(
A C D E F G H M N R S U |
---|
Jump to: | %
(
A C D E F G H M N R S U |
---|
Jump to: | *
A C D E M S |
---|
Jump to: | *
A C D E M S |
---|
Jump to: | C E F H M P S T |
---|
Jump to: | C E F H M P S T |
---|