Skip to content
Meridian 59
Feedback Open

Server Player Location Updates

🦀 Ella ·

[Copying this over with all relevant discussion from the old feedback channel because I don’t want it to be lost]

From @Essun

So I suspect you guys are aware of this already, but I wanted to make a feedback post anyway..

There seems to be an issue with player positions not being updated with the server frequently enough. It manifests in a lot of different ways. The one I hear people talk about most often is in PVP, particularly when using melee weapons. It will often look like you’re right on top of someone but since the server updates the player position so slowly, in reality that player will be in a completely different location and we’ll see a lot of the “is too far away to hit” message. This essentially makes melee weapons useless in a lot of PVP scenarios. Chance to hit with bow > no chance to even swing at all.

But it also manifests in other ways, i.e. sometimes when changing from zone to zone, if you turn around quickly before going through a zone, your character won’t be facing the same way when you walk through the door, which can be very disorienting. And then sometimes when you go to loot something, even though it will look like you’re right on top of the item on your screen, the game will return the “it’s too far away” message because the server thinks you’re still like 10-20 feet away when you aren’t. In those instances, you can’t move and then pick up stuff right away, but if you move, wait a few seconds, and then loot, it will work from the exact same spot you received the “too far away” message.

Most annoying manifestation of it for me is probably with spells that require concentration. Every time I cast one of those, if I’ve been moving beforehand, I’ll always wait ~5 seconds after stopping before actually casting it, because if I don’t, there’s a big risk that the server will think I was still moving when I cast it and then tell me I’ve lost my concentration and the spell was interrupted, when on my screen I’ve not moved at all.

Discussion 78

🦀 Ella Author

If you want an easy/consistent way to test this and see what I’m talking about, try running in a straight line and then resting in the middle of your run, the server will move your character back to where it thinks you are at the moment you click rest are and it’s very jarring. If you hit the key that makes you do an instant 180 just before clicking rest, it’ll be even more jarring! Pretty sure whatever’s happening here is the same as what happens when you go through a zone and are affected by the positioning issue.

🦀 Ella Author · edited

=====

from @playtoh

I’ve wondered about that one for (literally) decades too. I can only imagine the gameplay repercussions of a “fix”, since melee weapons are largely unusable on moving targets in real time - you have to quasi-predict where the player is trying to run, and get your model “ahead” of it to score a hit.

Primary driver in ranged combat is the ability to land skills/attacks. Unless you’re holding or blinding, melee is can be very challenging by comparison. TLDR: Agreed, Essun!

🦀 Ella Author · edited

=====

from @blackpanther6389

To me, this is probably the single most important issue to resolve on the server. I do the quadi-prediction stuff because I prefer melee over just bowing, but it’s still a major issue in my pvp play style. And the other issues Essun stated are also very important mechanics with those position update issues - the loot aspect as well as trying concentration cast right after stopping movement

🦀 Ella Author · edited

=====

from @Trev

Vets have learned to live with it but it would be a huge improvement to the game if it were fixed.

Again, something vets can kind of work around and a major frustration for anyone new trying to enjoy the game. Should be a top priority.

MeepMeep

Unresolved.

blackpanther6389

I’m still not completely familiar with using version control - what do these posts mean? These look like PR’s from years ago. Are these PRs that are to be merged with the official server?

MeepMeep

It’s old work for reference to help any active coder who may see this issue.

blackpanther6389

Ohhh

CoolMike

The closed PR #273 has a lot of stuff that I don’t think is necessary. My knee jerk reaction is that we are merging in a lot of related but separate issues all at once. In principal we can update just move.c, player.kod, and user.kod. The PR looks like they are updating the frequency of sending movement packets to the server without updating the frequency that the server expects these updates. There is then a bunch of code that looks for too-frequent updates in order to prevent hacking and/or handle cases of extreme lag. There appear to be problems handling this with the more frequent updates and so a new parameter GETTICKCOUNT was added and this is referenced in a bunch of spots. I’m easily the least likely person to be able to fix this but I’m happy to break some shit on my test server if it helps get the ball rolling.

CoolMike

How concerned do we need to be about teleport and speed hacking? How concerned do we need to be about false-positives on the teleporting and speed hacking detection parts of the code? The server lets you send a limited number of update requests at once and if you cross this threshold you can get flagged. The teleport detection looks simpler but I can’t say I understand it very well.

MeepMeep · edited

This stuff isn’t merged. These are pulled from other branches. I put them here for reference only. Note: be careful with old branches, news came out recently about potential for unverified GitHub projects with multiple owners being infected by malware. Helpful to see what has been done however.

Daenks

Would just like to say the old OpenMeridian codebase is clean. I scanned it extensively not more than 6 months ago, and since there has been no changes in years it should be 100% safe.

👍1 ❤️1
MeepMeep

Appreciate the feedback @CoolMike

MeepMeep

The OS branches are a bit obfuscated and inconsistent, unsure which of these speak to the problem at hand, I did my best to find what was available

CoolMike

Ok thanks - the code in PR273 looks reasonable but is more extensive than needed in my opinion. That PR was on the mother-ship github account I think but I could be wrong. My fix is simpler but also extremely unlikley to work but I will enjoy testing it. I really enjoyed trying and failing to fix the light jerkin display bug. I still have some other ideas to try on that one. One thing I need to get smarter about is version control - github doesn’t always work as expected for me. From now on I will only push updates to branches of my fork for this reason.

Daenks

On the topic in general, i saw some concerns posted elsewhere about single threadedness and possible movement issues with 100+ players. From experience i can say that 103 in its hayday had 120+ on and had no issues with our 250ms speed. There was live PvP at the time as well and we had no major complaints.

Daenks

The speedhack detection we used was pretty good, but not perfect. We used it in info-only mode for a while, then had it start auto-kicking users after some tweaking. Never had it auto-ban or anything more severe. Occasionally would get complaints on this for false positives.

davidklaw admin

Thanks for that info @Daenks. It looks as if OpenMeridian was updated for several years after the last commit was made to the public repository. Do you know if any additional headway was made in this area past Jan 2015?

Daenks

As far as I know, all changes to server 103 past the last GitHub commit are all Gar’s work, and he’s not a server technology guy, more of a worldbuilder. Any further work in this arena would have been done by 105. I’ve only very briefly looked at changes 105 has made from a code perspective, and am not familiar enough with any of that to comment further.

playtoh

@Gar You’ve probably already seen this if you checked the feedback backlog, but just in case. Pinging you on it since folks seem to believe you had a major hand in fixing it on 103. This is one of those that you’d describe as a universally loved change that doesn’t effect the integrity of the original game. Its a shameless plug (because I’d enjoy its result!) but here I am doing it.

CoolMike

Gar would probably know: Is there a way to just update the frequency from 1.0 seconds to 0.5 seconds for now, doubling all of the lag and over-flow checks in the process and see how that works? The PRs that were submitted were huge and included a dozen files changed and that seems tricky for our legacy product.

CoolMike

We may also have to cut in half the minimum step size

Gar

i’m about to go on vacation for 2 weeks but this was definitely something open source did

Gar

y’all can scan github code in the relevant locations

Gar

it essentially eliminated dot lag

Gar

i’ll find it when i get back

CoolMike

Enjoy your vacation!

MeepMeep

Bump.

CoolMike

I don’t think I’m the most qualified person to work on this. That said: if I were to test this on my server and intentionally generate a bunch of cheater logs - where would I find those logs? Perhaps I can at least help identify issues for someone who knows better than I how to handle this.

MeepMeep

This is one of the top issues that would go a long way towards the fun feel of the action gameplay for PVE and PVP, and would really put melee combat to where it should be.

I look forward to the first tournaments that have this taken care of.

Aesica

I agree 1000%, but netcode is beyond my expertise at the moment

Aesica

But like, the game has needed this fixed for over 25 years

CoolMike

I think it can be done without too much messing around. There are a few problems. Chiefly: How do we test this to make sure it works in the real world.
Secondarily: How do we ensure we are not tripping any of the spam and input buffer tools. Finally there is some weirdness with, of all things, wall spells that will need to be looked at. For some reason wall spells are sending client move messages according to the comments in the code.

CoolMike

I have a build with half the apparent lag set up and its running without issues. I just timed myself running across the Marion map and the amount of time is the same as on server 101.

This surprised me because I didn’t update the number of steps per move input or the minimum number of steps per move. The movement doesn’t work exactly how I thought it would. The game lets the client move in their world instantaneously - under the assumption the move is legal. This is obvious to the casual player. Less obvious: the game also sends this information to other clients immediately. Then later the server checks to make sure it agrees with where the clients think the player is. This happens once per second right now.

As a test, go to 101 and have two characters face each other. Press D to strafe right - but press it like you would if you were typing a word with the leter D - a single quick hit. Watch your character from the other screen (from the non moving character). The character will move almost instantly. Then about 1 second passes and the character will shift subtly to where the server wants the player to end up.

I will have to sit and have a good think about how this effect stacks up with larger longer movements. For movements longer than a second there will be multiple user movement corrections like this. The strange thing is that these corrections don’t seem to stack up and create jerky motion.

I think its likely I’m misunderstanding something but will look again for a bit tomorrow on my lunch break.

CoolMike

A good test will be fighting Avar Chieftans. I think I will try that later.

CoolMike

Another strange thing: When calculating range for melee attacks the game uses the last known position occording to the server of the two objects. Why not use the apparent positions of the players according to either client? Is this too likely to be abused? Quake 3 had a game mode that works that way. For Quake Live all hit-scan weapons used that technique.

blackpanther6389

How are the ways it could be abused though? A person having a better connection? I can’t think of other ways

CoolMike

I’m no hacker but putting something like that client side would mean players could hack their client to always report that the target is in melee range. We would have to put some sort of secondary check in I think

blackpanther6389

Ohhh, gotcha

CoolMike

All I am doing is changing the server move update frequency to 500 ms and then when we compare number of moves sent to the elapsed time in seconds we just double the elapsed time. There is a move_counter_threshold that I changed but I on’t think it is needed. I’ll probably test it at 100ms just to make sure the apparent difference I see is real. Final proposal will be either 250ms or 500ms. I’ll have to test wall spells to make sure they don’t double the damage as you move through them, spider web, all the pseudo-jumps we have in the game, and a bunch of other stuff.

Thoughts appreciated!

CoolMike

One comment: If you are working on this please do not assume I will be able to advance this to production. My chances of solving this issue are slim: <10% I would say as I have no experience and am way outside of my comfort zone. I’m just hoping a little bit of action gets someone better qualified to look at this.

Gar

i’ll try to take a look at this using the old open source change to dot lag. I’m not a server infrastructure guy but I can recreate what a pull request already did

Gar

at fast enough update speed, I think 103 is 250ms, dot lag no longer really affects pvp in a human detectable way

Gar

if you think you can hit someone, you usually can

CoolMike

I messed around with this. The movement doesn’t work as I expected. Movement translates ‘immediately’ - that is if you are running two clients and facing each other and move one user you will see the player move in 2x your latency and the effect appears instant for most users.

The strangeness is: The movement happens optimistically and then every second the server looks at where the player is vs where the server expects the player to be and then the server moves the player to the expected location. This movement is enough to break your trance when casting a spell!

If you set this value to equal the maximum user-request move frequency then the server update / player movement check never falls out of synch. The trouble with doing this is that we trip a cheat detector - although only rarely when changing rooms. This is despite the fact that I greatly loosened up the thresholds for cheating. So clearly I am missing some detail.

I really want to keep the scope of this change as small as possible. Adding 50+ lines to something so fundamental to the game feels like a recipe for trouble.

Gar

i mean it is fundamental, but we’ve also run it for over a decade on other servers, so the bugs have definitely been worked out

Gar

hmm i’ll try to figure out how they got around breaking concentration and the like

Keltic CenWulf

Can we expand this Feedback topic beyond Player locations to include NPC’s? It is frustrating to land the deathblow on the ghost and watch him retreat behind a wall to die leaving loot inaccessible. Just saying.

Gar

that’s actually something different, bt yeah can fix that too

Keltic CenWulf

Woot!!

playtoh

To revisit / bump: this remains the single biggest issue with Meridian 59 in its original form; the inability to detect where other players or NPCs are relative to you.

🦀 Ella Author · edited

Whoever cracks this is going to be a legend.

(not that our devs aren’t already legends)

MeepMeep

…we’ve gotten so used to the movement and combat timing that it has become its own skill

MeepMeep

I remember fungus beasts (and zombies) used to be the biggest culprit - their animation never matched their location, they’d appear to be hitting you from very far away and slowly it would catch up to their actual location. PC did something to fix that and make it less egregious.

playtoh

Given the bumper crop of new players, I’m going to go out on a limb and advocate for this one more time; especially because there are developers currently active in the project and because it would be incredibly meaningful.

@Toko was kind enough to point out an example PR (https://github.com/Meridian59/Meridian59/pull/273) that could be used as a jumping off point. I know I bugged @Gar about it in-game, but if @Aesica @DavidKlaw or anyone else I’m forgetting about has the time or energy…..

Be the hero that makes melee combat an actual thing!

Gar

Wait was that fix merged? Did it not work?

playtoh

No - it looks like it was plain old closed/abandoned

Gar

welp i’ll get into it and see what i can do

playtoh

What did you find @Gar? Doable?

Gar

yes it’s definitely doable, i’m trying to sort it out. the codebases are very different so i’m having to figure out some things that don’t make sense

playtoh

Just saw the initial PR get closed. Is the dream dead?

Gar

no, that component’s only part of a speedhack detection system, also CoolMike has lots of progress on this and i’m talking to him

playtoh

Gotcha. Appreciate the time. This is the one I’m really looking forward to.

playtoh

Great to hear. When this hits live its going to blow minds.

playtoh

Thanks to you and @CoolMike for keeping the train on the tracks

playtoh

Hey @Gar and @CoolMike - quick nudge from a desperate schmuck. Anything I can do to help? Willing to setup a dev env and test

Gar

Best thing would be to get a dedicated conversation w/ Zaphod and other important folk going for this specific issue. Thing is, pieces of this have been done, but I believe Z expressed concern over doubling or quadrupling movement packets. So it’s potentially up in the air whether the team even wants it? I’m unclear

It occurs to me, rereading this, that there is a way to do part of this without increasing movement packet frequency. A major part of the problem is the client side equation for smoothing movement from one player position to the next. If a player position is updated every 1 second, but the equation takes longer than 1 second to drift the player from one spot to the next, continual movement compounds the problem. I think that’s a major part of why it gets so off the longer a fight goes on, and also why hold procs are so OP (they force update you to the right spot and reset all your accumulated lag). If someone could tune up that drift speed, it would eliminate the compounding difference between where you appear to be and where you actually are. The concern is of course that it definitely can’t be less than 1 second, or you would start to get ‘halting’. Step, halt, step, halt. It would have to be basically exact. Or maybe we can just get closer to 1 second

Zoning in between areas and being faced the wrong way isn’t necessarily part of all this. Some doors and zone edges give the player a set direction in the new area. That could be fixed on a case by case basis

SpaceHarvester

What happened to this? Is it possible?

From skimming this it seems quite difficult especially since it still hasn’t been cracked a year later

Sign in to join the discussion.