Giter Club home page Giter Club logo

sergeants's People

Contributors

greenjoe avatar nosslin579 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sergeants's Issues

Ability to create a GameState implementation based on a replay file and turn number

There are two replay formats, a readable json - .gioreplay and a compressed .gior

There is a utility written by authors to convert compressed one to a non-compressed one
https://github.com/vzhou842/generals.io-Replay-Utils/blob/master/converter.js

There is also a description of fields in .gioreplay here:
http://dev.generals.io/replays

based on that it should be possible to create a utility to create a GameState implementation for a given turn of a given replay. That should make it easy to debug bots on particular game situations seen in replays.

Replays show the whole map - to make things realistic it should be made possible to pass a player name to the function and the function should then take care to find out which fields were visible by the given player (extended (8 - including diagonals, not 4) neighbours of fields owned by team of given player).

Custom game force start

When setting up the custom game, QueueConfiguration.customGame(true, "BotName") does that bot forces start, but after some changes (fe. map height/with, cities/mountains density) it has to "click" the force start button again. Is there a possibility to force bot to always force the start?

Support attack_index in GameState

There is an attack_index field in game updates coming from server. Generalsio team on reddit said that the field is not needed for bots ( https://www.reddit.com/r/generalsio/comments/5rgmk1/version_130_launch_of_the_official_bot_server_and/ddmnbdi/ ) and the field is also not in the official API documentation.

I've seen on Discord that people are using attackIndex to check if bot's move queue is empty which otherwise is not possible, so it might be a good idea to have attackIndex copied into GameState so that bots can use it if needed.

How to Install?

Sorry, I'm kind of a noob to GitHub and coding. How exactly can I install this so I can use it in-game on the real generals.io?

Thank you!

Array index out of bounds when map_diff contains only single number, lower than number of fields in the map

Not sure why generals socket is sending such a strange update

First update

"map_diff":[0,1146,22,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0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4,-3,-3,-3,-4,-4,-3,-3,-3,-3,-3,
-4,-4,-3,-4,-3,-3,-3,-3,-4,-3,-4,-3,-4,-3,-3,-3,-3,-4,-3,-3,-3,-3,-4,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-4,-4,-4,-3,-4,-4,-3,-3,-3,-3,-4,-3,-4,-4,-3,-3,-3,-3,-3,-3,-4,-4,-4,-4,-3,-3,-3,-4,-3,-3,-3,-3,-3,-3,-3,-3,-4,-3,-3,-4,-3,-3,-4,-4,-4,-4,-3,-3,-3,-3,-3,-4,-4,-3,-3,-3,-3,-
3,-3,-3,-3,-3,-3,-3,-4,-4,-3,-4,-3,-4,-3,-4,-3,-3,-3,-3,-3,-3,-4,-4,-3,-4,-4,-3,-3,-3,-3,-3,-3,-3,-4,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-4,-3,-3,-3,-3,-3,-4,-3,-3,-4,-3,-3,-3,-3,-3,-3,-3,-4,-3,-3,-4,-3,-4,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-4,-4,-4,-3,-3,-3
,-3,-3,-4,-4,-3,-3,-3,-3]

Second update:

"map_diff":[1014]

Map array contains 1146 items and the second update says that 1014 should stay the same but it says nothing about the rest, therefore currently the framework just truncates the array, which is obviously bad as the size of this array should stay the same through the whole game.

Simulator: bot gets two updates with turn 0

Probably due to
Arrays.stream(players).forEach(this::sendInitialGameUpdate);
method
onGameStateUpdate
is called two times with GameState for which getTurn() returns 0.
It should happen only once.

Great framework, what is the plan for the future?

I played around with your framework and it looks great. Do you have any plans for more features? I was thinking of a mock server that would take two or more pl.joegreen.sergeants.framework.Bot and run a game without delays. That means I cloud ran a lot of games very fast. This would be handy if using evolutionary programming.

//Christian

Simulated server

I have done some work on the simulated server and it is not done but it is possible too run a game with two bots and you can view a replay, so it is ready for an initial commit.
Major parts that are not implemented yet are:

  • random map generator
  • client fogging
  • sending GameStartApiResponse.java
  • sending GameLostApiResponse.java

And then there is minor issues.

I want your opinion on where to commit. To a separate package, different module or its own repo?

Support playing multiple games at the same time with same userId

While it is not possible to join queue multiple times with the same userId, it is possible to be playing multiple games.
It has to be done on different socket connections so that the messages are not mixed.

As soon as one game is started, another socket instance can join a queue to start a new game.

User should be able to specify how many games can be played at the same time.

Add pathfinding algorithms

Dijkstra (from or to chosen field) and maybe A* (between chosen fields), allow user to specify cost of different fields in path finding and whether it works only on VisibleField instances or also on non visible fields.

Algorithm should probably also be wise enough to check conquerability of the path if user wants to (it should add bot armies count and subtract enemy armies count and check that it doesn't drop below zero on the path).

Remember interval between turns is 500ms to it has to be quite efficient (<100ms?) even on larger maps such as 30x30.

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.