Carmageddon 2 - Networking without IPX
Stifado created Carmageddon 2 - Networking without IPX on Sun Sep 13, 2009 9:10 pm
Post
I did some research if that could be feasible... Using some basic knowledge on Windows Sockets and reverse code engineering, I created this project: CarmaUDP!

So, how it works?

Briefly: Carmageddon 2 uses one IPX socket for all networking operations. IPX and UDP are similar protocols and share the same Windows Sockets API. That is, to create an IPX or UDP socket, you use the socket() procedure, to send data the send() procedure, etc... The only actual problem is addressing, and can be easily resolved because both IPv4 and IPX addresses use the same structure (sockaddr) which is 16 bytes long. As simple as it sounds: hook input Winsock API calls to convert (on-the-fly) IPX addresses to IPv4 and hook output Winsock API calls to convert IP addresses back to IPX.

Sorry for my bad English.

http://rapidshare.com/files/280830607/CarmaUDP.zip
User avatar
Toshiba-3 on Sun Sep 13, 2009 9:30 pm
Post
Very nice!
Seeing Vista has no proper IPX drivers, LAN games over Vista should be possible with this nifty tool right? Or is that Winsock api also different on Vista and this program wouldn't work in there?

Anyway I'll test that tomorrow and feedback here.
Image / carmageddon add-ons at road reaction
User avatar
Razor on Sun Sep 13, 2009 10:43 pm
Post
Ooooh, I'm glad to see that the whole C2Online thing hasn't been completely dismissed, great!
I'm eager for news!
[ Razor @ Carmajunkies ] [ My Downloads ] [ My Carma Items ] [ Conversion lists ]
For information about the progress of my TDR2000 to Carma2 mod visit my site @ http://r.carmajunkies.com
Stifado on Mon Sep 14, 2009 9:38 am
Post
I have tested/developed it in Windows XP 32bit SP3, and I'm pretty sure it is compatible with Vista. If not, only minor changes would be needed.
User avatar
Razor on Mon Sep 14, 2009 10:20 am
Post
If you're unable to get it working with Vista, would it be possible to get it working with VirtualBox on an unsupported operating system?
[ Razor @ Carmajunkies ] [ My Downloads ] [ My Carma Items ] [ Conversion lists ]
For information about the progress of my TDR2000 to Carma2 mod visit my site @ http://r.carmajunkies.com
User avatar
Toshiba-3 on Mon Sep 14, 2009 1:12 pm
Post
Whatever I try, I get the "Local and/or Broadcast address not specified; exiting".
What address type is it supposed to be? My local address is correctely detected as 192.168.0.246, on the other comp it is ofcourse 192.168.0.1. I let the port unchanged. Broadcast address should be 192.168.0.255 right? Tried everything I could think of but no luck.
Image / carmageddon add-ons at road reaction
Stifado on Mon Sep 14, 2009 6:39 pm
Post
Quote:
Whatever I try, I get the "Local and/or Broadcast address not specified; exiting".
What address type is it supposed to be? My local address is correctely detected as 192.168.0.246, on the other comp it is ofcourse 192.168.0.1. I let the port unchanged. Broadcast address should be 192.168.0.255 right? Tried everything I could think of but no luck.

Problem fixed; link updated.

Quote:
If you're unable to get it working with Vista, would it be possible to get it working with VirtualBox on an unsupported operating system?

It depends on the unsupported OS. If we're talking about Vista I could handle it. If you imply Macintosh, I don't think so because I only have experience in Windows programming, sorry.
User avatar
Razor on Mon Sep 14, 2009 7:42 pm
Post
Quote:
It depends on the unsupported OS. If we're talking about Vista I could handle it. If you imply Macintosh, I don't think so because I only have experience in Windows programming, sorry.

I was thinking more along the lines of those poor Win7 users, who've 'upgraded'.
[ Razor @ Carmajunkies ] [ My Downloads ] [ My Carma Items ] [ Conversion lists ]
For information about the progress of my TDR2000 to Carma2 mod visit my site @ http://r.carmajunkies.com
User avatar
Toshiba-3 on Mon Sep 14, 2009 8:31 pm
Post
CarmaUDP stopped crashing when I added the Local key. But now it is C2 that crashes!
BTW what executable version did you work with? V2? Because here I've been trying your tool with BBQC2 and with a normal C2 upgraded with the super patch v2.
Here's the config on both comp:

Code:
[Addresses]
Local=192.168.0.1
LocalPort=12286
BroadcastPort=12286
MasterServerPort=12286
Broadcast=192.168.0.255
MasterServer=0.0.0.0


and

Code:
[Addresses]
Local=192.168.0.246
LocalPort=12286
BroadcastPort=12286
MasterServerPort=12286
Broadcast=192.168.0.255
MasterServer=0.0.0.0


Is the broadcast address correct? I guess letting 0.0.0.0 will set the range to be wide open.
Also I've ofcourse disabled the IPX drivers on both computers in order to be sure your tool is what makes the link between both games.
I get the same crash on both computers, do you want the report log?

@Razor: Cut it out already with useless and biased opinions.
Image / carmageddon add-ons at road reaction
Stifado on Mon Sep 14, 2009 8:49 pm
Post
Addresses are fine. (Setting broadcast address to 0.0.0.0 will make the socket to broadcast to address 0.0.0.0, which does nothing.) Disabling IPX is irrelevant because loader will patch Carmageddon 2 to create UDP sockets.

As for the version, here is the executable I work with: http://rapidshare.com/files/280114647/carma2_hw.zip
I'm not sure, but I think it's the Windows XP fix one.

A quick search on BBQC2 showed up to be a mod. I'll download it and test with it.

If there are any error reports from Carmageddon 2, that could be useful.
User avatar
Toshiba-3 on Mon Sep 14, 2009 9:16 pm
Post
Hey, it is working with your executable. It works well even. Gotta test the master server too.
The Local key and address must be added manually indeed.

So you actually build your tool based on the untouched executable. Most people nowadays use (or should use) the v2 executable. BBQ C2 uses a slightly modified version of the v2 exe. So if you could somehow detect whether the executable is based on the v1, v1.2 or v2 and then proceed to patch the ipx into udp accordingly that'd be really great!

I know Stainless did some changes in the net code for the v2. Not sure how much work it would be to adapt your tool to this version. Also... erm... it'd be very nice as well if you could do the same with C1 :heh:
A lot of people on this very forum are more C1 fans than C2 fans and would like to have a stable base for C1 networking.

I'm the guy who's maintaining that BBQ mod, it currently uses Hamachi to connect people together but I feel like your tool would be way better and ofcourse would allow people to use the mod on Vista too! So if you complete this project, would you let me embed your tool in the next BBQ release?$

Speaking of Vista there's still feedback needed there.

Keep up the very good work :]

Oh, and you can find the V2 patch there: http://rr2000.toshiba-3.com under PC Tools.
Image / carmageddon add-ons at road reaction
Stifado on Tue Sep 15, 2009 1:06 pm
Post
The "Local key and address" is fixed, check the new link (first post).

To be honest, I've never encountered any problems with this executable for a long time now, so I wasn't aware of any special patches except the Windows XP fix one. I think mine's is that one. Anyway, if BBQ C2's exe preserves PDNetInitialise() procedure as it was (into place, and umodified), then theoritically it should work, but I'll check it just to be sure.

About Carmageddon 1: As this is a 16-bit DOS application, I don't think I could handle it, sorry.

And of course, you can embed CarmaUDP in your mod :)
Stifado on Tue Sep 15, 2009 2:53 pm
Post
I downloaded Super Patch v2 and BBQ C2 and updated CarmaUDP.dll. It works for both now. I have even tested hosting a game with BBQ C2 and joining with plain Super Patch v2.

Here's the updated DLL to play with (ONLY supports v2!): http://rapidshare.com/files/280433131/CarmaUDP_for_Super_Patch_v2.zip

I'll begin updating the whole project, to support both versions transparently.
User avatar
Toshiba-3 on Tue Sep 15, 2009 9:48 pm
Post
Client-to-client mode works very well now! And I noticed it autodetects Hamachi's IP too!
However I can't make the master server mode work, I have only tried with BBQ so far though, I'd need a bit more freetime. Running the master server on one comp is ok, but trying to connect to it by enabling the master server address feature in CarmaUDP makes BBQC2 crash. I'll have to try with your XP patched executable.
The master server mode only works on LAN right? But the P2P client mode should work with Hamachi I think, gonna try to have some time to test that with TTR or Harm.

Thanks for your work! It seems to me like the LAN game works better than with the IPX netcode. In my case at least (I encountered lag or no synchronisation between both comps before).
I'll keep you updated with our tests!
Image / carmageddon add-ons at road reaction
Stifado on Wed Sep 16, 2009 11:41 am
Post
I've updated the whole project to support Super Patch v2 (including BBQ C2's executable). Everything should work fine now. (Link updated)

Theoritically, the whole project can work on the Internet. I just didn't had a chance to test that. Remember though, if you're going to do something like that, you'll need to forward every port that is needed.


Remark: To use CarmaUDP with BBQ C2, you must rename BBQC2.exe to carma2_hw.exe.
User avatar
Toshiba-3 on Thu Sep 17, 2009 11:34 pm
Post
We finally tested the client2client on vista and with hamachi. It worked very well. Like lagless (just a couple little wraps). Seeing TTR will install Win7 tomorrow we'll be able to test it on this OS as well. Though I don't see why it wouldn't work.
Your "autodetect broadcast address" function is a very nice addition. Set the broadcast address for Hamachi to 5.255.255.255 directly.

We'd also like to test the master server mode. Should the master server side also run the CarmaUDP client once the server is started? Also if we change the master server's port, is it permanently changed (and then stored in the ini file as well?) or is 666 the default for any time we run the executable without specifying the different port as argument?

Anyway, your tool really kicks the BBQ C2 project again!
Even motivates me to try to program that multiplayer car changer myself!
Image / carmageddon add-ons at road reaction
Stifado on Fri Sep 18, 2009 11:20 am
Post
I believe it'll work on Windows 7 too.

The auto-detect feature was something I was planning to include in the first version, though I was too lazy to code it :P

About master-server: CarmaUDP Client module is loaded only if you select the "Master-server address" checkbox in loader, and it's job is to make Carmageddon negotiate with the master-server. Master-server on the other hand, is a stand-alone application that manages a linked-list of registered servers reported by CarmaUDP Client. You can of course, start master-server and play Carmageddon in the same PC. Also, master-server doesn't save any configuration. So if port is omitted, it's defaulted to 666. ...though you can always create a shell link and append the port as an argument, I can change that if you want :)

So, what's that "multiplayer car changer" you're talking about?
User avatar
Razor on Fri Sep 18, 2009 12:58 pm
Post
Quote:
So, what's that "multiplayer car changer" you're talking about?

It allows you to change your car in a multiplayer game (most likely in the lobby just before the race), I'd like to see it included in the next release of BBQ as C2 tends to randomly choose the worst possible car for a track. Too bad the original car changer is nowhere to be found. :(
[ Razor @ Carmajunkies ] [ My Downloads ] [ My Carma Items ] [ Conversion lists ]
For information about the progress of my TDR2000 to Carma2 mod visit my site @ http://r.carmajunkies.com
Stifado on Fri Sep 18, 2009 3:18 pm
Post
That would be awesome; though I didn't know there was an "original car changer".
User avatar
Toshiba-3 on Fri Sep 18, 2009 4:58 pm
Post
666 is the perfect port for Carmageddon IMO :sglasses:
The original Multiplayer Car Changer is a very old tool from back in 1999 if not older.
It'd be a little tool that changes the cars availability prior to running Carmageddon. And thus allows you to choose your car. But then people can have the same car in the game, just like in TDR where everybody was always taking either the Gorvette or McKilem. But in C2 there's no name floating above the cars :B
Really too bad it's really nowhere to be found nowadays. That's why a new one is needed.
The idea is very simple but a lot of testing is needed to see if some game modes make the game crash etc.

Oh and BTW if people want to play BBQ with this new tool, you can now use the very latest Hamachi release: https://secure.logmein.com/hamachi.msi
Hamachi is still pretty handy for the chatroom actually :B
Image / carmageddon add-ons at road reaction
Stifado on Fri Sep 18, 2009 9:52 pm
Post
Quote:
666 is the perfect port for Carmageddon IMO

Well, 666 is best suited for Doom :P

Seems rather interesting. We shall wait for this new tool then :)
User avatar
Toshiba-3 on Thu Sep 24, 2009 3:31 pm
Post
Haven't been able to test further with Win7 as C2 doesn't boot on it so far.
Still haven't got time to test the master server mode myself. Will do though.

Anybody around able to run C2 in Win7?
Image / carmageddon add-ons at road reaction
Killer11 on Thu Sep 24, 2009 4:54 pm
Post
You mean simply running it with no extra settings save for the mandatory to everyone glidewrapper?
Well I can do it. What kind of problems are you having exactly?

[[i]Edit by tosh: removed the rest, thanks to keep it to PMs guys.[/i]]
TTR on Thu Sep 24, 2009 6:22 pm
Post
Well in 7, when i load up carma2_hw.exe (doing that since Vista) i get the error Can't load Brender engine front (font?) main menu blablabla..

No, now it does load up, then when the menu loads (it blows up from a 1x1 pixel to the full menu) just before its done loading the menu, it goes back and forth, very minor but NEVER loads the whole menu :sad:
Stifado on Fri Sep 25, 2009 10:11 am
Post
Seems to me that a Windows 7-compatible glide wrapper is needed.
Killer11 on Fri Sep 25, 2009 3:27 pm
Post
Well Zeckensack's wrapper works perfectly on my 64 bit 7. Just in case i uploaded all the files that sit in my carma 2 root directory.
http://www.mediafire.com/download.php?2zjyumjey43
Killer11 on Fri Sep 25, 2009 3:50 pm
Post
Tested on a friends pc that is runing exact same version of Seven that I am runing here and it fail to load if i try to run UDPLoader otherwise carma 2 works fine. Might it be Nvidia gfx card that is messing it up? My card is Radeon HD3870, his is Gf8500GT
TTR on Fri Sep 25, 2009 3:53 pm
Post
Yeah i already had problems with C1 on Vista, because it didn't load DirectDraw..but ATi users could play C1!

:decu:
Stifado on Sat Sep 26, 2009 9:03 am
Post
Killer 11, can you be more specific about the problem you encountered? You mean one of CarmaUDP modules failed to load and complained with a message box or just Carmageddon crashed?
Killer11 on Sat Sep 26, 2009 10:04 am
Post
When I simply run Carmageddon 2 everythign is fine. However, if I run the UDPLoader it gives me a message that Carma2_hw has stopped working.

Edit: Just want to say how glad I am for choosing a Radeon ^^.
Stifado on Sat Sep 26, 2009 4:13 pm
Post
Ok, Carmageddon crashes.

Let me see if I've understood correctly: If you run CarmaUDP on your machine (which is same as your friend's with the major exception the graphics card) it works, right? If that's the case, then something might interfere with API hooking (most possibly) on your friend's PC. See if he got any Antivirus program running, disable it, and try again.

I once tested CarmaUDP on a machine running Windows XP SP2 and BitDefender Antivirus 9, and caused me troubles because BitDefender likes to hook some Socket APIs in every process that runs through the "Appinit_Dlls" registry key...

Otherwise, we got a Windows 7 compatibility issue here.
Killer11 on Sat Sep 26, 2009 6:49 pm
Post
Well that PC is quite different hardware wise. but he's running same OS and using same antivirus. his cpu is AMD dual core while mine is a Core 2 Duo. I'll try to swap my gfx card with my brothers Geforce tomorrow and I'll see what happens.
Stifado on Fri Oct 09, 2009 8:55 am
Post
Judging by how many times CarmaUDP is downloaded, it seems that IPX doesn't pose any serious threat... yet :P
User avatar
Harmalarm on Fri Oct 09, 2009 2:03 pm
Post
Hey stifado,

nice work on the CarmaUDP! I've only recently seen your post and was flabbergasted. Just tested the tool with Toshiba over hamachi and it works like a charm on my Vista SP2 system. We had a pretty lag-less game, though I was at the uni which has a pretty swell connnection. Wonder how it runs at home now. :p

anyway, we also tried the master server but couldn't figure out how to use it properly. I thought it would work like this; Running the master server enables other players over the net to play with eachother through my connection right? So basically other players should enter my ip in their master server adress and then create their own game and let others join? Or should the master server also be running a game and is this the only way to get all players together?

me confused. :s Could you explain in a step by step way how you thought this would work?
Stifado on Fri Oct 09, 2009 5:59 pm
Post
Well... as I've stated in a previous post of mine, master-server is not a dedicated-server, but a simple "redirector" of sorts, which means that Carmageddon is not needed in order to work. You can think it as an announcer of games :P Nothing special.

So, "Running the master server enables other players over the net to be aware of eachother (open/closed games) through my connection. So basically other players should enter my ip in their master server adress and then create their own game and let others join." is the correct answer :)

Master-server "listens" by default at port 666, if not specified as an argument. Master-server client "listens" at port specified by "MasterServerClientPort" in CarmaUDP.ini (which is what you specify in the loader).
* Carmageddon communicates with master-server to register/update/delete a game, through it's own socket.
* Master-server client recieves the list of games through it's own socket when the user enters the Network menu.
* Then, Carmageddon can use this list of games, as if they were found in LAN.

Remember to forward ports correctly if you're testing this on the Internet. Which implies:

Master-server side:
* 666 UDP (or port specified as argument)

Player's side:
* Local port UDP
* Master-server client port UDP

Hope this helps :)
Pages:  1, 2  >>



Extra information
It is currently Sun Sep 23, 2018 4:56 pm,

Please Register a username.
In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
Users browsing this forum: No registered users and 2 guests
Moderators: coffeycup, Toshiba-3

Powered by phpBB :: Hosted by n3wton :: Molested by goats
CWA Links
Facebook