🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Direct Play 8

Started by
7 comments, last by Possibility 23 years, 6 months ago
Hey, I am trying to learn DP8, but am having a hard time understanding the sdk and the examples, so I wrote a very simple program that initializes a directdraw full screen ap and draws a single 640x480 image to the screen, and then prints some text, and heres what I need help with. When the game comes on it says 1. Host game 2. Connect to host so the user either presses 1 or 2 and hosts a DP session or connects to one then in text it says a) send message A to all players b) send message B to all players so ther user can press either a or b and on all screens it shows up ass: "A message was sent to all" or "B message was sent to all" and thats all I need the program to do I already totally wrote the program except for any Direct Play stuff, and that is where i was hoping to get some help. If i could just get that work, then i would totally understand DP. Also note, the program doesnt ask for an IP address, if the user needs to change the host ip, they need to enter the new ip into the source and recompile. The reason I ask for this help is cause i dont understand how them message boxes and windows crap from the sdk examples work, they just super confuse me. I understand DD and D3D and full screen games perfectly well. The source code I have written is at: Direct Play.zip Possibility Thanks for any help Edited by - Possibility on 12/4/00 1:14:12 PM
Advertisement
The SDK examples are the best i could find.

It's not overly difficult to figure everything out:
Just walk through the winmain function.

It will call a bunch of functions, none of which are too windows specific.

Just follow what winmain does with the dplay objects.

The only windows part is the GreetingDlgProc. This function responds to messages posted by the dialog. Just think of this as an input loop.

Note that WM_InitDialog (or something like that) is called when the dialog is created.

The other thing you need to know are the things that set values and get values from the dlg box. SetDlgItemText( hDlg, IDC_NUM_PLAYERS, strNumberPlayers ); and getdlgitemtext just grab text from within the dialog window. just think of these commands as input and print statements.

The last confusing thing is the netconnectwizard. The netconnectwizard is almost exclusively all windows stuff. I just left netconnectwizard in my other code. It makes life easier.

I think you may just have to bite the bullet and figure the windows code out. its good stuff to learn and it demonstrates dplay very clearly. . .

DmGoober

Edited by - DmGoober on December 4, 2000 6:25:55 PM
Alexander "DmGoober" Jhinalexjh@online.microsoft.com[Warning! This email account is not attended. All comments are the opinions of an individual employee and are not representative of Microsoft Corporation.]
I wouldn''t say very clearly

But DP8 is fairly heavy on the windows stuff. It uses threads and a couple of message pumps...

And is hellaeous to get to connect.

Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
What i was actually hoping for was someone to help me write the DP8 example I was describing, and then to write a tutorial for making it to post on this Gamedev site, cause there are basically NO decent DirectPlay articles out there anywhere on the web, and nothing yet for DP8.

And most beginners i know dont have a prayer of understanding any of them windows message box stuff, and all them windows stuff and there buttons and entering in your name and all that stuff, they simply know how to initialize a full screen directdraw or D3D game and use the LRESULT CALLBACK WindowProc (HWND hWnd, unsigned uMsg, WPARAM wParam, LPARAM lParam) or the DirectInput equivalent to detect if a mouse has been moved or a key has been pressed, and these are the people that a DP tutorial needs to be targetted too.

So if someone wants to help me with the DirectPlay component, I would be appreciative. I already wrote the DD component to create a simple little 640x480 game. And then we can write a tutorial on how to make it for GameDev.

Possibility
I''ve been trying to get the time to write a short DirectPlay 8: 101 tutorial for a while, but haven''t had the time thanks to an aggressive release schedule at work. I should be able to have one up in 3 weeks or so, I just want to doc my code and will have to write the article.

I''ll run a rough-draft by everyone on this board first, but that''s still 2+ weeks off at least. =)
quote: Original post by Possibility

Hey, I am trying to learn DP8, but am having a hard time understanding the sdk and the examples, so I wrote a very simple program that initializes a directdraw full screen ap and draws a single 640x480 image to the screen, and then prints some text, and heres what I need help with.

When the game comes on it says
1. Host game
2. Connect to host

so the user either presses 1 or 2 and hosts a DP session or connects to one

then in text it says
a) send message A to all players
b) send message B to all players

so ther user can press either a or b and on all screens it shows up ass:

"A message was sent to all"
or
"B message was sent to all"

and thats all I need the program to do

I already totally wrote the program except for any Direct Play stuff, and that is where i was hoping to get some help. If i could just get that work, then i would totally understand DP.

Also note, the program doesnt ask for an IP address, if the user needs to change the host ip, they need to enter the new ip into the source and recompile.

The reason I ask for this help is cause i dont understand how them message boxes and windows crap from the sdk examples work, they just super confuse me. I understand DD and D3D and full screen games perfectly well.

The source code I have written is at:

Direct Play.zip

Possibility
Thanks for any help



Edited by - Possibility on 12/4/00 1:14:12 PM


I,m currently working on a fairly simple 2d space shooter using DP7. When I''m a little furthur along I''ll try to post the DP parts. However some advice for the time being...You really just have to suck it up and learn some Win32 programming. If your going to make anything that runs on windows you, and since your using DX I assume you are, there is really no way around it. I was just like you about a year ago. You just have to keep plugging at it and it will start to make more sense, and you''ll be a better programmer for it.

Good luck.

Note:
In the MS Press book "Inside D3D," there is a decent chapter on integrating DPlay.
Anon... Did you mean DP4 or DP8?
I know about win32, in fact I have made almost a whole game like civ2, and I am working a 3d version of it right now, the stuff I dont like working with though are those normal windows in windows, they type of window that has a minimize, maximize, x in the upper write corner, you know, those kind of stuff that the direct play examples are using, I think its call MFC, like in that Simple Client program, it all gets confused by that windows shit, its hard to seperate it out. I have tried to understand it, but given up

Possibility

This topic is closed to new replies.

Advertisement