Code Monkey home page Code Monkey logo

mochadoom's Introduction

Mocha Doom

Top Language Code Size License

Mocha Doom is a pure Java Doom source port. Most of the hard work of porting Doom to Java has already been done, thanks to Velktron (Maes), but he has stopped working on it in 2013. Although the port is almost complete, some work remains to do, most importantly the network code for the multiplayer is missing. Features like support for the Boom format would also be great. I have decided to continue the development in my free time and fix some bugs.

How to run

  1. Open the project with Eclipse or NetBeans
  2. Delete every file that has errors (if any)
  3. Build and run the project

Advanced users

On Linux, two different scripts can be used.

  1. build-and-run.sh which will build Mocha Doom and run it. You can use it as such: ./build-and-run.sh -iwad ~/DOOM2.WAD. This is the preferred way to quickly test changes for developers.
  2. build-jar.sh which will build a JAR file. You can then run the JAR file as such: java -jar mochadoom.jar -iwad ~/DOOM2.WAD. This is the preferred way for distributing a Mocha Doom executable.

License

Mocha Doom contains work from many contributors. Here are the main contributors, but it's no limited to this list. Others are listed in the copyright headers of the files where they own copyright.

Mocha Doom is distributed under the GNU GPLv3.

Rip and Tear!

Mocha Doom in action: so_much_blood

mochadoom's People

Contributors

axdoomer avatar blunderchips avatar brantmeierz avatar goodsign2017 avatar hiperbou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mochadoom's Issues

Soundfonts

I'm messing around with the source and I want to know if soundfonts are a thing in mochadoom so I can use my own.

Best regards,
Me.

Sound driver crashes in FreeDoom

When macubus hears you, the sound driver crashes. Just IDCLEV07 or IDCLEV30 and it will crash very soon. The game, however, will continue to work without sound, but will hang on quit.

Getting Java.lang.verifyerror

What jdk does it need to be compiled in for it to run properly ?

I've tried 17 and it says verify error
11 and 17 says it was compiled for a higher version (v60)

Original Doom controls don't work

I don't know if you're still working on this, but the original controls don't work -- its not nostalgia, I find that Doom engine games are just easier to play using the control scheme they were designed for, so old and new (for new comers) should both be supported.

If you're not still planning on working on this sorry to have bothered you.

Add multiplayer support

Here's a checklist for the multiplayer support. It's the most important feature to add.

  • Add deathmatch 3.0 (youtube test video)
  • Write the multiplayer code (4 players must be able to play)
    -> The parameter -nodes # starts a server that waits for #-1 of players (the server is one node)
    -> -port # changes the server port to # (default is 2345)
    -> -net ip port could also be used. If no port is specified, then the default is used.
    -> Clients use -join ip port to connect (port is optional, default is 2345)
    -> Game options must be sent to the client(s)
  • Register games on master.chocolate-doom.org to help people play over the Internet

TODO list

List of TODOs (for version 1.7), copied from the old README.md:

  • Fix a bug that allows the player to see through walls.
  • Fix a crash between Doom II MAP20 and MAP21.
  • Fix game settings not being saved.
  • Adjust the default settings.
  • Display the correct quit messages.
  • Fix the different details of rendering.
  • Fix a bug where the player keeps moving forward after the automap has been activated.
  • Fix other input problems with the keyboard and mouse buttons.
  • Add back the mouse vertical movement. Allow it to be disabled using '-novert'.
  • Detect FreeDM and FreeDoom has IWADs.
  • Aspect-ratio correction.
  • Make sure the .jar file executes without the need to specify where the 'main' is.
  • Fix the wall-wiggle glitch / long wall error.
  • Fix the size of the 'pause' message.
  • Make the sound pitch better
  • Fix desync of DEMO1 and DEMO4 of The Ultimate Doom.
  • Restore the classic fuzz-effect (depends on the bitdepth).
  • Write the network code and add multiplayer support. (see #7)
  • Can't use the spy key during multiplayer demos (don't take a screenshot)
  • Can't play demo files without loading it first with -file
  • Add an OpenGL renderer on version 1.8?

Vanilla compatibility issues / lack of emulation

There are couple of bugs that was in vanilla DOOM due to limitations of engine combined with the attributes of the language it was written in - pointer arithmetic, manual memory management and so on.

Of course, in Mocha Doom there is little or no of these bugs. An emulation of them is not simple task, but the Chocolate Doom took approach and succeeded in emulation of most of them.

We lack such emulation. But eventually I would like to implement it.

For now, I'll post a little bit of "bugs we do not have".
If you open this wad in vanilla, the sky would glitch and the demo should crash after the first respawn (visplanes overflow). However, Mocha Doom does behave well beyond this point and show no hall-of-mirrors effect on the sky.
whitehouse.zip

Tip: How to load custom WAD

I think this info could be useful for others too.

To play a custom WAD, e.g. square.wad from here, first get e.g. plutonia.iawd from here.

Then use command line switches: -iwad plutonia.wad -file square.wad

Example in my Java dialect.

Porting to non-AWT environment?

@AXDOOMER @GoodSign2017

I would like to play Doom in my xterm.

I have a Java library that can handle the images and mouse, and I can get something to work for the keyboard. What would it take to instantiate Mocha Doom, pass it AWTEvents for keyboard and mouse, and grab a BufferedImage of its screen? Could it also work when sound is unavailable?

Thank you for any help you can provide.

Important note: finding old code in and debugging compatibility

To be able to debug vanilla incompatibilitites, the D_DoomLoop and all that is called by it that relates to the Loop itself, the ticks, game object modifications, mode changes and so on, MUST be preceded by a label, containing original underscored naming of the method in Doom Source Code.

Do not make labeled blocks inside the methods of your-written library classes, completely new functionality, only mark the place where you replaced or can replace something in future in the existing code.

It would have absolutely no impact on performance, the only limitation is local variable visibility. The variables declared inside the labeled block will not be accessible outside directly, however you can, if you need, declare the variable outside of the labeled block.

Example of labeled block:

M_CheckParm: {
  ... your precious new code doing some work of old...
}

Remember the label blocks will retain their name even in case of automated refactoring.

Consider the situation with old code:
I_InitGraphics ();

After translation to Java:
VI.InitGraphics();

After automated refactoring:
view = sceneRenderer.getView();

And if we use the underscored-named labels:

I_InitGraphics: {
  I_InitGraphics ();
}

After an automated refactoring:

I_InitGraphics: {
  view = sceneRenderer.getView();
}

Thus if you rename some method and update it throughout the whole codebase, the named label will still be named the same underscored original method name.

Do it the most verbose way you can - preserving both, or all brackets of all blocks containing and contained in the label and the brackets of the label itself, with one exception:

If there is no more function to do the task was given to the function in original Doom Source Code, the label stull MUST be present, just type a semicolon to end it without actions.

Right way (some obsolete original method):
I_StartFrame:;

Right way (replaced way the part of method work):

M_CheckParm: {
   if (cVarManager.bool(CommandVariable.DEBUGFILE)) {
     ...new code...
   }
}

Right way (look into future, prevent name changes to break search for old code):

if (advancedemo) {
   D_DoAdvanceDemo: {
      DoAdvanceDemo();
   }
}

Right way:

D_ProcessEvents: {
   ProcessEvents();
}

Right way is unambiguous, readable and easily distinguishable. The syntax is short (but verbose) and is easy to understand. Remember, Java is a verbose language and that makes it strong.
In contrary to it:

Wrong way - easy to miss the labeled block:

if (advancedemo) D_DoAdvanceDemo: {
   DoAdvanceDemo();
}

Wrong way - ambiguous:
D_ProcessEvents: ProcessEvents();

Wrong way - unambiguous, but easy to miss end of labeled block:

M_CheckParm:
   if (cVarManager.bool(CommandVariable.DEBUGFILE)) {
     ...new code...
   }

Wrong way - original block inheritance messed up:

if (cVarManager.bool(CommandVariable.DEBUGFILE)) M_CheckParm: {
  ...new code...
}

For the methods declarations themselves, it is better to use @annotations, like:

@D_Main.C(D_DoomLoop)
public void DoomLoop() throws IOException {
   ...
}

No music when using "-nosfx"

"-nosfx" acts as "-nosound"
See 'DoomMain.java' line 1225.

The game does seem to work fine if we replace
this.S=new DummySoundDriver();
with
this.S=new AbstractDoomAudio(this,numChannels);

I guess Maes wanted to write a sound driver that doesn't do distance calculations when the sound is off.

Would this.S=new AbstractDoomAudio(this,0); do the trick???

Unable to compile.

How do I compile this? The instructions provided are extremely vague and make no sense. When I try to build the project, the resulting .jar file crashes and doesnt run. I have tried it before and after deleting files with errors (as said in the README.)

Tip: How to redefine strafe keys

Here's how to use the cursor keys to strafe (like any sane person does!).

Put these values in mochadoom.cfg (in current dir):

key_strafeleft    105
key_straferight   106

BUT: Make sure there is no extra space at the end of the line (!). This should really be patched (in ConfigManager)...

Mouse grabbing

When the game is paused, a demo is playing or the player is in the menus, the mouse should be ungrabbed to let the player do other things. (Just like Chocolate-Doom)

[Request] Support for Custom Patch Wads/Mods like ZDoom

Ah, I can see that the cross-OS-platform source port is coming along. In its current state, it is like the original DOS version of the doom engine. Multiplayer support is a coming, so are the multiple iwads. Still, I wait for custom iwad support for this cross-platform source port.

Probably would do some good if a more stable version forks a flatpak version. Why? You know, containerization technology and stuff like that. In case something breaks as a fatal computer crash?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.