Author Topic: Implementation details behind paragon chat  (Read 3589 times)

Jeff Anderson

  • Boss
  • ****
  • Posts: 121
Implementation details behind paragon chat
« on: August 22, 2015, 02:40:18 PM »
Hi everyone,

I'm relatively new to the forum and and all the great work being done by the folks here.

I spent the last month or so working on a way to integrate Titan icon with a champions hero combat system automated rules engine to support highly interactive pen and paper style role playing games.

I've been automating city of heroes through software that reads the RPG combat engines latest state and  constantly updating keybind files and then sends a keystroke COH That updates the keybind through a bind load.

The result is a quasi-state machine for COH based on the latest key bind files being loaded. I'm getting some fairly sophisticated behavior like emulating a champions / hero system attack cycle, knockback, etc. , but I'm quickly running to limits on what I can do in the coding is definitely error-prone and cumbersome.

Looking at all the stuff that's in the roadmap for paragon shot it sounds like code Walker and Company have better access to the internal the city of heroes.

Is there anyway to get an understanding of how some of this functionality will be accomplished? It might make more sense to abandon the approach I'm doing now in favor of integrating with work with paragon chat instead.

I'm a pretty seasoned developer, with some spare time on my hands so there's a way that I can integrate my work and what others are doing and provide it to the community that would be awesome.

FloatingFatMan

  • An Offal
  • Elite Boss
  • *****
  • Posts: 1,178
  • Kheldian's Forever!
Re: Implementation details behind paragon chat
« Reply #1 on: August 22, 2015, 02:44:29 PM »
You definitely need to talk to Codewalker. Perhaps you should try sending him a PM?

Jeff Anderson

  • Boss
  • ****
  • Posts: 121
Re: Implementation details behind paragon chat
« Reply #2 on: August 24, 2015, 06:03:47 AM »
Hey good idea, sent him a PM, waiting to hear back.

I'll start posting what I have done on my own so far as well, I've built some cool stuff tHat othersay find fun to use...

Nyx Nought Nothing

  • New Efforts # 11,000!
  • Elite Boss
  • *****
  • Posts: 796
  • Ha!
Re: Implementation details behind paragon chat
« Reply #3 on: August 24, 2015, 08:17:57 PM »
Hey good idea, sent him a PM, waiting to hear back.

I'll start posting what I have done on my own so far as well, I've built some cool stuff tHat othersay find fun to use...
Oh yeah. What you've outlined so far sounds pretty awesome. Much more fun than running a Champions game through Roll20.
So far so good. Onward and upward!

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Implementation details behind paragon chat
« Reply #4 on: August 25, 2015, 07:49:27 PM »
This thread: http://www.cohtitan.com/forum/index.php/topic,10956.0.html may also be of some interest to you.  Three separate  Paragon Chat bot writers (including myself) have posted there, along with Codewalker.  A lot of the protocol that Paragon Chat implements is documented and discussed there.

Jeff Anderson

  • Boss
  • ****
  • Posts: 121
Re: Implementation details behind paragon chat
« Reply #5 on: August 27, 2015, 05:58:29 AM »
Thanks!

I just played a session last night and it was awesome! COH really makes champions come alive in a way that needs to be seen to believe.

Combining that with a software battle simulator and we had 3 super heroes take on a mob of 100+ agents and it was manageable.

I did check out the post and it left me with lots of questions, I'll need to spend some real time to dig into it. I guess a high level some questions I found hard to answer were
- how is COH being extended to create custom keybinds?
- how are the map screens and other items accomplished?
- how is it envisioned that things like NPC automation, GM zones etc will be built

Right now COH just look like one big black box with keybinds (and now with paragon an XMPP protocol which is awesome) to interact programmatically, but how are developers getting into the guts to make system level changes?

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Implementation details behind paragon chat
« Reply #6 on: August 27, 2015, 08:01:47 AM »
Thanks!

I just played a session last night and it was awesome! COH really makes champions come alive in a way that needs to be seen to believe.

Combining that with a software battle simulator and we had 3 super heroes take on a mob of 100+ agents and it was manageable.

I did check out the post and it left me with lots of questions, I'll need to spend some real time to dig into it. I guess a high level some questions I found hard to answer were
- how is COH being extended to create custom keybinds?
- how are the map screens and other items accomplished?
- how is it envisioned that things like NPC automation, GM zones etc will be built

Right now COH just look like one big black box with keybinds (and now with paragon an XMPP protocol which is awesome) to interact programmatically, but how are developers getting into the guts to make system level changes?

I think you're asking questions in several different domains.

1.  How does Icon work?  Icon is basically a hacked version of the City of Heroes client in which the client memory is patched in real time to trick it into thinking certain things are true: in particular that its connected to a server (but it never actually gets any messages from it, so nothing exists in the game except the player) and that the player has basically something close to administrative rights (which means Icon players can do things players couldn't do when the game was alive, but developers with elevated rights could, or could when they were testing the game internally).

So in Icon, many of the things you can do are things the game could always do - Icon didn't invent those features, it just turned them on.  But while you can do all sorts of things in Icon, some things will always be true.  In particular, no other player can ever join you in Icon, because Icon explicitly works by tricking the game client into not connecting to anything.

2.  How does Paragon Chat work?  Paragon Chat works by creating a piece of software that can, to very, very limited extents, pretend to be a game server.  So the City of Heroes game client can connect to it.  Once it does, Paragon Chat can understand a very, very, VERY limited subset of the network protocol that the game client sends to it, and it relays that to other Paragon Chat clients.  It does that by translating those messages into a form of XMPP and sending that to an XMPP server.  XMPP servers are basically chat servers, so they are explicitly designed to take chat messages and send them to everyone else connected.  So a Paragon Chat user is taking their own client and connecting it to a chat server where everything you do is sent to everyone else, who then sees what you are doing.  The net result of this is that City of Heroes becomes a 3D graphical chat client, and your character becomes an avatar for that chat server.  You jump, everyone else gets an XMPP message that says you jumped, and they see you jump.

Technically, everyone has a copy of you in their copy of Paragon Chat that is echoing what you are doing.  But while Icon was just a hacked client that didn't need to talk to anything, so we didn't need to know HOW the game did what it did, Paragon Chat must both UNDERSTAND how everything it wants to do works, and how to send the correct network messages to the game client to make the game client believe that thing is happening.  That's several orders of magnitude more complicated than making something happen in Icon, so Paragon Chat's feature set is much lower today than Icon's is (keep in mind Paragon Chat has only been publicly released for a couple months now).  Also, there are things that Paragon Chat could do today, but not in a way that would be safe for public use in a shared public community chat environment, which also limits what Paragon Chat is currently able to do.

3.  How are people apparently modifying Icon and/or Paragon Chat to do interesting things?

This is happening in lots of ways, most of them comparable to how we were always doing this in-game.  For example, we could always make special menus in City of Heroes.  See popmenu in paragonwiki for example.  These tools are just being used for special or broader purposes in Icon and Paragon Chat.  But they are not special to Icon and Paragon Chat.  We were doing this when the actual game was running.  Ditto custom keybinds.

The thread I pointed you to specifically discusses the XMPP network protocol that Paragon Chat uses to communicate with other Paragon Chat systems.  Implementing that protocol directly, someone can write a program (a bot) that looks and acts like a player without the specific need to run the City of Heroes game client.  Such bots are also to some degree free of client constraints, and can use information that the game client itself processes but doesn't present to the player.  For example, someone is currently writing a bot that can act as a pseudo badge-hunting tracker, by tracking the location of every player logged into the same server and notifying them when they reach a known badge location.  Which brings me to:

4.  What's the plan for extending and enhancing Paragon Chat in the future?

Short answer, see this thread: http://www.cohtitan.com/forum/index.php/topic,11126.0.html.  Longer answer: it depends.  That question can't be answered in the general case with a simple answer, except to say that the current plan for Paragon Chat is to try to implement as many City of Heroes game features as can practically be implemented that are consistent with the use case for Paragon Chat, which is not to replace the game itself but to act as a community chat platform with extensible community uses (such as a shared PnP gaming tool).

To answer this question directly: "how are developers getting into the guts to make system level changes?"  For Paragon Chat, they aren't.  Paragon Chat uses an unmodified I24 beta game client, and talks to it like a game server would.  Paragon Chat can only do what the game client could always do, and the trick is to learn how to send it the right messages to get it to do those things.  Codewalker isn't hacking the game client, he's learning how to talk to it (this is an oversimplification in many ways, but close enough for our purposes here).


Beyond that, the forums are full of threads of people discussing specific projects and technical ideas.  There are people specifically making tools to hack the Paragon Chat database to allow for character costumes that the Icon tailor won't by default allow players to create.  There's the thread I linked where I've been discussing the technical details of how to write a Paragon Chat bot.  There are threads where people are creating special popmenus that allow for executing special animations or to perform specific Paragon Chat tasks like moving to different zones.  If you specifically detail what you've been doing yourself (I honestly can't tell what you are doing exactly with the descriptions you've posted so far) and what specific questions you have about how to take that work and extend it in specific directions to do specific things, someone else that is either interested in that or has useful knowledge may be able to help.  I can probably answer most questions that are not "what is Codewalker working on now specifically and when will a particular feature be released" or "how does Paragon Chat explicitly implement a particular feature in its source code?"

Note: I'm not a part of the Paragon Chat development team.  I'm knowledgeable enough that I can generally figure out what Codewalker is doing when he implements something, and if I'm really stuck I can ask him a question, but I try to leave him alone to do his thing.  I'm probably one of the only players with comparable knowledge to Codewalker about how things work in general, but his knowledge of how the game does things specifically far surpasses mine at this point.  If you want to know how something probably works, I can probably help.  If you want to make suggestions about future direction, or you have some very nitty gritty question about how Paragon Chat was written, you should direct those to Codewalker or post in one of the appropriate threads that discuss those topics.

MomentaryGrace

  • Lieutenant
  • ***
  • Posts: 66
Re: Implementation details behind paragon chat
« Reply #7 on: August 27, 2015, 07:08:49 PM »
I think you're asking questions in several different domains.

(snipped...)

...  Codewalker isn't hacking the game client, he's learning how to talk to it (this is an oversimplification in many ways, but close enough for our purposes here).


I want to say two things. One, that was a very fascinating expanation of a whole bunch of stuff and I enjoyed it immensely! Thank you for writing it!

Two, I hereby propose Codewalker should have a secondary name. ClientWhisperer.  :D

Arcana, you are of course Unselfish Sharer of Magical Lore, er, CoH Project-related Inner Workings.

 ;D

Scrapperlock in ten... nine...