source: GTP/trunk/App/Demos/Illum/Shark3D/version164x12u/IllumDemo/src/res/client/actor/client.s3d_actor @ 2196

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