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