Giter Club home page Giter Club logo

Comments (6)

SomeTroglodyte avatar SomeTroglodyte commented on May 10, 2024

Opening a can of worms..

v1: Show blocking popup with our rotationg arrow animation and a cancel button while it does its job
v2: Break it into small, fast (<250ms) steps, drive from WorldScreen.update - if there's autoplay work to do, launch coroutine that does a step and finishes with worldScreen.shouldUpdate = true, possibly some launchOnGLThread stuff to show where something happened

from unciv.

yairm210 avatar yairm210 commented on May 10, 2024

Let's talk about next turn, since it had the same problem

How does next turn work?

  • clone game state
  • change worldscreen to be "read only" state - players can explore the current world but cannot take action
  • process next turn for clone in another thread
  • when other thread finishes, replace the world screen

Sounds like you want something similar - only in your case you can replace the world screen on every turn, but keep it "read only"

from unciv.

yairm210 avatar yairm210 commented on May 10, 2024

That is to say - add a onTurnComplete callback parameter to next turn
NextTurn should not be aware of UI directly, it just clones the game state on every turn end and calls the function - which can be on another thread
The latency cost of cloning the game state every turn is the major cost here

from unciv.

tuvus avatar tuvus commented on May 10, 2024

The way we made it "read only" in the past was by changing the viewing civ... Could we set the viewing civ to none and set the selected civ to the original civ like in Spectator?
The spectator needs to view each civ as if they were them without being able to modify them. We might be able to reuse this to apply the locking mechanism.

from unciv.

yairm210 avatar yairm210 commented on May 10, 2024

No, we just set isPlayersTurn to false

from unciv.

tuvus avatar tuvus commented on May 10, 2024

Why did I not realize this? AutoPlay already does that in order to lock the screen.

from unciv.

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.