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

Mocha Doom's future directions

Recommended Posts

Well, what do you know...thanks to kb's help, we've been able to pinpoint a MAJOR demo breaker, caused by a single line in the code. Now most IWADs demos do play correctly to the end (only DEMO4 from UD and DEMO2 from TNT still have some fuckups).

Share this post


Link to post
GhostlyDeath said:

Then you can modify fraggle's "check every compet-n demo" script to create original synchronization tables for every single demo. Then run the same script to create synchronization tables for your own port playing the demo. Then compare the files ignoring whitespace and line ending differences.

Reference.

Share this post


Link to post

fraggle: Oh wow, I didn't know about that! Thanks, I'll definitely check this out!

Share this post


Link to post

For anyone wondering, Mocha Doom is an awesome piece of machinery. Maes has taken the original Doom source distro, and converted it, module-by-module, line-by-line, into a byte-exact duplication of the original masterpiece, in the Java language. Honestly, I wasn't sure what to expect, but, now, Mocha is freaking playing IWAD demos (!!), which, if you know anything about demo sync, then you KNOW that it must be *real damn close*.

As for UD DEMO4, I can remember when I was working on demo sync - DEMO4 gave me a fit. I was still using ZDoom's v1.11 angle lookup table generator (yes, ZDoom v1.11). The demo would desync right at the beginning, when doom guy turns right, and takes out 2 shotgunners with one shot. In my demo playback, only one of the shotgunners died, and it was because that angle generator exactly recreated the original lookup table - except for one single angle, the number was off by one. That caused the shot to miss.

So, I *know* that, for an engine to play an IWAD demo properly, it has to be arbitrarily close to the original. As Maes stated, a single line of code can kill you.

Share this post


Link to post

I decided to try to compile MochaDoom from the command line using Maven. Here is the pom.xml that will build MochaDoom with the command

mvn clean install
pom.xml Maven file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.sourceforge</groupId>
    <artifactId>mochadoom</artifactId>
    <version>1.6.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>mochadoom</name>
    <url>http://mochadoom.sourceforge.net</url>
    <description>Doom in Java</description>
    <organization>
        <name>Maes</name>
        <url>http://mochadoom.sourceforge.net</url>
    </organization>
    <inceptionYear>2012</inceptionYear>
    <issueManagement>
        <system>Issue List</system>
        <url>http://mochadoom.sourceforge.net</url>
    </issueManagement>

    <scm>
        <connection>scm:cvs:pserver:anonymous::@mochadoom.cvs.sourceforge.net:/cvsroot/mochadoom:mochadoom</connection>
        <developerConnection>scm:cvs:pserver:anonymous::@mochadoom.cvs.sourceforge.net:/cvsroot/mochadoom:mochadoom</developerConnection>
        <url>http://mochadoom.sourceforge.net</url>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <main.class>i.Main</main.class>
        <app.name>${project.artifactId}</app.name>
    </properties>
    <developers>
        <developer>
            <id>Maes</id>
            <name>Maes</name>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GPL 3</name>
            <url>http://www.gnu.org/licenses/gpl-3.0-standalone.html</url>
        </license>
    </licenses>


    <prerequisites>
        <maven>3.0.4</maven>
    </prerequisites>


    <mailingLists>
        <mailingList>
            <name>Issues List</name>
            <archive>http://mochadoom.sourceforge.net</archive>
        </mailingList>
    </mailingLists>

    <build>
        <sourceDirectory>src</sourceDirectory>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgument>-Xlint:unchecked</compilerArgument>
                    <source>1.6</source>
                    <target>1.6</target>
                    <excludes>
                        <exclude>**/SwingDoom.java</exclude>
                        <exclude>**/testers/**</exclude>
                        <exclude>**/Overflow.java</exclude>
                        <exclude>**/net.java</exclude>
                        <exclude>**/ParallelTrueColorRenderer.java</exclude>
                        <exclude>**/ParallelRenderer2.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <finalName>${app.name}</finalName>
                    <archive>
                        <manifest>
                            <mainClass>${main.class}</mainClass>
                            <packageName>i</packageName>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <attach>false</attach>
                    <quiet>true</quiet>
                    <failOnError>false</failOnError>
                    <detectOfflineLinks>false</detectOfflineLinks>
                    <show>package</show>
                    <level>package</level>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <attach>false</attach>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                </plugin>

                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.4</version>
                </plugin>

                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.6</version>
                </plugin>

                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4</version>
                </plugin>

                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                </plugin>

                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.5</version>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.0</version>
                </plugin>

                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9</version>
                </plugin>

                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.13</version>
                </plugin>

                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.4</version>
                </plugin>

                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                </plugin>

                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.2</version>
                </plugin>

                <plugin>
                    <artifactId>maven-scm-plugin</artifactId>
                    <version>1.8.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-changelog-plugin</artifactId>
                <version>2.2</version>
            </plugin>

            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.9.1</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.5.1</version>
            </plugin>

            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>analyze-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>2.5</version>
            </plugin>

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <quiet>true</quiet>
                    <failOnError>false</failOnError>
                    <detectOfflineLinks>false</detectOfflineLinks>
                    <show>package</show>
                    <level>package</level>
                </configuration>
                <reportSets>
                    <reportSet>
                        <configuration>
                            <quiet>true</quiet>
                            <failOnError>false</failOnError>
                            <detectOfflineLinks>false</detectOfflineLinks>
                        </configuration>
                        <reports>
                            <report>javadoc</report>
                            <report>test-javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>2.7.1</version>
                <configuration>
                    <excludes>
                        <exclude>**/Overflow.java</exclude>
                    </excludes>
                    <linkXRef>true</linkXRef>
                    <sourceEncoding>utf-8</sourceEncoding>
                    <minimumTokens>100</minimumTokens>
                    <targetJdk>1.6</targetJdk>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <linkJavadoc>true</linkJavadoc>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.12.4</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <tagListOptions>
                        <tagClasses>
                            <tagClass>
                                <tags>
                                    <tag>
                                        <matchString>todo</matchString>
                                        <matchType>ignoreCase</matchType>
                                    </tag>
                                    <tag>
                                        <matchString>FIXME</matchString>
                                        <matchType>ignoreCase</matchType>
                                    </tag>
                                    <tag>
                                        <matchString>deprecated</matchString>
                                        <matchType>ignoreCase</matchType>
                                    </tag>
                                </tags>
                            </tagClass>
                        </tagClasses>
                    </tagListOptions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.0</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependency-updates-report</report>
                            <report>plugin-updates-report</report>
                            <report>property-updates-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
</project>
It does require a couple of minor tweaks to the code.
Index: src/doom/DoomMain.java
===================================================================
RCS file: /cvsroot/mochadoom/mochadoom/src/doom/DoomMain.java,v
retrieving revision 1.109
diff -u -u -r1.109 DoomMain.java
--- src/doom/DoomMain.java	6 Nov 2012 16:04:58 -0000	1.109
+++ src/doom/DoomMain.java	24 Jan 2013 08:35:46 -0000
@@ -60,7 +60,7 @@
 import rr.ViewVars;
 import rr.subsector_t;
 import rr.parallel.ParallelRenderer;
-import rr.parallel.ParallelRenderer2;
+//import rr.parallel.ParallelRenderer2;
 import s.AbstractDoomAudio;
 import s.ClassicDoomSoundDriver;
 import s.ClipSFXModule;
and
Index: src/w/WadLoader.java
===================================================================
RCS file: /cvsroot/mochadoom/mochadoom/src/w/WadLoader.java,v
retrieving revision 1.62
diff -u -u -r1.62 WadLoader.java
--- src/w/WadLoader.java	8 Nov 2012 17:16:12 -0000	1.62
+++ src/w/WadLoader.java	24 Jan 2013 08:36:48 -0000
@@ -1025,7 +1025,7 @@
 	 * @see w.IWadLoader#CacheLumpName(java.lang.String, int, java.lang.Class)
 	 */
 	public CacheableDoomObject CacheLumpName(String name, int tag, Class what) {
-		return this.CacheLumpNum(this.GetNumForName(name.toUpperCase()), tag,
+		return (CacheableDoomObject) this.CacheLumpNum(this.GetNumForName(name.toUpperCase()), tag,
 				what);
 	}
Let me know what you think.

Thanks
Dave

Share this post


Link to post

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
×