Comments (3)
Forum thread started on animations
On the general note, Discord chat is quite active for guidance
from openetg.
So started looking into this, & it's pushing me in the direction that the engine needs to be moved towards a full blown ECS. So let's hijack this thread & define what I mean by that
Currently AI bottleneck is primarily cloning game state. With an immutable game state cloning becomes free. Except the other way of looking at it is that all mutations incur the cost of cloning, so by that I'm really talking about sharing state between clones, ie copy-on-write
A feature I'd like to implement is game replays, there's the wire protocol that could be encoded to base64, but I'd like to support rewinding when viewing a replay (without having to compute backwards by replaying from start). This would all be simpler with an immutable game object
The wrench in the gears is that whenever an instance is updated their references need to be updated. Unfortunately this ends up meaning changing everything because there's a lot of back references (creatures point at player, player points at game, game points at players, player points at creatures)
Currently instances types are determined by which zone they're in. Think more like MtG having a battlefield & a graveyard, as opposed to creatures / enchantments. This lines up literally with the game ui's field layout
We don't currently generate an integer id for instances. That'd be the first step. This id could then be used as a key by the UI in order to animate motions between zones. But React only respects keys for children ordering, not moving around the tree. So we'll want to flatten the UI tree to one big list of everything on the field
For now we could keep the existing game-object structure (just add ids) & then have zone/index/etc be passed to ThingInst
. This all comes back to an idea I've been starting to have: Constructors are an antipattern. new Thing
should be game.mkThing
in order to manage ids properly (yeah, one could get around this by adding a game
context parameter to the constructor, but what a hack)
from openetg.
Immutable merged, so we're now using react-motion for moving instances around field
from openetg.
Related Issues (20)
- Skillless creatures display "0:undefined"
- [ignore this]
- etg.js line 462 "cr is undefined" (should be this)
- etg.js line 499 "x" should be "dmg"
- title screen pillars HOT 1
- Installation Tutorial in the Readme Needs an Update HOT 4
- Status constructor is not loading
- Site is down HOT 2
- More stat analysis
- PvE events HOT 1
- User bling: fields
- UI: ThingInst improvements
- UI: bring back some keyboard shortcuts HOT 1
- $$: Colosseum streaks
- etgutil.js should handle overflow HOT 1
- Request: Contribution guide + Roadmap HOT 3
- Suggestion: swap to Roboto HOT 1
- Dark Spirit Quest 5 is not accessible, typo in dependency makes it rely upon itself HOT 1
- Canvas HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openetg.