Comments (6)
@dgant @Bytekeeper
thanks. i solved
code
from jbwapi.
The most likely reason that this would happen is issuing a train command on consecutive frames. I took a quick peek at your code:
if (commandCenter.type == UnitType.Terran_Command_Center
&& commandCenter.canTrain()
&& commandCenter.trainingQueue.size <= 0
&& self.minerals() >= 50
) {
commandCenter.train(UnitType.Terran_SCV)
}
This can cause the command center to queue SCVs even when you don't expect it. The reason is because of latency.
Suppose you're running your bot in single player, which has 2 frames of latency. That means that when you tell your bot to train an SCV, the game does not follow the command until 2 frames later:
- Frame 100:
trainingQueue.size ==0
so you tell Command Center to train an SCV - Frame 101:
trainingQueue.size ==0
so you tell Command Center to train an SCV - Frame 102: The Command Center starts training an SCV.
trainingQueue.size == 1
- Frame 103: The Command Center starts training an SCV.
trainingQueue.size == 2
Here are two ways to avoid this situation:
- Enable latency compensation. This causes (J)BWAPI to present a fictional game state that looks like the game would if there were no latency
- Don't issue commands to units you've commanded too recently, perhaps by using
unit.getLastCommandFrame()
But if you've encountered an issue not described here, please let us know how to reproduce it.
from jbwapi.
@dgant
Hello. Thank you for your reply. I read your reply carefully.
- reply
- how can i settings "latency frames = 6, turn size = 2", Do I have to modify it within the code?
Or do I have to modify it within BWAPI?
- reply
If you use this command, you cannot request the following command
from jbwapi.
My English is not good enough.
Thank you for your understanding.
from jbwapi.
I solved it this way. Is this right?
this code
if (isTwiceReq) { isTwiceReq = false return } else { isTwiceReq = true }
from jbwapi.
@lavinoys You could join our SSCAIT Discord. You will find a link at the bottom of the "readme" of jbwapi here, in the documentation section. A lot of bot authors are hanging around there and might be able to help. (Ok most likely @dgant will answer there as well :) )
from jbwapi.
Related Issues (20)
- Renders wrong colors HOT 2
- Game::drawTextScreen(): StringIndexOutOfBoundsException HOT 5
- Crashes in init on playing a replay HOT 1
- Unique identifier for units HOT 5
- Training a unit when the queue is full throws Index out of Bounds HOT 5
- [Java9+] sun.nio.ch not visible HOT 2
- (Probably) Leaking memory in WrappedBuffer::Memory allocation HOT 1
- Color should be a flyweight object HOT 1
- Unit.getInterceptors (and maybe getLarva) runs slowly HOT 3
- Game can't issue grouped commands
- Give client bots a handler for pipe disconnection HOT 1
- Update StaticBuilding methods to public HOT 6
- Test all major platforms
- CI Improvements
- Documentation for drawTextMap lacking in regards to adding color
- Investigate BWEM issue with "New Popular Fastest Map"
- Update badges in README.md
- canBuildHere mineral vs depot check is not correct
- Add LastError to Game
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jbwapi.