Author Topic: Technical discussion of bases  (Read 27402 times)

Mister Hassenpheffer

  • Boss
  • ****
  • Posts: 125
    • 3D printouts?!
Technical discussion of bases
« on: May 26, 2016, 12:04:04 AM »
I hope one day we will see bases in PC.

At one time on the live forums I remember someone mentioning that bases were stored on a separate server.

Might be safe to assume (hate that word) that since it would require a server that it simply wouldn't be able to happen. <---tech limitations?

But if there was a way around that...

Just think of the base contests we could hold, Imagine gamezines getting involved with the other standard media already in place.

I can dream. I can hope.
« Last Edit: May 26, 2016, 03:09:01 PM by Codewalker »

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical discussion of bases
« Reply #1 on: May 26, 2016, 12:51:31 AM »
I hope one day we will see bases in PC.

At one time on the live forums I remember someone mentioning that bases were stored on a separate server.

Might be safe to assume (hate that word) that since it would require a server that it simply wouldn't be able to happen. <---tech limitations?

But if there was a way around that...

Hypothetically speaking, there's a way around that.  We can extrapolate that there's a way around that because you could demorecord a base.  That means it is possible to, in effect, tell the game client "please load this geometry, it is a base" without the game servers existing.  The free-camera mode even allows you to walk around a recorded base.

Very hypothetically speaking it should be possible for Paragon Chat to send base geometry to the CoH client, and in effect teleport you into a base.  It is then just a hop, skip, jump, rocket launch, warp drive, wormhole, temporal displacement, and dimensional shift away from allowing a Paragon Chat user to create a private room that is a base, and have every user that joins that room load the base geometry like a mega costume stanza and tell the CoH client to render that.

I don't know where this is on Codewalker's roadmap, if it is on it at all, and there are likely implementation details I'm glossing over or completely unaware of that could make this far more difficult than I perceive it to be, but I think this is a stretch goal for Paragon Chat that falls within the realm of possibility moreso than most things people want Paragon Chat to do.  If I had to guess, I would guess this is the kind of thing Codewalker might take a swing at after he does the work he's mentioned about administrative access private rooms.

LadyVamp

  • Elite Boss
  • *****
  • Posts: 539
Re: Technical discussion of bases
« Reply #2 on: May 26, 2016, 02:40:45 AM »
Might be safe to assume (hate that word) that since it would require a server that it simply wouldn't be able to happen. <---tech limitations?

It's just another map.  Should be possible to run it off of any server handling private maps iow missions.  The trick is where to store the base when not needed due to no players on that map.

I don't see any reason the client can't render the map by being told where things are.  The question is how to generate the map so the client has something to render.  of course what would be nice is if the map could be shared among clients which is where the server is likely needed.

Thing to keep in mind is an impressive amount of work has gone into getting the client to allow chatting and getting costumes working and being able to walk around the pre-defined zones.
/e clap

I can dream. I can hope.

We all are doing that.
« Last Edit: May 26, 2016, 02:51:43 AM by LadyVamp »
No Surrender!

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical discussion of bases
« Reply #3 on: May 26, 2016, 03:00:26 AM »
It's just another map.  Should be possible to run it off of any server handling private maps iow missions.  The trick is where to store the base when not needed due to no players on that map.

http://www.xmpp.org/extensions/xep-0060.html

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Technical discussion of bases
« Reply #4 on: May 26, 2016, 08:30:45 AM »

LateNights

  • Elite Boss
  • *****
  • Posts: 388
Re: Technical discussion of bases
« Reply #5 on: May 26, 2016, 10:50:55 AM »
"Upgrade Plot"...

Oh yeah  8)

 ;D

Mister Hassenpheffer

  • Boss
  • ****
  • Posts: 125
    • 3D printouts?!
Re: Technical discussion of bases
« Reply #6 on: May 26, 2016, 11:43:05 AM »
Wait... what?!

Huh?

What was that?

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Technical discussion of bases
« Reply #7 on: May 26, 2016, 12:52:34 PM »
Wait... what?!

Huh?

What was that?

Evidence that Arcana's hypothesis, and what I already knew to be true, is correct. It's possible to extract a base from a demorecord and send it to the client to load.

Even that took some doing, because the format it gets sent over the wire is not the same as what's in a demorecord. It's a compressed text format in the demo, but to get the client to load it, it needs to be sent in the binary equivalent (which the client will dutifully convert back to text to save in the demo file if recording is on). Going between the two formats requires more or less perfectly duplicating what the game calls the textparser. But that was already mostly done because it's similar to loading .bin files.

The incremental update protocol is even wackier.

It's still quite a way from being usable though. There's a few minor issues like:

  • Rubber-banding through furniture, and falling through the floor when moving beyond the starting room, because the 'server' piece is not yet generating the geometry from the base map.

  • Bases with functional items don't load correctly, as those need the correct entities to be spawned.

  • The editor not working at all. The client thinks it can edit so the buttons light up, and you can see the editor screen, but none of the placement functions are implemented yet so it just hangs.

  • Extracting the base from the demo file is still a manual process.

  • There's no protocol for sending it to other people over XMPP yet, so it's just local only at this point.

« Last Edit: May 26, 2016, 02:39:08 PM by Codewalker »

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Technical discussion of bases
« Reply #8 on: May 26, 2016, 01:04:43 PM »
I don't know where this is on Codewalker's roadmap, if it is on it at all

Same place it's always been on the roadmap. :P

after he does the work he's mentioned about administrative access private rooms.

Yes, it does depend on the private instance functionality being done first. If somehow the work on the editor gets finished first I'll probably roll it into the development build for prerelease testers to play with as a local-only feature, but for people to be able to coexist in a base, both the private instance and pubsub modules have to be done.

http://www.xmpp.org/extensions/xep-0060.html

There are a number of features in Paragon Chat that are planned to be built on top of pubsub and are waiting for work on the module implementing it to be done. The simplified security model from PEP (http://xmpp.org/extensions/xep-0163.html) makes several of them more convenient to write, as pubsub is a quite complex protocol by XMPP standards, though some of the serverwide stuff will use baseline pubsub since it's not owned by specific users.

Openfire also doesn't yet support setting a default access model for new node creations (required by XEP-0163 and generally just really convenient to have). I'll probably end up having to implement that as well, and submit a patch for it back to Openfire.

Tahquitz

  • Titan Staff
  • Elite Boss
  • ****
  • Posts: 1,865
Re: Technical discussion of bases
« Reply #9 on: May 26, 2016, 01:40:23 PM »
"Work is love made visible." -- Khalil Gibran

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Technical discussion of bases
« Reply #10 on: May 26, 2016, 03:24:04 PM »
It's just another map.

It really isn't. There are considerable differences between bases and regular maps.

When connecting to a regular map, whether it's an open zone or an instanced mission (there is very little difference between the two), the server just sends a filename. Say, maps/City_Zones/City_01_01/City_01_01.txt. That's Atlas Park.

The client sees that filename and opens the appropriate geobin, inside of which are a bunch of GroupDefs and Refs that, handwaving away some complexity with the object library, tells the client how to build the geometry for the zone. The server has its own copy that it loads, and -- assuming the two of them are identical -- both client and server have an independent copy of the geometry and the player can move around without the client and server desyncing.

Base maps on the other hand branch off very early in the scene negotiation protocol. Instead of a filename, they send a compressed binary representation of the base itself. That format is completely different than the on-disk format for regular maps. Instead of groupdefs and refs, it contains high-level information about room layout, color schemes, base items that have been placed, even the contents of storage bins (ever wondered why the base would flicker and redraw itself when putting stuff in storage?).

When the client receives that information, it uses it to construct an in-memory map out of predefined groupdefs that contain pieces of rooms. There's a special base details file for base items as well that gets referenced. It's assumed that the server does the same thing in order to build up its representation of the scene; this is necessary to have the geometry in order to run physics and collision detection, which in COH is done serverside. This has to happen in exactly the same way on the client and the server for things to sync up; otherwise you get rubber banding.

With some dirty debugger tricks, it's actually possible to convince the client to write out the temporary map it constructed for the base in geobin (groupdef) format. That gives valuable clues about how the world is constructed from the base map and what needs to be done to replicate that process.

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Technical discussion of bases
« Reply #11 on: May 26, 2016, 03:38:36 PM »
I see that you suggest PvP arena matches might be possible in the future - so that means you "think" combat is possible...

There's some rather huge caveats with that. The reason I specifically said arena matches (and left it in the 'maybe' category) is that:

1. It's PVP, so it can be done without having a working AI and things like NPC pathing. Sorry masterminds and controllers.

2. It's a small, controlled instance, so it can be handed off to another protocol rather than trying to sync it over XMPP. The most likely situation would be one of the players is selected as 'server', and everybody else connects to that player's Paragon Chat (or an arena bolt-on package) using either the good old fashioned mapserver protocol or something new and different. Navigating firewalls and such can be assisted by information exchanged over XMPP.

In that case, it works a lot like some first person shooter games do, with XMPP as the matchmaking server and one player being chosen as host. Or SIP where the initial contact can be through a central server, but the actual call is made direct from peer to peer. Pick your protocol, there are a dozen examples.

Would that mean AE is a possibility?

Now, I recall you mentioning AE before - specifically that it was actually more difficult than combat itself - but would AE functionality not alleviate lag that might be more prevalent in true zones?

There's nothing special about AE that would make it useful for that. AE is just a paint-by-numbers template for assembling missions out of canned pieces that sits on top of the everything else. In order for AE to exist, the ability to create missions by writing them outside of AE would have to exist first, as well as a power system, full NPC AI, a mission engine, and a system to handle dynamic spawning of enemies. If hypothetically all that stuff exists someday, there are far more interesting things it can be used for than AE.

nicoliy

  • Boss
  • ****
  • Posts: 120
Re: Technical discussion of bases
« Reply #12 on: May 26, 2016, 07:05:11 PM »
For features on the roadmap, bases has been my most wanted item. I'll be watching this closely.

I wish I could help with figuring out how to make it work, but this is not my expertise :(. I'll be glad to test it when that day comes though.

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical discussion of bases
« Reply #13 on: May 26, 2016, 07:26:29 PM »
I don't see any reason the client can't render the map by being told where things are.  The question is how to generate the map so the client has something to render.  of course what would be nice is if the map could be shared among clients which is where the server is likely needed.

Paragon Chat's development prime directive seems to be "keep it compatible with any reasonable XMPP server that supports core extensions."  To that extent, I think Codewalker is loathe to implement any feature that requires a central server beyond what an XMPP server can do with core extensions.  Custom modules, for example, are currently not appealing.  That's why I mentioned, and Codewalker confirmed, XEP-0060 aka PubSub.  PubSub allows an XMPP client to "publish" data to the XMPP server that other users can "subscribe" to and fetch.  A base would then be something that only the base owner "possesses" the geometry for, but Paragon Chat could be extended to allow a player to "instance" a base by creating a new room (in the discussion channel sense) on the XMPP server and then publishing the base geometry.  When you wanted to enter someone else's base, Paragon Chat would add you to the room associated with that base (in the same way that zoning works) and also fetch the base geometry by essentially subscribing to the right stream that contains that data, and then feed it to your own local game client.  There would be no central server in the sense of a single thing "running" the base, instead bases would function logically like zones, but with the extra machinery necessary to fetch the base geometry when needed.  The only central server bit you'd need is something that a base owner could send base geometry to and other users could fetch it from, and PubSub allows a generic XMPP server that supports the appropriate (and reasonably common) XMPP extension.

Keeping everything in sync would then happen via extensions to the current XMPP encapsulated Paragon Chat messages that keep everything else currently in sync.

TL;DR: anything that can work but requires a central server falls into the category of "theoretically possible if you want to write it, but not likely to be something I think Codewalker is working to release at the current stage of Paragon Chat development."  For the feature to be on this side of "eventually" there needs to be a way to do it with basically Openfire and its currently supported extensions, plus custom (but standards-supporting) XMPP stanzas.  Bases appear to fall into that category of possible.

Cremzen

  • Underling
  • *
  • Posts: 1
Re: Technical discussion of bases
« Reply #14 on: May 26, 2016, 08:25:16 PM »
I understand so very little discussed, but that pic....



I think I just soiled myself

Tahquitz

  • Titan Staff
  • Elite Boss
  • ****
  • Posts: 1,865
Re: Technical discussion of bases
« Reply #15 on: May 26, 2016, 10:56:25 PM »
Idea... maybe not a good one, but what the hell? 

Possibility of a separate editor like Titan Icon for bases?  (Naming isn't my strongsuit... Titan Hardhat? Sure there's something better.)  Something for people to play with the Base Editor off XMPP, and to make bases offline and import into Paragon Chat someday?  The app doesn't have to be released before the feature is ready necessarily.

And like Titan Icon, if there's a mode to shut off validation offline to make some truly weird stuff that wouldn't be allowed in the game (like placement limits, deleting the Base Portal, or other ideas.)  Bases that don't validate can't be uploaded to Paragon Chat, of course... just as a online toy, or to do custom demorecording with.

Or scrap the separate app idea, perhaps this could be an extension to Titan Icon later?
"Work is love made visible." -- Khalil Gibran

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: Technical discussion of bases
« Reply #16 on: May 26, 2016, 11:16:58 PM »
Idea... maybe not a good one, but what the hell? 

Possibility of a separate editor like Titan Icon for bases?  (Naming isn't my strongsuit... Titan Hardhat? Sure there's something better.)  Something for people to play with the Base Editor off XMPP, and to make bases offline and import into Paragon Chat someday?  The app doesn't have to be released before the feature is ready necessarily.

And like Titan Icon, if there's a mode to shut off validation offline to make some truly weird stuff that wouldn't be allowed in the game (like placement limits, deleting the Base Portal, or other ideas.)  Bases that don't validate can't be uploaded to Paragon Chat, of course... just as a online toy, or to do custom demorecording with.

Or scrap the separate app idea, perhaps this could be an extension to Titan Icon later?

I'm not sure what the benefit of making a "stand alone" base editor would be, in the sense that implementing a method to activate the editor in Paragon Chat would allow for a stand alone editor in the degenerate case of not logging Paragon Chat into an XMPP server.  Moreover, doing so in Paragon Chat creates the obvious opportunity to allow Paragon Chat to "see" and thus save the base in a form that the larger Paragon Chat environment could use.  Even if there was a quickie way to hack the client into base editor mode, unlike with Icon and costumes the game client itself has no way to save bases explicitly (at least as far as I'm aware).  "Base Icon" might be able to shove you into the base editor, but it couldn't save your work without even more hacktitude. 

Just to make sure this is clear: Paragon Chat can already hypothetically work without connecting to anything.  You can connect to your own personal XMPP server that no one else has access to, and you can even disconnect it from everything and in effect run Paragon Chat without the need for anything else anywhere else.  If and when base editing in Paragon Chat is implemented, you will automatically have an offline editor if you want one.  As in: you could be on your laptop, in an airplane, with no wifi, connected to nothing, editing your base.

Now, editing a base while people are standing in it might require more work if you want the edits to happen dynamically.  But that could always be a 1.01 base feature: it shouldn't hold up base functionality if Paragon Chat implemented base editing, bases as rooms, and dynamic editing of base geometry as three separate and independent features (i.e. base editing can work with or without the ability to share them as room geometry, instancing bases can work without without the real time editor if there was a way for Paragon Chat to read and convert base geometry extracted from demorecords, and real time geometry editing can be a pasted-on feature on top of the other two).

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Technical discussion of bases
« Reply #17 on: May 27, 2016, 12:35:11 AM »
Possibility of a separate editor like Titan Icon for bases?  (Naming isn't my strongsuit... Titan Hardhat? Sure there's something better.)  Something for people to play with the Base Editor off XMPP, and to make bases offline and import into Paragon Chat someday?

You want the -offline command line parameter. Once I have some time to work on the options panel UI (or find a helper who knows C/Win32), it'll also be a checkbox you can tick.

LadyVamp

  • Elite Boss
  • *****
  • Posts: 539
Re: Technical discussion of bases
« Reply #18 on: May 27, 2016, 02:25:07 AM »
It really isn't. There are considerable differences between bases and regular maps.

I stand corrected.  Though I was thinking about the "running" of the map, collision detection for example, rather than how the client gets the data to construct it as someone enters.
No Surrender!

LadyVamp

  • Elite Boss
  • *****
  • Posts: 539
Re: Technical discussion of bases
« Reply #19 on: May 27, 2016, 02:46:21 AM »
Paragon Chat's development prime directive seems to be "keep it compatible with any reasonable XMPP server that supports core extensions."  To that extent, I think Codewalker is loathe to implement any feature that requires a central server beyond what an XMPP server can do with core extensions. 

Actually, I'm quite impressed with Codewalker's efforts.  Though I must admit I don't partake in the fruits of his labor.  While there are many parts of the game I love dearly, and getting bases working would certain be near the top of my list, the one thing I would miss most is combat.  And, I believe Codewalker has already stated combat will never be available.  Feel free to tell me I'm wrong about combat, Codewalker.  And for that reason alone, I don't avail myself to Paragon Chat.

I am very happy to see we have such talented people here.  Codewalker, your efforts are most appreciated.  If your efforts bring relief to even one person, then it was worth it.  I cannot be that person today.  But perhaps one day I will be able to be one of many.

Good luck and as my mice would say, "No Surrender!"
No Surrender!