source: GTP/trunk/App/Demos/Geom/Shark3D/clod_head_demo_win32/src/res/client/actor/client.s3d_actor @ 2236

Revision 2236, 22.4 KB checked in by gumbau, 17 years ago (diff)
Line 
1///////////////////////////////////////////////////////////////////////////////
2//
3//      ##  ######
4//       ######  ###
5//  ## ###############        Shark 3D Engine (www.shark3d.com)
6//   ########## # # #
7//    ########                Copyright (c) 1996-2006 Spinor GmbH.
8//   ######### # # #          All rights reserved.
9//  ##   ##########
10//      ##
11//
12///////////////////////////////////////////////////////////////////////////////
13
14// Definition of the game client.
15// This file defines all actors used on client side.
16// It includes the graphic output definitions "client/actor/gfx.s3d_actor_run"
17// and the display defintion "client/actor/display.s3d_actor_run".
18
19// The client root actor is a capsule, defining an own local namespace.
20actor_ident "kit_base.capsule"
21actor_param
22{
23    active 1
24    // Scope name. Used in error messages.
25    scope "client"
26    // Name of the capsule actor within its own namespace.
27    // Actors within the capsule can access the capsule
28    // actor itself by this name.
29    local_name "capsule"
30    // Delegate commands from outside to the correct dispatcher.
31    deleg_target "dispatch_export"
32    // The capsule actor contains a group of actors:
33    child_ident "kit_base.group"
34    child_param
35    {
36        active 1
37        child_array
38        {
39            // Dispatcher for commands from outside the client capsule.
40            ident "kit_base.dispatch"
41            param
42            {
43                name "dispatch_export"
44                entry_array
45            }
46        }
47        {
48            // Central command dispatch actor.
49            // This dispatcher is used internally within the client.
50            ident "kit_base.dispatch"
51            param
52            {
53                name "dispatch"
54                entry_array
55                {
56                    cmds "set_camera_transf"
57                    targets "io"
58                }
59                {
60                    cmds "io_reloaded"
61                    targets "universeplayer_refresh_charge"
62                    newcmd "perform"
63                }
64            }
65        }
66        {
67            // This dispatcher is used to filter input commands.
68            ident "kit_base.dispatch"
69            param
70            {
71                name "dispatch_input"
72                entry_array
73                {
74                    cmds "quit" "refresh_all_res"
75                    targets "^root"
76                }
77                {
78                    cmds "store_file_default"
79                    targets "store_file_default"
80                    newcmd "perform"
81                }
82                {
83                    cmds "load_file_default"
84                    targets "load_file_default"
85                    newcmd "perform"
86                }
87                {
88                    // Send these commands to server:
89                    cmds
90                        "fire" "directfire"
91                        //"god"
92                        "goto_level0" "goto_level1"
93                        "goto_level2" "goto_level3"
94                        "goto_level4" "goto_level5"
95                        "goto_level6" "goto_level7"
96                        "goto_level8" "goto_level9"
97                        "goto_level_next" "goto_level_prev"
98                    // Delegate to the universe-player:
99                    targets "universeplayer"
100                }
101                {
102                    // Send movement commands to the movement control actor:
103                    cmds
104                        "apply_move_pos_x" "apply_move_neg_x"
105                        "apply_move_pos_y" "apply_move_neg_y"
106                        "apply_move_pos_z" "apply_move_neg_z"
107                        "assign_vel_pos_x" "assign_vel_neg_x"
108                        "assign_vel_pos_y" "assign_vel_neg_y"
109                        "assign_vel_pos_z" "assign_vel_neg_z"
110                        "switch_vel_pos_x" "switch_vel_neg_x"
111                        "switch_vel_pos_y" "switch_vel_neg_y"
112                        "switch_vel_pos_z" "switch_vel_neg_z"
113                        "apply_rot_pos_x" "apply_rot_neg_x"
114                        "apply_rot_pos_y" "apply_rot_neg_y"
115                        "apply_rot_pos_z" "apply_rot_neg_z"
116                        "assign_spin_pos_x" "assign_spin_neg_x"
117                        "assign_spin_pos_y" "assign_spin_neg_y"
118                        "assign_spin_pos_z" "assign_spin_neg_z"
119                        "switch_spin_pos_x" "switch_spin_neg_x"
120                        "switch_spin_pos_y" "switch_spin_neg_y"
121                        "switch_spin_pos_z" "switch_spin_neg_z"
122                        "jump"
123                    targets "motion_deleg_deleg"
124                }
125                {
126                    cmds
127                        "assign_vel_pos_x" "assign_vel_neg_x"
128                        "assign_vel_pos_y" "assign_vel_neg_y"
129                        "assign_vel_pos_z" "assign_vel_neg_z"
130                        "assign_spin_pos_x" "assign_spin_neg_x"
131                        "assign_spin_pos_y" "assign_spin_neg_y"
132                        "assign_spin_pos_z" "assign_spin_neg_z"
133                        "move_cursor_x" "move_cursor_y"
134                    targets "extra_script"
135                }
136                {
137                    cmds "extra"
138                    targets "extra_script"
139                    newcmd "toggle"
140                }
141                {
142                    cmds "god"
143                    targets "extra_script"
144                    newcmd "god"
145                }
146                {
147                    // Commands for gfx:
148                    cmds "set_cursor_x" "set_cursor_y"
149                        "move_cursor_x" "move_cursor_y"
150                        "toggle_showgfxbound"
151                        "toggle_showgfxmesh"
152                        "toggle_showgfxwire"
153                        "toggle_showgfxocclmesh"
154                        "toggle_showgfxocclwire"
155                        "toggle_showphysbound"
156                        "toggle_showphysgeo"
157                        "toggle_showphyscontact"
158                        "toggle_simple"
159                        "toggle_shownoise"
160                        "toggle_showsensorbound"
161                        "toggle_showsensorgeo"
162                        "store_screenshot"
163                        "reset_msg"
164                        "toggle_frmtime"
165                        "toggle_stat" "reset_stat"
166                        "toggle_fullscreen"
167                        "toggle_catch_mouse"
168                    targets "io"
169                }
170                {
171                    cmds "reload_io"
172                    targets "io_extern"
173                    newcmd "load_current"
174                }
175                {
176                    // Character input
177                    cmds "handle_char"
178                    targets
179                }
180            }
181        }
182        {
183            // Dispatcher of commands coming from the server.
184            ident "kit_base.dispatch"
185            param
186            {
187                name "dispatch_universe"
188                entry_array
189                {
190                    cmds "get_basesuppl"
191                    targets "sersuppl"
192                    newcmd "get_obj"
193                }
194                {
195                    cmds "ignore_frmtime"
196                    targets "^root"
197                }
198                {
199                    cmds "cfg_access_int_info"
200                    targets "^cfg"
201                    newcmd "access_int_info"
202                }
203                {
204                    cmds "cfg_access_float_info"
205                    targets "^cfg"
206                    newcmd "access_float_info"
207                }
208                {
209                    cmds "cfg_access_str_info"
210                    targets "^cfg"
211                    newcmd "access_str_info"
212                }
213                {
214                    cmds "cfg_access_chunk_info"
215                    targets "^cfg"
216                    newcmd "access_chunk_info"
217                }
218                {
219                    cmds "universe_cfg_access_int_info"
220                    targets "universe_cfg"
221                    newcmd "access_int_info"
222                }
223                {
224                    cmds "universe_cfg_access_float_info"
225                    targets "universe_cfg"
226                    newcmd "access_float_info"
227                }
228                {
229                    cmds "universe_cfg_access_str_info"
230                    targets "universe_cfg"
231                    newcmd "access_str_info"
232                }
233                {
234                    cmds "universe_cfg_access_chunk_info"
235                    targets "universe_cfg"
236                    newcmd "access_chunk_info"
237                }
238                {
239                    cmds "enable_notice_destroying" "disable_notice_destroying"
240                        "enable_notice_loading" "disable_notice_loading"
241                        "enable_notice_saving" "disable_notice_saving"
242                    targets
243                }
244                {
245                    cmds "enable_notice_destroying" "disable_notice_destroying"
246                        "enable_notice_loading" "disable_notice_loading"
247                        "enable_notice_saving" "disable_notice_saving"
248                    targets
249                }
250            }
251        }
252        {
253            ident "kit_perch.mgr"
254            param
255            {
256                name "perchmgr"
257            }
258        }
259        {
260            ident "kit_snk.data"
261            param
262            {
263                name "universe_cfg"
264                val
265                {
266                    server 0
267                }
268            }
269        }
270        {
271            ident "kit_base.sersuppl"
272            param
273            {
274                name "sersuppl"
275                child "^basesuppl"
276            }
277        }
278        {
279            // Dispatcher of commands coming from the server.
280            ident "kit_base.dispatch"
281            param
282            {
283                name "dispatch_inform"
284                entry_array
285                {
286                    cmds "set_state_world"
287                    targets "state_world"
288                    newcmd "set_obj"
289                }
290                {
291                    cmds "set_state_sky"
292                    targets "state_sky"
293                    newcmd "set_obj"
294                }
295                {
296                    cmds
297                        "set_gfxmgr_level"
298                        "set_sndmgr_level"
299                        "set_state_world"
300                        "set_state_sky"
301                        "set_sim_world"
302                        "set_noise_world"
303                        "set_sensorstate_world"
304                    targets "io"
305                }
306                {
307                    cmds "set_sim_world"
308                    targets "sim_world"
309                    newcmd "set_obj"
310                }
311                {
312                    cmds "set_noise_world"
313                    targets "noise_world"
314                    newcmd "set_obj"
315                }
316                {
317                    cmds "set_sensorstate_world"
318                    targets "sensorstate_world"
319                    newcmd "set_obj"
320                }
321                {
322                    cmds "set_camera"
323                    targets "elem_camera"
324                    newcmd "set_obj"
325                }
326                {
327                    cmds "set_playerbody"
328                    targets "io"
329                }
330                {
331                    cmds "notice_level_load_pre"
332                    targets "display"
333                    newcmd "enable_notice_loading"
334                }
335                {
336                    cmds "notice_level_load_post"
337                    targets "display"
338                    newcmd "disable_notice_loading"
339                }
340                {
341                    cmds
342                        "notice_level_load_pre"
343                        "notice_level_load_post"
344                    targets "io"
345                    newcmd "suspend_output"
346                }
347                {
348                    cmds
349                        "notice_level_load_pre"
350                        "notice_level_load_post"
351                    targets "io"
352                    newcmd "perform_output"
353                }
354            }
355        }
356        {
357            // Event queue.
358            ident "kit_base.evtmgr"
359            param
360            {
361                active 1
362                name "evtmgr"
363                extcfg_actor "^cfg"
364                extcfg_entry_log "log.evtmgr"
365            }
366        }
367        {
368            // Information line collection actor.
369            // This actor collects per-frame information lines
370            // like the frmtime.
371            // This actor does not generate the information,
372            // but only is responsible for collecting the lines.
373            ident "kit_base.inspcollect"
374            param
375            {
376                name "inspcollect"
377            }
378        }
379        {
380            ident "kit_engbase.extern"
381            param
382            {
383                active 1
384                name "universe_extern"
385                deleg_name "universe"
386                allow_no_target 1
387                res ""
388                net_imprint 0
389            }
390        }
391        {
392            ident "kit_engbase.plug"
393            param
394            {
395                name "plug"
396                deleg_name "plug_root"
397                netlink_suppl "^envcompsuppl"
398                netlink_ident "eng_base.netlink"
399                netlink_param
400                {
401                    env "^env"
402                }
403                netroot_target "universe"
404                lost_target ""
405                lost_cmd ""
406                nettraverse_target "universe_extern"
407                nettraverse_cmd "traverse"
408            }
409        }
410        {
411            // Create a network engine.
412            ident "kit_io.neteng"
413            param
414            {
415                active 1
416                name "neteng"
417                // Get parameters from the actor "cfg",
418                // which is defined above.
419                extcfg_actor "^cfg"
420                // Get the parameters from the "network" entry.
421                extcfg_entry_param "network"
422                given_array
423                {
424                    item "^env"
425                    given_ident "env"
426                }               
427            }
428        }
429        {
430            ident "kit_engbase.plugconnect"
431            param
432            {
433                name "plugconnect"
434                plug "plug"
435                neteng "neteng"
436                localroot "^server"
437                extcfg_actor "^cfg"
438                extcfg_entry_addr "client.addr"
439            }
440        }
441        {
442            ident "kit_engobj.informmgr"
443            param
444            {
445                name "universeplayer_informmgr"
446                deleg_name "universeplayer"
447                inform "dispatch_inform"
448                ignore_no_charge 1
449                notify_target ""
450                notify_pre_cmd ""
451                notify_post_cmd ""
452                produce_target "plug_root"
453                produce_cmd "produce_player"
454            }
455        }
456        {
457            ident "kit_base.paramvoid"
458            param
459            {
460                name "universeplayer_refresh_charge"
461                target "universeplayer_informmgr"
462                cmd "refresh_charge"
463            }
464        }
465        {
466            ident "kit_engobj.fetch"
467            param
468            {
469                name "universeplayer_fetch"
470                query_target "universeplayer_informmgr"
471                query_cmd "get_charge"
472                produce_target "universeplayer_informmgr"
473                produce_cmd "produce_charge"
474                produce_report_target ""
475                produce_report_cmd ""
476                enum_target ""
477                enum_cmd ""
478                enum_report_target ""
479                enum_report_cmd ""
480            }
481        }
482
483        {
484            ident "kit_engobj.itemeye"
485            param
486            {
487                name "sim_world"
488            }
489        }
490        {
491            ident "kit_engobj.itemeye"
492            param
493            {
494                name "noise_world"
495            }
496        }
497        {
498            ident "kit_engobj.itemeye"
499            param
500            {
501                name "sensorstate_world"
502            }
503        }
504        {
505            ident "kit_engobj.itemeye"
506            param
507            {
508                name "elem_camera"
509            }
510        }
511        {
512            // Define the camera:
513            ident "kit_engobj.cameractrl"
514            param
515            {
516                active 1
517                name "cameractrl"
518                rawtransf_src "elem_camera"
519                transf_target "dispatch"
520                transf_cmd "set_camera_transf"
521            }
522        }
523        {
524            // Include the definition of the display.
525            ident "kit_base.extern"
526            param
527            {
528                active 1
529                name "display_extern"
530                deleg_name "display"
531                res "client/actor/display.s3d_actor_run"
532                // No watch because display needs "set_clientimageobj_xxx"
533            }
534        }
535        {
536            // Include actors for movement control:
537            ident "kit_base.extern"
538            param
539            {
540                active 1
541                deleg_name "motion"
542                res "client/actor/motion.s3d_actor_run"
543            }
544        }
545        {
546            ident "kit_engobj.itemeye"
547            param
548            {
549                name "state_world"
550            }
551        }
552        {
553            ident "kit_engobj.itemeye"
554            param
555            {
556                name "state_sky"
557            }
558        }
559        {
560            ident "kit_engobj.itemeye"
561            param
562            {
563                name "state_display"
564            }
565        }
566        {
567            // Include the definition of the display.
568            ident "kit_base.extern"
569            param
570            {
571                active 1
572                name "io_extern"
573                deleg_name "io"
574                res "client/actor/io.s3d_actor_run"
575                notify_target "dispatch"
576                notify_post_cmd "io_reloaded"
577                watch_target "io_extern"
578                watch_cmd "load_current"
579            }
580        }
581
582        // The following entry_array define the order of actions
583        // performed each frame in the client.
584        // General order:
585        //   1. Receive data from server.
586        //   2. Update output (especially timeconsuming 3D output).
587        //   3. Evaluate input.
588        //   4. Send data to server.
589        // Note that performing input before output would be the wrong order,
590        // since the input would not have been evaluated by the server yet-
591        // The above order archives that the display reflects the input
592        // as soon as possible.
593        {
594            ident "kit_base.onaction"
595            param
596            {
597                active 1
598                name "check_universeplayer_onaction"
599                target "universeplayer_fetch"
600                cmd "check_produce_charge"
601            }
602        }
603        {
604            // First, evaluate data received from server:
605            ident "kit_base.onaction"
606            param
607            {
608                active 1
609                name "poll_recv_onaction"
610                target "plug"
611                cmd "poll_recv"
612            }
613        }
614        {
615            // Update camera transformation to views and snd.
616            ident "kit_base.onaction"
617            param
618            {
619                active 1
620                name "update_cameractrl_onaction"
621                target "cameractrl"
622                cmd "update"
623            }
624        }
625        {
626            // Render the gfxports and update the sndports:
627            ident "kit_base.onaction"
628            param
629            {
630                active 1
631                name "perform_output_onaction"
632                target "io"
633                cmd "perform_output"
634            }
635        }
636        {
637            // Evaluate input data:
638            ident "kit_base.onaction"
639            param
640            {
641                active 1
642                name "perform_input_onaction"
643                target "io"
644                cmd "perform_input"
645            }
646        }
647        {
648            // Evaluate motin input control:
649            ident "kit_base.onaction"
650            param
651            {
652                active 1
653                name "update_motion_onaction"
654                target "motion"
655                cmd "update_motion"
656            }
657        }
658        {
659            // Send data to server:
660            ident "kit_base.onaction"
661            param
662            {
663                active 1
664                name "poll_send_onaction"
665                target "plug"
666                cmd "poll_send"
667            }
668        }
669        {
670            ident "kit_base.paramstr"
671            param
672            {
673                name "store_file_default"
674                target "universeplayer"
675                cmd "store_file"
676                param "save.sav"
677            }
678        }
679        {
680            ident "kit_base.paramstr"
681            param
682            {
683                name "load_file_default"
684                target "universeplayer"
685                cmd "load_file"
686                param "save.sav"
687            }
688        }
689        {
690            ident "kit_base.deleg"
691            param
692            {
693                name "motion_deleg"
694                deleg_name "motion_deleg_deleg"
695                deleg_target "motion"
696                enabled 1
697            }
698        }
699        {
700            ident "kit_perch.script"
701            param
702            {
703                name "extra_script"
704                perchmgr "perchmgr"
705                res "client/actor/extra.s3d_perch_run"
706                notes_enabled 1
707                evtmgr "evtmgr"
708                param
709                {
710                }
711            }
712        }
713    }
714}
Note: See TracBrowser for help on using the repository browser.