root/trunk/contrib/vmap_debugger/readme.txt @ 2

Revision 2, 5.0 kB (checked in by yumileroy, 17 years ago)

[svn] * Proper SVN structure

Original author: Neo2003
Date: 2008-10-02 16:23:55-05:00

Line 
1Here you find a visual debugging tool. With that you can check it yourself. You need to compile it
2yourself or just use the precompiled version. The precompiled version should not need any
3additional libraries. If you try to compile it yourself you need G3D library 7.00 and
4SDL 1.2.8 or higher.
5
6There is NO “how to compile support”.... You will manage it, if you need to...
7
8What does it do?
9
10The program analyses the content of the vmapcmd.log file created by [b] mangosd compiled
11in debug mode [/b] with vmap support. The commands written to disk are read and the result
12is displayed in a graphical view. This view shows a wire frame model of the loaded vmaps
13and you can move in these maps. Furthermore you can see witch line of sight query where
14performed and its result. You are able to perform the ling of sight query again and will see, if
15the current version of the vmap source compiled against the debugger, produces the same
16result. This last function is useful for debugging the line of sight code.
17
18The little program is a real hack, but is fits is purpose.
19
20How to use it:
21
22[b]Logging[b]
23You will need to set _VMAP_LOG_DEBUG when compiling core in debug mode to get this log.
24If mangos is compiled in debug mode it will then write the vmapcmd.log file. The file does only
25contain the information which vmaps are loaded. I addition to that the file need the
26information where your character currently in standing in the maps. This position information
27has to be inserted manually. To do that I modified the .announce command to send the
28position of the current character to the log file (modification is in the attached patch).
29
30The line of sight query is only stored in the log file if you enable this kind of logging. This is
31done by performing the modified .gm off command. Enabling line of sight and moving your
32character a bit will log the queries and there results. Don’t do this for log, it will produce lots
33of data, which is hard to analyze later.
34
35The modified command .gm on will stop the logging of the line of sight calculation.
36
37What do you have to do for logging?
381.      Apply the patch to mangos to modify your .announce, .gmoff and .gmon commands
392.      Compile mangos in debug mode
403.      Go to the position where you suspect a problem
414.      Use .gmon to be sure you will not be attacked when you login
425.      Save, Logoff and stop mangosd
436.      Delete the vmapcmd.log from the mangos dir. The logger will append to that file.
447.      Start mangos
458.      Login with your character
469.      Send your position to the log file. Do this with the .announce command (.announce
47foo)
4810.     Type .gmoff enabling the line of sight logging
4911.     Move a bit to get the attention of the mobs
5012.     Type .gmon to stop the logging
51
52[b]Analysing the log file[/b]
531. Start the vmap debugger with the path to the mangos data dir and the full path (name) of
54the log file
552. The debugger is controlled by single keys and the mouse. Here is a list of key commands.
56The result is displayed at the console:
57
58l – (small L) Load the next block off logging data into the command queue and process the
59first command from the queue. When the end is reached a message “end reached” is display at
60the console. If you reached the you can press l again. Sending .gm on sets an end mark to the
61file. You have to load the next logging block after each .gmon command.
62
63r – Reload the last command block
64
65mouse middle click – process the next command from the queue
66
67mouse left click – reprocess the last command from the queue
68
69c – recalculate the last line of sight command and send the result to the console
70
71w,s,a,d – move within the 3D view
72
73ESC – exit
74
75TAB – release/grep the mouse
76
77[b]How to test the included example with the precompiled version with the included
78vmapcmd.log file:[b]
79
80open your console
81move to the contrib\vmap_debugger\bin directory
82run: vmapdebugger.exe <your mangos data dir> vmapcmd.log
83Wait until the block screen is open and arrange the console and the screen, so you can see
84both
85Press: l  (small L not one)
86click middle
87click middle
88click middle
89
90Now you should see the wire frame model of scholo and the green line of sight line in the
91display. The green line means the test was performed and you are seen. A red line means you
92are not seen. Move around a bit with the mouse and the w,s,a,d keys.
93
94Press c
95Press ESC
96
97[b]Problems with your gfx.card[/b]
98Maybe the program does not woth with your graphics card. In this case you have dad luck.
99One think might help, if not .... I do not know...:
100
101Here I take 60 MB Ram from Gfx-Card [b]VARArea::create(1024*1024*60)[/b]. That
102might cause problems on your system.
103
104[code]
105    ModelContainerView::ModelContainerView(GApp* pApp) :  GApplet(pApp) {
106        i_App = pApp;
107
108        iCommandFileRW.setFileName(gLogFile);
109        iCurrCmdIndex = 0;
110        iVMapManager = new VMapManager();
111        iDrawLine = false;
112
113        iVARAreaRef = VARArea::create(1024*1024*60);
114        iInstanceId = -1;
115
116    }
117[/code]
118
119This should give all of you who, are interested the chance to check the content and behavior
120of the vmaps.
121
Note: See TracBrowser for help on using the browser.