Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration of Chocolate Doom network code #280

Merged
merged 22 commits into from
Nov 26, 2021

Conversation

rfomin
Copy link
Collaborator

@rfomin rfomin commented Sep 14, 2021

I think this is a much cleaner attempt. Original code changes are kept at a minimum, take a look if you have time. Connects successfully to Crispy Doom with complevel vanilla. Also fixes #279.


// Call D_QuitNetGame on exit:

//I_AtExit(D_QuitNetGame, true);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the server cannot be properly closed with the standard atexit(). Should we implement I_AtExit()?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we implement I_AtExit()?

We probably should (using the implementation in Pr+). But that's orthogonal to this PR. Let's not mix things up too much.

@rfomin
Copy link
Collaborator Author

rfomin commented Nov 26, 2021

I would like this to be reviewed.
Known Issues:

  1. fastdemo doesn't work.
  2. No netgame UI (by default, it just waits for 2 players to connect).
  3. Interpolation doesn't work properly in newsync mode.
  4. Coop statistics are different from PrBoom+.

@fabiangreffrath
Copy link
Owner

  1. fastdemo doesn't work.

This only applies to network demos? For singleplayer demos it still works, right?

  1. No netgame UI (by default, it just waits for 2 players to connect).

This is expected, as we only add the minimal possible amount of libtextscreen.

  1. Interpolation doesn't work properly in newsync mode.

This is inherited from Crispy, I guess.

fabiangreffrath/crispy-doom#747

  1. Coop statistics are different from PrBoom+.

This is probably the same as here:

fabiangreffrath/crispy-doom#778

Source/d_main.c Show resolved Hide resolved
@@ -2230,7 +2243,7 @@ void D_DoomMain(void)
{
I_StartTic ();
D_ProcessEvents ();
G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the [maketic%BACKUPTICS] part and why was it dropped?

Copy link
Collaborator Author

@rfomin rfomin Nov 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

netcmds declaration is different in MBF, I replace it with Choco version.

@@ -1,580 +1,270 @@
// Emacs style mode select -*- C++ -*-
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the pristine d_net.c file from Choco?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but without the support of other games (heretic/hexen/strife)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I added sync of Boom/MBF options.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is also where lowres_turn hides...

@@ -49,6 +49,18 @@ set(WOOF_SOURCES
m_swap.h
midifile.c midifile.h
mmus2mid.c mmus2mid.h
net_client.c net_client.h
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all the other net_* files taken pristine from Choco or are there any changes that need to get documented?

Copy link
Collaborator Author

@rfomin rfomin Nov 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only changes are for other games and fixing gcc/clang warnings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I commented out "SecureDemo" experiment.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never heard of that. 🤷

Copy link
Collaborator Author

@rfomin rfomin Nov 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at NET_StartSecureDemo in net_query.c Not sure how it works.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem to be actually used anywhere.

Source/CMakeLists.txt Outdated Show resolved Hide resolved
@rfomin
Copy link
Collaborator Author

rfomin commented Nov 26, 2021

  1. fastdemo doesn't work.

This only applies to network demos? For singleplayer demos it still works, right?

It doesn't work in all types of demos due to the GetAdjustedTime() function.


if (net_player_name == NULL)
{
net_player_name = NET_GetRandomPetName();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some odd reason, I have my problems with this "pet name" thing. I guess it's too much of an Choco inside joke to apply here. Could you replace this initialization with a GetUserName() on WIN32 and getlogin() elsewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to name them "Player 1" ... "Player 4"?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Na, that's a bit lame, isn't it? 😉 I think even Vanilla had the sprite colors as player names, i.e. "green", "brown", "indigo", "red".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should invent dogs related joke here 😄

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😮

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, that's nice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

net

@fabiangreffrath
Copy link
Owner

Merge it?

@rfomin
Copy link
Collaborator Author

rfomin commented Nov 26, 2021

Merge it?

Yes, I think we can. Everything works except fastdemo.

@fabiangreffrath fabiangreffrath merged commit 2c2eff1 into fabiangreffrath:master Nov 26, 2021
@fabiangreffrath
Copy link
Owner

Yeeha!

Fastdemo will require a separate fix, but it was more important to finally get this networking code merged before.

@rfomin rfomin deleted the netgame branch November 26, 2021 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: add -solo-net parameter
2 participants