Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
ketmar

k8vavoom: no good thing ever dies!

Recommended Posts

1 hour ago, ketmar said:

sure. in GNU/Linux, it still prints to the terminal, so i simply didin't noticed that on windows it won't open console window. ;-) i'll fix it later.

Ah ok cool, I'll add it to the launcher later then, because right now it would be a real pain to have to end task it all the time heh.

1 hour ago, ketmar said:

because client only rendering what server telling it to

At the time, I was running the dedicated through batch file for some quick tests, this must have been before I found that it was running in the background.

Will go back to working with the dedicated server app later though after you get it updated a bit. ~ aside from the dedicated server stuff, the launcher is running via game server host and it's working just fine. ;)

2 hours ago, ketmar said:

it should be a normal intermission screen, with 4 second unskippable pause, and then it will be skipped as usual (i.e. one player skipped it -- everybody skipped it). at least that is how i wanted it to be. i'll check if i broke it (i certainly did ;-).

Yeah, even single player/coop intermission is super quick!

 

Will pm you the launcher beta version shortly so you can take a look.

 

Cheers

Share this post


Link to post
1 hour ago, Mr.Rocket said:

Will go back to working with the dedicated server app later though after you get it updated a bit.

ok. i'll prolly send you a fixed build later, so you will be able to test it before "official release". ;-)

Share this post


Link to post
6 hours ago, ketmar said:

actually, i updated the official build, why not. ;-) now dedicated server should open the console window.

Ah nice! I'll add the option to run dedicated in the launcher. :)

Share this post


Link to post

i wanted to write a proper article, but i am too lasy. still, i wrote an introduction, and now it sits on my HDD. so, i'll waste some of your time with it: introduction to k8vavoom MP code design and implementation.

 

Spoiler

k8vavoom network layer built on top of UDP protocol. it is using "virtual channels" to
send and receive packets of data (i.e. it is message-oriented, not steaming, like TCP).
each virtual channel is independent of others, but inside the channel, all messages are
guaranteed to be delivered in strict sequential order. comm layer does all the work on
multiplexing messages, resending lost packets, and maintain the order.

there are 1023 virtual channels. first three are used to send control messages, map updates
(height, texture, lighting and other map changes), and player updates (position and view
angles). one channel is used to communicate various internal data. other channels are
dynamically assigned to map entities.

to send world updates, the network layer dynamically builds so-called "fat PVS" (list of
sectors, visible to camera with 360-degrees FOV). it is used to decide which entities are
"active", and need to be replicated over the network. "active" entity gets its own virtual
channel, and creates "entity snapshot" (current values of all entity fields that will be
replicated). this is to avoid sending unchanged values -- usually, only position, orientation,
and animation frame need to be sent repeatedly, all other fields sent only once (becase

those fields mostly unchanged during the entity lifetime).

as we have a limited number of channels, maps like Nuts cannot be fully replicated. so the
code has a system to decide which objects are "more interesting" than the others. basically,
updater prefers the object closest to the player. players has the higher priority, then comes
monsters and projectiles, then pickups, then decorations, and dead bodies comes last. on each
update frame, the code checks if it has enough channels for updates. if there are more entities
than free channels, update manager "evicts" furthest objects, and reusing freed channels for
new updates.

in this scheme of things, client never does any gameplay changes, it only renders what the
server sends. but it is possible to "detach" some objects and leave their processing to the
client. this is what k8vavoom does with blood entities: basic blood spawning object created on
the server, and then it becomes "detached". the server destroys the object, but on the client
side it lives, spawns flying blood and so on.

currently, client doesn't perform any player movement prediction, it only sends the desired
movement speed to the server, and waits for the answer. this creates noticeable latency.
but it is possible to start moving the player on the client side, and correct the prediction
when any new position received. most of the time the prediction will be correct, and there will
be zero latency (actually, not zero, but no more than with a local game). this will require
timestamping the events (easily done, because the game has internal timer). also, timestamped
events will allow to implement "lag compensation" (temporarily rewing the world back in time
to trace hitscan attacks). client-side prediction and lag compensation are used in all modern

network shooters, and we can do it too!

 

Share this post


Link to post

i implemeted experimental support for "simulated proxies". this is network entity that spawned on the server, sent to client, and then client simulates its physics. the server only takes its authority back when such entity is going to die.

 

this is good for various projectiles: most of the time, a projectile is simply flying forward with the given velocity, so there is no need to spam clients with its new position. also, simulating it on the client will give it much smoother movement (because physics will be caluclated with client FPS). so, now various balls and rockets are simulated on the client side, and the server only takes it back when it explodes.

 

the implementation is a bunch of hacks, but it is ok for the first draft. and the result is visible even on the localhost (because server FPS is 35, and client FPS is 60+, so imp fireballs are moving much smoother). there can be a little delay before explosion (and it may explode in a different place in the crowded room), but there's nothing the engine could do with that (and most other engines does it this way too).

Share this post


Link to post

Hey, Thanks for taking the time to write that up, very interesting!

As well as further tests with simulated proxies, which sounds like it may be a bit smoother, is it a keeper?

 

I'm currently trying to decide if I should have the dedicated server window encapsulated in a windows form.

Strictly for the purpose of the launcher with simple start server, stop server button click. 

Share this post


Link to post
10 minutes ago, Mr.Rocket said:

I'm currently trying to decide if I should have the dedicated server window encapsulated in a windows form.

Strictly for the purpose of the launcher with simple start server, stop server button click.

i am planning to implement some way to control the dedicated server from the outside later. but i don't know how/when yet.

 

also, i don't think that you can incapsulate windows console window in such way. in windows, console window is not even a "real" window internally, it only knows about several predefined messages (and they are hard-coded). i think that for now your best bet is to find the process and simply terminate it (it is ok to "kill" the server in such way).

 

15 minutes ago, Mr.Rocket said:

As well as further tests with simulated proxies, which sounds like it may be a bit smoother, is it a keeper?

ahem? here my engrish failed, i've never seen the word "keeper" in such context.

Share this post


Link to post
22 hours ago, ketmar said:

i don't think that you can incapsulate windows console window in such way.

 

You sure about that? 

 

22 hours ago, ketmar said:

i've never seen the word "keeper" in such context.

It just means, is it worth keeping? is it working good enough to keep.. I suppose the word "keeper" is some English slang.. sorry about that. ;)

 

Edited by Mr.Rocket

Share this post


Link to post
25 minutes ago, Mr.Rocket said:

You sure about that?

absolutely not, my windows knowledge if very old and rusty. ;-) it wasn't possible with XP, and wasn't possible with Vista, i think. that's mostly the latest windows i've seen. back then, console windows ignored all attempts to reparent them.

 

25 minutes ago, Mr.Rocket said:

It just means, is it worth keeping?

ah, i see. sure, it makes projectile movement alot smoother. most of the time it works as expected. and when it doesn't, it is only a small visual glitch, and you already have much bigger problems anyway (alot of objects or huge lag already made the game virtually unplayable).

 

25 minutes ago, Mr.Rocket said:

I suppose the word "keeper" is some English slang.. sorry about that. ;)

no problems, i love to learn new things, and i love to ask questions. ;-)

Share this post


Link to post
10 minutes ago, ketmar said:

console windows ignored all attempts to reparent them.

Well, it wasn't easy to figure this out heh.

There's another launcher I started on before this one and I called it DoomBox, it will support several source engines, it has IRC built in and DOSBox. DOSBox is setup to run Doom2 and works really well. But there was always a problem, DOSBox its self would never center to screen (there was no actual command to do it), you always had to move the window.. But with the above code, that will be fixed, and depending on the threads, I should be able to run DOSBox Doom2 inside the DoomBox launcher. ;) But of course an option to run fullscreen as well.

Share this post


Link to post

I decided to clean up my previous post about the dedicated server stuff, I don't want to litter up your thread. ;)

Besides I may be removing the server console from the form after some tests.

I may not be able to completely keep focus on the process, so it may turn out that the dedicated server console will only be launched from the launcher as a stand alone app as it is after all.. :\

 

Will let you know how things turn out and hopefully have an update ready for you by tonight. :)

Share this post


Link to post
1 hour ago, Mr.Rocket said:

I don't want to litter up your thread

ah, it is even ok to offtop here (to some extent ;-), it is like "dev diary" anyway. and not only my diary. just don't make it so hard that official moderators will have to clean it up (and that limit is high on doomworld ;-). i myself love to derail other threads, so people are free to derail mine. ;-)

Share this post


Link to post
42 minutes ago, ketmar said:

ah, it is even ok to offtop here (to some extent ;-), it is like "dev diary" anyway. and not only my diary. just don't make it so hard that official moderators will have to clean it up (and that limit is high on doomworld ;-). i myself love to derail other threads, so people are free to derail mine. ;-)

lol I'll just keep to myself on that one. :P

Share this post


Link to post

i am experimenting with client-side prediction now (but i don't think that it will be in the next build), so remote server control is not at the top of TODO. besides, i didn't decided how to implement it properly, and how to auth "server owner" yet. the easiest way is to use UDP, buth auth it still need to be designed.

 

may be just drop in tweetNaCl, and encrypt all traffic, lol.

 

p.s.: actually, i'll prolly encrypt it with ChaCha later. not because of "hacking protection", but for the authentication.

Share this post


Link to post

Just so you'll know, I have no idea wtf ChaCha is lol, I'm guessing it's just an encryption library of sorts.

Encrypting all traffic doesn't sound like a bad idea though.

Share this post


Link to post

Was there a command for public or private server when hosting through the in-game server?

I'm guessing it's the menu option for "report to master server" ? but I don't know the command for it.

 

EDIT:

ah found it, master_allowed "1".. I'll make it a checkbox.

 

If so, is there also a "server name" command, eg: +ServerName  "My Super Duper Cool k8vavoom DM Server".

And perhaps a +MOTD "Thanks for joining! ~ Free Popcorn with $5 cover charge!" etc..

Or are we just using strictly IP's for now?

 

If none if the above, then there's a couple feature requests. ;)

 

Thanks

 

Edited by Mr.Rocket

Share this post


Link to post
9 hours ago, Mr.Rocket said:

Just so you'll know, I have no idea wtf ChaCha is lol, I'm guessing it's just an encryption library of sorts.

it is a stream cypher by prof. D.J.Bernstein. the same person who created NaCl (on which libsodium is based), Poly1305 message auth algo, and so on. also, qmail, djbdns and other software.

 

3 hours ago, Mr.Rocket said:

I'm guessing it's the menu option for "report to master server" ? but I don't know the command for it.

it's easy. press "?" (with shift), and cvar name that the given menu item changes will be printed in the console.

 

WARNING! it doesn't work right with input fields, and most MP menus are done in non-standard way, so you'll see something like "_netgame__max_players_", for exampe, which is just a temp var to save item value when menu is closed. yet it works for all options in option menus, and for "report to master" menu item. ;-)

 

3 hours ago, Mr.Rocket said:

If so, is there also a "server name" command

sure. it is called "+HostName". MOTD is not there yet, tho. name is limited to ~120 bytes, and won't interpret UTF-8 in the built-in browser (i.e. limit it to ASCII).

 

as for MOTD, i don't know. i mean, it is possible to implement it, but it doesn't fit into the current game UI, and i am too lazy to change the UI, and therefore i am too lazy to implement MOTD. maybe later. ;-)

 

3 hours ago, Mr.Rocket said:

ah found it, master_allowed "1".. I'll make it a checkbox.

there's also "master_address". as the master is not something Very Secret, people may want to use different masters, so it may be worth adding too.

 

 

p.s.: "Thanks for joining! ~ Free Popcorn with $5 cover charge!" of course, i read it as "free porn".

Edited by ketmar

Share this post


Link to post

...and i implemented very simple packet encryption. because why not? it doesn't need any working brain cells anyway.

Share this post


Link to post
On 3/21/2020 at 6:16 AM, ketmar said:

p.s.: "Thanks for joining! ~ Free Popcorn with $5 cover charge!" of course, i read it as "free porn".

lol

15 hours ago, ketmar said:

...and i implemented very simple packet encryption. because why not? it doesn't need any working brain cells anyway.

Nice!

 

There's something thats been bothering me a little lately.. 

Is there any way to speed up the loading of k8vavoom just a little? it seems like it takes up to almost 5 seconds before the Doom splash screen is even displayed on the screen.

I mean I'm sure there's a lot going on at load time, but is there anyway to speed up the process after execution?

 

Edited by Mr.Rocket

Share this post


Link to post
25 minutes ago, Mr.Rocket said:

Is there any way to speed up the loading of k8vavoom just a little?

i don't think so. it has to do alot of work with textures, and it fully loads many textures for that. this is quite hard to change. on GNU/Linux i am starting it from the terminal, so i see alot of startup messages, and i'm ok with that. for windows, it is completely silent, tho. maybe i'll add some kind of log window later, dunno. i don't really want to bring in win32-specific windowing code.

 

of course, everything can be made faster, but in our case it will require alot of rewritten code (and i'll need to fully redesign several vital subsystems). it is alot of work (literally many monthes), and in the end it will start in 2.5-3 seconds instead of 5. not a huge gain. ;-) going from 30 seconds to 5 is ok, but from 5 to 2...

 

30 minutes ago, Mr.Rocket said:

before the Doom splash screen is even displayed on the screen

the engine cannot do that without fully initialising each subsystem. title screen means that the game is fully initialised, and there's nothing more to load and process. ;-) it cannot be done in any other way, sadly. until texture subsystem is fully up and running, i don't even have a font to render "please, wait...". and when i have the font, it is time to show a title anyway.

 

i'll think about some kind of "loading..." window, tho.

Share this post


Link to post

...and i implemented very simple "rcon" protocol. it is now possible to set "secret password" for server, and send console commands to it (but the only interesting command is "quit" anyway ;-).

 

@Mr.Rocket it *may* help you, but now you need ChaCha20, CRC32C and SHA512, because packets are encrypted and checksummed, and the secret is hashed. sorry. ;-)

Share this post


Link to post
10 hours ago, ketmar said:

the engine cannot do that without fully initialising each subsystem

Is there a texture pre-cache sub system that can be enabled/disabled via video settings command?

eg if all effects and such are disabled then shouldn't the load time speed up this way?

 

9 hours ago, ketmar said:

...and i implemented very simple "rcon" protocol. it is now possible to set "secret password" for server, and send console commands to it (but the only interesting command is "quit" anyway ;-).

 

@Mr.Rocket it *may* help you, but now you need ChaCha20, CRC32C and SHA512, because packets are encrypted and checksummed, and the secret is hashed. sorry. ;-)

 

Nice!

I'll just have to wait until the next build and see if there's anything I may need to change up, otherwise, it's just MaxPlayers 2-8 and calling the dedicated executable (if wanted else ingame-server host) and adding a  "server admin settings", with an additional "use recon password input field". 

 

I would have had an update to the launcher to you but, r/l and I realized I had to add some checks to see if the external dedicated exe is running or not in a couple different places and shut it down if needed.

Hopefully I'll have it to you by tonight though.

Edited by Mr.Rocket

Share this post


Link to post
On 3/22/2020 at 11:08 PM, Mr.Rocket said:

Is there a texture pre-cache sub system that can be enabled/disabled via video settings command?

eg if all effects and such are disabled then shouldn't the load time speed up this way?

texture precaching is a different thing -- it is about uploading textures to GPU when a map is started, so it won't "stutter". but the engine has to build list of all textures in advance. as there are zero guarantees for wads/pk3 being "well-built", the engine has to scan each texture to determine image format (and sometimes extract dimensions and BPP). it doesn't do full image decoding at this stage, but it is still alot of work (especially with Doom patches -- they have no signature, and the best you could do is to use some heuristics, and for that, you have to load at least some parts of the image).

 

also, there are other things the engine has to initialise, and alot of VavoomC/decorate code to compile (around 3.5 megabytes!). the compiler is fast, but not infinitely fast. ;-) and i removed the option to precompile the code into intermediate binary form for several reasons, and i have no plans to restore it.

 

i don't think that we have any low-hanging fruits left there. maybe i'll invent something in the future, but for now i don't know any way to make the things considerably faster. sorry.

 

 

p.s.: i also added the option to have password-protected servers. actually, all servers are password-protected now, because technically empty password is still a password. ;-)

Share this post


Link to post

let's try some magic: each time i am writing here that i'm planning to rest a little, in next two or three days i'm getting some energy and ideas, and throwing away resting idea. so, i'm planning to rest a little.

Share this post


Link to post
On 3/24/2020 at 10:35 AM, ketmar said:

i don't think that we have any low-hanging fruits left there. maybe i'll invent something in the future, but for now i don't know any way to make the things considerably faster. sorry.

Ah, that's too bad, I was hoping there might have been a work around by disabling some things at init time and re-enabling before map load. :\

 

On 3/24/2020 at 10:35 AM, ketmar said:

p.s.: i also added the option to have password-protected servers. actually, all servers are password-protected now, because technically empty password is still a password. ;-)

Ok, nice!, I'll wait until the next build before adding it to the launcher.

4 hours ago, ketmar said:

let's try some magic: each time i am writing here that i'm planning to rest a little, in next two or three days i'm getting some energy and ideas, and throwing away resting idea. so, i'm planning to rest a little.

Hah, ok no worries, I totally understand that!

In the mean time, it seem that +HostName works fine for hosting an in-game server from command line, but the command currently doesn't seem to work when hosting a game from the dedicated executable. ~ The dedicated console shows the Host name being the user name, even if +HostName foobar is added.. (unless, which I haven't tested yet, needs to be in a certain order for the dedicated?)

 

Again, +HostName works fine when running an in-game server from command line, as well as being the last in line of its commands..

 

Thanks 

 

 

Share this post


Link to post
50 minutes ago, Mr.Rocket said:

In the mean time, it seem that +HostName works fine for hosting an in-game server from command line, but the command currently doesn't seem to work when hosting a game from the dedicated executable. ~ The dedicated console shows the Host name being the user name, even if +HostName foobar is added..

"Host name" log string in console is not what "hostname" sets. ;-) this is part of the internal network layer init code, and it has nothing in common with "game host name". this is completely unintuitive, i know, but this is what Vavoom historically did. ;-)

 

basically, "HostName" is only seen when you're sending a special "get server info" request (which you can do only if your server is registered in master). there's no way to see it elsewhere (because it is not used in any other place ;-). i.e. you can only see it in "mp -> join -> search for network games...", and that search only shows servers registered at master (and only if those servers are available by their "external" IP address -- i.e. by that address that master had seen).

 

and what you see in console log is what `gethostname()` call returns, and it is used as default "HostName". it is almost immediately overriden by CLI setting, tho. but the engine will not say it in the log. sorry.

Share this post


Link to post

Ah ok, I see, so it's probably working then, I just can't see it..

It's the exact same line as it is for the in-game host command line, so then it's likely working.

Cool, thanks. ;)

 

I have limited access on my network connection at the moment and I have no way to access the router. ~ to forward the port btw..

So for now I can't host to the master.. :\ 

Is the master server running though? ~ is shows it as resolved in the console, but no game servers are found.

 

If it is and if you host a game, I'll connect to it, see how bad our lag is heh. ~ note* I'm only going to be running build 550317.

Edited by Mr.Rocket

Share this post


Link to post
51 minutes ago, Mr.Rocket said:

Is the master server running though? ~ is shows it as resolved in the console, but no game servers are found.

yep, it is working (and i see your server reporting). but the process is going like this:

1. client asks the master about all known server IP:Port records.

2. client asks each server about details. if the server aren't responding, then the client assumes that the server is inaccessible (non-existent).

 

as your server prolly has different address when it reports to the master ("external IP"), and local, and client asks what master gave ("external"), it simply cannot connect to the server, and assumes that there are no servers.

 

there is code to look for LAN games, but i disabled it, because it doesn't work with localhost-only, and i don't have proper LAN setup to debug it.

 

i'm not usually running a game server, but even if i'll do, it will be latest devbuild, of course, and you won't even be able to get server info from it, because network protocol changed alot. ;-)

 

it should be possible to build windows master server .exe and run it in your network, but i didn't tested it.

Share this post


Link to post
Guest
This topic is now closed to further replies.
×