D2X for MS-Windows

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

D2X for MS-Windows

Post 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. :)
User avatar
Tyranny
DBB Defender
DBB Defender
Posts: 3399
Joined: Sun Nov 10, 2002 3:01 am
Location: Phoenix, Arizona

Post 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
User avatar
SSX-Thunderbird
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Jun 03, 2001 2:01 am
Location: Washington (the state, not the city)

Post 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.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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.
DigiJo
DBB Ace
DBB Ace
Posts: 491
Joined: Thu Jul 18, 2002 2:01 am
Location: Germany
Contact:

Post 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?
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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:
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

OMG - I've made it! No slow mouse on high fps any more! Am I good, or am I good? :D
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16042
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Post 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).
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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:
User avatar
Tyranny
DBB Defender
DBB Defender
Posts: 3399
Joined: Sun Nov 10, 2002 3:01 am
Location: Phoenix, Arizona

Post 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
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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.
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6458
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

might be saner in the long run to exise SDL from the win32 version, and use DX.

especially for controllers.
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

I believe that was on Valin's agenda for Descent.NET, and IINM TB is planning on reworking D2X with DirectX. :)
User avatar
SSX-Thunderbird
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Jun 03, 2001 2:01 am
Location: Washington (the state, not the city)

Post 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.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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 "<".
User avatar
Skyalmian
DBB Admiral
DBB Admiral
Posts: 1722
Joined: Wed Aug 18, 1999 2:01 am

Post 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?
User avatar
Tyranny
DBB Defender
DBB Defender
Posts: 3399
Joined: Sun Nov 10, 2002 3:01 am
Location: Phoenix, Arizona

Post 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.
User avatar
SSX-Thunderbird
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Jun 03, 2001 2:01 am
Location: Washington (the state, not the city)

Post 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.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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: ).
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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).
User avatar
Ferno
DBB Commie Anarchist Thug
DBB Commie Anarchist Thug
Posts: 15012
Joined: Fri Nov 20, 1998 3:01 am

Post by Ferno »

holy crap. it actually works..

now what about sound?
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Sound? Is there no sound? :shock:

Ok, it's on again.

Check my web site.
User avatar
Ferno
DBB Commie Anarchist Thug
DBB Commie Anarchist Thug
Posts: 15012
Joined: Fri Nov 20, 1998 3:01 am

Post by Ferno »

can't charge fusion, and the ab sounds like it's pulsing.
User avatar
Topher
DBB Alumni
DBB Alumni
Posts: 3545
Joined: Thu Nov 05, 1998 12:01 pm
Location: New York
Contact:

Post by Topher »

Ferno wrote:can't charge fusion, and the ab sounds like it's pulsing.
no one uses fusion anyway....
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Yeah, limiting input rate has brought some problems. D2X is ferkin bad programming, heck. :x
User avatar
SSX-Thunderbird
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Jun 03, 2001 2:01 am
Location: Washington (the state, not the city)

Post 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 ;).
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Yes, I'd like to have it.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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.
User avatar
SSX-Thunderbird
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Jun 03, 2001 2:01 am
Location: Washington (the state, not the city)

Post 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 :(.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

w/o power? lol! Where do you live - somewhere in the jungle? :wink:
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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. :)
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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).
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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.
User avatar
Skyalmian
DBB Admiral
DBB Admiral
Posts: 1722
Joined: Wed Aug 18, 1999 2:01 am

Post 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.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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).
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Oooooh yeah - I got colored segments for underwater and under lava effects ... :D
User avatar
SSX-Thunderbird
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Jun 03, 2001 2:01 am
Location: Washington (the state, not the city)

Post 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.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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:
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post 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?
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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. :)
Post Reply