RosaryMala / armok-vision

A 3d realtime visualizer for Dwarf Fortress
MIT License
319 stars 27 forks source link

AV causes the Dwarf Fortress window to respond extremely slowly #60

Open alexchandel opened 6 years ago

alexchandel commented 6 years ago

Before starting AV, the Dwarf Fortress window responds immediately to keypresses (e.g. panning with arrow keys). But as soon as AV connects, Dwarf Fortress lags considerably, and now takes multiple seconds to respond to any keypress.

Is this related to the amount of communication between AV and DFHack? Does AV query the entire map every second? Is there a change API that AV could use, so it's only notified when the map geometry changes?

RosaryMala commented 6 years ago

There's a lot of things AV reads from DF, and most of them to take a small amount of time, but it adds up.

This is something I'm currently working on fixing, by splitting up the timers on things so things can update at different rates. That way things that need to update quickly, like where people are, can, while not getting bogged down by things that are slower, like map updates.

alexchandel commented 6 years ago

Is there an API in RemoteFortressReader that would allow a client to receive change notifications, rather than polling the map/entity locations?

RosaryMala commented 6 years ago

No.

Such a thing would be great, but would require two things:

  1. A complete re-write of RemoteFortressReader
  2. Somebody with much better knowledge of network programming than me.
alexchandel commented 6 years ago

No worries. Cutting map updates to once per second will probably relieve most of the DF window's latency.

alexchandel commented 6 years ago

With the new timers, does this mean the mesh is updated/regenerated only 2x per second now?

alexchandel commented 6 years ago

Hey @JapaMala, did you see JapaMala/VoxelFortress#2?

RosaryMala commented 6 years ago

There's better ways to contact me than issues on other projects.