SSZDooM (Splitscreen ZDooM)

Software projects like source ports (3DGE, Eternity, etc), launchers like ZDL, and other useful utilities belong in this forum.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

SSZDooM (Splitscreen ZDooM)

Postby DumdogsWorld » Fri Feb 03, 2017 1:10 am

Hello all! New to the forum!

Splitscreen....a feature requested by a small few for almost forever. I decided to finally get around to mapping out the code differences between the ZDooM engine and the vanilla engines, and I've found that my "hacks" used in some of my unreleased custom ports transitioned over quite nicely!

====Notes about this ZDooM fork====

==The Features==
-Splitscreen multiplayer, with 2 players.
-Based off of ZDooM 2.8.1.

==Notes==
-The second player is always in the game, so SSZDooM is designed to run in conjunction with a normal ZDooM 2.8.1 installation. It has a renamed executable, and uses a different file extension for saves.
-Saving currently doesn't work, but is in the process of being re-enabled. Netplay is disabled.
-Make sure you have a PC with Direct3D support. DirectDraw mode is broken.

If somebody can suggest a screen recording software that doesn't actually suck, I would be happy to upload a Youtube video of the program in action. (Fraps doesn't work because of how the port handles the Direct3D backbuffer.)

Until then, I'm uploading a screenshot. Everything is finished so far except for the second player's controls, which should only take an extra day or two to finish up.

====EDIT====

Here's a video of it in action:
Attachments
splitscreen.jpg
Demo
Last edited by DumdogsWorld on Fri Feb 03, 2017 2:04 am, edited 3 times in total.
DumdogsWorld
 
Joined: 02 Feb 2017

Re: SSZDooM (Splitscreen ZDooM)

Postby wildweasel » Fri Feb 03, 2017 1:11 am

Does OBS Studio capture the program correctly, I wonder?
User avatar
wildweasel
I love the smell of sourdough in the morning
 
Joined: 15 Jul 2003
Location: avatar by kurashiki

Re: SSZDooM (Splitscreen ZDooM)

Postby DumdogsWorld » Fri Feb 03, 2017 1:12 am

I'll check. BRB.

EDIT: It works in OBS if I set it to record the whole screen. I'm gonna post a Youtube video above...
DumdogsWorld
 
Joined: 02 Feb 2017

Re: SSZDooM (Splitscreen ZDooM)

Postby Nash » Fri Feb 03, 2017 1:47 am

That's amazing! Would you consider sending this as an official Pull Request so that it can be integrated into GZDoom? ZDoom has already been discontinued, while GZDoom continues to be active...
User avatar
Nash
Nash Muhandes [Audio Engineer | Game Designer | Scripting]
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: SSZDooM (Splitscreen ZDooM)

Postby DumdogsWorld » Fri Feb 03, 2017 1:57 am

I could try to request a merge with GZDooM, but there's some things that need to be done first. First of all, I really want to finish the normal ZDooM version first. Second, my changes are hacky and intrusive on the rest of the codebase. I would need to re-work a few things to only happen (or not happen) when the engine is in splitscreen mode, and only in that mode. Also, I need to upgrade my compiler and re-work the changes for the more modern GZDooM codebase. However, I'll likely do all of these things anyway. xD
DumdogsWorld
 
Joined: 02 Feb 2017

Re: SSZDooM (Splitscreen ZDooM)

Postby Nash » Fri Feb 03, 2017 1:59 am

Sounds promising! I wish you luck in all of these. This is some amazing work!

Also, here's the proper way to use Youtube tags (you can Quote my reply to see the source code)

User avatar
Nash
Nash Muhandes [Audio Engineer | Game Designer | Scripting]
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: SSZDooM (Splitscreen ZDooM)

Postby Graf Zahl » Fri Feb 03, 2017 4:44 am

Do you have any code that can be reviewed? Getting some feedback now might not be the worst idea.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: SSZDooM (Splitscreen ZDooM)

Postby drfrag » Fri Feb 03, 2017 7:44 am

One of my old ideas was to make my own sourceport with splitscreen based on an early ZDoom version and WDPM (since both were derived from NTDoom). WDMP had 4 player support. BTW those early ZDoom versions up to 1.22 were unstable and crashed a lot, curious that the official "stable" release was 1.22 for years while 1.23 was beta. I wonder where you got the code from, doom legacy?
This looks interesting but i guess getting netplay and splitscreen working at the same time will be complicated, should be fun anyway.
User avatar
drfrag
ZDoom32 developer.
 
Joined: 23 Apr 2004

Re: SSZDooM (Splitscreen ZDooM)

Postby DumdogsWorld » Fri Feb 03, 2017 9:54 am

I didn't get the splitscreen code from other ports. I implemented it myself. :)
DumdogsWorld
 
Joined: 02 Feb 2017

Re: SSZDooM (Splitscreen ZDooM)

Postby cmw1986 » Fri Feb 03, 2017 10:37 am

This is awesome!. Have you ever thought of giving players the option of using either a horizontal or vertical split?.
cmw1986
 
Joined: 09 Jan 2012

Re: SSZDooM (Splitscreen ZDooM)

Postby DumdogsWorld » Fri Feb 03, 2017 10:43 am

Graf Zahl wrote:Do you have any code that can be reviewed? Getting some feedback now might not be the worst idea.


I have some, but I want to make it more "friendly" with the rest of the engine before I submit it for review or anything. Shouldn't be too difficult, though. I just need to isolate the new behavior based on a CVAR or something.

cmw1986 wrote:This is awesome!. Have you ever thought of giving players the option of using either a horizontal or vertical split?.


Yes, this is going to be a feature. The only thing that I'm debating is whether this should be in the menus or not. Currently, my plan is to have it set as a command parameter.
DumdogsWorld
 
Joined: 02 Feb 2017

Re: SSZDooM (Splitscreen ZDooM)

Postby dpJudas » Fri Feb 03, 2017 12:01 pm

DumdogsWorld wrote:I have some, but I want to make it more "friendly" with the rest of the engine before I submit it for review or anything. Shouldn't be too difficult, though. I just need to isolate the new behavior based on a CVAR or something.

Getting a rough idea on how you implemented it would be really useful to know. The latest release of ZDoom uses a rather old version of the codebase where I have made some changes to both the software renderer and the framebuffer classes.

Especially when it comes to QZDoom I refactored the r_* family of files to look completely different. GZDoom is not using that version of it yet, but there's a good chance down the road it will, so I'm interested in knowing exactly at which points in the rendering process you hooked in the split screen.
dpJudas
 
Joined: 28 May 2016

Re: SSZDooM (Splitscreen ZDooM)

Postby Graf Zahl » Fri Feb 03, 2017 1:06 pm

Not only that. Another big issue is that this is based on 2.8.1 which is pre-portals and pre-floating point, which has a high risk of the code already being somewhat obsolete. If we can do some reviewing now, it may save you quite a bit of work. We are not here to trash your work but to ensure that it can actually be used. It'd be a real shame if it went to waste because it turns out too late that some breaking issue prevents integration.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: SSZDooM (Splitscreen ZDooM)

Postby Rachael » Fri Feb 03, 2017 1:32 pm

Graf and dpJudas are right. To add to that, there hasn't even been a question answered about whether or not this will work in GZDoom yet. If there's a port the community would want catered to, that would be it.

The software renderer is nice (and we still do work on it when we can) but the OpenGL renderer is what receives the most play.
User avatar
Rachael
 
Joined: 13 Jan 2004

Re: SSZDooM (Splitscreen ZDooM)

Postby DumdogsWorld » Fri Feb 03, 2017 3:18 pm

I'll post some code once I get player controls implemented, but I'll go over the changes in a rough summary now.

First and foremost, the splitscreen mode marks the game as being in netplay mode with 2 nodes and 2 players, which handles the majority of the changes automatically. However, it disables various functions related to receiving network packets and suppresses a warning message about the game desyncing over the network.

As for the software renderer, it's like 99% untouched. I haven't touched anything related to the rendering of levels, sprites, etc.

The function which calls Renderer->RenderView() (well, actually the function which calls that function) alternates back and forth between player 1 and player 2, essentially dedicating half of the framerate to one player and the other half of the framerate to the other player. The actual class which handles the Direct3D calls (specifically, D3D9's present() function) has a new variable which indicates whether or not the current player being handled is the first or second player. Depending on the value of that variable, the present() function uses a different bounding box for the draw region on the window. (That's why Fraps doesn't record it correctly.)

StatusBar->AttachToPlayer() and StatusBar->Tick() are also called to prevent the need for two StatusBar instances. For this hack to work, stat interpolation (like the health counter in Heretic) had to be disabled. It also does some funky things to the preview of the player's head in DooM 1 and 2, so I'm disabling the player head preview in the status bar for now.
DumdogsWorld
 
Joined: 02 Feb 2017

Next

Return to Software and Ports

Who is online

Users browsing this forum: No registered users and 2 guests