• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

waxychicken

Members
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

99 Neutral

About waxychicken

  • Rank
    Member
  1. [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img]
  2. What is the proper usage, purpose, or ranges of the .Volume property in SlimDX.DirectSound.SoundBuffer? (for example, i'm learning that i can't set the .volume to 500) Does it eleminate attenuation or does it just increase the general volume and thus increase the range the sound can be herd from? Links welcome. [CODE] Public Sub PlaySound(ByVal description As String, ByVal X As Double, ByVal Y As Double, ByVal Z As Double, Optional ByVal MyVolume As Integer = 500) Dim Temp As Integer description = UCase(description) Temp = SoundList.FindIndex(Function(value As SoundListDefinition) Return value.Description = description End Function) Dim SoundBufferEntryCopy As New SoundListDefinition Device.DuplicateSoundBuffer(SoundList(Temp).Buffer, SoundBufferEntryCopy.Buffer) SoundBufferEntryCopy.Buffer.Volume = MyVolume Dim t As New Thread(DirectCast(Sub() PlayStoredSoundBuffer(SoundBufferEntryCopy, X, Y, Z), ThreadStart)) t.Start() End Sub [/CODE]
  3. Found the problem. i didn't know you couldn't directcast a copy/clone. you have to use the function Device.DuplicateSoundBuffer(Source SoundBuffer, Destination SoundBuffer) and had to go from SecondarySoundBuffer to just SoundBuffer as the type definitions.
  4. I finaly got it to a point where i can get an error. [quote]An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll Additional information: An item with the same key has already been added.[/quote] the error is at the "DIM The3DBuffer" line in this sub (complete code above.) [pre] Private Sub PlayStoredSoundBuffer(ByVal BufferIndexClone As SoundListDefinition, ByVal x As Double, ByVal y As Double, ByVal z As Double) Dim The3DBuffer As New SoundBuffer3D(BufferIndexClone.Buffer) The3DBuffer.Position = New Vector3(Convert.ToSingle(x), Convert.ToSingle(y), Convert.ToSingle(z)) BufferIndexClone.Buffer.Play(0, PlayFlags.TerminateByDistance And PlayFlags.TerminateByPriority And PlayFlags.TerminateByTime) While BufferIndexClone.Buffer.Status = BufferStatus.Playing Application.DoEvents() End While 'I thought that disposing things was perhaps the problem - maybe i was 'cross-disposing items still in use. but that hasn't helped. The3DBuffer.Dispose() 'BufferIndexClone.Buffer.Dispose() 'BufferIndexClone = Nothing End Sub[/pre] i don't get it. it's in a new thread. why is there a conflict? just because it's the same sound?
  5. Ok, New problem: I created a sound library class. first: the principal: Upon initialization ... Dim Audio as New SoundLibrary it opens up a data file, reads the information listed in the file, and stores the sounds in buffers accordingly so that they can be called upon later to play at any time. (Sample sound index file: ) [CODE] /Sound Index File [Description] GunShot [Frequency] 44100 [BitRate] 16 [FileName] Pistol1.wav [End Of Sound] [end][/CODE] It reads the file fine. It will create the 3D listener fine. It creates the device, primary, and secondary buffers fine. It even goes so far as to play a sound: Audio.PlaySound("GUNSHOT", MenuCamera.Position.X, MenuCamera.Position.Y, MenuCamera.Position.Z) when the program first loads. but when i ask it to play the same sound a second time it crashes For testing reasons, i have it so that clicking on the screen anywhere calls the Audio.PlaySound again. [CODE] If MouseStateInfo.LeftClick = True Then MouseStateInfo.LeftClick = False If ShowMenu1 = True Or PopUp <> eMessageBox.NoBoxDisplayed Then MenuClick(MouseStateInfo.Position.X, MouseStateInfo.Position.Y) Audio.PlaySound("GUNSHOT", 0.1R, 0.1R, 0.1R) Application.DoEvents() 'exit Function End If End If[/CODE] but it's crashing. and it's not giving me an error response in Debug or in the Try..Catches i have set up. If anyone can tell me what the hell i'm doing wrong then i'll be totally grateful because i am utterly lost in why sounds will play once but not a second time. [CODE] Imports System Imports System.Text Imports System.Windows.Forms Imports System.Collections.Generic Imports Microsoft.VisualBasic Imports SlimDX Imports SlimDX.Multimedia Imports SlimDX.DirectSound Imports System.Threading Imports System.IO 'Some items are not actually used yet even though they are loaded. such as Frequency. 'a ListOf by the definition of SoundListDefinition under the name of SoundList. 'soundbuffers and discriptions are added to the list using Sub AddSoundToIndex(...) 'When a call is made to play a sound then the following steps are taken: (see sub PlayStoredSoundBuffer(...) ) ' 1 - match the "Discription" given to a SoundList(IndexOf) ' 2 - clone SoundList(IndexOf) to a new object. ' 3 - start a new thread for the playing (copy of) buffer ' 4 - the thread loops and when the Buffer.Status = DonePlaying then ' it disposes of the temporary buffer. ' Current problem: Sounds play only once then crash on the second attempt to play. Public Class SoundLibrary Public Shared AmUpdating As Boolean = False Public Shared AmReady As Boolean = False Public Structure ThreeDAlgos Public Const Defalt As String = "Default 3D Algorithm" Public Const Low As String = "Low 3D Algorithm" Public Const Full As String = "Full 3D Algorithm" Public Const NoVirt As String = "No Virtualization Algorithm" End Structure Private Structure SoundListDefinition Dim Description As String Dim Buffer As SecondarySoundBuffer End Structure 'TODO: note to self 'http://health-7.com/Introduction%20to%203D%20Game%20Engine%20Design%20Using%20DirectX%209%20and%20CSharp/Hearing%20in%20Three%20Dimensions 'SoundBuffer3D listing 9.16 Private Device As New DirectSound Private SoundList As New List(Of SoundListDefinition) Private Buffer As PrimarySoundBuffer Private Desc As SoundBufferDescription Friend applicationBuffer As SecondarySoundBuffer Friend MyListener As SoundListener3D Friend SoundPath As String Friend Sub New() PushIntoChat("INITILIZING SOUND...") SetUpHardware() SoundPath = Application.StartupPath AddToDebug("Sub SoundLibrary New()") Dim CurrentLine As String Dim WavSoundsList As System.IO.TextReader = New System.IO.StreamReader(SoundPath + "\bin\Sounds\SoundList.txt") Dim Doit As Boolean = True Dim Channels As Short = 1 Dim Frequency As Integer Dim BitRate As Short Dim FileName As String = "FILENAME NOT GIVEN" Dim Description As String = "NO DESCRIPTION SET" Try While Doit = True ReReadLine: CurrentLine = WavSoundsList.ReadLine() AddToDebug("JUST READ:" & CurrentLine) CurrentLine = UCase(Trim(CurrentLine)) If Left(CurrentLine, 1) = "/" Or Left(CurrentLine, 1) = "\" Or CurrentLine = "" Then GoTo ReReadLine End If Select Case CurrentLine Case "[DESCRIPTION]" Description = UCase(WavSoundsList.ReadLine()) Case "[FREQUENCY]" Frequency = Val(WavSoundsList.ReadLine()) Case "[BITRATE]" BitRate = (Val(WavSoundsList.ReadLine())) Case "[FILENAME]" CurrentLine = Trim(UCase(WavSoundsList.ReadLine())) FileName = SoundPath + "\bin\sounds\" + CurrentLine Case "[END OF SOUND]" 'have all info. load the sound and store it in the list. AddSoundToIndex(FileName, Channels, Frequency, BitRate, Description) Description = "Undiscribed" Frequency = 0 BitRate = 0 FileName = "NO FILE NAME PROVIDED IN SOUND LIST FILE" Case "[END]" Doit = False End Select End While WavSoundsList.Close() WavSoundsList = Nothing Catch ex As Exception MsgBox("ERROR LOADING SOUNDS:" & ex.ToString) MsgBox(debugstring) End Try Application.DoEvents() Application.DoEvents() Application.DoEvents() AmReady = True End Sub Private Sub AddSoundToIndex(ByVal File As String, ByVal Channels As Short, ByVal Frequency As Integer, ByVal Bitrate As Short, ByVal Description As String) If File = "FILENAME NOT GIVEN" Then PushIntoChat("ERROR: NO FILE NAME GIVEN FOR SOUND FILE!") Exit Sub End If PushIntoChat("Loading sound...: " & File & " " & Description) Dim DefaultBufferDescription As New SoundBufferDescription Dim CurrentSoundToAdd As New SoundListDefinition Dim FileName As New WaveStream(File) DefaultBufferDescription = New SoundBufferDescription DefaultBufferDescription.AlgorithmFor3D = DirectSound3DAlgorithmGuid.NoVirtualization3DAlgorithm DefaultBufferDescription.Format = FileName.Format DefaultBufferDescription.Flags = BufferFlags.Control3D + BufferFlags.Mute3DAtMaxDistance + BufferFlags.GlobalFocus If DefaultBufferDescription.Format.Channels <> 1 Then PushIntoChat("WARNING! NOT A MONO SOUND FILE! AVOID STEREO! " & File) Exit Sub End If DefaultBufferDescription.Flags = BufferFlags.Control3D + BufferFlags.GlobalFocus + BufferFlags.ControlVolume DefaultBufferDescription.SizeInBytes = FileName.Length CurrentSoundToAdd.Buffer = New SecondarySoundBuffer(Device, DefaultBufferDescription) CurrentSoundToAdd.Buffer.Write(ReadWaveFile(FileName), 0, LockFlags.None) CurrentSoundToAdd.Description = Description CurrentSoundToAdd.Description = UCase(Description) SoundList.Add(CurrentSoundToAdd) PushIntoChat("Sound Successfully loaded into memory") End Sub Private Sub SetPrimaryBuffer(ByVal channels As Short, ByVal frequency As Integer, ByVal bitRate As Short) Desc = New SoundBufferDescription Dim format As New WaveFormatExtensible() Try With format .FormatTag = WaveFormatTag.Pcm .Channels = 1 .SamplesPerSecond = frequency .BitsPerSample = bitRate .BlockAlignment = CShort(Fix(bitRate \ 8 * channels)) .AverageBytesPerSecond = frequency * format.BlockAlignment End With Desc.Flags = BufferFlags.PrimaryBuffer + BufferFlags.Control3D ' + BufferFlags.GlobalFocus Device.SetCooperativeLevel(Form1.Handle, CooperativeLevel.Priority) Buffer = New PrimarySoundBuffer(Device, Desc) Buffer.Format = format Catch ex As Exception Debug.Print(ex.ToString) Debug.Print(ex.Message) Debug.Print(" ") End Try End Sub Private Function ReadWaveFile(ByVal file As WaveStream) As Byte() Dim data(file.Length - 1) As Byte file.Read(data, 0, CInt(file.Length)) Return data End Function Private Sub SetUpHardware() Device = New DirectSound() Device.SetCooperativeLevel(Form1.Handle, CooperativeLevel.Priority) SetPrimaryBuffer(1, 44100, 8) MyListener = Create3DListener(1, 1, 1) End Sub Private Function Create3DListener(ByVal x As Single, ByVal y As Single, ByVal z As Single) As SoundListener3D Dim GivenVector As Vector3 Dim listener As SoundListener3D Dim description As New SoundBufferDescription listener = New SoundListener3D(Buffer) GivenVector = New Vector3(x, y, z) listener.Position = GivenVector Return (listener) End Function Public Sub MoveListener(ByVal x As Single, ByVal y As Single, ByVal z As Single) MyListener.Position = New Vector3(x, y, z) End Sub Public Sub PlaySound(ByVal MyIndex As Integer, ByVal x As Double, ByVal y As Double, ByVal z As Double) PlaySound(SoundList(MyIndex).Description, x, y, z) End Sub Public Sub StartUpdatingAudio() Dim T As Thread T = New Thread(AddressOf UpdateAudioThread) AmUpdating = True T.Start() End Sub Private Sub UpdateAudioThread() While SoundLibrary.AmUpdating = True If MyListener IsNot Nothing And InGameCamera IsNot Nothing Then Dim front As New Vector3(InGameCamera.Target.X, InGameCamera.Target.Y, InGameCamera.Target.Z) Dim top As New Vector3(0.0F, 1.0F, 0.0F) Dim position As New Vector3(InGameCamera.Position.X, InGameCamera.Position.Y, InGameCamera.Position.Z) MyListener.FrontOrientation = front MyListener.TopOrientation = top MyListener.Position = position MyListener.CommitDeferredSettings() End If End While End Sub Public Sub StopUpdatingAudio() AmUpdating = False End Sub Public Sub PlaySound(ByVal description As String, ByVal X As Double, ByVal y As Double, ByVal z As Double, Optional ByVal MyVolume As Integer = 100) Dim Temp As Integer description = UCase(description) Temp = SoundList.FindIndex(Function(value As SoundListDefinition) Return value.Description = description End Function) Dim SoundBufferEntryCopy As SoundListDefinition SoundBufferEntryCopy = Me.CopyOf(SoundList(Temp)) ' Audio.PlaySound("GUNSHOT", 0, 0, 0) SoundBufferEntryCopy.Buffer.Volume = MyVolume 'If SoundBufferEntryCopy.Buffer.Status = BufferStatus.Playing Then ' SoundBufferEntryCopy.Buffer.Stop() 'End If Dim t As New Thread(DirectCast(Sub() PlayStoredSoundBuffer(SoundBufferEntryCopy, X, y, z), ThreadStart)) t.Start() End Sub Private Function CopyOf(ByVal MyObject As SoundListDefinition) As SoundListDefinition 'Duplicates the object so i may play it multiple times without worrying about interrupting a currently playing sound. Dim NewObject As SoundListDefinition NewObject.Buffer = MyObject.Buffer NewObject.Description = MyObject.Description NewObject.Buffer = DirectCast(MyObject.Buffer, SecondarySoundBuffer) Return NewObject End Function Private Sub PlayStoredSoundBuffer(ByVal BufferIndexClone As SoundListDefinition, ByVal x As Double, ByVal y As Double, ByVal z As Double) Dim The3DBuffer As SoundBuffer3D = New SoundBuffer3D(BufferIndexClone.Buffer) The3DBuffer.Position = New Vector3(Convert.ToSingle(x), Convert.ToSingle(y), Convert.ToSingle(z)) BufferIndexClone.Buffer.Play(0, PlayFlags.TerminateByDistance And PlayFlags.TerminateByPriority And PlayFlags.TerminateByTime) While BufferIndexClone.Buffer.Status = BufferStatus.Playing Application.DoEvents() End While 'I thought that disposing things was perhaps the problem - maybe i was 'cross-disposing items still in use. but that hasn't helped. 'The3DBuffer.Dispose() 'BufferIndexClone.Buffer.Dispose() 'BufferIndexClone = Nothing End Sub End Class [/CODE]
  6. Note to self: before saying "OH! That looks good! I'll go try it!" first see if it's .NET compatible. [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img]
  7. XAudio2 looks prety straight forward. Thanks for the post, Dynamo, i think i'll switch and try that for a bit. i already found more documentation for it. Programming with DirectX : Sound in DirectX - XAudio2 http://programming4.us/multimedia/3830.aspx
  8. then let me correct myself - i can't find ANY sound tutorials for SDX. and i'm not having much luck changing the above link (in first post) from MDX to SDX. It's not a straight conversion from MDX to SDX. Althought i can muttle through some of it, there are places that... i just don't get. for example: going from [code] dim TheSound as DirectSound.SecondaryBuffer=new DirectSound.SecondaryBuffer("C:\mysound.wav", BufferDesc, DSDevice) [/code] to this: [CODE] Dim TheSound As SlimDX.DirectSound.SecondarySoundBuffer = New SlimDX.DirectSound.SecondarySoundBuffer("C:\mysound.wav", BufferDesc, DSDevice) [/CODE] is fail for three reasons: 1 - there are only 2 variable fields for SlimDX.DirectSound.SecondarySoundBuffer 2 - none of those fields are the location of the sound to play. 3 - i don't even know if i'm defining it as the correct SDX object. but if you have suggestions on how else to covercome this and other errors then i would greatly appreciate it. The only three tutorials on their website (Basic Window, Device Creation, Simple Triangle) deal with graphics, not audio. On other websites i'm just finding reposts of those same tutorials.
  9. I was banging my head for 3days trying to figure out why my D3D References weren't showing up in VS 2010 and found out that it's not compatible with .NET 4.0 so i'm having a go at SlimDX. I've just downloaded the newest relase but their website is seriusly lacking on tutorials. I'm looking for a SlimDX 3D audio tutorial that can do this: [url="http://content.gpwiki.org/index.php/DirectX:DirectSound:Tutorials:VBNET:DX9:3D_Sound"]http://content.gpwik...ET:DX9:3D_Sound[/url] (3d listener location and sound emitter location) I've been GooGle-ing but i'm only finding Graphic tutorials with SlimDX (but i know it has audio because i checked the docs) Anybody have any SlimDX Audio tutoiral links available? will take any .NET tutorials (I use VB.NET and can read a good bit of VC.NET even though i can't write it yet. so any .NET tutorials for Slim)
  10. I already thought of that last week. [code] Public Sub SendData(ByVal cSUM As String, ByVal Data() As Byte) ' TODO: Optimize routine ' 1 - double sending. ' 2 - don't make it repeatedly calculate port and ip. have it determined once and ' stored in varable for faster recall. ' 3 - Fine tune error checking. Try msg("Send Data To:" & cSUM) msg("Client IP from String = " & GetClientIPFromString(cSUM)) msg("Client Port from String = " & GetClientPortFromString(cSUM)) ServerSocket.Send(Data, Data.Length, GetClientIPFromString(cSUM), ClientPort) ServerSocket.Send(Data, Data.Length, GetClientIPFromString(cSUM), GetClientPortFromString(cSUM)) Catch ex As Exception msg("ERROR IN SENDDATA() TRY :: " & cSUM & " , " & Data.ToString, ConsoleColor.Red, ConsoleColor.White) EventRaise(EventPointer.errEncounter, ex) End Try End Sub[/code] Server console Output: (i removed the last oct. of IP addresses manualy.) [quote] >> New Player Requesting Connection: $REQ$BRIANTITAN$ | 174.108.69.xxx:53139 >> creating client: 174.108.69.xxx:5139 >> IGNORING CONNECTION: Client is already connected. Ghost? !!TODO! disabled ignore for debugging packetloss. >> Replying To: 174.108.69.xxx:53139 >> Client IP from String = 174.108.69.xxx >> Client Port from String = 5139 >> Replying To: 174.108.69.xxx:53139 >> Client IP from String = 174.108.69.xxx >> Client Port from String = 5139 >> Replying To: 174.108.69.xxx:53139 >> Client IP from String = 174.108.69.xxx >> Client Port from String = 5139 [/quote] so, currently, i'm actualy sending to both the 45000 port and the port received from the endpoint.
  11. The "Master Server" is just server browsing data. it just tells the Game Client "This is a list of servers." the PHP Master Server is not trying to set up a NAT punch through. Just pass information for "You can find a server at 123.123.123.123:5555" The Game Server is trying to set up a connection. It can hear, but the client can't. Game Server---> UPnP Router---> Public Cloud <---- NAT Non-UPnP Router <---- Game Client [quote]The client simply needs to connect to the IP/port of the listed server, and no NAT discovery or punch-through is needed.[/quote] So then the connection error i'm having is likely in my code and not in a closed client router port? ----- EDIT: it can't be a programing error because any client with UPnP router OR with a client machine directly connected to the internet with no router is able to hear the Game Server say "Yes, you may join the game".
  12. I've asked about this in a couple of places but havn't found anyone that knows how to do it. I've also been reading up at [url="http://www.brynosaurus.com/pub/net/p2pnat/"]http://www.brynosaur...pub/net/p2pnat/[/url] but some of it is a bit fuzzy to me so maybe you guys can help. First, the problem:[list] [*]Game Server is UPnP enabled. works perfectly. [*]Client has no UPnP protocols on their router so it requires manual port settings (which kills any modern game) or NAT Punching. [*]"Master Server" is just an HTTP PHP scripted web server that receives Form Submissions to add, remove, and output current Game Server IP:Port infos for clients to download and browse through. (Server Browser data for clients) [/list] [indent=1]currently i have: [color=DarkOliveGreen]Server[/color] starts, contacts master server via HTTP request and informs it "This is my port/ip/name/etc..." [color=Navy]Client[/color] loads and makes an HTTP request to the master server and gets the serverlist, including our target [color=DarkOliveGreen]server[/color]. [color=DarkOliveGreen]Server[/color] Listens on: <Server Customized> [color=DarkOliveGreen]Server[/color] Sends To: 45,000 [color=DarkSlateBlue]Client[/color] Listens On: 45,000 [color=DarkSlateBlue]Client[/color] Sends To: <Server customized> [color=DarkSlateBlue]Client[/color] does HTTP request to a master server to get the target server's IP and <ServerCustomized>port (working) The [color=DarkSlateBlue]client[/color] sends UDP request to the [color=DarkOliveGreen]server [/color]join the [color=DarkOliveGreen]server[/color] targeting <ServerCustomized> port. (working) [color=DarkOliveGreen]Server[/color] hears the [color=DarkSlateBlue]client[/color] request (working) and replies to [color=DarkSlateBlue]client[/color] listening port 45000 "yes you may join" [b](NOT working - [/b]NON-UPnP routers are blocking[b])[/b] as far as i can tell, the[color=DarkOliveGreen] server[/color] is sending it, but the[color=DarkSlateBlue] client[/color] doesn't hear it due to it's NAT router. [size=1]Q: OMG! Why are you doing hole punching? A:Because i've already found 2/3 testers that DONT have upnp routers (eg: WANPPPConnection:1 and WANIPConnection:1).[/size][/indent] From what i understand from [url="http://www.brynosaurus.com/pub/net/p2pnat/"]http://www.brynosaur...pub/net/p2pnat/[/url] , it appears that the game server won't need a 3rd negotiating machine so long as the game server is properly configured to receive connection requests from game clients - no problem. got that. According to the document and what I've been able to scrounge up on the web it seems the game server will need to reply to the client on the end points:[list] [*]LAN[size=6][b].[/b][/size]IP[size=6][b].[/b][/size]xxx[size=6][b].[/b][/size]xxx[size=6][b]:[/b][/size]MachinePort "Token #1" [*]WAN[size=6][b].[/b][/size]IP[size=6][b].[/b][/size]xxx[size=6][b].[/b][/size]xxx[size=6][b]:[/b][/size]RouterPort "Token #2" [*]WAN[size=6][b].[/b][/size]IP[size=6][b].[/b][/size]xxx[size=6][b].[/b][/size]xxx[size=6][b]:[/b][/size]MachinePort "Token #3" [/list] (as far as i understand, endpoint means IP[b]:[/b]PORT ) The game client will reply back with a "I herd "Token #[i]n[/i] " and the server locks in on that information to run the game connection. Now my questions:[list=1] [*]Do i understand correctly? [*]How do i find the external WAN port of the client? [/list] LAN IP, PORT no problem. WAN IP, no problem WAN Port - don't know how to get it. On a side question of the same topic: on section 2.2 of the document [url="http://www.brynosaurus.com/pub/net/p2pnat/"]http://www.brynosaur...pub/net/p2pnat/[/url], how do either of the machines receive the Hole Punch UDP Data Packets from the Server S if the client routers are not yet holepunched to get through the NAT? VB.NET 2010 Ultimate Win 7 Ultimate
  13. Game Server is UPnP enabled. works perfectly. Client has no UPnP protocols on their router so it requires manual port settings. But these days most games find a way around that problem and i'm guessing they are using Hole Punching. I've researched it a bit but it's all fuzzy to me. So maybe someone can clarify the steps needed to do a HolePunch on most networks. currently i have: (all UDP except for the HTTP ofcourse) [color=DarkOliveGreen]Server[/color] starts, contacts master server via HTTP request and informs it "This is my port/ip/name/etc..." [color=Navy]Client[/color] loads and makes an HTTP request to the master server and gets the serverlist, including our target [color=DarkOliveGreen]server[/color]. [color=DarkOliveGreen]Server[/color] Listens on: <Server Customized> [color=DarkOliveGreen]Server[/color] Sends To: 45,000 [color=DarkSlateBlue]Client[/color] Listens On: 45,000 [color=DarkSlateBlue]Client[/color] Sends To: <Server customized> [color=DarkSlateBlue]Client[/color] does HTTP request to a master server to get the target server's IP and <ServerCustomized>port (working) The [color=DarkSlateBlue]client[/color] sends UDP request to the [color=DarkOliveGreen]server [/color]join the [color=DarkOliveGreen]server[/color] targeting <ServerCustomized> port. (working) [color=DarkOliveGreen]Server[/color] hears the [color=DarkSlateBlue]client[/color] request (working) and replies to [color=DarkSlateBlue]client[/color] listening port 45000 "yes you may join" [b](NOT working)[/b] as far as i can tell, the[color=DarkOliveGreen] server[/color] is sending it, but the[color=DarkSlateBlue] client[/color] doesn't hear it. I say this because it works on LAN and i haven't found a UPnP enabled tester to try it with over the internet. to hole punch, do i just need to have the [color=DarkSlateBlue]client[/color] send the initial join request on both <ServerCustomized> port and the 45000 port to punch a hole? [size=1]Q: OMG! Why are you doing hole punching? A:Because i've already found 2/3 testers that DONT have upnp routers (eg: WANPPPConnection:1 and WANIPConnection:1).[/size]