Three structural fixes to flatten mode, found bringing up games on-device (Epic A1 Phase 5): 1. Nested classes: processFlatten now recurses through getDeclaredClasses() (not gated on the outer class's eligibility), so nested Streamables like BangConfig.Round get deterministic methods too. All detection/substitution/ insertion is scoped to each class's own body region (brace-matched, comment/string-aware, member-class bodies masked during detection) so an instrumented outer class can't hide — or poison — a nested one. 2. Ancestor-aware generation: a class whose ancestor declares read/writeObject now generates `super.readObject(ins)` + only the fields declared below that ancestor, instead of a self-contained full-set method. A self-contained subclass method silently dropped the ancestor's side effects for every subclass that previously inherited it: Prop.init() (server NPE cloning board props at startRound), Item's _nondb identity extras (itemId=0 on every wire-streamed item), InvocationMarshaller's _invdir rebind. Byte layout is unchanged: the ancestor's method streams exactly the flattened prefix. When the subclass adds no fields, nothing is generated — plain inheritance is already complete (the field-free marshaller/unit case). 3. Abstract classes: substitution-only. Their default*Object() pass-throughs are replaced in place with the class's own flattened prefix (making them safe super-call targets — the reflective pass-through reads the full dynamic-class set and would double-read the subclass tail), but whole methods are never generated for them. Requires every Streamable ancestor to be covered by the task's filesets; see findStreamMethodAncestor doc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HhfHCXYp2ctWi76Z91y9Ut
The Narya library
Narya provides a framework for building realtime distributed systems with an emphasis on multiplayer online games (massive or otherwise). Its various packages include:
- presents: A distributed object and remote procedure call framework for creating realtime distributed systems.
- crowd: A foundation for a multiplayer environment with notions of bodies and places, and support for chat and moving between places.
- admin: Useful administrative functionality including a mechanism for declaring configuration that can be viewed and modified at runtime by an administrative client.
- bureau: A framework for managing a network of code execution servers, which can be used to host ActionScript server-side code in addition to the Java server normally used by presents.
Javadoc documentation is provided.
Tutorials, etc.
Three Rings hosts a site called Game Gardens where the Narya library is used to develop a wide array of multi-player online games. On that site you can find tutorials and sample code relating to the use of Narya in game development.
Building
The library is built using Maven, or Ant.
The Maven build uses the standard targets:
package: builds the code and creates the jars and swcs
install: builds and installs the artifacts into your local Maven repository
test: builds and runs the unit tests
The Ant build uses the following targets:
all: builds the distribution files and javadoc documentation
compile: builds only the class files (dist/classes)
javadoc: builds only the javadoc documentation (dist/docs)
dist: builds the distribution jar files (dist/*.jar)
If you wish to build the ActionScript components via Ant, you will need to supply the location of the Flex SDK on the command line:
% ant -Dflexsdk.dir=SOMEPATH dist
Artifacts
Narya provides three different build artifacts, for differing purposes:
- narya: contains the main Java library; exports dependencies only for libraries which are required by a running client or server.
- naryalib: contains the main ActionScript library; exports dependencies for libraries needed when building a SWF using naryalib.
- narya-tools: contains the code generation portions of Narya which one need integrate into their build; exports dependencies for various libraries needed when running code generation.
Narya is published to Maven Central. To add a Narya dependency to a Maven
project, add the following to your pom.xml:
<dependencies>
<dependency>
<groupId>com.threerings</groupId>
<artifactId>narya</artifactId>
<version>1.15</version>
</dependency>
</dependencies>
To add it to an Ivy, SBT, or other Maven repository using project, simply remove the vast majority of the boilerplate above.
If you prefer to download pre-built binaries, those can be had here:
Related Libraries
Narya is extended by the Nenya and Vilya libraries which provide additional game related functionality like 2D and 3D graphics support, animated character rendering and a more sophisticated virtual world framework.
Distribution
Narya is released under the LGPL. The most recent version of the library is available at http://github.com/threerings/narya
Contact
Questions, comments, and other worldly endeavors can be handled via the Three Rings Libraries Google Group.
Narya is actively developed by the scurvy dogs at Three Rings Contributions are welcome.