StarCraft | decentralised micromanagement scenario of StarCraft II | Machine Learning library

 by   starry-sky6688 Python Version: Current License: No License

kandi X-RAY | StarCraft Summary

kandi X-RAY | StarCraft Summary

StarCraft is a Python library typically used in Artificial Intelligence, Machine Learning, Deep Learning, Pytorch applications. StarCraft has no bugs, it has no vulnerabilities and it has low support. However StarCraft build file is not available. You can download it from GitHub.

Pytorch implementations of the multi-agent reinforcement learning algorithms, including IQL, QMIX, VDN, COMA, QTRAN(both QTRAN-base and QTRAN-alt), MAVEN, CommNet, DyMA-CL, and G2ANet, which are the state of the art MARL algorithms. In addition, because CommNet and G2ANet need an external training algorithm, we provide Central-V and REINFORCE for them to training, you can also combine them with COMA. We trained these algorithms on SMAC, the decentralised micromanagement scenario of StarCraft II.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              StarCraft has a low active ecosystem.
              It has 447 star(s) with 127 fork(s). There are 11 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 54 have been closed. On average issues are closed in 1 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of StarCraft is current.

            kandi-Quality Quality

              StarCraft has no bugs reported.

            kandi-Security Security

              StarCraft has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              StarCraft does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              StarCraft releases are not available. You will need to build from source code and install.
              StarCraft has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed StarCraft and discovered the below as its top functions. This is intended to give you an instant insight into StarCraft implemented functionality, and help decide if they suit your requirements.
            • Generate an episode .
            • Train the model .
            • Initialize the model .
            • Gets the input tensors for a given batch .
            • Plots the win rate mean .
            • Calculate QTRAN .
            • Get the arguments for the mixer .
            • Top level function for td_da function
            • Run the optimizer .
            • forward computation .
            Get all kandi verified functions for this library.

            StarCraft Key Features

            No Key Features are available at this moment for StarCraft.

            StarCraft Examples and Code Snippets

            No Code Snippets are available at this moment for StarCraft.

            Community Discussions

            QUESTION

            Searching keywords inside the nested arrays
            Asked 2021-Feb-08 at 16:01

            I have an object and its array that contain multiple arrays like below

            ...

            ANSWER

            Answered 2021-Feb-08 at 15:52

            Its 2 level nested array, you can use nested $elemMatch and $eq,

            Source https://stackoverflow.com/questions/66104690

            QUESTION

            Understanding Depth-First Branch and Bound implementation to StarCraft 2
            Asked 2020-Nov-06 at 16:01

            The problem is that I'm finding it difficult to understand how DFBB works, what the parameters and output should be for this case.

            I'm working on creating an AI for the game StarCraft 2 that will handle the build order in the game (for team Terran). I was planning to follow the approach described in the link (see below) which followed a very similar thing that I was going for. To summarize what I'm planning to do:

            A list of different type of buildings that need to be built will be given to me. Buildings cost minerals and gas (this is the currency in the game), some buildings have prerequisites (meaning other buildings need to be built before it's possible to build it) and they take a certain amount of time to build.

            In the article they used Depth-First Branch and Bound to figure out the optimal build order, meaning the fastest way possible to build the buildings in that list. This was their pseudocode:

            Where the state S is represented by S = (current game time, resources available, actions in progress but not completed, worker income data). How S´ is derived is described article and it is done through three functions so that bit I understand.

            As mentioned earlier I'm struggling to understand what the starting status S, goal G, time limit t and bound b should be represented by in the pseudocode that they are describing.

            I only know three things for sure: the list of buildings that needs to be built, what consumables I have at the moment (minerals and gas), resources (that is buildings I already have in the game). This should then be applied to the algorithm somehow, but it is unclear what the input should be to the function. The output should be a list sorted in the right order so if I where to building the buildings in the order they come in then it should all work out and it should be the optimal possible time it can be done in.

            For example should I iterate through the list buildings and run DFBB on every element with the goal then being seeing if the building can be built. But what should the time limit be set too and what does bound mean in this case? Is it simply the cost?

            Please explain how this function should be run on the list in order to find the optimal path of building it. The article is fairly easy to read, but I need some help understanding how it is meant to work and how I can apply it to my problem.

            Link to article: https://ai.dmi.unibas.ch/research/reading_group/churchill-buro-aiide2011.pdf

            ...

            ANSWER

            Answered 2020-Nov-06 at 16:01

            Starting Status S is the initial state at the start of the game. I believe you have 100 minearls and Command center and 12? SCVs, so that's your start.

            The Goal here is the list of building you want to have. The satisfies condition is are all building in goal also in S.

            The time limit is the amount of time you are willing to spend to get the result. If yous set it to 5 seconds it will probably give you a sub-optimal solution, but it will do it in 5 seconds. If the algorithm finishes the search it will return earlier. If you don't care leave it out, but make sure you write solutions to a file in case something happens.

            Bound b is the in-game time limit for building everything. You initially set it to infinite or some obvious value (like 10 minutes?). When you find a solution the b gets updated so every new solution you find MUST be faster (in-game) than the previous one.

            A few notes. Make sure that the possible action (children in step 9) includes doing nothing (wait for more resources) and building an SCV.

            Another thing that might be missing is a correct modelling of SCV movement speed. The units need to move to a place to build something and it also takes time for them to get back to mining.

            Source https://stackoverflow.com/questions/64716652

            QUESTION

            How can I make a rectangle selection tool in python 3?
            Asked 2020-Nov-06 at 14:58

            I'm trying to make a simple game in which the user can select units on the screen using an RTS-style box selection (ex. StarCraft, Warcraft). After digging through a lot of stuff I found on Google and from other people, I'm still not getting how it's done.

            When looking around I found this:

            ...

            ANSWER

            Answered 2020-Nov-06 at 14:58

            A pygame.Rect is created from the top left position and the width and height. The width and height must be positive. You need to find the minimum and maximum x and y coordinates of the 2 points. Write a function that creates the pygame.Rect object from the two points:

            Source https://stackoverflow.com/questions/64716266

            QUESTION

            Slow performance when unpacking bits for a tensor layer in tensorflow
            Asked 2020-Jun-18 at 02:44

            I'm working with data that comes over a WebSocket connection with a starcraft 2 client to obtain image data from a game that is in progress. In some cases, the image data maybe be set with a format of 1 bit per pixel. When this happens I need to "unpack" the bits from each byte in the response (1 byte => 8 bits). This is done in the code below:

            ...

            ANSWER

            Answered 2020-Jun-17 at 11:35

            It looks like tensorflow.js does not have a bitwise AND function, so suspect doing the work within tensorflow.js will require some coding gymnastics...

            One suggestion, though, is to create an array of 256 Uint8Array's of size 8, and pre-populate it with the complete list of 8 byte translations. This greatly reduces the repeated calculations for a byte stream that will likely have repeated values in the range of 0 - 255. Eg, the first entry in the precomputed array represents the unpacking of byte 0, and therefore is a Uint8Array of size 8 populated with 0's, the next entry is another Uint8Array of size 8 populated with 00000001, etc all the way to the entry representing byte 255 with is a Uint8Array of size 8 populated with all 1's.

            Then, when unpacking, simply make use of the typed array .set method to copy the precomputed unpacked representation into the results Uint8Array...

            Hope this helps.

            EDIT Created a number of variants of the unpacking algorithm to test the performance of inline calculations vs memory lookup and was surprised at the results using Chrome. Some of the optimizations of the V8 compiler are non-intuitive...

            The differences in the versions...

            • unpackbits [FAST]: From the original question and this is the bar by which the others variations are compared.
            • unpackbits1 [FAST]: Modified by...
              • Specifying "|0" after every integer.
              • Using the increment unary op ( "++" ) rather adding increments to the offset index of the result array.
              • Replacing the calculation of bit masks with the actual value. (Ie, rather than 1 << 5, the function used 32.)
            • unpackbits1a [FAST]: The same as unpackbits1, except...
              • Kept the calculation of bit masks rather than integer values. (Ie, using 1 << 5 rather than 32, as in the original question.) Counter intuitively, this produces a bit faster result!
            • unpackbits1b [SLOWER]: The same as unpackbits1a, except...
              • The offset is not recomputed every time inside the loop. Ie, offset = 0|0 is initially set, and then thereafter offset is only incremented within the loop. So, offset = ( (8|0) * i ) is no longer calculated for every byte. Counter intuitively, this produces a slower result!
            • unpackbits2 [SLOWEST]: This is the memory lookup option that I recommended above. Counter intuitively, this implies that typed array memory operations are much slower than calculating the results as in unpackbits!
            • unpackbits3 [SLOWER]: This is the memory lookup option that I recommended above, with the following change.
              • Rather than used the the typed array .set method, this version set the eight bytes one-by-one. Counter intuitively, this implies that the typed array .set method is slower (at least for eight bytes) than individually setting the values!
            • unpackbits4 [SLOWER]: This variation of the algorithm was on par with the original, and was a variation of the memory lookup option. But, rather than 256 individual Uint8Array's, this combined all the pre-calculated results into a single Uint8Array of length 256 * 8. And it did not make use of the typed array .set method.
            • unpackbits5 [SLOWER]: Same as unpackbits4, except...
              • Rather than using the unary "++" on the index into the lookup table, it calculated the index for each of the 8 bytes being copied. As expected, calculating the index every time was slower than using the unary "++" operator.

            Here are the tests. BEWARE that this builds an initial array of 10M random bytes, and then runs each unpack algorithm on this same data. On my workstation, the test runs in less than 5 seconds.

            Source https://stackoverflow.com/questions/62333937

            QUESTION

            How to display json data using for loop with flask
            Asked 2019-Jun-28 at 21:59

            I've tried to display JSON data within HTML using flask using {% for bring in company %} ... {% endfor %} loop with no success.However, I had applied JSON into the about.html page using direct application with the data/name as e.g:{{races[0][name]}} and it worked. I don't know what is the problem

            I had even tried to find it and did not find any solution.

            Python/Flask

            ...

            ANSWER

            Answered 2019-Jun-28 at 20:42

            You send the data to the template as races, not company.

            Source https://stackoverflow.com/questions/56812996

            QUESTION

            Starcraft starts with pyhton-sc2 but nothing happens after the loading screen
            Asked 2019-Jun-27 at 13:55

            As a learning exercise I have been trying to build a CNN to play Starcraft. The below code is a sample of what I'm trying to run. However, when the game starts I can see the game window loading the map (which doesn't display the picture) but when it finishes loading the screen closes and nothing happens afterward.

            Has someone experienced anything similar?

            I'm using spyder with python 3.7.3 and sc2 0.11.1 I have followed the instructions on https://github.com/Dentosal/python-sc2 to the letter.

            My system is:/n Window 10 Pro 64bit Intel i7-8700K CPI 6 core (12 logical processors) @ 3.7GHz 32GB RAM NVIDA GeFORCE GTX 1080 GPU C drive 326GB free of 464GB D drive 931 GB

            I can run the game by itself so I don't think this is hardware related.

            ...

            ANSWER

            Answered 2019-Jun-27 at 13:55

            I had the same error, the game's current version is not compactible with the modul. There is a thread about it: https://github.com/Dentosal/python-sc2/issues/283 There is also an instruction how to remove the error, it worked for me, so hope it will help you as well.

            Source https://stackoverflow.com/questions/56611966

            QUESTION

            How do I do a LIKE function referencing another Column?
            Asked 2019-May-08 at 17:30

            So my problem is, I three tables that I'm working with, Table A/Table B/Table C, Table A & Table B both have number mechanisms within them. So lets say Table A is Spend, Table B is Revenue. Table C contains the name of the Video Game along with a secondary name it goes by. What I'm trying to do is be able to have the Video Game name and Video Game Name Secondary both show and add together.

            I've tried to do something like,

            ...

            ANSWER

            Answered 2019-May-08 at 17:30

            Below is for BigQuery Standard SQL

            Source https://stackoverflow.com/questions/56042859

            QUESTION

            sc2 python, AssertionError: Unsupported pixel density
            Asked 2019-Apr-30 at 11:48

            Here is my code that I want to run

            ...

            ANSWER

            Answered 2019-Apr-30 at 11:48

            I have ran into the same problem as yourself. I commented out the following line:

            assert self.bits_per_pixel % 8 == 0, "Unsupported pixel density"

            within the pixel_map.py.

            The map now loads correctly.

            Source https://stackoverflow.com/questions/55836416

            QUESTION

            Shortest path in games (StarCraft example)
            Asked 2018-Dec-06 at 21:04

            In games like StarCraft you can have up to 200 units (for player) in a map.

            There are small but also big maps.

            When you for example grab 50 units and tell them to go to the other side of the map some algorithm kicks in and they find path through the obsticles (river, hills, rocks and other).

            My question is do you know how the game doesnt slow down because you have 50 paths to calculate. In the meantime other things happens like drones collecting minerals buildinds are made and so on. And if the map is big it should be harder and slower.

            So even if the algorithm is good it will take some time for 100 units.

            Do you know how this works maybe the algorithm is similar to other games.

            As i said when you tell units to move you did not see any delay for calculating the path - they start to run to the destination immediately.

            The question is how they make the units go through the shortest path but fast.

            There is no delay in most of the games (StarCraft, WarCraft and so on)

            Thank you.

            ...

            ANSWER

            Answered 2018-Dec-06 at 11:10

            I guess it just needs to subdivide the problem and memoize the results. Example: 2 units. Unit1 goes from A to C but the shortest path goes through B. Unit2 goes from B to C. B to C only needs to be calculated once and can be reused by both. See https://en.m.wikipedia.org/wiki/Dynamic_programming

            In this wikipedia page it specifically mentions dijkstra's algorithm for path finding that works by subdividing the problem and store results to be reused.

            There is also a pretty good looking alternative here http://www.gamasutra.com/blogs/TylerGlaiel/20121007/178966/Some_experiments_in_pathfinding__AI.php where it takes into account dynamic stuff like obstacles and still performs very well (video demo: https://www.youtube.com/watch?v=z4W1zSOLr_g).

            Another interesting technique, does a completely different approach: Calculate the shortest path from the goal position to every point on the map: see the full explanation here: https://www.youtube.com/watch?v=Bspb9g9nTto - although this one is inefficient for large maps

            Source https://stackoverflow.com/questions/52752976

            QUESTION

            "Failed to connect to the SC2 websocket. Is it up?"
            Asked 2018-Nov-30 at 03:02

            I am trying to run the Deepmind Environment for Starcraft II, following this tutorial

            After running:

            ...

            ANSWER

            Answered 2018-Nov-30 at 03:02

            This might be obvious for some, but it took me 25 minutes, so I'll put it here.

            The SC2 websocket is up once you completely installed and started the game.

            Not only the battlenet interface.

            Source https://stackoverflow.com/questions/51224752

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install StarCraft

            Directly run the main.py, then the algorithm will start training on map 3m. Note CommNet and G2ANet need an external training algorithm, so the name of them are like reinforce+commnet or central_v+g2anet, all the algorithms we provide are written in ./common/arguments.py. If you just want to use this project for demonstration, you should set --evaluate=True --load_model=True. The running of DyMA-CL is independent from others because it requires different environment settings, so we put it on another project. For more details, please read DyMA-CL documentation.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/starry-sky6688/StarCraft.git

          • CLI

            gh repo clone starry-sky6688/StarCraft

          • sshUrl

            git@github.com:starry-sky6688/StarCraft.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link