Debugging C++ in Visual Studio
How do I use Visual Studio's debugging capabilities on a client server game? I'm running both the client and the server on the same machine during development. When I run "Local Windows Debugger" in Visual Studio and set a breakpoint in my code, how do I know if execution hits the breakpoint in the server executable or the client executable?
asked May 26 '15 at 07:23 AM in C++ Programming
I don't know if it will help, but you have several configurations. "Debug Game Editor", "Development Editor", ...
If you use "Development Editor", what I've seen, is that some variables are optimized. The editor is launched separately and you have to attach the debugger to an exe. Every time you made code modifications, the hot reload takes care of the changes.
If you use "Debug Game Editor", it will launch the editor when you start debugging. It is slower, but easier to debug. You don't launch the editor, VS2013 will do it for you.
I hope it will help. Have a nice day. D.
answered May 26 '15 at 04:31 PM
Please note that for client-server game debugging, you can use Network Profiler tool that comes with the Engine. It can show you a lot of network-related information, such as the amount of replicated properties and Actors, how much bandwidth is being used and more.
You can find the tool at /Engine/Binaries/DotNET/ directory.
To view the data, please capture a profile while your game is running. To do this you can enter 'netprofile' command in the console to start/stop recording. Then, after the recording stops, the appropriate *.nprof file will appear in Saved/Profiling directory of your project. To get the information, please open the file with the Network Profiler.
Hope this helped!
Have a great day!
My way: 1. build a windows dedicated server(DS); 2. debug the DS, find what happened when launch the DS; 3. package a DS, and start with the command: ShooterGameServer.exe /Game/Maps/Sanctuary?game=TDM -server -log -port=7777 -NOSTEAM 4. build and package a game client; 5. start the game client with the command: ShooterGame.exe 127.0.0.1 then attach the client process to visual studio, and debug the client, find what happend when launch the client; 6. debug the DS, make a break point at Net Driver or somewhere you like, then launch client to connect DS, find what happend when a client connect to DS; 7. now, open your imagination to do something else like find what happened when a player fired to other player
better way to debug a game, please tell me, thanks!
Follow this question
Once you sign in you will be able to subscribe for any updates here