DirectPlay Emulation Project

DirectPlay Emulation Project; support/discussion/questions

Moderator: thunderchero

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2546
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke » Sat Oct 11, 2008 9:00 am

jigalypuff wrote:the grapics engine (3d) is the falcon 4.0 one, and i believe it is open source now.
Well, that would be cool!
Get me the source and I'll implement a new one. =)

If it's really possible to obtain that source, I'll definately need some help, cause with graphics engine AND networkengine there would become so much possible. Why waiting on an unsatisfactory botf2 if we can get a real great BotF 1.7!!! 80

Thanks for your encouragement to all that have posted yet. :)

User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6058
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Post by thunderchero » Sat Oct 11, 2008 9:39 am

falcon 4.0 is engine used in hades version 1.1 is original falcon, and 2.2 is updated version.

thunderchero

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2546
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke » Sat Oct 11, 2008 9:54 am

Doesn't matter if updated or not, just get me the source of a BotF compatible version, so I can study the functions and classes and functionpointers and the parameters it's using as I've done with DirectPlay :)
First goal would be to develope a layer for it as well.

Malvoisin
Lieutenant-Commander
Lieutenant-Commander
Posts: 158
Joined: Fri Apr 25, 2008 2:00 am
Location: Germany
Contact:

Post by Malvoisin » Sat Oct 11, 2008 10:03 am

for a satisfying botf 1.8 I'd need a better AI flocke (hint at what's next :lol:) ;).

btw. congrats on your perseverance. but maybe don't announce surrender before you stopped working on botf as a whole, you'll never know what you uncover :P.

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2546
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke » Sat Oct 11, 2008 10:49 am

Well, that could have meant never telling to stop without ever continuing on it. I've spent many days on figuring out this bug without of any success...
Did I shock you that hard with having solved the bug afterall? *bg*

As told on first page, with new networkengine it would even become possible to develope a new AI for BotF! :lol:
But I just talked of 1.7 as version and not 1.8. ;) ;)


Oh and some news:

Updated dpnemu.dll
Same link as before, I'll update first post later.
It's now protocoling nearly every function used by botf, including all data being sent. So it has now become possible to begin analysing all the messages of BotF!

Hmm, next I would have to get a new networkengine I fear. :roll:

Malvoisin
Lieutenant-Commander
Lieutenant-Commander
Posts: 158
Joined: Fri Apr 25, 2008 2:00 am
Location: Germany
Contact:

Post by Malvoisin » Sat Oct 11, 2008 11:29 am

you will shock me when you implement an AI which acts as a working and skilled fake-human mp opponent :lol:.

User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER » Sat Oct 11, 2008 1:09 pm

Congratulations Flocke :D looking forward to your advances :)

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2546
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke » Sat Oct 18, 2008 2:35 pm

Thx DCER, have finished my work on the Protocol-Layer and on studying RakNet and DirectPlay.
I have updated first post, so have a look!

Furthermore, I have done some tests with RakNet and it's NAT punch through with using the server of Freibier.
By the way, thx very much to Freibier, he'll host the upcoming Network-Server for Nat punch through as well as bypass connections with BotF! =)

Now work will go on adding the new networkengine.
Although I'll have less time with universaty continuing monday.

User avatar
cannon
Cadet 1st Year
Cadet 1st Year
Posts: 2
Joined: Tue Dec 07, 2010 3:00 am

Post by cannon » Tue Dec 07, 2010 9:55 pm

Sorry about bringing back a very old thread. I'm writing a direct play emulation layer for a different game. I notice the download link in the first post is dead and I was wondering if anybody still has a copy of it and could share it.

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2546
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke » Wed Dec 08, 2010 4:13 am

cannon wrote:Sorry about bringing back a very old thread. I'm writing a direct play emulation layer for a different game. I notice the download link in the first post is dead and I was wondering if anybody still has a copy of it and could share it.
Of course I have it. But it won't help you much cause it's not including the source (I ofc have just as well).
What game you're working on? Is it Risk? :lol:
What's your intent with it? It's actually easy to write a layer like this but if you want to adapt it to a new network engine, why not supporting botf?

Let me summarize how you do a simple layer. Most important is the interface of the dll you want to hook in. For directplay there's a defined interface that only got extended for later versions, at least before of the managed code. Later DirectPlay got completely dropped by Microsoft and sadly they just kept some documentation on the managed code interface.

However there are still tutorials, api-references and sdk copies lurking in the web. First you need to find out which version you need / is in use by the game you're working on. 2nd you should learn how to use the DirectPlay interfaces, e.g. by a tutorial like this: http://www.gamedev.net/reference/progra ... efault.asp.

For BotF, using DirectPlay 6 or 7? Something in between? Nm, I used this source: http://www.vbgamer.de/cgi-bin/loadframe ... ctx7.shtml (german) as API reference. They also offer the old SDK for download, it helps alot to have the source.

So when you know the interface and know how it works, all you need to do is write a dll with a similar interface but name global functions different if you want to call the real ones inside your dll, else they'll conflict and cause compiler errors.
When renaming your exported functions, and also giving the dll a different name, you ofc also have to adjust the game exe to use your dll and your functions instead. If there are too many functions (not the case for directplay, but if there are), you could instead load the real directplay dll (dplayx.dll) dynamically and just rename the dll but not the functions you're using.

There are two ways exported functions get addressed in the dll, either by their exported order, or by their function name.
If their are addressed by their name you should keep same name length, that's a simple change. If it's by position it depends on the compiler you're using. For gcc exports are ordered alphabetically, so giving the functions an appropriate prefix is a simple solution.

If using gcc/MinGW like me and having to match function names, there's another issue I once solved by hexediting but is simpler to do using the --kill-at linker flag: By default, the gcc linker adds postfixes telling the argument sizes to the exported function names like "functionname@4@8".

And keep care of function declarations like WINAPI / __stdcall or __cdecl, cause else you'll cause stack overflows and stuff.

If you want to see what exported functions of the dlls get called by your game, I recommend: http://www.dependencywalker.com/

Btw, for dpnemu, beside of dplayx.dll I also had to hook CoCreateInstance, CoInitialize and CoUninitialize of ole32.dll, so if ole32.dll is also in use for other things than directplay in the game you're working on, you might have a problem.

This should get you go, if you still need my dpnemu source as example I might search my disk. ;)

P.S. wow, so much time passed by, why the hell do you have to bring up that old reminders right now? :lol:

User avatar
cannon
Cadet 1st Year
Cadet 1st Year
Posts: 2
Joined: Tue Dec 07, 2010 3:00 am

Post by cannon » Wed Dec 08, 2010 9:33 pm

Thanks for taking the time to reply. I hack around on a mod called 'discovery' for an old game called Freelancer. This game dates from around 2003 and uses direct play for network communications.

I am familiar with both managed and unmanaged directplay. I'm certainly not an expert but I know a little bit. I also do a fair bit of x86 asm hacking and hooking to make the game do new and interesting things. Sometimes this is successful.

I've almost finished writing a direct play proxy for the Freelancer multiplayer server to allow me to split the game universe up between multiple server instances. This allows me to support a greater number of players by reducing the load on a single instance. (I do this because the game has essentially no way to use multiple-cores.)

I'm starting to consider re-implementing the directplay protocol layers and I'm looking around for work already done by other people. I'm also starting to think about the changes I need to make in the game to support IPv6 which might mean including hooking out directplay and replacing it with a different network library.

If anybody is bored, the stuff we mess with is here: http://www.discoveryfl.com or http://the-starport.net

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2546
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke » Thu Dec 09, 2010 8:22 am

wow, cool stuff, I loved playing Freelancer
wish you good luck on this! :)

User avatar
nTOXIC
Cadet 1st Year
Cadet 1st Year
Posts: 1
Joined: Fri Oct 28, 2011 9:17 am

Re: DirectPlay Emulation Project

Post by nTOXIC » Fri Oct 28, 2011 9:37 am

Hi Flocke,

if you still have the emulator, what do you think about loading up this project again, in case its still usable with BotF? Would be great to have this emulator, so I could continue playing BotF with friends of my. If I had the time I would also program this tool for myself, which I unfortunately don't have atm.

Thanks and greets
nTOXIC
Last edited by nTOXIC on Fri Oct 28, 2011 12:13 pm, edited 1 time in total.

User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: DirectPlay Emulation Project

Post by QuasarDonkey » Fri Oct 28, 2011 10:26 am

I second it. It would nice to revive this project. I haven't read everything on it, but am I correct in assuming that you've wrapped all the DirectPlay functions, but have not actually emulated them yet?

It shouldn't be *too* hard. Boost::asio looks like a nice library for networking. Either that or plain Berkeley sockets / Winsock.

Post Reply

Return to “DirectPlay Emulation Project”

Who is online

Users browsing this forum: No registered users