How to implement cl...

Clear all

# How to implement client-side prediction and reconcile this with what the server and other clients see?

1 Posts
1 Users
0 Likes
1 Views Illustrious Member
Joined: 4 months ago
Posts: 57371
Topic starter

I’m aware there’s a lot of issues regarding online play. One major being player synchronization such as their position and inputs. I know there are several techniques to help with this.

First from what I understand about client sided prediction is the client runs the same update logic as the server. So when a player presses an input it simulates that input but also sends it to the server which then simulates that input? But the issue with this is the server receives it later than when then client pressed it. But the server is the authority so only their position is the real position. Does the server then respond with the real position and the client goes to it?

Then does the server just send the input of player one to player two or the position? If it sends the input then player two can act out player ones movements albeit incredibly late but more realistic, but if it sends the position then player one’s movement looks extremely jumpy to player two.

So does the server send player one’s input to player two but every several frames sends the position to make sure they’re aware of the real position as allowed to the position the clients are simulating?

In order to prevent this jumping of positions the clients should interpolate the movement from their previous position to the newest position the server sends and this involves all game objects like projectiles as well?

What is the usefulness of a high precision timer in multiplayer development why would a regular timer not work?

Do clients need to send their current frame to the server? What’s the purpose? Do they need to synchronize times and frames?

I’m just trying to grasp these multiplayer concepts and adapt them to simple two player games but it’s all very confusing.

## Cut points, continuous paths and increasing sequence of sets

currently I have a question about the following point-set topology problem. Everything takes place in $$(mathbb C,|cdot|)$$ and we are given the following setup.

1. One has a sequence of closed connected sets of points in the complex plane $${L_t}_{t geq 0}$$ (the precise definition for this problem should be irrelavant) such that $$L_t subseteq L_{t+s}$$ for each $$s > 0$$. So basically as $$t$$ increases the set grows aswell.
2. There exist continuous curves $$gamma$$ such that for each $$t geq 0$$ one has $$gamma : [-t,t] to mathbb C$$ such that $$gamma([-t,t]) subseteq L_t$$. Moreover we know especially that $$gamma(t+s)$$ and $$gamma(-(t+s))$$ are not in $$L_t$$ and together with another given property one can actually proof that $$gamma(t)$$ and $$gamma(-t)$$ are cut points of $$L_{t+s}$$ for $$s > 0$$. Using the definition found here this tells us (for example) that $$L_{t+s} setminus gamma(t)$$ is disconnected.

Question: We already have for each $$t geq 0 : gamma([-t,t]) subseteq L_t$$ I want to proof that one actually has equality, i.e. $$L_t = gamma([-t,t])$$.

Idea: Take for example $$[a,b]$$ in $$mathbb R$$ then every point $$c in (a,b)$$ is a cutpoint, the important take away here is that the ”end-points” of the interval $$[a,b]$$ are not cutpoints. Here something similiar should be possible. Since $$gamma(t)$$ is a cut point of $$L_{t+s}$$ it cannot be that that $$L_{t+s} setminus L_t$$ did not grow ”along” $$gamma(t)$$. Growing say along the middle of the curve around $$gamma(t/2)$$ should contradict some combination of the notion of cut point and continuity of $$gamma$$ but I find it hard to write down precisely.

## ref{xyz} with usepackage{hyperref} not working correctly

I use pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)

I put label on sections, figures, etc.

I had been using texlive 2016. Until I installed texlive 2022, ref{xyz} produced only the number for xyz.

Now it includes the number, the title (section name, figure caption, …) what it is (section, figure, …) and then the number again.

For example, with an equation having label{Flow}, when I wrote “Equation (ref{Flow})” I used to get “Equation (2)”. Now I get “Equation (2Flowequation.3.2)”

This occurs both using documentclass{article} and a proprietary class for a professional journal. I haven’t tried others.

I’ve “compiled” in a fresh directory, so it’s not due to confusion caused by an old .aux file.

Without including hypeffef, I get only the number — but of course no hyperlink.

Is there a repair for this?

## Is there a Wayland diagnostic to check for supported display resolutions?

So far as I can tell, the listed resolutions:

``````nicholas@mordor:~\$
nicholas@mordor:~\$ cat /sys/class/drm/card0/card0-VGA-1/modes
1024x768
800x600
800x600
848x480
640x480
nicholas@mordor:~\$
nicholas@mordor:~\$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:    22.04
Codename:   jammy
nicholas@mordor:~\$
``````

match what is shown in `setting` exactly. However, prior to logging out, higher resolutions were available.

Is there a diagnostic to re-check supported resolutions?

## Is \$ mu(E times F) leq nu(E times F) forall (E,F) implies mu(A) leq nu(A) forall A in mathcal{E} otimes mathcal{F} \$ true?

Let $$(X,mathcal{E})$$ and $$(Y,mathcal{F})$$ denote two measurable spaces and let $$mu,nu$$ denote two finite measures on $$(X times Y, mathcal{E} otimes mathcal{F})$$, where $$mathcal{E} otimes mathcal{F}:= sigma(mathcal{E} times mathcal{F})$$. Consider the claim

$$mu(E times F) leq nu(E times F) text{ for all } (E,F) in mathcal{E} times mathcal{F} implies mu(A) leq nu(A) text{ for all } A in mathcal{E} otimes mathcal{F}.$$

Question: Is this claim true?

Attempt:

Define the set $$M = {A in mathcal{E} otimes mathcal{F} colon mu(A) leq nu(A)}.$$
Then we want to show that $$M = mathcal{E} otimes mathcal{F}$$. Note that clearly $$M subseteq mathcal{E} otimes mathcal{F}$$. For the other inclusion, we have by assumption that $$mathcal{E} times mathcal{F} subseteq M$$ so it follows that $$mathcal{E} otimes mathcal{F}= sigma(mathcal{E} times mathcal{F}) subseteq sigma (M)$$ and hence it would suffice to show $$M$$ is a $$sigma$$-algebra.

However I am not sure this is the case. I can’t seem to show that $$M$$ is closed under complements and countable unions. In particular say for the union part, we can do the following:
$$mu(bigcup_{n in mathbb{N}}A_n) leq sum_{n in mathbb{N}} mu(A_n) leq sum_{n in mathbb{N}} nu(A_n),$$
but then we cannot go back to $$nu(bigcup_{n in mathbb{N}}A_n)$$. So this is where I am stuck.

I have also tried to look at Dynkin’s $$pi$$-theorem but at least I could not see how this was useful here.

Also I haven’t been able to come up with any counterexample yet.

As a final remark, I will just need to apply this result for $$mathcal{E},mathcal{F} = mathcal{B(mathbb{R}^d}),mathcal{B(mathbb{R}^m})$$ but I would like to prove it higher generality if this is indeed possible. If this is not possible, are there any conditions we can impose for it to hold? Any feedback/help is much appreciated!

## Problem to define a key and the associated value of a table from a variable

I’m sorry for the imprecision of my question but I couldn’t find a way to describe my problem correctly.

I created a new package and in the “lua” part, I use two classes, one for points and the other for lines. Two tables `z` and `L` are associated to these classes. In the first one are stored the points and in the second the lines.
For example for points `z.a = point: new (1,2)`. This defines the point `a` whose affix (complex number) is `1+2i`. In the table here the key is `a` and the value `1+2i` . In the same way if `a` and `b` are defined, I can define a line with for example `L.a__b = line: new (z.a,z.b)`. This is a bit more complicated because tables are stored in a table.

I may be wrong but I think my problem can be translated like this:
If x=a and y=b then how do I define a function that gives me `L.a__b = line: new (z.a,z.b)`, `L.x__y` etc. gives nothing.

The package can be found on this page tkz-elements. You will find in the archive the code of tkz-elements a readme and a small documentation and several examples. All this is still experimental!

Here is the more complete code:

``````documentclass{article}
usepackage{tkz-euclide}
usepackage{tkz-elements}
begin{document}
parindent = 0pt

begin{elements}
z.a = point: new (0, -1)
z.b = point: new (4, 2)
z.c = point: new (1, 2)
z.d = point: new (-1, 3)
L.a__b = line: new (z.a,z.b)
L.a__d = line: new (z.a,z.d)
L.d__b = line: new (z.d,z.b)
-- L.c__d = line: new (z.c,z.d)
-- z.i =intersection_ll_ (L.a__b,L.c__d)

va = tostring(c__d)
for i in pairs(L) do
if i == va then
else
_, _,ft, sd = string.find( "c__d", "(.+)__(.+)" )
L["ft__sd"] = line: new (z.ft,z.sd)  -- wrong !
--  tex.print(ft..'__'..sd)   -- to show the values of ft and sd
break
end
end

-- the next code is here to show the different values
for i,k in pairs(L) do
tex.print(tostring(k)..";"..tostring(i))
for u,v in pairs(k)
do
tex.print(tostring(v))
end
tex.print('\\')
end
end{elements}

begin{tikzpicture}
tkzGetNodes

tkzDrawPoints(a,b,c,d)
tkzLabelPoints(a,b,c,d)
end{tikzpicture}
end{document}
``````

Some explanations: 4 points are defined then 4 lines but I commented the last one `L.c__d` to show my problem.
The code allows to get the intersection of two lines if they are defined. I would like to find a test to know if one of them is not defined and in this case create it automatically.
Having commented `L.c__d = line: new (z.c,z.d)` this line is no longer defined. So I parse the expression representing this line with the `string.find` function and get `ft` and `sd` which point to `c` and `d`.

Question: How can I use `ft` and `sd` to get `L.c__d = line: new (z.c,z.d)`? ## AppImage .desktop file not showing on dock

I’m on Ubuntu 22.04.2 LTS.
I have two `.desktop` executable files for the Keet AppImage in my `.local/share/applications` folder.
I didn´t create them they have been created by the app I suppose.
However they are both not showing on my dock (I have Dash to Dock installed).
All the others AppImages are showing.
If I run them form the terminal with `gtk-launch keet` or `gtk-launch appimagekit_8d9752879526b100ab8504901c9bd0a4-Keet` the app starts succesfully.
Removing one of the two files and restarting the system does not fix the issue.
What can be the reason and how can I solve the issue?
The content of the files is:

``````[Desktop Entry]
Name=Keet
Exec=/home/giovanni/snap/Keet_7695b52a4e54b87f751f760f6ab65255.AppImage %U
Terminal=false
Icon=keet
Type=Application
StartupWMClass=Keet
X-AppImage-Version=1.0.1
Comment=Keet
MimeType=x-scheme-handler/punch;x-scheme-handler/holepunch
``````

and :

``````[Desktop Entry]
Name=Keet
Exec=/home/giovanni/snap/Keet_7695b52a4e54b87f751f760f6ab65255.AppImage
Icon=appimagekit_8d9752879526b100ab8504901c9bd0a4_keet
Type=Application
Categories=Network;AudioVideo;

TryExec=/home/giovanni/snap/Keet_7695b52a4e54b87f751f760f6ab65255.AppImage
X-AppImage-Old-Icon=keet
X-AppImage-Identifier=8d9752879526b100ab8504901c9bd0a4
Actions=Remove;
X-AppImageLauncher-Version=2.2.0 (git commit 0f91801), built on 2020-09-29 21:36:15 UTC
``````

## How to install Ubuntu server 20.04 with UEFI (non gui)

I have done this before but the current ISO installer does not match my notes from previous installs.

ISO: ubuntu-20.04.5-live-server-amd64 using non gui installer via idrac.

get to disk partitioning
select disk the only option is to add a GPT partition and no option to format as ESP.

How should I create a /boot partition for UEFI?

All the stuff I turned up in searching used the GUI install where the dialogue was different.

## Elements of the coset G/H, where G=\$GL^+\$(2) and H=SO(2)

In this paper1 in section 2, a method to write the elements of the coset of G/H is provided for GL(4), but I am interested in $$GL^+$$(2).

My matrix representation of $$mathfrak{gl}(2)$$ is

$$begin{bmatrix} a+x& -b+y\ b+y & a-x end{bmatrix}$$

My matrix representation of $$mathfrak{so}(2)$$ is

$$begin{bmatrix} 0& -b\ b & 0 end{bmatrix}$$

Reading the paper, it states that the element g of G can be decomposed as g=$$gamma$$h, where

$$gamma = exp left( begin{bmatrix} a+x& +y\ y & a-x end{bmatrix} right) in G/H$$

and where

$$h = exp left( begin{bmatrix} 0& -b\ b & 0 end{bmatrix} right) in H$$

Is this correct, or no?

I am suspicious of the argument, because to me

$$exp left( begin{bmatrix} a+x& y\ y & a-x end{bmatrix} right)exp left( begin{bmatrix} 0& -b\ b & 0 end{bmatrix} right) neq exp left( begin{bmatrix} a+x& -b+y\ b+y & a-x end{bmatrix} right)$$

Thus, $$gamma h$$ does not appear to realize all elements of $$G$$. Or do we not care about some missing elements for cosets?

## Project not working after moving to WSL directory

My dockerized Lumen project had slow response time so according to advices I moved my project from my classic path C:Mgrlumen_laravellumenmysql to wsl.localhostUbuntuhomesamolumenmysql, then created Z: drive so I can open terminal in that location and run “docker-compose up -d”.
In previous adress it was working.I didnt change any code and have got error. Any advices? Thank you.

error in docker

2023-03-21 22:49:00 AH00112: Warning: DocumentRoot [/var/www/html/public] does not exist

According to docker inspect Mount info it exists

/VAR/WWW/HTML Z:homesamolumenmysql

docker-compose.yml

``````version: '3.8'

services:

mysqldb:
image: mysql:5.7
container_name : mysqldb
restart: always
volumes:
- \${DOCKER_MYSQL_VOLUME:-/opt/db_data}:/var/lib/mysql
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: diplomovka

environment:
PMA_HOST: mysqldb
ports:
- "3400:80"
depends_on:
- mysqldb

app:
container_name: Lumen
build:
context: .
dockerfile: Dockerfile
volumes:
- ./:/var/www/html
restart: \${DOCKER_RESTART_POLICY:-always}
ports:
- "9000:80"
working_dir: /var/www/html
environment:
MYSQL_HOST: mysqldb
MYSQL_USER: root
MYSQL_PORT: 3306
``````

vhost.conf

``````<VirtualHost *:80>
ServerName localhost

DocumentRoot /var/www/html/public

<Directory "/var/www/html">
AllowOverride all
Require all granted
</Directory>

ErrorLog \${APACHE_LOG_DIR}/error.log
CustomLog \${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
``````

Dockerfile

``````FROM php:7.4.19-apache

WORKDIR /var/www/html

RUN apt-get update && apt-get install -y
zlib1g-dev
libzip-dev
libonig-dev
curl

&& docker-php-ext-install pdo_mysql
&& docker-php-ext-install mysqli
&& docker-php-source delete

COPY ./vhost.conf /etc/apache2/sites-available/000-default.conf

COPY ./ ./

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN chown -R www-data:www-data /var/www/html
&& a2enmod rewrite

RUN cd /var/www/html && composer install && php artisan key:generate
``````

## Using Root Test to see whether \$sum_{n=1}^{infty}frac{n^{n+frac{1}{n}}}{(n+frac{1}{n})^{n}}\$ converges

This exercise specifically requires that we use the root test to determine whether the series converges or not.

All I’ve done so far is get the sequence in this form:
$$sqrt[n] frac{n^{n+frac{1}{n}}}{(n+frac{1}{n})^{n}} = sqrt frac{n^{(1+n^{-2})n}}{(n+frac{1}{n})^n}=frac{n^{1+n^{-2}}}{n+frac{1}{n}} = frac{n^{frac{n^2+1}{n^{2}}}}{n^{2}+1}$$

But, I’m not even sure if I’m on the right track here. Any guidance is appreciated.

Edit: I showed my effort. I didn’t tell anyone to solve it for me. Not sure why the downvotes..

Share: