WIP - huge refactors to be expected, some ugly code at some places :).
Trying to simulate evolution, synchronized over gRPC to clients that render a 3D visualisation.
To be used with the Unity client
# Edit your /etc/ssl/openssl.cnf add subjectAltName = IP:127.0.0.1 in [v3_ca] section
# Maybe it will do the trick but not tested :D
sed -i -e 's/#subjectAltName = IP:127.0.0.1/subjectAltName = IP:127.0.0.1/g' /etc/ssl/openssl.cnfopenssl genrsa -out server1.key 2048 &&
openssl req -new -x509 -sha256 -key server1.key -out server1.crt -days 3650
cp server1.crt $UNITY_PROJECT_PATH/Assets/StreamingAssetsgo get github.com/The-Tensox/Erutan-go
cd $GOPATH/src/github.com/The-Tensox/Erutan-go
make runmake dbuild
make drunYou can tweak the [base configuration](config.yml.
go test -vSome metrics are exposed.
Install and run Grafana + Prometheus to monitor erutan-go:
make dmonThe Entity(well you will usually find them named "object" instead, but same principle) Component System(ECS) design is used.
Composed of physical data (position, rotation, scale, shape, collision ...), logic + others ...
Sorted in execution order:
- Collision: handle physics (what to do when a movement has been requested, how to handle collisions, gravity ...)
- Network: for every object, simply synchronize every added components over network.
- Logic: Herbivorous, Eatable, Vegetation (will probably change name over time): some temporary hard-coded logic
All out-going messages are handled asynchronously: throw in the channel then it will be sent to the client.
- Process incoming client packets (synchronously)
- Update each system (by their order of priority)
- Compute physics and notify of new state
- All observers update their local state accordingly
See issues, feel free to drop any things
