bencbartlett / Overmind

AI for Screeps, a multiplayer programming strategy game
MIT License
545 stars 155 forks source link

Move visualization CPU bucket checks to unobfuscated code #181

Closed Moredread closed 3 years ago

Moredread commented 4 years ago

Feature request summary

Move bucket limit checks to unobfuscated code, esp. for visualization.

Motivation:

I'd like to run Game.cpu.generatePixel when the bucket is full (and nothing interesting is happening). This causes the visualization to stop though with e.g.

CPU bucket is too low (5042) - skip rendering visuals.

The limit check seems to be located in obfuscated code though, so I it can't be (easily) changed. I don't think it is essential for the assimilator feature, so it ideally be changeable from user code.

Description:

Move limit checks (esp. for visualization) to main.js.

Related issues:

xyzzy529 commented 4 years ago

+1 for this.

Also, the unobfuscated code should have a Memory variable to turn it On/Off, so that when the Browser is not visible, it can be turned off. As well as just manually turn it off when Player wants to save the CPU.

Is there some way to automate that? The browser code would need to automatically turn it on when the browser is open, then the server side turn it off after ~10 turns of not being reset by the Browser.

Where is the Obfuscated code? And why is it Obfuscated?

YukkuriC commented 3 years ago

Try to decorate the method _Overmind.visuals or Visualizer.visualsand provide a fake Game.cpu.bucket amount