Pattern Encoder Block—The solution to all our docking problems

    This idea.


    • Total voters
      35
    Joined
    Jan 22, 2014
    Messages
    1,047
    Reaction score
    299
    I couldn't come up with a cool name, so let's just call it by what the block does, it encodes patterns (short: PEB). I believe it to be the solution to many issues the current docking system provides, like ship alignment relative to the docking module, or the direction or orientation of docked ships.

    General Behavior
    The PEB can be connected to Docking Modules, Cockpits and Ship Cores. All connected PEBs then would form a pattern, which would serve as a filter that only allows the docking of ships that represent the same encoded pattern as the Docking Module. The patterns then serve as the point of origin (replacing the ship core in that matter), as well as they determine direction and orientation of the docked ship.

    So how does it work?
    In the following, the red blocks serve as a replacment for PEBs. In each picture, each of the visible PEBs is connected to the Docking Module/the Cockpit respectively.

    Suppose we have this docking port:
    starmade-screenshot-0005.png
    We could dock there with ships that have something like including, but not limited to, the following:
    starmade-screenshot-0001.png starmade-screenshot-0002.png starmade-screenshot-0003.png
    These could not be docked:
    starmade-screenshot-0004.png starmade-screenshot-0006.png

    Applications
    Apart from the obvious, factions could standardize docking ports, like the docking rings from Star Wars (only a few meters in diameter, suited for passage of one person at a time), or troup/cargo transport ports (the large hangar-like doors at the sides of a Venator). Each docking port could only be accessed by a ship supporting the associated pattern. A ship could support many patterns (on different cockpits) to connect to different kinds of docking ports. Since the patterns would serve as the docking origin, ships would be aligned to compatible docking ports.

    Extending the system
    (Edit: Note that these are merely examples of what could be possible. I'd like the discussion to mainly focus on the docking part.)
    • With Turret Docking Units: specify the turret's default rotation.
    • With doors: Only ships which match the hangar door's pattern are allowed to open it.
    • With Bobby AI: Drones could automatically redock to compatible docking ports.
     
    Last edited:

    CyberTao

    鬼佬
    Joined
    Nov 10, 2013
    Messages
    2,564
    Reaction score
    641
    • Legacy Citizen 4
    • Railman Gold
    • Thinking Positive
    So, to simplify; Its a need block which you can arrange into a pattern (Say on the bottom of the turret, and the area near the Turret docking modules), and instead of the Core sitting directly above the Docking module, its shifted so that the Patterns line up?

    It sounds interesting :u But I can see issues with say Turrets getting "stuck" if they end up snapping back.

    Whats more, While I dont know coding, I wonder how well the game will deal with said thing :u What I'm thinking is the 1st PEB will line up fine (They would line up like a Core over a docking module), but for the second one; Would it not just swing the turret around and see if it can force them to Line up? I think it would work better if the PEB were put together in a group, Since multiple groups would end up with the the turret checking and trying to force, failing and realigning (Attempting to check every possibility I mean).

    The Plex door part I dont see why we need though :p allied ships can open Faction plex doors just fine o -o
     
    Joined
    Jan 22, 2014
    Messages
    1,047
    Reaction score
    299
    So, to simplify; Its a need block which you can arrange into a pattern (Say on the bottom of the turret, and the area near the Turret docking modules), and instead of the Core sitting directly above the Docking module, its shifted so that the Patterns line up?
    Yes. This also auto-rotates ships in whatever direction the builder desires.

    It sounds interesting :u But I can see issues with say Turrets getting "stuck" if they end up snapping back.
    The pattern would only be relevant for the process of docking, no further computations needed afterwards. I also didn't think that turret part through (as it was only an example for further applications). It may be feasible to restrict the system to orientation in that case, so that the pattern wouldn't serve as the turret's pivot point.

    Whats more, While I dont know coding, I wonder how well the game will deal with said thing :u What I'm thinking is the 1st PEB will line up fine (They would line up like a Core over a docking module), but for the second one; Would it not just swing the turret around and see if it can force them to Line up? I think it would work better if the PEB were put together in a group, Since multiple groups would end up with the the turret checking and trying to force, failing and realigning (Attempting to check every possibility I mean).
    Well, of course these computations would take place before the game would align a ship, but when checking for compatibility. Checking every possibility is not necessary. There are several ways that could be used to speed up computing.
    The decision that two patterns definitely do not fit can be solved in constant time (by using the number of blocks and a hash sum that is stored with every pattern). The maximum number of blocks could be limited, which introduces several assumptions that can be used (also, already two PEBs theoretically allow an infinite number of possible patterns).
    For a large number of PEBs per pattern, a modification of the Iterative Closest Point algorithm for matching point sets could be used. Even the unmodified version would be quite fast at the scale we're talking about. But since orientations are limited to 6 directions, that would already be too complex. :)

    The Plex door part I dont see why we need though :p allied ships can open Faction plex doors just fine o -o
    Well, that was just an example for further applications that I came up with. For instance, the faction protection of doors could be removed/disabled, so that the pattern needed would be a secret worth protecting. Also, areas that are accessible to only a few faction members, or selected people from other factions could be created. Stuff like that.
     
    Joined
    Aug 28, 2013
    Messages
    1,831
    Reaction score
    374
    • Legacy Citizen 2
    • Top Forum Contributor
    • Legacy Citizen
    The problem is then you lose universal docking capability.
     

    Lecic

    Convicted Lancake Abuser
    Joined
    Apr 14, 2013
    Messages
    5,115
    Reaction score
    1,229
    • Thinking Positive Gold
    • Purchased!
    • Legacy Citizen 11
    This sounds like an awesome idea. I think we should still be able to set an orientation in a settings on a docking module as well, though, so we can have universal docks with orientations.
     

    Fellow Starmadian

    Oh cool so thats what this is
    Joined
    Jun 7, 2014
    Messages
    227
    Reaction score
    87
    • Community Content - Bronze 1
    • Wired for Logic
    • Legacy Citizen 2
    Perhaps instead of using PEBs, we could use a block (Lets call it "PEB 2.0") that we connect to the main docking port, which, when selected with R, opens up a menu which allows certain things to be changed, such as the orientation of the docking ship. You could then have another PEB 2.0 on the docking ship which connects to a DAB (Docking Alignment Block). The DAB would align with the docking port, instead of the core. The two PEB 2.0s would also have some kind of key code that can be changed in the same menu as the orientation, which would only allow matching key codes to dock to one another. That would, in my opinion, cut alot of processing out and probably wouldn't even effect the game all that much, as it is only a couple of parameters that have to be met, instead of a QR code.:D
     
    Joined
    Jun 30, 2013
    Messages
    108
    Reaction score
    29
    anything, I mean anything, to change docking direction.
     
    Joined
    Jun 29, 2013
    Messages
    72
    Reaction score
    23
    Why not this idea for regular docking, and leave turrets alone? I see where this would be a good benefit for regular docking, but for turrets it seems unnecessary. The other thing is perhaps make it limited how much docking space you need based on mass.

    For exmaple: A small fighter only needs the docking port to connect to something (whether something can be docked or not is determined by the smaller ship, which is docking to the larger), but a frigate needs perhaps 3 or 4 PEBs, and a capital ship might need 20 lined up. This way we could still require more blocks/bigger docking area for larger ships, without the current limitation of not being able to dock two large ships together without a ridiculous-looking docking setup (or ignore docking area enabled).
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    How about:
    Docking Module = Array Controller (Docking)
    Docking Enhancers = PEBs​

    Just limit to max 25 blocks per controller and allow a pattern size of 5x5 (can be above or below the door as community-standart)
    That should decrease most calculations to the absolute minimum.

    6*5 =32 and fits as bits into a 32 integer variable.
    JavaScript:
    if( dock.pebMask & cockpit.pebMask = dock.pebMaks)
    . . return true; else return false; // true = docking allowed
    Does it remember you to a QR-code?:


    Use 32 blocks to fill this shape somewhere:
    Code:
    1_ AS SI Z_ E_ _1
    PW PW PW PW PW PW
    PW PW PW PW PW PW
    PW PW PW PW PW PW
    1_ AL PB RA NK _0
    For a community standard, I suggest
    • to have it below the docking port (as it is more important being able to walk between ships than having a roof over the ship-to-ship bridge)
    • use top/bottom left/right with 11 10 (0 = rear right; sets 2 used axis and orientation)
    • use up to 3 blocks (SI Z_ E_) top as binary coded number x in:
      • max allowed ship size = 2^(2*x) blocks (x=7 : 16'384)
        • provide a lookup table "x => size limit" for dummies
      • with 4 blocks, optionally set (first) AS block for all sizes and and use 3 blocks for what you want.
    • use up to 4 blocks (PB AL RA NK) at bottom for:
      • 00 00, 11 11 = (personal only), (friends & ally & public, al members)
      • 0 00, 1 11 = (personal only), (friends (& ally if rank not 0..2), al members)
      • 00, 11 = guild rank 0..4
      • 0, 1 = personal, faction-members
    • use up to 3 lines (middle) for custom data
    • you are able to just leave any row or column empty, then condense/collapse the pattern into a smaller pattern as long
      • as the top/bottom left/right blocks are 1110 the result will be correct.
    I also suggest only flat plane which makes calculations easer and can hide below armour blocks - or having blocks only be distinguishable while in build mode to keep the password save? Server settings by texture? Exploits like a tool-tip when hovering over a block?


    For turrets, maybe it just sets the default orientation?
     
    Last edited:

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    How about, instead of all of this stuff about fancy patterns and data storage, just... you know... have point-to-point (block-to-block) docking, with a block that toggles between off (invisible, nonsolid, does nothing) and on (Visible, will attach to any other one it gets within a 1/2 block radius of until turned off)?
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Like Space Engineers, just let the docking clamp blocks also make a connection (no holes) between the two ships?

    I like it too - especially for RP.
    But some times you want to dock fast and don't have to search the right spot each time with tiny manoeuvres.

    Want my opinion? I want both :)

    BTW: Do you know the old PlexLander blocks? AFAIK SM had something you suggest and I am curious why it is not available any-more, too.
     

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    Like Space Engineers, just let the docking clamp blocks also make a connection (no holes) between the two ships?

    I like it too - especially for RP.
    But some times you want to dock fast and don't have to search the right spot each time with tiny manoeuvres.

    Want my opinion? I want both :)

    BTW: Do you know the old PlexLander blocks? AFAIK SM had something you suggest and I am curious why it is not available any-more, too.
    Want to dock fast? Then stick a docking clamp on your ship's nose. :p

    ...Also, from the PlexLander code retained in a build a little while ago, those things seem to act just like docking units but glitchier... More messing around is needed though...
     
    Last edited:
    Joined
    Jun 6, 2014
    Messages
    78
    Reaction score
    10
    (i should point out, by "we should add", i mean the community or someone, assuming i managed it, let's say it'd be buggy beyond belief, just easier to type this way)
    I did miss a fine point the first time, i thought you were suggesting a passcode docking port, if i'm reading right, your actually suggesting teleporting a player to a ship/station, and "storing" the ship
    with these in mind, i may have a method.
    display's, those mostly decorative blocks, if we add a seprate text storage for it, when you type in the display say "dockcode=password1", it sees dockcode as a command, it passes the text "password1" to the second text storage.
    if you connect a screen with a docking module (or a ship core), it looks for that code before allowing docking to take place.
    since the display only displays that first text storage, the dockcode is NOT displayed, and as a bonus, all the normal functions of the block
    should work (display shields/power...etc)
    (that's the password/passcode side done)

    wherever that linked screen is, is also where a player with THAT code will teleport, so that they are FACING the screen.
    since the display is the main feature, i recommend building on that, a signal to that display triggers it to teleport any person within 5 blocks. if a person is aboard a ship, it'll teleport them to the station.
    IF the person is on a station, it'll check if they CAME from the ship. (maybe a prompt could warn a AUTHORISED person that there is X amount of people included in transport, checkbox the names maybe?)
    of course, it should check the ROOM the screen is facing into, so it don't snatch a pile of random people...

    when the game detects a ship has no players aboard, and it is docked, the game saves the ship, and deletes it. when someone approaches a teleport station (easier then "a display connected to a docking module"), the game checks to see if that player has came from a ship, and if that ship is in dock, or despawned.
    if it's despawned it'll check the docking port, if the docking port is blocked, it'll display a warning the docking port is blocked (to station leaving person) and it'll warn people on the offending ship they are about to be teleported inside.
    i admit, people being well.... will be a problem. but when is it not? this method prevents the use of extra block id's, and gives another use to a block that is pretty much decorative.
     
    Joined
    Mar 15, 2014
    Messages
    238
    Reaction score
    68
    • Community Content - Bronze 1
    • Legacy Citizen 3
    Nerp... all way too complex... just show a 3-axis orientation indicator in adv build mode, and allow us to ROTATE the orientation of the block not just "turn" the block around as we currently can.

    With chain docking now, the logistics of figuring out how a ship will dock is a huge headache, especially with docking on a scaffolding or a construction dock, docked to a station arm, docked to a station. I've actually had to make a "ship" with a core and docking module out off in space away, dock that, then dock my ship to that, to get docking correct in some places. ugh.
     
    Joined
    Jan 22, 2014
    Messages
    1,047
    Reaction score
    299
    @Ithirahad, @Ghent96: I of course thought of your solutions, too. However, they are a lot less powerful than mine is. For example, mine does not only allow point-to-point docking and player-chosen docking directions. It does also allow you to layout out your ship like you want. You place a docking port somewhere on your ship, no matter the side or orientation and your ship will dock, point-to-point, with the right orientation, to the mothership.
    The difference: In your solutions the mothership still has a fixed docking direction. It may not be forward, but backward, but that does still empose design limitations on ships that have to dock, because they all have to have their docking ports on specific places of the ship. That is actually not much better than the current system.

    @srs008: Nope, it is about docking, and yes, it kind of works like a passcode. I'm suggesting an extension to the existing docking system that allows point-to-point docking and auto-rotating ships accordingly.
     
    Joined
    Mar 15, 2014
    Messages
    238
    Reaction score
    68
    • Community Content - Bronze 1
    • Legacy Citizen 3
    How differently can I explain the words "too complex", such that they are understood? :/
    SIMPLE! KEEP IT SIMPLE.
    I'm sorry to be so blunt and offend some of you, but all the above proposed systems suck. It's way too complex. Gameplay needs to be accessible to EVERYONE regardless of their knowledge of hexadecimal, geometry, or QR encoding. Seriously... if you're so into programming complexity, go make a game from scratch, don't propose to put programming front & center in actual gameplay of an existing game. The point of StarMade is not to teach programming ;p

    There is absolutely no weakness or deficiency to simply allowing docking module rotation along all axes, der_scheme. I don't think you understood my explanation. Ships dock core-over-core on center. It's how the game is coded. Docking Enhancers are broken and underbalanced, and /ignore_docking_area true just needs to be a default setting in the game, especially now with chain docking. If something docks with clipping, then the game needs to have a clipping check. If enough people cry out for a way to modify the position of the docking area relative to the module/core/center, then docking modules can be given a dialogue box like Bobby AI or Faction Modules that allows a precise dimension and x,y,z start to be set for that docking zone, and a check-box for "allow any". That will be much simpler than adding more blocks or controllers or whatever.
     
    • Like
    Reactions: Ithirahad
    Joined
    Jan 22, 2014
    Messages
    1,047
    Reaction score
    299
    No, I don't think you understood the problem. A GUI for that stuff makes it less flexible and more complex. Or do you want to change settings everytime you attempt to dock with a ship that has a different layout? No, you don't. My solution works for every ship. All it has to do is, programmer's talk on, to implement an interface, programmer's talk off. Your solution can't do that, it requires fix constraints for both ships.
    My solution is clean and simple. Do I look like I care about complex shit? No. What do you think is hard about: Place blocks somehow on the mothership, place blocks in the same pattern on the docked ship, now you can dock. Or ignore it and dock like before.
     
    Joined
    Aug 28, 2013
    Messages
    1,831
    Reaction score
    374
    • Legacy Citizen 2
    • Top Forum Contributor
    • Legacy Citizen
    I think @Zanaten 's concept will be easier. Use a second module to redefine the "front" of either a docking module or it's corresponding piece. Simple, expands existing system.
    Also, another tweak to docking: Docked ships should be on the grid of the main ship, instead of 1/2 a block off when docked. To avoid clipping issues on undocking, the ship will have that half block added back into its position when undocking. This gives us a nice visual indicator that we've undocked.
     
    Joined
    Jan 22, 2014
    Messages
    1,047
    Reaction score
    299
    Okay, let me explain it like this: You have a mothership/station with a docking port. You have three other ships that you want to be able to dock.
    1. A gunboat. It has its docking port at the dorsal side.
    2. A corvette. It has its docking port at the starboard side.
    3. A cruiser. It has its docking port at the aft side.
    It should be obvious to everyone that you can't solve this by defining a fixed docking direction, because then it would only be right for one of the ships. The important part is that the layout of the docking ship should define docking direction, not the mothership.
    I was unable to find the suggestion you hinted, @ltmauve, but I'm certain you couldn't solve the gunboat issue, not sure about the other ones.

    And now, imagine you have different docking ports—for instance, the corvette could also have a boarding ramp to be used in hangars. Also imagine someone wanted to build a ship with multiple gravity directions. Those people shouldn't be limited in their creativity by a limiting docking system.