Skip to content

u/Elronnd

In this archive from Aug 2015 to Mar 2020

45
posts
118
comments
17
media
2k
score

It is not, it is for the sake of efficiency. They a shader which can handle 256 lights, and to handle more would make the shader less efficient. (Although, it would be possible to have a switch over to a less efficient light shader, or do multiple render passes, that you can switch on if you have need of more lights; wonder if that's in the pipeline?)

2 points

Whoah, that was in-depth! I didn't quite understand all of it, I just decided to try out godot a couple of days ago and I noticed that when window size != monitor size and fullscreen is enabled, text doesn't look very good (and neither do sprites).

I'm also using godot's default 2-d scene type, so it look like your remarks on using a 3d scene + polygons that don't use the 3rd dimension don't apply? Or are you saying I need to do that in order to get proper AA?

1 points

Yes, that's what I did, but there is still a logical resolution that's rendered to. I want the logical resolution to be constant so that internal figurings can be easier (eg I can say this sprite moves at 3px/s). For example, my screen is 1366x768, I set the window size to 1920x1080 so it has to scale it down to fit on my screen and it looks awful. When I use something like SDL, this works fine -- I can set the size to whatever the monitor is, logical size to 1920x1080, render in terms of the 1920x1080 dimensionality and even though it's scaled down it looks fine.

1 points

Yep, just alsa and jack. No pulseaudio and I'd like to keep it that way if possible :)

That link is where I got the guide from; the other method works, but it's supposed to be not as good (and actually I notice a slight delay when unpausing mpv with ao=alsa compared to when ao=jack -- nothing major, but I'd like to avoid it). I will ask in /r/linuxaudio.

1 points

How can I make better curves? I spent a while tweaking it but they still don't look very good. Might make it into an animation when I get back to a computer.

1 points

As you mention, it's not a very good idea to have the client send timestamped messages to the server because that can and, in fact, will be exploited. If you game gets as popular as you want it to, I guarantee it. So instead, here's what I'd do.


First, have the client calculate its average ping to the server. Update this over the course of the game, in case the server gets more or less loaded, or the amount of network congestion changes. Let's say it's 60ms, round-trip. Then, divide that by two to get that it'll take about 30ms, on average, for a message to get to the server. After the player does something, send the message to the server (without a timestamp), saying it happened, then wait 30ms and start simulating it on the client. After the server gets the message, it should acknowledge it, with a timestamp. Let's say that the server actually got it at 35ms later, so the client gets back an acknowledgment at 70ms that the action was received at 35ms. So then it rewinds time back to 30ms, undoes the action, then fast-forwards to 35ms, makes the action perform then, then fast-forwards again back to 70ms.

If the server gets back to the client before the client predicted, then you just have to rewind time a bit more.

This does introduce a small amount of jitter, if the action was 'start moving up', then the client would start moving up and then jump back down slightly. You can increase the latency but reduce the jitter, by doing this. Pick a value that's a bit more than half; say, 40ms. Send that value as a timestamp to the server. Now, if the server receives it at 35ms but the timestamp if 40ms, that's fine -- it's okay to make things happen in the future, just not to rewrite the past. The server can just acknowledge that the action happened at 40ms. If the action does end up taking longer than 40ms to arrive, say, 45, then the server should acknowledge it as happening at 45ms because, again, you don't want to let the client rewrite history.

Alternatively, although I don't recommend this, you can let the client rewrite history, but not allow more than a certain deviation from the actual time. So if the number you pick is 20ms, then if the client send a message timestamped 45ms and the server gets it at 60ms, it'll acknowledge it as having happened at 45ms, but if it doesn't get there until 80ms have passed, then the server can only acknowledge it as having happened at 60ms.

3 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.