GithubHelp home page GithubHelp logo

923132714 / screepsscript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lokisharp/screepsscript

0.0 0.0 0.0 1.4 MB

抄 LokiSharp 的 Screeps 半自动 AI 项目

License: The Unlicense

TypeScript 100.00%

screepsscript's People

Contributors

923132714 avatar lokisharp avatar

Watchers

 avatar

screepsscript's Issues

新房规划完成后不建设

规划后未发布建筑任务,看了下代码,发现规划会发布延迟任务,memory中有一个延迟任务,但是延迟任务并未生效。

优化 蜜汁寻路

现在有个场景 W29N56到W30N50 正常思维应该出门左拐走过道,但是现在爬就是要另辟蹊径,走到W31N55,然后走对角线 越走越远
与其如此,我觉得不如优先走过道。

不 spawn manager|worker 问题解决

现象: 内存中数量大于1,spawnList为空 manager 0 或 worker 0 不会再次发布
原因: 内存中的数量并不符合实际

问题位置: src\modules\room\spawn\CreepRelease.ts
image

是否可以定期扫描现状以解决问题?或者每次都从0开始发布,已存在的就不添加到spawnList中?

processor 一直 取出资源

processor 切换不同资源类型任务时会拿着上一个任务的资源导致没有空间存放新的资源,导致卡死。

target 阶段 transfer 出现异常,错误码 -12 creep.callDefender is not a function

【E12N27 E12N27 remoteHarvester0】 target 阶段 transfer 出现异常,错误码 -12
[下午10:13:10][shardSeason]TypeError: creep.callDefender is not a function
    at Object.source  (../src/role/remote/remoteHarvester.ts:76:12)
    at CreepExtension.onWork  (../src/mount/CreepExtension/CreepExtension.ts:84:44)
    at App.errorMapper [as _catcher]  (../src/utils/global/ErrorMapper.ts:82:4)
    at App.doWithCatcher  (../src/modules/framework/index.ts:205:9)
    at allItem.forEach.item  (../src/modules/framework/index.ts:191:35)
    at App.do  (../src/modules/framework/index.ts:191:14)
    at App.run  (../src/modules/framework/index.ts:143:12)
    at Object.loop  (../src/main.ts:44:6)

代码中没有 callDefender 这个方法的实现

ConsoleHelper 未更新

  • roomHelper
  • spawnerHelper
  • spawner.releaseHelper
  • controllerHelper
  • factoryHelper
  • terminalHelper
  • observerHelper
  • powerSpawnerHelper

ypeError: Cannot read property 'lookFor' of undefined

:01][shard2]TypeError: Cannot read property 'lookFor' of undefined
at Function.goToInner (../src/modules/move/Move.ts:145:9)
at Function.goTo (../src/modules/move/Move.ts:196:24)
at CreepExtension.goTo (../src/mount/CreepExtension/CreepExtension.ts:103:16)
at Object.target (../src/role/war/rangedAttacker.ts:29:12)
at CreepExtension.onWork (../src/mount/CreepExtension/CreepExtension.ts:82:44)
at App.errorMapper [as _catcher] (../src/utils/global/ErrorMapper.ts:82:4)
at App.doWithCatcher (../src/modules/framework/index.ts:205:9)
at allItem.forEach.item (../src/modules/framework/index.ts:191:35)
at App.do (../src/modules/framework/index.ts:191:14)

harvester 不挖矿四处遛弯

查看内存状态 prepare为false
看代码发现harvester link状态 prepare 必须到两点之间的唯一位置,如果走不到就不结束,要求过于严格,实际预期只是原地挖矿能放到sourceLink即可。
又看了下后续的getenergy 和transfer 方法中都有移动,即时第一次挖完矿要移动到link 第二次应该就能走到正确位置了,所以干脆prepare就不要求移动到准确位置。

]TypeError: Cannot use 'in' operator to search for 'level' in undefined

大号从去年代码更新到最新的发生问题

[上午10:17:33][shard3]TypeError: Cannot use 'in' operator to search for 'level' in undefined
    at FactoryHelp.handleInsufficientResource  (../src/mount/StructureExtension/FactoryExtension/FactoryExtension.ts:132:13)
    at FactoryHelp.getResource  (../src/mount/StructureExtension/FactoryExtension/FactoryExtension.ts:223:21)
    at FactoryHelp.runFactory  (../src/mount/StructureExtension/FactoryExtension/FactoryExtension.ts:46:13)
    at FactoryHelp.onWork  (../src/mount/StructureExtension/FactoryExtension/FactoryExtension.ts:25:13)
    at App.errorMapper [as _catcher]  (../src/utils/global/ErrorMapper.ts:82:4)
    at App.doWithCatcher  (../src/modules/framework/index.ts:205:9)
    at allItem.forEach.item  (../src/modules/framework/index.ts:195:65)
    at App.do  (../src/modules/framework/index.ts:195:14)
    at App.run  (../src/modules/framework/index.ts:142:12)
[上午10:17:36][shard3]TypeError: this.memory.find is not a function
    at RoomPowerController.hasTask  (../src/modules/room/power/controller.ts:174:25)
    at RoomPowerController.addTask  (../src/modules/room/power/controller.ts:40:16)
    at RoomSpawnController.runSpawn  (../src/modules/room/spawn/index.ts:125:26)
    at SpawnExtension.onWork  (../src/mount/StructureExtension/SpawnExtension/SpawnExtension.ts:9:22)
    at App.errorMapper [as _catcher]  (../src/utils/global/ErrorMapper.ts:82:4)
    at App.doWithCatcher  (../src/modules/framework/index.ts:205:9)
    at allItem.forEach.item  (../src/modules/framework/index.ts:195:65)
    at App.do  (../src/modules/framework/index.ts:195:14)
    at App.run  (../src/modules/framework/index.ts:142:12)

请求优化 蜜汁寻路

现在有个场景 W29N56到W30N50 正常思维应该出门左拐走过道,但是现在爬就是要另辟蹊径,走到W31N55,然后走对角线 越走越远
与其如此,我觉得不如优先走过道。
#23

新claim房问题

  1. remoteUpgrader remoteBuilder 一直生成 何时结束?
  2. 新房worker太少
  3. worker自动调整总是下降

unit 数量调整异常

吉尔。。。

[下午10:04:06][shardSeason]【E11N29】 调整 manager 单位数量 [修正] -256 [上/下限] 5/1[修正后数量] -511
[下午10:04:06][shardSeason]【E11N29】 调整 worker 单位数量 [修正] -256 [上/下限] 10/1[修正后数量] -511
[下午10:04:06][shardSeason]【E12N28】 调整 manager 单位数量 [修正] -4096 [上/下限] 5/1[修正后数量] -8191
[下午10:04:06][shardSeason]【E12N28】 调整 worker 单位数量 [修正] -4096 [上/下限] 10/1[修正后数量] -8191
[下午10:04:47][shardSeason]【E11N29】 调整 manager 单位数量 [修正] -512 [上/下限] 5/1[修正后数量] -1023
[下午10:04:47][shardSeason]【E11N29】 调整 worker 单位数量 [修正] -512 [上/下限] 10/1[修正后数量] -1023
[下午10:04:47][shardSeason]【E12N28】 调整 manager 单位数量 [修正] -8192 [上/下限] 5/1[修正后数量] -16383
[下午10:04:47][shardSeason]【E12N28】 调整 worker 单位数量 [修正] -8192 [上/下限] 10/1[修正后数量] -16383

ErrorMapper -> sourceMappedStackTrace -> outStack SyntaxError: Unexpected end of JSON input

【global】 重新挂载拓展
[下午6:01:05][shardSeason]ErrorMapper -> sourceMappedStackTrace -> outStack SyntaxError: Unexpected end of JSON input
[shardSeason]SyntaxError: Unexpected end of JSON input
    at initDelayTasks  (../src/modules/delayQueue/index.ts:78:22)
    at App.errorMapper [as _catcher]  (../src/utils/global/ErrorMapper.ts:82:4)
    at App.execLifecycleCallback  (../src/modules/framework/index.ts:173:11)
    at App.onGlobalReset  (../src/modules/framework/index.ts:156:9)
    at App.run  (../src/modules/framework/index.ts:136:37)
    at Object.loop  (../src/main.ts:40:6)

Cannot read property 'x' of undefined

[下午7:29:43][shard3]TypeError: Cannot read property 'x' of undefined
    at RoomHelp.serializePos  (../src/mount/RoomExtension/RoomExtension.ts:34:19)
    at Function.findPath  (../src/modules/move/Move.ts:240:73)
    at Function.goToInner  (../src/modules/move/Move.ts:95:33)
    at Function.goTo  (../src/modules/move/Move.ts:196:24)
    at CreepExtension.goTo  (../src/mount/CreepExtension/CreepExtension.ts:104:16)
    at Object.inPlace  (../src/utils/creep/inPlaceBase.ts:13:12)
    at CreepExtension.onWork  (../src/mount/CreepExtension/CreepExtension.ts:68:65)
    at App.errorMapper [as _catcher]  (../src/utils/global/ErrorMapper.ts:82:4)
    at App.doWithCatcher  (../src/modules/framework/index.ts:205:9)
    at allItem.forEach.item  (../src/modules/framework/index.ts:191:35)

重新挂载时会报错

[上午11:34:07][shard3]ErrorMapper -> sourceMappedStackTrace -> outStack TypeError: Cannot read property 'x' of undefined
[上午11:34:07][shard3]TypeError: Cannot read property 'x' of undefined
    at JSON.parse.map  (../src/modules/ConstructionController/index.ts:55:40)
    at initConstructionController  (../src/modules/ConstructionController/index.ts:52:61)
    at App.errorMapper [as _catcher]  (../src/utils/global/ErrorMapper.ts:82:4)
    at App.execLifecycleCallback  (../src/modules/framework/index.ts:173:11)
    at App.onGlobalReset  (../src/modules/framework/index.ts:156:9)
    at App.run  (../src/modules/framework/index.ts:136:37)
    at Object.loop  (../src/main.ts:44:6)

Cannot destructure property `MIN` of 'undefined' or 'null'.

执行 Game.rooms["W23N51"].spawner.release.changeBaseUnit("Worker",3) 报错

TypeError: Cannot destructure property `MIN` of 'undefined' or 'null'.
    at RoomCreepReleaseController.changeBaseUnit (main:13953:111)
    at eval (eval at <anonymous> (_console1620006039826_0:1:46), <anonymous>:1:38)
    at _console1620006039826_0:1:46
    at _console1620006039826_0:1:60
    at Object.exports.evalCode (<runtime>:15811:71)
    at Object.exports.run (<runtime>:46479:41)

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.