Zay-Es architectural patterns knowledge base


#1

Since a lot of us are using @pspeed’s awesome Zay-Es library I was wondering if we should create a knowledge base of architectural patterns so that others can have a jump start. We can start with basic patterns like Inventory Systems, Prefab Entity Construction Systems, Parent Child Relationships, Weapons and Firing Systems, Player Stats Systems, Commands Systems (move, jump, go to this location, etc.) and then possibly move to more advanced concepts like long lived Persistence and multi server coordination, Aggregation of Entities to form a new complex entity (Assembling a ship with parts and aggregating the part’s stats to describe the ship’s stats), etc …

We could then post this in the Docs section as a series of tutorials.


#2

Adding to the list :


#3

I integrated MonkeyBrains as a system for my NPC task AI and for player based programmable ship AI in battles.


#4

For my game, I am planning to use a GoapSystem at the heart. I found this https://github.com/p1387h/JavaGOAP implementation for Java. This system is going to be used by both NPCs and PCs.

Then I’m going to have an NpcTaskSystem, this is npc specific and is a very simple Behaviour Tree at it’s heart. It’s job is to set the goal for npc and provide alternative goals if npc was not able to find a way to accomplish the main goal. This system only tells npc What to do but does not tell him How to do it. It’s GoapSystem job to find a way to accomplish the goal.


#5

I am using MonkeyBrain (only the steer behaviours package) to apply steer force to bodies.


#6

I will have to look into that. I do like the GOAP approach better than the standard state machine route.


#7

You may find these links useful: :slightly_smiling_face:

The last one is an article from @Sploreg. He once was a JME core developer but I do not know how he happened to migrate to Unity.


#8

How about just the nuts, ie, what zayes actually has and how to use it as is. By this I mean, I know there is included database management, zones, login management etc but there is no documentation that explains the way to use any of this or what other classes are used for.

I know how to use databases, I know you can persist data with zay-es but nothing explains any of that.

Actually, nothing is explained at all pretty much. I am totally amazed at the code skills people have being able to read source and translate that into ok, step one, do this, step two use that…

Edit: The entity system example that someone did for the es system is a great example of what I am talking about.

Edit 2: It took paul two days to try and figure out his own code and he wrote the thing…

Crap. I crossed simetheral with zay-es. zay-es is easy and documented, its simetheral I was talking about.


#9

Not sure what this means. It only takes me 10 minutes to integrate SimEthereal with a new project. I just follow the getting started guid on the wiki.

If I have to fix some bug deep down in the sync code, then yes, I take my time and relearn that part because a) it’s some of the most complicated code I’ve ever written, and b) it’s super important not to screw it up because folks rely on this library now (with lots of users).

SimEthereal overview:

Getting Started guide:

…even I use it to add SimEthereal to a new project when I’m not just cutting and pasting the prebuilt example.


#10

I think those are potentially good examples because in my mind that have no (or very limited) interaction with the ES. So they would be good case studies on where the ES ends and the system’s own book-keeping begins.

For example, usually (usually), the ES is not a trash pile for systems to throw in whatever they want for convenience (convenience?). There can be exceptions and that would be the interesting part.


#11

Perhaps there are systems beside Decay that are universal ? Or just systems in general that could be generalised here on a list. Perhaps they could be contenders for the SiO2 library.


#12

I have a couple of patterns I use often collected on my http://fprintf.logdown.com blog, for example this one http://fprintf.logdown.com/posts/1366518-ecs-patter-decay

There are more I prefix them as “ECS Pattern:”, mabye they are of any help, don’t know.


#13

@ia97lies I actually found your stuff useful when I was starting out using Zay-ES


#14

I’m working on my first online game, based on the awesome sim-eth-es example. The player controls a character in a persistent world, like an mmo. When a player logs in again, his/her character should be at the same location before logging out.

I use Zay-ES with a SQLEntityData to store the location components. However, the characters should only be visible when the player is actual online. How would I go about this? Should I add an ‘Online’ component to flag all entities/characters that are online, or are there better solutions for this?


#15

Probably better to store their offline position with their other user data that also isn’t game data. Like password, etc… Then the next time they login, you retrieve their location from the user database and create the appropriate position component/init simethereal or whatever.