Giter Club home page Giter Club logo

lobby-bots's Introduction

 0 A.D. Introductory Information
=================================

0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
real-time strategy game of ancient warfare.

This is currently an incomplete, under-development version of the game.
We're always interested in getting more people involved, to help bring the game
towards completion and to share the interesting experience of developing a
project of this scope.

There are several ways to contact us and find more information:

  Web site: http://play0ad.com/

  Forums: http://www.wildfiregames.com/forum/

  Trac (development info, bug tracker): http://trac.wildfiregames.com/

  IRC: #0ad on irc.quakenet.org


---------------------------------------
Running precompiled binaries on Windows
---------------------------------------

Open the "binaries\system" folder.

To launch the game: Run pyrogenesis.exe

To launch the map editor: Run Atlas.bat or "pyrogenesis.exe -editor"


-----------------------------------
Compiling the game from source code
-----------------------------------

The instructions for compiling the game on Windows, Linux and OS X are at
http://trac.wildfiregames.com/wiki/BuildInstructions


------------------
Reporting problems
------------------

Bugs should be reported on Trac. For information on reporting problems
and finding logs, see http://trac.wildfiregames.com/wiki/ReportingErrors


------------------
 Contributing Code
------------------

If you want to help out programming for the game, have a look at
https://trac.wildfiregames.com/wiki/GettingStartedProgrammers
or contact us on #0ad-dev on irc.quakenet.org


--------------------
Contributing Artwork
--------------------

If you want to make artwork for the game, have a look at
https://trac.wildfiregames.com/#Forartists:
or visit the forums http://www.wildfiregames.com/forum


-----------
Translating
-----------

You can help translating the game at https://www.transifex.com/projects/p/0ad
for more information, see https://trac.wildfiregames.com/wiki/Localization

lobby-bots's People

Contributors

dunedan avatar rossenburgg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lobby-bots's Issues

Broad Approach To Enable Users To Join With More Than One Instance At The Same Time And Host Multiple Games

In order to allow users to join with more than one instance and host multiple games, we need to modify the code to support multiple sessions for each user. This could be achieved in several ways, depending on the specific requirements and constraints. One approach could be to use a unique identifier for each session, and store information about each session separately in the database. For example, you could add a session_id field to the Player and PlayerInfo tables in the database, and use that field to distinguish between different sessions for the same user. We also need to modify the code that processes game results to associate each game result with the correct session. For example, you could include the session_id in the game result messages, and use that to look up the correct session in the database when processing the messages.
Additionally, you would need to update the ProfileXmppPlugin class to handle requests for multiple sessions. Currently, this class only provides information about the overall rating and statistics for a player, without considering multiple sessions. You could modify it to accept a session_id parameter in the get_profile method, and use that to retrieve the correct session data from the database.
To use the code, users would need to specify a unique session identifier when they connect with each instance. This could be done using a command-line argument, or by providing a session ID in the authentication credentials. The code would then use the session ID to distinguish between the different instances and sessions, and process game results and other messages accordingly.
The users would also be able to retrieve their profiles and ratings for each individual session using the ProfileXmppPlugin class. This would provide them with more detailed and accurate information about their performance and progress in each session, and allow them to compare their results across different sessions.

Overall, implementing support for multiple sessions in the code would provide a more flexible and engaging experience for the users, and allow them to participate in more games and activities within the game. It would also allow the code to handle a larger number of users and games simultaneously, and provide more accurate and detailed information about the players and their ratings.
Once its successfully implemented, some potential ideas for additional features :

  • Adding support for different game modes and settings. Currently, the code assumes that all games are played using the same rules and settings. However, you could modify the code to support different game modes and settings, and allow users to specify the mode and settings when they report game results. This would provide more flexibility and customization options for the users, and allow them to play games with different rules and challenges.
  • Improving the rating calculation algorithm. The code currently uses a simple Elo rating system to calculate the ratings of the players. However, we could experiment with different algorithms and approaches to see if you can find a more accurate and fair way to calculate the ratings. For example, we could try using a Bayesian rating system, which takes into account the uncertainty and variability of the ratings, or a TrueSkill system, which uses a more sophisticated model to calculate the ratings.
  • Adding support for team games. The code currently only supports games between two players. However, you could modify the code to support team games, where multiple players play on the same side (rated team games - the long term requested feature isnt impossible to implement) . This would require some additional changes to the data model and the rating calculation algorithm, but it would allow the code to handle more complex and diverse game scenarios.
  • Adding support for real-time games. Currently, the code only processes game results after they have been completed.
  • Adding support for different leaderboards. The code currently only maintains a single global leaderboard, but we could modify it to support different leaderboards for different groups of players or different game types. This would allow the users to compare their ratings with other players in their own groups or categories, and provide more detailed and relevant information about their performance.

To use a Bayesian rating system , we would need to implement a new rating calculation algorithm that uses Bayesian statistics to estimate the ratings of the players. This would require a significant amount of changes to the existing code, as the current algorithm uses a simple Elo rating system.

We can do something like ;

`import math

from scipy.stats import beta

# Define some constants for the prior distribution
PRIOR_A = 2
PRIOR_B = 2

def get_rating_adjustment(player1_rating, player2_rating, player1_score, player2_scor
```e):

Calculate the rating adjustment for two players based on the results of a game.

This function uses a Bayesian rating system to calculate the rating adjustments for
the two players based on the score of the game. It estimates the probability that
each player would win the game, and uses that probability to adjust their ratings.

Arguments:
    player1_rating (int): Current rating of player 1
    player2_rating (int): Current rating of player 2
    player1_score (int): Score of player 1 in the game
    player2_score (int): Score of player 2 in the game

    Returns:
        Tuple containing the rating adjustment for player 1 and player 2


    # Calculate the total number of points in the game
    total_points = player1_score + player2_score

    # Estimate the probability that player 1 would win the game
    # based on their current rating and the scores of the game
    player1_win_prob = beta.cdf(
        player1_rating / (player1_rating + player2-rating),
PRIOR_A + player1_score,
PRIOR_B + player2_score,
)

 _Calculate the expected score for player 1 based on their win probability_
player1_expected_score = player1_win_prob * total_points

_Calculate the rating adjustment for player 1 based on their actual and expected scores_
player1_rating_adjustment = math.sqrt(total_points) * (player1_score - player1_expected_score)

 _Repeat the same process for player 2_
player2_win_prob = beta.cdf(
    player2_rating / (player1_rating + player2_rating),
    PRIOR_A + player2_score,
    PRIOR_B + player1_score,
)

player2_expected_score = player2_win_prob * total_points
player2_rating_adjustment = math.sqrt(total_points) * (player2_score - player2_expected_score)

 Return the rating adjustments for player 1 and player 2
return player1_rating_adjustment, player2_rating_adjustment

I've been working on this for a while now, works better than just fine. This code uses the 'beta.cdf' function from the 'scipy.stats' module to estimate the probability that each player would win the game based on their current ratings and the scores of the game. It then uses this probability to calculate the expected score for each player, and adjusts their ratings based on the difference between their actual and expected scores.
To use this rating calculation algorithm in the code, you would need to replace the existing get_rating_adjustment function with this new function. You would also need to import the beta function from sc

I know in order to make these changes we will need to change a lot in the code. We cannot stay at the same place due to the nature of the code we are currently using. At least there is far better way to broaden and make it much flexible to add more features easily
lemme know what you think @Oceandragon @Dunedan @StanleySweet .

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.