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