Page 1 of 6

D2X for MS-Windows

Posted: Sat Apr 24, 2004 6:01 pm
by Diedel
Heya,

news for all die-hard D2 fans:

I have managed to create an MSVC project for D2X and build a working D2X executable. It's way smaller than the official one and even has it's first bug fix.

I will continue to try to fix any known problems with D2X and offer a d/l link for my D2X Windows version. :)

Posted: Sat Apr 24, 2004 10:57 pm
by Tyranny
First suggestion, see if you can get ahold of Sekmu (i'll try to track down his email for you) and get into the D1x source as well, so D1x can be improved.

Biggest problems other then a lot of people having trouble running D1x/D2x correctly (main problem, don't have it, others will have to talk about their problems), is joystick support. While both games do eventually work correctly with joysticks such as the 3DPro and PrePro & PrePro2, it takes a LOT of work to try and get these to work properly.

Also, compared to the DOS executables of D1x that don't work with Win2k & XP correctly, both applications have TERRIBLE joystick sensetivity settings and keyboard ramping. Sliding left and right on keys is somewhat OK, still really slow. Turning left and right / looking up and down on the joystick and using the hat on the joystick to slide up and down are a big turnoff.

I'm not really sure what causes this, I imagine all that would need to be done is increase the current sensetivity rate when its at its highest setting because the highest setting just isn't cutting it. There are other things, such as D2x not being able to correctly recognize the axis settings for a joystick to utilize the twist function. We ended up having to make pre-defined joystick .plr files with the correct axis settings already configured using a HEX editor (THX again Jeff! :) ) and releasing it as a patch on PlanetDescent. This problem should have been identified and fixed early on IMO because the majority of online Descent players have used or do use a joystick.

There are more things that I'm sure I've forgotten at the moment. I was about to go to bed when I saw this. Hopefully this might be a start though. There are plenty of other people here on the DBB who have had other problems that need equal attention. Such as joysticks not being detected period or the application not running at all (which could be a hardware issue). Let the fun begin :P

Posted: Sun Apr 25, 2004 12:33 am
by SSX-Thunderbird
Note that D2X completely supports D1 missions. I've seen weird things with some textures when the D1 PIG file is in the D2X directory though.

Posted: Sun Apr 25, 2004 12:54 am
by Diedel
Thanks for the hints, but I will never fix those joystick problems - because then you will whoop my butt again in D2X! (/me = mouser) :P

Ok, j/k. :D

It's the next issue on my list.

Posted: Sun Apr 25, 2004 5:03 am
by DigiJo
i had allways 2 problems with any d2x versions, the joystick settings and the sound lagging behind the action, that kept me from using d2x.

for the joystick-settings... hmmm well i am probably on thin ice here but is it really that difficult to read a few analog axis and buttons from direct input and pass it over to d2? who needs the old method of polling the gameport anyway this days?

Posted: Sun Apr 25, 2004 5:24 am
by Diedel
The problem is how D2X handles the input. I am currently trying to fix the problem of mouse sensitivity depending on frame rate, and it's not as straight forward as it should imho be. :mad:

Posted: Sun Apr 25, 2004 10:33 am
by Diedel
OMG - I've made it! No slow mouse on high fps any more! Am I good, or am I good? :D

Posted: Sun Apr 25, 2004 10:47 am
by Krom
DigiJo wrote:i had allways 2 problems with any d2x versions, the joystick settings and the sound lagging behind the action, that kept me from using d2x.

for the joystick-settings... hmmm well i am probably on thin ice here but is it really that difficult to read a few analog axis and buttons from direct input and pass it over to d2? who needs the old method of polling the gameport anyway this days?
And becides that, I havnt had a gameport joystick in years, all my precision pros are USB. (it is a royal pain to get em working in D1x or D2x).

Posted: Sun Apr 25, 2004 10:53 am
by Diedel
I have a Saitek 4 axis USB force feedback stick, and the D2X joy config crashes when I am rotating the handle (roll function) ... :roll:

Posted: Sun Apr 25, 2004 11:57 am
by Tyranny
My 3Dpro is a standard gameport joy, so I'd like that to be fixed. D2x should also have good support for USB joysticks as well.

The lagging sound issue was fixed a while ago. D2x needed the latest sdl.dll file (Simple DirectMedia Layer) placed in the D2 directory to correctly process the sound. For Those of you having this issue.. http://missions.dyndns.org/downloads/SD ... -win32.zip

Posted: Sun Apr 25, 2004 4:17 pm
by Diedel
I am using the latest SDL software, and once I post my D2X_W32 for download, I will post that SDL DLL as well.

Joystick support afaik is basically a matter of the OS and the SDL. The current problem with joystick setup in D2X is that it's crashing, and probably that joystick sensitivity is too low (dunno that one yet). Nothing that could not be fixed, imho.

Posted: Sun Apr 25, 2004 5:43 pm
by fliptw
might be saner in the long run to exise SDL from the win32 version, and use DX.

especially for controllers.

Posted: Sun Apr 25, 2004 5:45 pm
by DCrazy
I believe that was on Valin's agenda for Descent.NET, and IINM TB is planning on reworking D2X with DirectX. :)

Posted: Sun Apr 25, 2004 6:14 pm
by SSX-Thunderbird
DCrazy wrote:I believe that was on Valin's agenda for Descent.NET, and IINM TB is planning on reworking D2X with DirectX. :)
I hope you aren't referring to me by that.

Posted: Sun Apr 25, 2004 7:03 pm
by Diedel
I have fixed the crash in the joystick config when assigning handle axis to a control. There is a bug in in joystick_read_raw_axis() from arch/sdl/joy.c:

for (i = 0; i <= JOY_NUM_AXES; i++) axis = Joystick.axes.value;

i is running to far due to the "<=" comparison. It should be "<".

Posted: Sun Apr 25, 2004 9:09 pm
by Skyalmian
I have managed to create an MSVC project for D2X and build a working D2X executable. It's way smaller than the official one and even has it's first bug fix.
??
Using the D2x source from here?

Posted: Sun Apr 25, 2004 11:16 pm
by Tyranny
Lets try to stick to having ONE core project of fixes for D1 and D2 so that when its all said and done there aren't 20587037503 D1Xs and D2Xs with different types of fixes in each different one.

Set the standard. If someone wants to integrate DX coding to help improve D1x and D2x run better in a win32 environment then they should work WITH Diedel or Diedel with them to make sure that everything gels together.

On another note, Diedel, did you get my DBB instant message with Sekmu's email? Hopefully we can get you setup with the D1x source so you can continue the excellent work Sekmu did on improving D1.

Posted: Mon Apr 26, 2004 12:30 am
by SSX-Thunderbird
There's a lot of D1X code already in D2X.

And last I looked, icculus.org has been working with D2X for awhile. Though I don't know exactly what they're doing right now, if anything. The only problem I currently have with D2X is that I get random crashes in custom SP missions.

Posted: Mon Apr 26, 2004 4:45 am
by Diedel
Afaik my D2X project is based on current D2X sources from icculus.org.

The guys from icculus.org haven't been working much on D2X during the last few months though. I had contacted Bradley Bell from icculus.org/d2x for some help and had only gotten a reply when I had almost forgotten I had ever asked him a question ... I had been pretty much on my own building D2X/Win32 here.

I also cannot currently be bothered digging into the D2X CVS system and newsgroups to store and post about the changes I have made to the code.

All I want is a D2X version for Win32 that works the way I (and if get the input, others) think it should.

D2X random crashes on SP missions might have been caused by triggers targetting single sided walls (i.e. open wall trigger, where there was no wall at the opposite side of the wall to be opened). I have fixed that bug already. I have also fixed mouse sensitivity depending on frame rate and the joystick setup crashing when assigning a joystick axis (i.e. handle movement) to a flight control. Joystick control itself is however not yet working; I will look into that this week.

If there is anybody who'd like to reintegrate my changes into the D2X branch in CVS, I will give him a link to my source files.

As far as D1X is concerned, it is not very likely that I will look into it all too soon (if ever). I am pretty much at my limits with D2X, and I have a pregnant wife and a house to build (and besides that, a full time job :wink: ).

Posted: Mon Apr 26, 2004 6:37 pm
by Diedel
Joystick is fully working in my d2x_w32.exe now!

If anybody cares:

The function reading the axis input should have returned a bit field denoting which axis had been moved, but it always returned 0. So the following code never knew the joystick handle had been moved. So simple.

Check my descent site (click on D2X/Windows in the side menu).

Posted: Tue Apr 27, 2004 1:12 am
by Ferno
holy crap. it actually works..

now what about sound?

Posted: Tue Apr 27, 2004 3:21 am
by Diedel
Sound? Is there no sound? :shock:

Ok, it's on again.

Check my web site.

Posted: Tue Apr 27, 2004 11:02 am
by Ferno
can't charge fusion, and the ab sounds like it's pulsing.

Posted: Tue Apr 27, 2004 11:22 am
by Topher
Ferno wrote:can't charge fusion, and the ab sounds like it's pulsing.
no one uses fusion anyway....

Posted: Tue Apr 27, 2004 3:08 pm
by Diedel
Yeah, limiting input rate has brought some problems. D2X is ferkin bad programming, heck. :x

Posted: Tue Apr 27, 2004 3:13 pm
by SSX-Thunderbird
Still want the code I used to enable music? It is a pretty bad implementation, but I'm sure you could improve on it ;).

Posted: Tue Apr 27, 2004 4:20 pm
by Diedel
Yes, I'd like to have it.

Posted: Thu Apr 29, 2004 8:55 am
by Diedel
An update: It looks like I have managed to fix quite a few issues I had with D2X. Check my descent site for more info, my D2X executable and source archive.

Posted: Fri Apr 30, 2004 9:43 am
by SSX-Thunderbird
Diedel: Check your mail :). Sorry it took so long to get it to you, but I was without power for a couple of days, so I had no Internet access during that time :(.

Posted: Fri Apr 30, 2004 10:59 am
by Diedel
w/o power? lol! Where do you live - somewhere in the jungle? :wink:

Posted: Mon May 03, 2004 7:32 am
by Diedel
A new version of my D2X-W32 with a few nice bug fixes will be available in my Descent site's D2X section tonight (I'm on GMT+1 DST). If you're interested, you can grab it there. :)

Posted: Tue May 04, 2004 8:09 am
by Diedel
Update: A new version of D2X-W32 is available, that will display cloaked walls properly (all other versions always paint them black, regardless of their cloak value).

Posted: Mon May 10, 2004 2:52 am
by Diedel
The next version of D2X-W32 is available. It can handle repair centers (similar to fuel centers, but replenish shields), which can be added to a mine with DLE-XP.

Next thing I will look into is colored light. If I get this to work, I will try to add new segment types "under water" and "under lava" with bluish and reddish lighting.

Posted: Mon May 10, 2004 8:22 pm
by Skyalmian
Diedel wrote:Update: A new version of D2X-W32 is available, that will display cloaked walls properly (all other versions always paint them black, regardless of their cloak value).
Downloaded it and ran it.
Odd--it isn't fixed. They still render as black.
The level I took the two screenshots from can be found here. The level is called "PTMC City" (pcity.hog/mn2) in the level list.

Posted: Tue May 11, 2004 6:42 am
by Diedel
Yes, my fix was buggy. I have a working version now. I will upload a version where it works this evening (I am on GMT+1).

Posted: Tue May 11, 2004 2:31 pm
by Diedel
Oooooh yeah - I got colored segments for underwater and under lava effects ... :D

Posted: Tue May 11, 2004 3:46 pm
by SSX-Thunderbird
I think adding in support for DETLEF32 servers for mission autodownload would be handy. If you need something to do with D2X :P.

Posted: Tue May 11, 2004 4:45 pm
by Diedel
I don't have access to Detlef support source code, and I don't have much time to do big changes to D2X. All I am doing is tinkering around a bit with it. :wink:

Posted: Tue May 11, 2004 8:25 pm
by DCrazy
Are all of these D2X/W32-only features (underwater/underlava lighting etc) backwards-compatible with regular .rl2 files? Like, if I make a D2 level with D2X/W32-specific features, like the shield regenerator cube for example, can that same level be played on regular D2 without the D2X/W32 features? That would be awesome for something like the Descent 2 Revivals. :D

If not, can you change the file extensions for D2X/W32-only levels to something like .rlx, that way levels with cube types not supported by regular D2 don't crash people's games when they try to load the level?

Posted: Wed May 12, 2004 2:14 am
by Diedel
Repair centers are compatible with all D2-Versions. Water and lava cubes are not necessarily, as I had to introduce new segment type identifiers for it. My changes for D2X-W32 are being integrated into the main D2X development branch, so D2X might be able to cope with them to. I had however D2X w/o some (very minor) modifications for water and lava cubes CTD (because one of the functions check the segment type and end the program when an unknown segment type is encountered). I will try standard D2 with a level and tell you what it does. :)