Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would love to add an AI component to play with bots - is it possible? #1

Open
leethobbit opened this issue Apr 12, 2020 · 1 comment

Comments

@leethobbit
Copy link

Hi,

First of all, thank you so much for the huge amount of GB information shared here! Secondly, I am only a little experienced in RE and development. I managed to bypass encryption and create a login server emulator for Path of Exile but I'm still quite fresh. Do you have any opinions on how hard it would be to add a simple AI system to the game so you could play solo against some bots?

@jglim
Copy link
Owner

jglim commented Apr 13, 2020

Hi!

It might be an uphill task, though not impossible.

Some background..
The gameserver mostly acts as a directory service, to set up peer-to-peer networks between individual game clients. When game clients enter a room, the gameserver announces the network details of other game client peers. From here on, the game clients mostly communicate and manage the gameplay themselves, with the room keybearer as the authority.

Communications are directly between clients, typically over UDP. If there are issues with UDP, the clients will switch over to TCP, using the gameserver as a relay (via tunnel 45XX packets).

There is an entire set of P2P commands that are managed purely between clients
(000X, 400X, 8XXX, CXXX, FXXX). These manage functions like in-game chat, turn management, animations, movements, firing shots, respawns, drops etc. , which the gameserver does not handle at all)

Bot emulation
With the above context, if you intend to emulate a "player" as a bot, you will also need to emulate the entire P2P section. P2P uses a different encryption method, packet layout, checksum and sequence. I believe that getting a emulated bot to "exist" in a game (chat, move around, pass turn) is very doable.

The harder part would be getting the bot to shoot; in my limited understanding, when a shot is fired, the client sends (among other things):

  1. Shot origin (x/y)
  2. Shot type (1/2 or SS)
  3. Absolute firing angle
  4. Firing power
  5. Array of explosion points

To find the array of explosion points, you will need to first develop the "perfect" aimbot to find where the projectile hits the land/player. Gunbound clients synchronize their map states (e.g. which regions are destroyed) by subtracting the explosion points from the map.

If there are discrepancies with the trajectory calculation, your bot's map and the player's actual map will appear different and open up another can of issues.


I hope this comment will not discourage you, rather I hope it shows you where the potential obstacles are. Perhaps a start would be to develop an aimbot, which should also be quite a gratifying experience (please use it responsibly!). Thanks for your interest in Gunbound and this project :^)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants