My java 1.4 doom engine.

I posted this in the source ports forum first, but that place seems a bit dead. ;)

Anyhow, I started making a doom compatible java 2.5d engine a while back, and now it finally renders Doom1 levels properly.

If you have J2SE1.4 installed, you can check it out here.
It's not very optimized yet, so expect about 25 fps on a 750 mhz computer.


Comments are extremely welcome.

Share this post


Link to post

Well that looks pretty cool. It's hitting about 35fps on my Pentium III 900Mhz, too. Would there be a way to go into a higher resolution though ? 320x200 on a 1280x960 desktop is just a little too small for my comfort. A great job on the engine though, let us know when the "blowing shit up" part of it is completed.

Share this post


Link to post

damn, didn't expect it to be that good. Could you make it move a little faster though? Just feels wierd to not be running 90mph.

Share this post


Link to post

Yeah, the engine can be run in any resolution, but for the sake of speed, I'm probably going to keep it at very low ones for now. =)

The stand-alone version tries to run in fullscreen 320x200 mode (doesn't work on linux, for some reason), so you won't have to change your resolution to be able to see the details.

The next two things I'm going to fix are the middle texture in two-sided linedefs, and the speed. Right now it renders the entire level all the time.. I haven't been able to figure out how doom cut out the hidden areas.


Thanks for the feedback!

Share this post


Link to post

I haven't been able to figure out how doom cut out the hidden areas.

I'm guessing the original source code could give you guidance in that area. I know the Doom engine uses the nodes resource for that (bsp). Exactly how it works I have no idea. I haven't taken the time to understand the math involved. Besides I'm not a coder so C++ looks like jibberish to me. Shouldn't be too hard to port the necessary code to java.

Share this post


Link to post

MarkusP said:
(doesn't work on linux, for some reason)

Oh the reason isn't odd, it's commonplace in it's obscurity. Linux is intended to break down on you on a regular basis so you spend less of your time doing things you like and more time fixing the OS, unless of course, you enjoy fixing an OS, which is what hooked the entire Linux fanbase. Yeah, both of 'em. =)

Share this post


Link to post
deadnail said:

Oh the reason isn't odd, it's commonplace in it's obscurity. Linux is intended to break down on you on a regular basis so you spend less of your time doing things you like and more time fixing the OS, unless of course, you enjoy fixing an OS, which is what hooked the entire Linux fanbase. Yeah, both of 'em. =)

There you go again :) The fact is, it is odd that it doesn't work with Linux. Java is cross platform. As long as the proper version of the VM is installed it should work the same. Unless of course there is something wrong with the way he has Java set up in Linux, which is possible I guess but unlikely since he seems to know what he's doing :P

Share this post


Link to post

Yeah deadnail, java is supposed to be cross platform (of course it fails it) so this is suns problem, not linux's. I bet it doesn't work on solaris either.

It's not very optimized yet, so expect about 25 fps on a 750 mhz computer.


That sounds really impressive for java, I imagine you must be pretty talented :) I have to wait a day to check it out though.

Share this post


Link to post

Oh, I don't know the first thing about Linux. ;) I can barely get the darn thing to boot without getting a "LI01010101010101010101..."-flood.

Anyway, I just updated it on the site. It's a bit faster now, had middle textures, and should run at the same speed on all computers.

I'll add sprites tomorrow.


Somtime in the future (after everything works), I plan on making this multi-player.. Playing multiplayer doom in an applet just seems very appealing to me. =)

Share this post


Link to post

I know about Java dammit I was just taking an op to hose Loonix once again. =P

Personally I'm still waiting for 2 player support in a Java NES emulator. Haven't heard of that yet. =(

Share this post


Link to post
MarkusP said:

Yeah, the engine can be run in any resolution, but for the sake of speed, I'm probably going to keep it at very low ones for now. =)

The stand-alone version tries to run in fullscreen 320x200 mode (doesn't work on linux, for some reason), so you won't have to change your resolution to be able to see the details.

The next two things I'm going to fix are the middle texture in two-sided linedefs, and the speed. Right now it renders the entire level all the time.. I haven't been able to figure out how doom cut out the hidden areas.


Thanks for the feedback!

Well, from what I understand, it cuts out a lot simply by checking that the bounding boxes of each node are in the field of view (if they arent, they can obviously be discarded immediately). Also, when it renders the textures, the textures are not rendered immediately but the texture details are instead stored into a temporary buffer. Closer textures take precedence over further away ones. The textures are only rendered after the whole tree has been traversed.

Share this post


Link to post

Yeah, I noticed the bounding-boxes of the nodes and now I cut out the obviously-not-in-view parts of the level. Also, I made it simply stop going down the tree if all columns have been rendered with either one-sided linedefs, or sidedefs that fill the entire column with the upper and lower textures.

It still seems like it's evaluating an overly large number of sectors though. At first, I thought the REJECT map took care of what sectors could be seen from which, but it doesn't seem to work that way at all.

Share this post


Link to post
MarkusP said:

At first, I thought the REJECT map took care of what sectors could be seen from which, but it doesn't seem to work that way at all.

The reject map determines if monsters can see to a certain part of the map from another part of the map. The BSP is used for visibility calculations.

Share this post


Link to post

why would he need to do that if all he's doing is using the shareware wad?

Share this post


Link to post

The shareware WAD is NOT freeware or public domain or anything like that.

Share this post


Link to post

I thought the rights to shareware were the same as freeware except that with shareware you don't have the full thing or you're on a time trial.

Share this post


Link to post

Well, actually... as far as my intuition goes, this usage of the shareware WAD should be perfectly legal if just the license agreement is shown to the player. Fact, the applet just downloads a copy of the shareware WAD and plays in the 'source port'. That shouldn't be illegal.

Share this post


Link to post

Argh, I need to let go of this visability-stuff now. I've broken the engine three times, and had to revert back to an older backup.
I'll just leave it as it is, for the time being. ;)


And the reason I don't use the freedoom-textures is that the .ZIP file would be too big. The shareware doom1.wad zipped is only just above one meg.
And I think I read some statement from idsoftware from when they released the doom source code, where they mentioned that people were allowed to redistribute the doom1.wad file with their ports, as long as you included the information on how you were allowed to distribute it.. or something similar to that.
I might be wrong.


I should probably try finding out if what I'm doing is illegal or not.

Share this post


Link to post

id owns all rights to the shareware version of doom1, right?
Anyone have any email-adresses I could mail them on and ask?

Share this post


Link to post
Linguica said:

BTW, you should think about using the Freedoom textures (http://freedoom.despayre.org:81) instead of the copyrighted ones, just to sidestep any possible legal blah blah.

I dont think thats a problem. doom1.zip is just a zipped version of doom1.wad.

Share this post


Link to post

The site is updated. The sprites kinda broke on me, so it's still the same old applet. ;)
It comes in three flavors now, though.

And sprites and clipping is coming this weekend.

Share this post


Link to post
This topic is now closed to further replies.