• Advertisement

Archived

This topic is now archived and is closed to further replies.

Debugging in exclusive mode

This topic is 6238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Yep, you guessed it. The usual pain of debugging full screen stuff... I have 2 options: 1) Buy another computer and use the remote debugging feature in VC++. I tried this with my bro''s comp and it worked nicely, although I dont really want to buy another comp just for debugging. 2) Buy a PCI vid card and a monitor and do the multi-monitor thing...Now, assuming thats what I do, which monitor will get the Mouse/Keyboard changes? both? what if DInput is in Exclusive mode? has anyone had any experience here? How is this done in professional game companies? I would assume they can afford a second computer on each programmer''s desk, but is that what they do? Are there any other ways that I left out?

Share this post


Link to post
Share on other sites
Advertisement
The easiest thing to do is allow your game to run in windowed mode. Debugging is simple as pie in windowed mode and it doesn''t take very much code to setup your game to do so.

There should be a few tutorials on GameDev explaining how to do this.


- Houdini

Share this post


Link to post
Share on other sites
Well, yeah, I can always do windowed mode, but I dont really like doing it that way...I''m interested in hearing about any experience people had with debugging using the multi-monitor setup.

Also, anyone have any idea what pro game dev companies do?

Share this post


Link to post
Share on other sites
Just write to a debug file. Then you have an account of every variable at every state, and you dont have to shell out $500 for a monitor and new video card, or whatever it costs for another computer. I used a debug file and caught most of my errors pretty quickly.

Besides, I hear thats how the pros do it.

Share this post


Link to post
Share on other sites
Debug files are nice. Especially when you are interested in FPS and you don''t want to spend a lot of time writing functions to display that info on the screen... Basically write it out to a file.

If that is not to your liking, I use a duel monitor setup. My mouse is in exclusive mode so I don''t get access to it but I do get access to the keyboard. This takes a little work in that you need to know the hotkeys to get around C++...

Windowed mode is a viable option. Put a bunch of #defines everywhere to determine if it is in debug mode... then when it comes down to it, simply remove those #defines to make your game exclusive mode again...

There are a lot of ways to do it and I''m sure that the professional world varies their methods amongst these and a few others...

E.D.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by BadBros

Well, yeah, I can always do windowed mode, but I dont really like doing it that way...I''m interested in hearing about any experience people had with debugging using the multi-monitor setup.

Also, anyone have any idea what pro game dev companies do?


Um, why wouldn''t you even WANT to do that? Is it that you don''t like being able to debug real-time, or be able to change your code on the fly without recompiling/restarting the game, or both? It takes like 15 minutes to write code to allow a game to run in windowed mode, and you can reuse that code for any other game so it''s a one time thing.

I can''t understand why you''d purposely want to limit yourself to debugging with text files (unless you got the money for the multi-monitor option). I mean, is there seriously a reason you don''t want to debug in windowed mode?

Share this post


Link to post
Share on other sites
Have you considered a KVM switch? It lets you use a single monitor, keyboard and mouse with multiple computers. There are a lot of uses for a second computer beyond just debugging. You can use it for a print server and various other types of servers, testing networking code and differant platforms as well as running long running tasks on it. You could view it as a unneeded luxary, but it is only a matter of time until you need a new PC. You could pitch the old one or selling for next to nothing or you could use it.

Share this post


Link to post
Share on other sites
I use multimonitor debugging and the experience has been very positive. Here are some points on it:

-You need to get a card that''s able to disable its primary VGA output, so that it can be your secondary card. Most good cards can do this though.

-It should be very easy to set up. For me, it was just plug the monitor in and it worked in Windows. It took about 15 mins of looking through the DXSDK and experimenting with code to get it working.

-I happened to get a card that operated with a different pixel format in 16 bit color than my primary, as well as with a different linear pitch. This enables me to test on different configurations, and make sure drawing code etc is actually correct.

-The second monitor runs a lot more slowly for some reason (when I run fullscreen on it). This is a disadvantage because slow sucks, but an advantage because I get to see the game I''m debugging running more slowly, and to make sure my timing code is correct.

It''s a really cool thing. Although I think Windowed mode is probably a little easier, multimon gives you a good chance to test on different hardware without even moving the program.

You can email me if you have any more questions.

invader@hushmail.com

Share this post


Link to post
Share on other sites
I dont have two monitors or the window option, so I use a debug logfile for my game.

So, I think a log fills up nearly all debug possibilities and you even dont need to switch to an external program all the time.
It''s quite convenient.

Another good reason for choosing a logfile is the ability to display exactly the information you need and the fact, that you can view every game part (e.g. engine startup, textureload) with one look into your logfile.

A bad thing is that you sometimes looses the rest of your file on crashes.


Have a look at our game "Crashday" at www.moonbyte.de

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I have experience in using 2 monitors to debug a Direct Draw aplication. I work like this: In one monitor I run the DD app, and the other I use VC++. Only thing you have to do is to comment the windows messages procesing code in your DD app, and then you can debug like any other app.

Share this post


Link to post
Share on other sites
I use two computers and use the remote debugging feature of VC++. But then Im also a bit of a hardware junky and never throw out old PCs.

I find it very easy to use and very useful. You dont have to muck around with extra code or setting up multi monitors etc. definately the way to go if you can afford IMO.

Share this post


Link to post
Share on other sites
Houdini> How do you debug remotely. I have a network set up and would love to be able to do this but when I have tried it before (using the help in msdn) I just haven''t managed to do it. Could you please explain how to do it?

Thanks

Zeke000000@aol.com

Just my thoughts take them as you will.

"People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face

Share this post


Link to post
Share on other sites
quote:
Original post by Zeke

Houdini> How do you debug remotely. I have a network set up and would love to be able to do this but when I have tried it before (using the help in msdn) I just haven''t managed to do it. Could you please explain how to do it?




Zeke, I don''t. I''m not sure if you got my name mixed up with another post, but I allow my game to run both fullscreen and windowed mode so I don''t NEED to debug remotely. You can debug your windowed game just like any other application.


- Houdini

Share this post


Link to post
Share on other sites
Ok,

I wrote code to toggle fullscreen and windowed, and thats what I''ve used up to know, Its just that I personally find it a pain to keep switching windows and I dont like running games in windowed mode in general.

I''ve also used debug files many a time, but i''m interested in taking full advantage of the debugger (Traces, Breakpoints, etc.)

The only reason I would be setting up multi-monitors is for running the game on one monitor and running VC on the other, not testing my game on different cards/monitors.

What I wanted to hear about in multi-mon was about the mouse/keyboard. I would assume both the game and VC would get the mouse/keyboard events, unless the game was running DInput in exclusive mode, is this correct?

Thank you very much for your input

------------

Zeke - the MSDN docs for setting up the remote debugging were a bit confusing. Just do the following - On the computer you want to run the game on, run the msvcmon.exe, set it to connect to the other computer and click on "Connect".

The rest of the instructions (Like setting up the remote path and stuff like that) are all done in VC on the computer that will be running the debugger.

Hope that helps

Share this post


Link to post
Share on other sites
Yes, you''re right about the mouse/keyboard.

If the game has the focus, then VC++ doesn''t get input messages from the keyboard of course. But if VC++ has focus then it gets messages and the game also responds to the keyboard, because it''s reading it more directly than through windows messages. So basically, if you are scrolling in the VC++ editor, then the controls are also working in your game.

Share this post


Link to post
Share on other sites

  • Advertisement