Jump to content
sleirsgoevy

DooM I (1993) running on Blu-Play

Recommended Posts

It seems I've (semi-)successfully ported DOOM I (1993) to BD-J, using Cibyl MIPS-to-Java transpiler. It basically works, however there are still bugs that don't allow to finish the second level.

 

The porting process was relatively straightforward, except for several corner cases like unaligned access and different endianness, as the OS-dependent parts of the game are abstracted from the engine itself. However, as for now only video output and controller input have been implemented.

 

The source code is on GitHub.

 

P.S. Google says that DOOM source code has been published twice with different licenses, and the comments in the source imply that it's the non-free version. Because of this I don't know if it's even legal to publish a modified version on GitHub.

P.P.S. I've uploaded a binary version of the port to Google Drive. The archive contains files from PS3 BD-J SDK and the compiled JAR.

Edited by sleirsgoevy
  • Like 1
  • Upvote 1

Share this post


Link to post
Share on other sites

Holy moly!!!

This is really impressive!!!

 

I did not expect it to run this smoothly at all! This is looking very promising indeed!

Tested on PS3.

 

You should be able to setSize(720, 480) instead of 1920x1080 in order to fill more of the screen. 🙂

 

Consider using L1 or R1 for forward, so you can press L1 + LEFT/RIGHT to move forward and left/right at the same time.

Sadly, the gamepad doesn't allow us to press UP+LEFT/RIGHT at the same time in blu-ray mode. But any other buttons can be pressed and held fine.

This is one of the annoying limitations of Blu-Play. And it's even worse on Xbox One.

For "The UFO Game!" I added shoulder buttons for UP+LEFT, UP+RIGHT, DOWN+LEFT, DOWN+RIGHT - all firing at the same time.

 

Do you need/want help with audio? I can look into creating an m2ts file with the music, and a sound.bdmv file with the sound effects.

Share this post


Link to post
Share on other sites

Regarding the video, the DVBBufferedImage used as a framebuffer is just 576x324, and is blitted to the whole screen in a single drawImage. I actually keep the full HD resolution just to keep a fancy console font, and not make it look like an actual BIOS console.

 

As for the controls, I thought of moving some of the movement buttons to L2/R2, however that would leave two directional buttons unused, and using some of them for movement and some for other actions seems too awkward. Maybe the 2 other buttons may be used to change weapons though.

 

As for the sound, I think that creating such sound files may be illegal, as they will definitely be a derivative work of the DOOM Shareware .wad file, whose license only allows sharing the unmodified version. Is there really no way to play a sound file from memory?

P.S. I think fixing bugs is still the top priority

Edited by sleirsgoevy

Share this post


Link to post
Share on other sites

Really? It's supposed to fill the whole screen? Here it's just rendered in the top left corner. Both on PS3 and a standard blu-ray player I tested on.

 

But if you use a smaller resolution you'll get a higher framerate too. And higher framerates are always good. 🙂

 

You don't have to remove forward movement from the UP button just because you also put it on a shoulder button.

 

Alternatively, you could add a way to redefine controls, like I've done in Ukko's Journey.

Share this post


Link to post
Share on other sites

No, it is not supposed to render to the whole screen. 576x324 is including the unused area.

added 1 minute later

About the buttons: I mean that leaving some buttons unused (or with the same function as others) would create a shortage of buttons, as there are only 11 usable.

Share this post


Link to post
Share on other sites
2 hours ago, sleirsgoevy said:

No, it is not supposed to render to the whole screen. 576x324 is including the unused area.

added 1 minute later

About the buttons: I mean that leaving some buttons unused (or with the same function as others) would create a shortage of buttons, as there are only 11 usable.

 

hmkay.... I think it'll be more important to people to be able to move forward + left/right at the same time though.

Share this post


Link to post
Share on other sites

It turned out that the gameplay bugs (broken elevators and E1M2 being impossible to pass) were caused by a Cibyl bug resulting in incorrect integer comparison. After fixing that bug, E1M2 can now be passed.
I've uploaded a fixed binary build. No source code changes were necessary.

  • Upvote 1

Share this post


Link to post
Share on other sites

Game saves are now properly written to the VFS persistent directory, and are retained across disc removes.

Edited by sleirsgoevy
  • Upvote 1

Share this post


Link to post
Share on other sites

It's awesome that you're so active with this project.

 

The only thing your updates needs are photos. 🙂

Or maybe even videos.

I may create some later.

Share this post


Link to post
Share on other sites

I've just captured myself passing the first 2 levels of DOOM using the BD-J port. Unfortunately the game crashed after trying to load a save, so I couldn't demonstrate that saves do actually work. Now I'll need to download that save file in some way, so that I can debug it in VLC.
Anyway, I've posted the video on Youtube here.

Edited by sleirsgoevy
  • Upvote 1

Share this post


Link to post
Share on other sites

I was just recording a video myself when you posted this. 🙂

Gonna upload soon.

Share this post


Link to post
Share on other sites

I've added a webserver on port 4444 that serves DOOM save files (doomsav*.dsg), so a buggy save can now be downloaded. Unfortunately the exact file format is architecture-dependent, so it isn't possible to load the same save on the PC build.
Interestingly enough, the Xlet can access the public Internet, but any attempts to connect to a host in the local network just times out.

  • Upvote 1

Share this post


Link to post
Share on other sites

Sound effects now finally work, I've uploaded an updated version. Will probably record a video demo now. https://youtu.be/81DbMsr2Pxc
Interestingly enough, I don't have any problems regarding playing multiple streams at once.

Edited by sleirsgoevy
  • Upvote 1

Share this post


Link to post
Share on other sites

Indeed yes!

Couldn't test on the PS3 right now, but even on my standard Sony Blu-ray player, multiple sounds are playing at the same time!

Well done!

 

I guess HSound is the key.

I've been using a sound.bdmv for my projects so far and loaded the sounds with a Player. Must try out HSound next time!!

 

Again: Really impressive work!

 

 

What's next? Is it complete now? I never really got to play Doom back in the day. But I think I'm gonna start when this port is done. 😄

 

Share this post


Link to post
Share on other sites

Well, I think the main two major pieces that are still missing are background music and network play. Regarding the music, DOOM uses a proprietary MIDI-like format (it isn't implemented in the released source code, so need to find some description), which meens it can be played (do I miss something?) by simply having an HSound for each possible note and starting them at the right time.
Regarding network play, I see several options:

  • Leave the port purely singleplayer. Seems odd as most games nowadays are multiplayer ones. However that's not true for Blu-Play.
  • Leave the networking as it currently is (hardcoded UDP peers) and just implement the low-level send/receive functions. Probably the easiest to implement.
  • Implement DosBOX's IPX tunneling protocol and port the original ipxsetup. This would allow network play with Chocolate Doom peers.
  • Invent a brand new transport for DOOM packets. UDP broadcast may be a good choice.

P.S. I think the key for simultaneous sounds is the use of separate sound files, not HSound. I used HSound instead of javax.media.Player just because the latter doesn't have a stop() method.

  • Upvote 1

Share this post


Link to post
Share on other sites

I'll have to experiment with separate sound files. The main reason I went with a sound.bdmv file, was because that archived discussion forum at Markmail.org advised it. Most people seemed to have trouble getting sound working in other ways, and the JMF was also recommended for having more options such as panning and volume setting, which HSound doesn't have.

The Player object does as a stop() method.

 

Regarding music: Why not just use a video with an mp3 file? Would be a lot easier. And although you can play simultaneous sounds, I seriously doubt it'll work with that many simultaneous sounds. You're basically talking about a MOD/MIDI player lib. And that would definitely be impressive.

 

Network: Is anyone else still playing Doom anymore? 🙂 I think IPX would probably be overkill. Maybe as a final step when everything else is done, if you're still missing a challenge at that time?

Share this post


Link to post
Share on other sites
2 hours ago, mr_lou said:

I think IPX would probably be overkill

As far as I understand, the protocol basically sends whole IPX packets as UDP datagrams to a relay server. Shouldn't be hard to implement if I get the local network to work properly.

  • Upvote 1

Share this post


Link to post
Share on other sites

Yea, sounds fairly simple.

But a relay server? Isn't that usually one of the clients? Is such a server also included in the Blu-Play port?

Share this post


Link to post
Share on other sites

By the way, I've uploaded a new version with minor improvements. See the github commit for more info.
 

P.S. HSound does have an advantage over javax.media.Player, as it allows loading sound files from a byte array, not from disc

  • Upvote 1

Share this post


Link to post
Share on other sites

Some progress in implementing network play.

 

As of now, I've basically implemented the necessary system calls (socket, sendto, recvfrom) using java.net.DatagramSocket as a backend. The protocol should be exactly the same as in vanilla LinuxDOOM, as I did not modify any functional parts. To play a network game, add the proper command line parameters (-net <consoleplayer> <peer_ip_addr>...) into cmdline.txt file in the disc root.

 

1wyDW_FyLqw.jpg

 

P.S. It turns out that the BD-J build can play against the native build, so there is no need for a second console.
P.P.S. It's not the final version, of course.

Edited by sleirsgoevy
  • Upvote 1

Share this post


Link to post
Share on other sites

Gotta be honest and admit that I didn't even know Doom had a multiplayer mode.

Is it one-on-one then, or is it teamwork against the enemy? 🙂

 

Something tells me I'll be spending a lot of time with this game when the Blu-Play port is complete.

 

Share this post


Link to post
Share on other sites

It is co-op by default, but deathmatch can be activated with the -deathmatch flag. (That's the vanilla behaviour, I didn't alter it).

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...