- Support pragmas on system args
- Support multiple
runSystemOncecalls in a template
- Add
Resourcedirective - Support resources that require initialization
- Support
typeOfin directives
- Fix
eventSysopen symbol normalization - Improve support for open symbols
- Fix
extendusage in bundles - Fix tuple extension with generics
- Fix
getTupleSubtypeserror message - Avoid unnecessary resource refs
- Improve error location reporting for nimNode errors
- Add type name to system var errors
- Remove tuple join sorting requirement
- Directives have been changed from functors back to procs. For most projects,
this should be a transparent change. However, if you were depending on directives
being
objectsyou will need to update your code to use theprocsinstead.
- Resolved error when detaching a component not present in the archetype
- Fixed issue with optionally detaching accessories
- Added support for union types in event declarations
- Allow
AttachandSwapto operate on objects that don't support copies (Nim >= 2.3)
- No known backwards incompatible changes
- Remove archetype sorting restriction
- Add generations to entity IDs to prevent entity confusion when entity IDs are recycled
- Add
DeleteAlldirective - Add
fromforSystemVar - Support
Localdirectives in bundles - Add
maxCapacitypragma - Add
requireMaxCapacitybuild flag - Add
necsusSystemTraceflag - Improve log message for necsusEntityTrace
- Use system IDs for profiling
- Remove closure iterators from queries
- Lazy archetype alloc by default
- Pre-initialize event inboxes
- Fast compile mode improvements
- Faster archetype iteration
- Allow missing keys while parsing
- Allow open symbols in directive parsing
- Support all directives for
runSystemOnce - Handle missing entities
- Fix instantiation order of time values
- Fix index error for
Notqueries with accessories - Fix infinite loop in
-d:dump - Fix bundle privateAccess error for built systems
- Fix conflicting
eventsysmailbox names - Don't send messages to inactive systems
- Generate
sendProcforIndirectEventCallbacksystems - Add missing necsus imports
-d:dump
- Fix
nonelookup result for optional pointers to accessory components
- Improve readability of
EntityDebugoutput
- Resolved a crash when looking up a pointer for an optional accessory
- Fix invalid dumped code for temporary variables and queries over accessories
- Runtime performance optimizations
- Fix inbox sharing when a system is assigned to a variable
- Fix inbox name collisions when argument names were the same
- Fix error messages when a system incorrectly returns a value
- Fix invalid code dumping when a newline is injected after a sink parameter
- Allow joined tuples to operated on joined tuples
- Use
()operator for directives instead of passing in procs. This improves compile speed and performance by removing the need for Nim to create and manage closures. However, it requires that all Necsus users enable the--experimental:callOperatorflag. - Remove the
necsusFloat32flag and instead useBiggestUIntandBiggestFloat
- Accessory components
- Adding the
accessorypragma means that a component no longer forces the creation of new archetypes. This reduces the size of generated code and improves compile speed.
- Adding the
- Adds
SystemVar.clear - Support tuple joining without explicit type definitions
- Add an error message when attach/detach/swap fails
- Build speed improvements
- Adds
SaveSystemInstanceandEventSystemInstancetypes - Fast compile mode for speeding up IDE integration
- Fix memory corruption bug caused by Nim mishandling sink parameters
- Support tuples in
SharedandLocal - Fix a bug where an instanced
eventSyscan't be invoked
- Add compiler flags for tracing various behavior during execution
-d:necsusSaveTrace-- Log save and restore activity-d:necsusQueryTrace-- Log executed queries-d:necsusEventTrace-- Log when an event is sent-d:necsusEntityTrace-- Log when entities are created, modified or deleted
- Overall reduction of memory allocations
- Mark the logger parameter as
gcsafeandraises: [] - Remove the
sinkflag from theOutboxproc parameter
- Fix
Lookupdirectives that contain aNotclause
No known breaking changes
extendandjoinmacros for combining tuple typeseventSyssystem type- Include
importstatements when using-d:dump - Support for
Optionalcomponents inDetachdirectives - Add the
Swapdirective - Add the
-d:archetypesbuild flag - Support component aliases with generics
SaveandRestoredirectives, along withsaveSysandrestoreSyssystem types- Returning
SystemInstanceautomatically flags a system as instanced.
- Ensure that archetype rows are never copied
- Silence noisy compiler warnings
- Reduce size of generated code by around 50%
- Logger is disabled by default
- Add the
-d:necsusLogcompiler flag for logging when systems are called - Support for the
-d:necsusFloat32compiler flag to ensure float32 values are used internally - Add a variant of
SystemVar.getOrPutthat sets default values - Support sending events in from the outside world when an app instance is self-managed
- Removed the
eventQueueSizeparameter fromnewNecsusConfas it is now unused. Event queues are dynamically sized. - Use a
uint32for tick IDs
- Support for
reftypes in system variables - Removed code gen elision for nimsuggest as it was causing language server errors
- Remove unnecessary initializers in generated code
- Hosting of the readme directly on the doc site: https://necsusecs.github.io/Necsus/
-
Removed
teardownandstartupparameters from thenecsuspragma. With this change, you should switch to using thestartupSysandteardownSyspragmas attached directly to the systems instead. For example, this:import necsus proc startupSystem() = discard proc loopSystem() = discard proc teardownSys() = discard proc app() {.necsus([~startupSys], [~loopSys], [~teardownSys], newNecsusConf).}
would become:
import necsus proc startupSystem() {.startupSys.} = discard proc loopSystem() = discard proc teardownSys() {.teardownSys.} = discard proc app() {.necsus([~startupSys, ~loopSys, ~teardownSys], newNecsusConf).}
-
SpawnandQueryno longer return anEntityId. If you need them, use aFullSpawnor aFullQueryinstead. This change allows Necsus to improve build speeds and produce less output code. If you're interested in the details, read on.During a build, Necsus automatically generates a set of all possible archetypes that could possibly exist at runtime. It does this by examining systems with
FullQuery,FullSpawn,Lookup, andAttachdirectives, then uses that to calculate all the combinatorial possibilities. Naively, this is an exponential algorithm. This is important because archetypes themselves aren't free. Each archetype that exists increases build times and slows down queries.Using
Spawninstead ofFullSpawnandQueryinstead ofFullQueryallows the underlying algorithm to ignore those specific directives when calculating the final set of archetypes. Because your system doesn't have access to theEntityId, it can't use the output of aSpawncall as the input to an Attach directive, which means it can't contribute to the list of archetypes. -
Convert
TimeDeltaandTimeElapsedfromfloattoproc(): float. This means anywhere you were referencing it as a variable, you now need to invoke it as a proc. This was done to make sure any times stored in aBundlereturn correct values.
- Add the
runSystemOncemacro. This makes it easier to test a system. This macro accepts a single lambda as an argument, and will invoke that lambda as if it were a system. You can then pass those directives to other systems, or interact with them directly. - Add a new directive,
TickId.TickIdgives you an auto-incrementing ID for each time a tick is executed. This is useful, for example, if you need to track whether an operation has already been performed for the current tick. - Add support for the
-d:profilecompiler flag. This allows you to get a quick and dirty idea of how your app is performing. When this flag is set, Necsus will add profiling code that reports how long each system is taking. It takes measurements, then outputs the timings to the console.
- Allow
Inboxes to work in aBundle - Improve the code generated by
-d:dumpso it can be directly copied and pasted without change - Lazy archetype instantiation. This means that memory will only be allocated once an archetype is actually used
- Use fewer closures when defining an app
- Speed up archetype generation code by using a bitset instead of a full
Set - Fix
Bundles that use generics - Code gen an iterator for each query instead of using runtime generics
- Various bug fixes
- Various code-gen speed improvements
This was done to simplify macro logic, which led to compile time performance improvvments.
This fixes an unintuitive situation where an inbox appears in the system list before the outbox. In that case, events are sent, but never received because all the mailboxes were cleared at the end of every tick.
With this change, each system gets its own inbox, which is cleared after the system executes. It will mean more memory usage, but the difference should be small. And the behavior will be much more intuitive.
- Add state management via the
activepragma. See readme for details - Add
SysVar.getOrPut - Add
Shared.isSome - Add
Inbox.len Bundlepragma. See readme for details
- Many compile time speed improvements
- Various bug fixes
- Improved generic alias handling