Giter VIP home page Giter VIP logo

Comments (3)

serprex avatar serprex commented on June 2, 2024

Forum thread started on animations

On the general note, Discord chat is quite active for guidance

from openetg.

serprex avatar serprex commented on June 2, 2024

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.

serprex avatar serprex commented on June 2, 2024

Immutable merged, so we're now using react-motion for moving instances around field

from openetg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.