Author Topic: Technical side discussion  (Read 164697 times)

slickriptide

  • Elite Boss
  • *****
  • Posts: 356
Re: Technical side discussion
« Reply #200 on: July 24, 2015, 04:43:48 PM »
Double-checking here -

Does this:

Quote
m is the current animation that is playing. This is the same MOV names that are used in demorecords. Paragon chat optimizes this by only sending a new MOV if the client couldn't reasonably predict it by using the "next move" and cycle info from the sequencers.

mean that Paragon Chat will interpret m="" to mean "do whatever you think is appropriate"?

So, if I send a U stanza like <U p='1.0 2.0 3.0' o='0.0 0.0 0.0' v='0.0' m=''> and Paragon Chat is already showing my avatar located at /loc=1.0, 2.0, 3.0 where it's standing around doing the arms crossed default emote, when it receives this stanza it will say, "Okay, keep standing there and keep doing arms crossed"?

Also, is there a slash command like /loc that shows your character's current orientation?

***EDIT***

I'm not really differentiating here between Paragon Chat proper and the CoH game client - Draw the lines between them as appropriate.
« Last Edit: July 24, 2015, 07:25:48 PM by slickriptide »

Azrael

  • Elite Boss
  • *****
  • Posts: 666
Re: Technical side discussion
« Reply #201 on: July 24, 2015, 08:22:12 PM »
I caught this interesting bit on Reddit...by Leandro.

It's not something I've noticed posted on here...unless I missed it.

'Most of this work has already been done by Titan.  Reverse-engineering the main protocol (the one that DBserver and map server use) was a nightmare, but it was finally 'done' mid to late last year.  It has been partially implemented and in testing since.  The first public release is happening very, very soon.'

...and...

'You can make the COH client connect directly to a DB server, skipping the authserver entirely and have full functionality.'

So.  The 'umbilical' cord that talks to the CoH client has been reverse engineered?  ie.  The puppet strings can now by attached to a 'replica' server.  In Paragon Chat's instance...a 'chat server.'  And it will 'talk' to the CoH client?

In theory, if you have emulated the protocol that CoH used...you could attach the client to a real-time(?) server for 'combat'?  Or create a local micro server unreal tournament style and have LAN or limited P2P combat?

I'm not technical.  Stay with me... ;)

So...we have the replicated language of the protocol to talk to COH in the client/server relationship.  That means, sure, we don't have the original server content.  eg. the missions are all gone?  But we can recreate missions if we unlock the AE confidentiality..?  The original combat server is gone.  But the combat system is well understood and can be replicated.  Travel powers can be simulated.  The powers can be replicated with combat dummies.  NPCs are difficult but not impossible.  So blocks of the game can be replicated or unbundled because we have the 'protocol'.  ?

One idea I did have that dawned on me.  'Be NPC.'

Instead of 'A.I' spawns (though these will come a long time down the track?) you could have 'be npc' .  Imagine 50 paragon chat players being 'NPC' outcasts and some paragon chat players being the 'pc'.  You could...have 'real life' npc spawns as real players which would be far more unpredictable than A.I npcs.  ie.  PVP 'npc' vs hero style.  It would redefine pvp.  The 'red zones' on any given map...if you went into them.  You could(!) be attacked.  Green zone/tram lines neutral.  Yellow zones 'sniped at.'  An honour code pvp system.  I always thought instead of separate pvp zones...City of Villains should just have been villains added to the normal zones but with an honour code to only allow 'pvp' in the red tram/tracks of each zone.  IF you had 'be npc' for outcasts, trolls...clocks...you could have the players themselves(!) bringing 'mob' life to each zone.  And as most mobs don't have super travel powers...it wouldn't be 'running' around combat pvp style...but you'd have 'force multiplier' player attacks on a hero.

'Real NPCs' vs hero PCs.  To the untutored eye, Paragon City zones would live again.  All that would be needed would be missions.  And they could be replicated in a similar style.

Anybody have any thoughts on this?

If PVP has to come before A.I combat...then I thought my 'be npc' idea could replicate 'spawns' in a 'real' way in the interim.

Azrael.


General Idiot

  • Elite Boss
  • *****
  • Posts: 648
Re: Technical side discussion
« Reply #202 on: July 25, 2015, 01:57:37 AM »
I think the thing there is that some parts have been reverse engineered and some haven't. Combat and powers would be two of the things that haven't, and even without any knowledge of how the client actually works I could see those being massively harder to do than simple movement and chat.

In essence, we have some of the language used between the client and the server. But there's still many words we don't have.

Dyne

  • Lieutenant
  • ***
  • Posts: 54
  • Gluer of Gears
Re: Technical side discussion
« Reply #203 on: July 25, 2015, 09:06:55 PM »
I'm behind the curve because I only heard about Paragon Chat earlier this week (I used Icon last year, but I've been a bit distracted with various issues and other projects).   Nevertheless, I'm diving in feet first and poking around with my own Python bot.  This is the first successful test from my Costume module.  I'm trying to make sure I'm getting the same results from the costume Arcana was testing earlier in the thread

Code: [Select]
Validator concatenation:
=============
1f6bbaaff-0.85-0.53-0.780shortsskin_tightsminiskirt_11ff0000ff20045ccff1Tightskin_tightsTop_51ff0058ff2d40000ff2V_fem_Head.GEO/GEO_Head_V_Asym_Standard!v_sf_face_skin_head_101ff65cdff2ccca00ff3Bracer_02Skin_Bracer_02aSkin_Bracer_02b1fffd00ff2d40000ff4Hi_Heels_02skin_Hi_Heels_02askin_Hi_Heels_02b1990031ff20000ffff5standardMARTIAL_ARTS_011990031ff21f0000ff6Long_04Long_01aLong_01b1ff0000ff2aa3800ff8Tiara_01Tiara_01aTiara_01b1ccca00ff2d40000ff9TightBaseStar_102fffd4cff15FullCape_Top_011ff0058ff2ff0058ff3ff0058ff4ff0058ff17!X_Valkyrie_Cape_01!Cape_Valkyrie_01_Maskcapes/CapeLongFem.fx1ff0058ff2ff0058ff3ff0058ff4ff0058ff19ShortSkirt_01pleatedplaid_01b1ff0058ff2ff0058ff
=============

My concatenation:
=============
1f6bbaaff-0.85-0.53-0.780shortsskin_tightsminiskirt_11ff0000ff20045ccff1Tightskin_tightsTop_51ff0058ff2d40000ff2V_fem_Head.GEO/GEO_Head_V_Asym_Standard!v_sf_face_skin_head_101ff65cdff2ccca00ff3Bracer_02Skin_Bracer_02aSkin_Bracer_02b1fffd00ff2d40000ff4Hi_Heels_02skin_Hi_Heels_02askin_Hi_Heels_02b1990031ff20000ffff5standardMARTIAL_ARTS_011990031ff21f0000ff6Long_04Long_01aLong_01b1ff0000ff2aa3800ff8Tiara_01Tiara_01aTiara_01b1ccca00ff2d40000ff9TightBaseStar_102fffd4cff15FullCape_Top_011ff0058ff2ff0058ff3ff0058ff4ff0058ff17!X_Valkyrie_Cape_01!Cape_Valkyrie_01_Maskcapes/CapeLongFem.fx1ff0058ff2ff0058ff3ff0058ff4ff0058ff19ShortSkirt_01pleatedplaid_01b1ff0058ff2ff0058ff
=============

Congrats!  Concatenations match!



Validator Hash (P.C.):
=============
2TjGyYMQNC6GHr7gI5hlaNm1/+E=
=============

Validator Hash (Arcana):
=============
ycY42S40EIPgvh6GaGWYI+H/tdk=
=============

My Hash:
=============
ycY42S40EIPgvh6GaGWYI+H/tdk=
=============

Congrats?  Hash matches Arcana.



Paragon Chat Hex:
=============
c9c638d92e341083e0be1e8668659823e1ffb5d9
=============

Arcana Hex:
=============
d938c6c98310342e861ebee023986568d9b5ffe1
=============

My Hex:
=============
c9c638d92e341083e0be1e8668659823e1ffb5d9
=============


Figured I'd get this bit out of the way before trying to tackle actual XMPP functionality

It's a start, anyway.
-= Virtue Server - 2004-06-13 to 2012-11-30 =-
hortis publicis gemini in aeternum

Usurper Dyne, Still Heart, River Elemental, Saul Invictus, Grim Grinner

slickriptide

  • Elite Boss
  • *****
  • Posts: 356
Re: Technical side discussion
« Reply #204 on: July 26, 2015, 05:26:50 PM »
In a reminder about the difference between looking at forests and looking at trees - When everything looks right and it's still not working, ask yourself if something unrelated to your assumed causes could be wrong...

As it turns out, class="Blaster" is not actually the same as class="Class_Blaster". /headdesk

On the plus side, my bot is visible. I probably need to learn adjust my YPR order, though.



Anyway, next up - IQ costume get requests
« Last Edit: July 26, 2015, 10:17:40 PM by slickriptide »

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical side discussion
« Reply #205 on: July 27, 2015, 10:08:35 PM »
Double-checking here -

Does this:

mean that Paragon Chat will interpret m="" to mean "do whatever you think is appropriate"?

So, if I send a U stanza like <U p='1.0 2.0 3.0' o='0.0 0.0 0.0' v='0.0' m=''> and Paragon Chat is already showing my avatar located at /loc=1.0, 2.0, 3.0 where it's standing around doing the arms crossed default emote, when it receives this stanza it will say, "Okay, keep standing there and keep doing arms crossed"?

Also, is there a slash command like /loc that shows your character's current orientation?

***EDIT***

I'm not really differentiating here between Paragon Chat proper and the CoH game client - Draw the lines between them as appropriate.

I'm not in a position to test today as I'm in Hilo, but in general it is best if the attribute is null to just not send it at all.  However, I believe that whenever Paragon Chat doesn't understand what you sent, it ignores it.  That's probably the same behavior as when the attribute is null.

But what Codewalker meant was that Paragon Chat has the same animation sequencer that the client has, so for example if your intent is to play SOME_ANIMATION_PRE and the sequencer says the next animation in the sequence is SOME_ANIMATION_CYCLE, Paragon Chat doesn't send m="SOME_ANIMATION_CYCLE" because it knows the game client will do that anyway, and your bot doesn't have to do that either.

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical side discussion
« Reply #206 on: July 27, 2015, 10:12:48 PM »
Anybody have any thoughts on this?

I have some thoughts on this.  Thus, all my posts in this thread.  Given the current architecture of Paragon Chat, a central server is possible but would be fighting upstream against the system design.  But bots could replicate much of the capabilities of a mapserver, if and when Codewalker adds the appropriate XMPP message support for those features.  It then becomes a question of implementing a bot that uses those things in the right way.  Paragon Chat itself will likely never get all the way there, but its an interesting question to ask how far can it get.

When Paragon Chat gets as far as it will ever likely get and Codewalker open sources the software, other things may become possible for enterprising software writers.

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical side discussion
« Reply #207 on: July 27, 2015, 10:14:44 PM »
It's a start, anyway.

We all started from the same blank page.  The important thing is to find the learning curve you're comfortable with.

PS: make sure you pay attention to all the discussion that followed that post.  As it turns out, Codewalker byte-swapped his hash so Paragon Chat's hash is different from what I originally computed and what Codewalker originally documented, but with the appropriate byte swap they match.  Also, *my* costume file doesn't match what the client and Paragon Chat import, and I had to delete two colors from it for the "in-game" costume to match the contents of the file itself.  With those two corrections, Codewalker and I compute identical hashes.

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical side discussion
« Reply #208 on: July 27, 2015, 10:18:01 PM »
On the plus side, my bot is visible.

Gratz.  Visibility is a key milestone, because now you can *see* what you're doing right and wrong.

Also, I made the same silly mistake with Class names about a hundred times.  Although in my case I made that silly mistake back in the I10-ish timeframe and got it out of my system long ago, about the same time I learned to live with "Gadgets."

slickriptide

  • Elite Boss
  • *****
  • Posts: 356
Re: Technical side discussion
« Reply #209 on: July 28, 2015, 04:48:03 AM »
Thanks. I don't think it will boil down to so simple a fix for whatever is wrong with my IQ costume stanzas. I'm thinking I'll have my char wear the test costume on cohtitan's server and record what paragon chat sends to another paragon chat client, then compare that to what paragon chat is receiving is receiving from my bot's IQ result.

Todogut

  • Boss
  • ****
  • Posts: 247
    • Todogut on deviantART
Re: Technical side discussion
« Reply #210 on: July 28, 2015, 05:02:08 AM »

Dyne

  • Lieutenant
  • ***
  • Posts: 54
  • Gluer of Gears
Re: Technical side discussion
« Reply #211 on: July 28, 2015, 08:33:20 PM »
PS: make sure you pay attention to all the discussion that followed that post.  As it turns out, Codewalker byte-swapped his hash so Paragon Chat's hash is different from what I originally computed and what Codewalker originally documented, but with the appropriate byte swap they match.  Also, *my* costume file doesn't match what the client and Paragon Chat import, and I had to delete two colors from it for the "in-game" costume to match the contents of the file itself.  With those two corrections, Codewalker and I compute identical hashes.

Yep, I read through the entire thread (as well as the Coming Soon thread that preceded it).  How much of the thread I can manage to keep straight/retain is a different question, of course. :)

I hadn't gotten around to the endianness issue yet; I was happy enough to get concatenation working.  Once I did get there, I got stumped for awhile because my brain blew a fuse and I couldn't figure out how swapping the bytes on the base64 hash was going to produce anything at all correct.

Yeah.

I forgot that the base64 hash is not the equivalent of the hexdigest, the digest is.  The base64 is just a rendition of the latter.  It's the (non-hex) digest that needs to be byte swapped, not the hexdigest (which was obvious) nor the base64 hash (which was where my brain faceplanted and started calling for rez).

Just ignore me, I'll be over here slamming my head against the desk.
-= Virtue Server - 2004-06-13 to 2012-11-30 =-
hortis publicis gemini in aeternum

Usurper Dyne, Still Heart, River Elemental, Saul Invictus, Grim Grinner

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical side discussion
« Reply #212 on: July 28, 2015, 09:32:52 PM »
Just ignore me, I'll be over here slamming my head against the desk.

At least Slickriptide can probably tell you which orientation parameter to use to do that.

slickriptide

  • Elite Boss
  • *****
  • Posts: 356
Re: Technical side discussion
« Reply #213 on: July 28, 2015, 11:00:39 PM »
At least Slickriptide can probably tell you which orientation parameter to use to do that.

LMAO.

In other news - I decided to use the -pcdata -localhost trick to login a second client and find out what Paragon Chat was sending back and forth in the costume stanzas. Imagine my surprise when I saw this on the second client.



Only thing I can figure is that the first client must have accidentally /ignored the bot or something. I'm not sure how to clear an ignore list. Anybody know?

So, Phase One is complete. The bot can manifest itself in Paragon City and it can even return its bio.

I guess the next thing is to figure out whether motion or chat interactivity is higher on my priority list.

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical side discussion
« Reply #214 on: July 29, 2015, 03:44:03 AM »
I guess the next thing is to figure out whether motion or chat interactivity is higher on my priority list.

You should break "motion" down into two parts, one easy and one not so easy.  The easy part is that if you don't need to "move" but you do want to animate, that's easy.  Just send the appropriate emote MOV and your bot will perform the proper animation.  You could then connect that to chat: when someone sends you a chat message, you could respond by both sending a chat reply and doing an appropriate animation: saluting, waving, holding signs, barfing, whatever.

"Motion" interpreted to be trying to get your bot to travel from point A to point B in a way that is both smooth in terms of change of location and orientation, combined with the appropriate animations that make you seem like you are walking/running/flying and not just gliding there in mid-air like Magneto, is a little bit harder to do in the general case.  It involves combining acceleration (so you don't instantly start moving at full speed), changing orientation smoothly (so you face in the direction you're moving, assuming you want to do that), and executing the right animations at the right time to look like you're walking/running/flying and *also* you stop doing that when you stop moving so you don't keep moonwalking in place.  For what you're apparently trying to do, that seems to be an optional stretch goal since traveling seems less important to the kinds of interactivity you are interested in replicating.

But barfing on someone's shoes, that I think you should try to implement.

slickriptide

  • Elite Boss
  • *****
  • Posts: 356
Re: Technical side discussion
« Reply #215 on: July 29, 2015, 06:44:39 AM »
Shoe barfing. Definitely need to move that to the top of the list. ;-)

Movement-wise, I could see experimenting with a "follow" command where you can tell the bot to follow and it literally copies your <U> stream as it receives it from you, which should result in the bot mimicing your route, velocity, vector of travel, etc...

Travel animation is going to require some sort of time coding to mark the transition between various parts of a travel animation; Pre, Cycle, and Post as examples.

I think my first order of business may be to convert all of my hard-coded initialization into configurable ErrBot parameters with an appropriate requirements file for initial state. After that, define a bunch of basic utility commands like "change costume" and "relocate to point XYZ" and "change Nick" and etc... Once I've got that stuff in the state I want, I can setup a GitHub for a Paragon Chat plugin and make it so that anybody who installs ErrBot can just command ErrBot to download and run the Paragon Chat plugin.

At that point, "phase one" will truly be finished and "phase two" will commence. In an ideal world, I'd have all kinds of bot functionality, broken up into groupings of features that can be loaded, run and unloaded as needed or desired. My pie-in-the-sky goal is not so much to have a bot as to have a NPC management platform. That's going to involve a lot of record keeping about the state of a NPC as well as some sort of simple scripting language to handle various sorts of NPC activities and decision making.

I  suppose that somewhere in there I'll have to put up a Markov chain powered chatbot also, heh, just to see how people react to something like that inside of a graphical game environment.


Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical side discussion
« Reply #216 on: July 29, 2015, 08:08:03 AM »
Travel animation is going to require some sort of time coding to mark the transition between various parts of a travel animation; Pre, Cycle, and Post as examples.

For most movement animations, the _pre animation automatically executes the cycle animation after it completes, and the cycle animation automatically cycles.  So you only need to send _pre to start and _post to end and cycle happens in the middle without your intervention.  Because _pre is always interruptable (so far as I've seen), you can always send _post when you stop moving even if you are in the middle of _pre.  There are corner cases, but that's the basics. 

slickriptide

  • Elite Boss
  • *****
  • Posts: 356
Re: Technical side discussion
« Reply #217 on: July 29, 2015, 02:12:44 PM »
For most movement animations, the _pre animation automatically executes the cycle animation after it completes, and the cycle animation automatically cycles.  So you only need to send _pre to start and _post to end and cycle happens in the middle without your intervention.  Because _pre is always interruptable (so far as I've seen), you can always send _post when you stop moving even if you are in the middle of _pre.  There are corner cases, but that's the basics.

Groovy. Thanks for the helpful advice along the way, Arcana, and for sharing your experiences as the bleeding edge. It was immensely helpful at times to have an example to compare to or even just an assurance that, "Yes, this can actually be made to work".

Likewise, thanks Codewalker for the specs to make it all happen.

On a different note, I've found a reliable crash scenario for Paragon Chat v. 0.98beta. It involves a long message being sent. Specifically, this one:

Code: [Select]
2015-07-29 07:00:16,545 DEBUG SEND: <message type="groupchat" xml:lang="en" to="atlaspark@conference.cjj-pc"><body>Available commands for ErrBot:

!about: Returns some information about this err instance
!apropos: Returns a help string listing available options.
!blacklist: Blacklist a plugin so that it will not be loaded automatically during bot startup
!config: configure or get the configuration / configuration template for a specific plugin
!echo: A simple echo command. Useful for encoding tests etc ...
!export configs: Returns all the configs in form of a string you can backup
!help: Returns a help string listing available options.
!history: display the command history
!import configs: Restore the configs from an export from !export configs
!load: load a plugin
!log tail: Display a tail of the log of n lines or 40 by default
!reload: reload a plugin
!repos export: Returns all the repos in form of a string you can backup
!repos install: install a plugin repository from the given source or a known public repo (see !repos to find those).
!repos uninstall: uninstall a plugin repository by name.
!repos update: update the bot and/or plugins
!repos: list the current active plugin repositories
!restart: restart the bot
!status gc: shows the garbage collection details
!status load: shows the load status
!status plugins: shows the plugin status
!status: If I am alive I should be able to respond to this one
!unblacklist: Remove a plugin from the blacklist
!unload: unload a plugin
!uptime: Return the uptime of the bot
!zap configs: WARNING : Deletes all the configuration of all the plugins</body></message>

This is a help message from ErrBot. I send "!help ErrBot" to the bot and it replies with the above message.

The three test cases are as follows:

1) /tell @errbot, !help ErrBot -- performs as expected

2) With paragonchat set as the "current" channel, enter !help Errbot -- An error "Parameter too long" is generated and the entire message, preceded by the error message, is received as a "tell" (or at least it's in yellow text like a "tell").

3) Send on broadcast, /b !help ErrBot -- Paragon Chat crashes to desktop.

Most likely a buffer overrun or something like that. If you need any more info about it, let me know.

« Last Edit: July 29, 2015, 03:55:20 PM by slickriptide »

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical side discussion
« Reply #218 on: July 29, 2015, 05:47:48 PM »
Paragon Chat probably doesn't bounds check everything perfectly since normally the City of Heroes client itself has enforced limits on things like the maximum length of a tell.  Its probably a good idea to try to stay within those bounds ourselves, although given the fact that we're not the only people that will eventually figure out how to do this, its also probably a good idea for Paragon Chat to bounds check all XMPP messages just for anti-griefing purposes alone.

slickriptide

  • Elite Boss
  • *****
  • Posts: 356
Re: Technical side discussion
« Reply #219 on: July 29, 2015, 06:20:44 PM »
I agree, @Arcana, and there are steps I can take if that's a necessary thing. I'm pretty sure this is new behavior,though. I don't remember any previous versions of PC crashing just from listing a help menu in the bot. I wasn't actively testing for that kind of thing, so I can't state categorically that it worked previously but I've used those menus before this time and I have to think that at least once would have been in the Paragon Chat channel if not in Broadcast.