]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/default/bot.qc
Cleanup server mutator #includes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / bot.qc
1 #include "bot.qh"
2
3 #include "cvars.qh"
4
5 #include "aim.qh"
6 #include "navigation.qh"
7 #include "scripting.qh"
8 #include "waypoints.qh"
9
10 #include "havocbot/havocbot.qh"
11 #include "havocbot/scripting.qh"
12
13 #include "../../teamplay.qh"
14
15 #include "../../antilag.qh"
16 #include "../../autocvars.qh"
17 #include "../../campaign.qh"
18 #include "../../cl_client.qh"
19 #include "../../constants.qh"
20 #include "../../defs.qh"
21 #include "../../race.qh"
22 #include <common/t_items.qh>
23
24 #include "../../mutators/_all.qh"
25
26 #include "../../weapons/accuracy.qh"
27
28 #include <common/physics/player.qh>
29 #include <common/constants.qh>
30 #include <common/mapinfo.qh>
31 #include <common/teams.qh>
32 #include <common/util.qh>
33
34 #include <common/weapons/all.qh>
35
36 #include <lib/csqcmodel/sv_model.qh>
37
38 #include <lib/warpzone/common.qh>
39 #include <lib/warpzone/util_server.qh>
40
41 entity bot_spawn()
42 {
43         entity bot = spawnclient();
44         if (bot)
45         {
46                 currentbots = currentbots + 1;
47                 bot_setnameandstuff(bot);
48                 ClientConnect(bot);
49                 PutClientInServer(bot);
50         }
51         return bot;
52 }
53
54 void bot_think(entity this)
55 {
56         if (this.bot_nextthink > time)
57                 return;
58
59         this.flags &= ~FL_GODMODE;
60         if(autocvar_bot_god)
61                 this.flags |= FL_GODMODE;
62
63         this.bot_nextthink = this.bot_nextthink + autocvar_bot_ai_thinkinterval * pow(0.5, this.bot_aiskill);
64         //if (this.bot_painintensity > 0)
65         //      this.bot_painintensity = this.bot_painintensity - (skill + 1) * 40 * frametime;
66
67         //this.bot_painintensity = this.bot_painintensity + this.bot_oldhealth - this.health;
68         //this.bot_painintensity = bound(0, this.bot_painintensity, 100);
69
70         if (!IS_PLAYER(this) || (autocvar_g_campaign && !campaign_bots_may_start))
71         {
72                 this.bot_nextthink = time + 0.5;
73                 return;
74         }
75
76         if (this.fixangle)
77         {
78                 this.v_angle = this.angles;
79                 this.v_angle_z = 0;
80                 this.fixangle = false;
81         }
82
83         this.dmg_take = 0;
84         this.dmg_save = 0;
85         this.dmg_inflictor = NULL;
86
87         // calculate an aiming latency based on the skill setting
88         // (simulated network latency + naturally delayed reflexes)
89         //this.ping = 0.7 - bound(0, 0.05 * skill, 0.5); // moved the reflexes to bot_aimdir (under the name 'think')
90         // minimum ping 20+10 random
91         this.ping = bound(0,0.07 - bound(0, (skill + this.bot_pingskill) * 0.005,0.05)+random()*0.01,0.65); // Now holds real lag to server, and higer skill players take a less laggy server
92         // skill 10 = ping 0.2 (adrenaline)
93         // skill 0 = ping 0.7 (slightly drunk)
94
95         // clear buttons
96         PHYS_INPUT_BUTTON_ATCK(this) = false;
97         PHYS_INPUT_BUTTON_JUMP(this) = false;
98         PHYS_INPUT_BUTTON_ATCK2(this) = false;
99         PHYS_INPUT_BUTTON_ZOOM(this) = false;
100         PHYS_INPUT_BUTTON_CROUCH(this) = false;
101         PHYS_INPUT_BUTTON_HOOK(this) = false;
102         PHYS_INPUT_BUTTON_INFO(this) = false;
103         PHYS_INPUT_BUTTON_DRAG(this) = false;
104         PHYS_INPUT_BUTTON_CHAT(this) = false;
105         PHYS_INPUT_BUTTON_USE(this) = false;
106
107         if (time < game_starttime)
108         {
109                 // block the bot during the countdown to game start
110                 this.movement = '0 0 0';
111                 this.bot_nextthink = game_starttime;
112                 return;
113         }
114
115         // if dead, just wait until we can respawn
116         if (IS_DEAD(this))
117         {
118                 if (this.deadflag == DEAD_DEAD)
119                 {
120                         PHYS_INPUT_BUTTON_JUMP(this) = true; // press jump to respawn
121                         this.bot_strategytime = 0;
122                 }
123         }
124         else if(this.aistatus & AI_STATUS_STUCK)
125                 navigation_unstuck(this);
126
127         // now call the current bot AI (havocbot for example)
128         this.bot_ai(this);
129 }
130
131 void bot_setnameandstuff(entity this)
132 {
133         string readfile, s;
134         float file, tokens, prio;
135
136         string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
137         string name, prefix, suffix;
138
139         if(autocvar_g_campaign)
140         {
141                 prefix = "";
142                 suffix = "";
143         }
144         else
145         {
146                 prefix = autocvar_bot_prefix;
147                 suffix = autocvar_bot_suffix;
148         }
149
150         file = fopen(autocvar_bot_config_file, FILE_READ);
151
152         if(file < 0)
153         {
154                 LOG_INFO(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
155                 readfile = "";
156         }
157         else
158         {
159                 RandomSelection_Init();
160                 while((readfile = fgets(file)))
161                 {
162                         if(substring(readfile, 0, 2) == "//")
163                                 continue;
164                         if(substring(readfile, 0, 1) == "#")
165                                 continue;
166                         tokens = tokenizebyseparator(readfile, "\t");
167                         if(tokens == 0)
168                                 continue;
169                         s = argv(0);
170                         prio = 1;
171                         FOREACH_CLIENT(IS_BOT_CLIENT(it), LAMBDA(
172                                 if(s == it.cleanname)
173                                 {
174                                         prio = 0;
175                                         break;
176                                 }
177                         ));
178                         RandomSelection_Add(NULL, 0, readfile, 1, prio);
179                 }
180                 readfile = RandomSelection_chosen_string;
181                 fclose(file);
182         }
183
184         tokens = tokenizebyseparator(readfile, "\t");
185         if(argv(0) != "") bot_name = argv(0);
186         else bot_name = "Bot";
187
188         if(argv(1) != "") bot_model = argv(1);
189         else bot_model = "";
190
191         if(argv(2) != "") bot_skin = argv(2);
192         else bot_skin = "0";
193
194         if(argv(3) != "" && stof(argv(3)) >= 0) bot_shirt = argv(3);
195         else bot_shirt = ftos(floor(random() * 15));
196
197         if(argv(4) != "" && stof(argv(4)) >= 0) bot_pants = argv(4);
198         else bot_pants = ftos(floor(random() * 15));
199
200         this.bot_forced_team = stof(argv(5));
201
202         prio = 6;
203
204         #define READSKILL(f,w,r) if(argv(prio) != "") this.f = stof(argv(prio)) * (w); else this.f = (!autocvar_g_campaign) * (2 * random() - 1) * (r) * (w); ++prio
205         //print(bot_name, ": ping=", argv(9), "\n");
206
207         READSKILL(havocbot_keyboardskill, 0.5, 0.5); // keyboard skill
208         READSKILL(bot_moveskill, 2, 0); // move skill
209         READSKILL(bot_dodgeskill, 2, 0); // dodge skill
210
211         READSKILL(bot_pingskill, 0.5, 0); // ping skill
212
213         READSKILL(bot_weaponskill, 2, 0); // weapon skill
214         READSKILL(bot_aggresskill, 1, 0); // aggre skill
215         READSKILL(bot_rangepreference, 1, 0); // read skill
216
217         READSKILL(bot_aimskill, 2, 0); // aim skill
218         READSKILL(bot_offsetskill, 2, 0.5); // offset skill
219         READSKILL(bot_mouseskill, 1, 0.5); // mouse skill
220
221         READSKILL(bot_thinkskill, 1, 0.5); // think skill
222         READSKILL(bot_aiskill, 2, 0); // "ai" skill
223
224         this.bot_config_loaded = true;
225
226         // this is really only a default, JoinBestTeam is called later
227         setcolor(this, stof(bot_shirt) * 16 + stof(bot_pants));
228         this.bot_preferredcolors = this.clientcolors;
229
230         // pick the name
231         if (autocvar_bot_usemodelnames)
232                 name = bot_model;
233         else
234                 name = bot_name;
235
236         // number bots with identical names
237         int j = 0;
238         FOREACH_CLIENT(IS_BOT_CLIENT(it), LAMBDA(
239                 if(it.cleanname == name)
240                         ++j;
241         ));
242         if (j)
243                 this.netname = this.netname_freeme = strzone(strcat(prefix, name, "(", ftos(j), ")", suffix));
244         else
245                 this.netname = this.netname_freeme = strzone(strcat(prefix, name, suffix));
246
247         this.cleanname = strzone(name);
248
249         // pick the model and skin
250         if(substring(bot_model, -4, 1) != ".")
251                 bot_model = strcat(bot_model, ".iqm");
252         this.playermodel = this.playermodel_freeme = strzone(strcat("models/player/", bot_model));
253         this.playerskin = this.playerskin_freeme = strzone(bot_skin);
254
255         this.cvar_cl_accuracy_data_share = 1;  // share the bots weapon accuracy data with the NULL
256         this.cvar_cl_accuracy_data_receive = 0;  // don't receive any weapon accuracy data
257 }
258
259 void bot_custom_weapon_priority_setup()
260 {
261         float tokens, i, w;
262
263         bot_custom_weapon = false;
264
265         if(     autocvar_bot_ai_custom_weapon_priority_far == "" ||
266                 autocvar_bot_ai_custom_weapon_priority_mid == "" ||
267                 autocvar_bot_ai_custom_weapon_priority_close == "" ||
268                 autocvar_bot_ai_custom_weapon_priority_distances == ""
269         )
270                 return;
271
272         // Parse distances
273         tokens = tokenizebyseparator(autocvar_bot_ai_custom_weapon_priority_distances," ");
274
275         if (tokens!=2)
276                 return;
277
278         bot_distance_far = stof(argv(0));
279         bot_distance_close = stof(argv(1));
280
281         if(bot_distance_far < bot_distance_close){
282                 bot_distance_far = stof(argv(1));
283                 bot_distance_close = stof(argv(0));
284         }
285
286         // Initialize list of weapons
287         bot_weapons_far[0] = -1;
288         bot_weapons_mid[0] = -1;
289         bot_weapons_close[0] = -1;
290
291         // Parse far distance weapon priorities
292         tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," ");
293
294         int c = 0;
295         for(i=0; i < tokens && c < Weapons_COUNT; ++i){
296                 w = stof(argv(i));
297                 if ( w >= WEP_FIRST && w <= WEP_LAST) {
298                         bot_weapons_far[c] = w;
299                         ++c;
300                 }
301         }
302         if(c < Weapons_COUNT)
303                 bot_weapons_far[c] = -1;
304
305         // Parse mid distance weapon priorities
306         tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_mid)," ");
307
308         c = 0;
309         for(i=0; i < tokens && c < Weapons_COUNT; ++i){
310                 w = stof(argv(i));
311                 if ( w >= WEP_FIRST && w <= WEP_LAST) {
312                         bot_weapons_mid[c] = w;
313                         ++c;
314                 }
315         }
316         if(c < Weapons_COUNT)
317                 bot_weapons_mid[c] = -1;
318
319         // Parse close distance weapon priorities
320         tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_close)," ");
321
322         c = 0;
323         for(i=0; i < tokens && i < Weapons_COUNT; ++i){
324                 w = stof(argv(i));
325                 if ( w >= WEP_FIRST && w <= WEP_LAST) {
326                         bot_weapons_close[c] = w;
327                         ++c;
328                 }
329         }
330         if(c < Weapons_COUNT)
331                 bot_weapons_close[c] = -1;
332
333         bot_custom_weapon = true;
334 }
335
336 void bot_endgame()
337 {
338         entity e;
339         //dprint("bot_endgame\n");
340         e = bot_list;
341         while (e)
342         {
343                 setcolor(e, e.bot_preferredcolors);
344                 e = e.nextbot;
345         }
346         // if dynamic waypoints are ever implemented, save them here
347 }
348
349 void bot_relinkplayerlist()
350 {
351         player_count = 0;
352         currentbots = 0;
353         bot_list = NULL;
354
355         entity prevbot = NULL;
356         FOREACH_CLIENT(true,
357         {
358                 ++player_count;
359
360                 if(IS_BOT_CLIENT(it))
361                 {
362                         if(prevbot)
363                                 prevbot.nextbot = it;
364                         else
365                         {
366                                 bot_list = it;
367                                 bot_list.nextbot = NULL;
368                         }
369                         prevbot = it;
370                         ++currentbots;
371                 }
372         });
373         LOG_TRACE("relink: ", ftos(currentbots), " bots seen.");
374         bot_strategytoken = bot_list;
375         bot_strategytoken_taken = true;
376 }
377
378 void bot_clientdisconnect(entity this)
379 {
380         if (!IS_BOT_CLIENT(this))
381                 return;
382         bot_clearqueue(this);
383         if(this.cleanname)
384                 strunzone(this.cleanname);
385         if(this.netname_freeme)
386                 strunzone(this.netname_freeme);
387         if(this.playermodel_freeme)
388                 strunzone(this.playermodel_freeme);
389         if(this.playerskin_freeme)
390                 strunzone(this.playerskin_freeme);
391         this.cleanname = string_null;
392         this.netname_freeme = string_null;
393         this.playermodel_freeme = string_null;
394         this.playerskin_freeme = string_null;
395         if(this.bot_cmd_current)
396                 delete(this.bot_cmd_current);
397         if(bot_waypoint_queue_owner==this)
398                 bot_waypoint_queue_owner = NULL;
399 }
400
401 void bot_clientconnect(entity this)
402 {
403         if (!IS_BOT_CLIENT(this)) return;
404         this.bot_preferredcolors = this.clientcolors;
405         this.bot_nextthink = time - random();
406         this.lag_func = bot_lagfunc;
407         this.isbot = true;
408         this.createdtime = this.bot_nextthink;
409
410         if(!this.bot_config_loaded) // This is needed so team overrider doesn't break between matches
411                 bot_setnameandstuff(this);
412
413         if(this.bot_forced_team==1)
414                 this.team = NUM_TEAM_1;
415         else if(this.bot_forced_team==2)
416                 this.team = NUM_TEAM_2;
417         else if(this.bot_forced_team==3)
418                 this.team = NUM_TEAM_3;
419         else if(this.bot_forced_team==4)
420                 this.team = NUM_TEAM_4;
421         else
422                 JoinBestTeam(this, false, true);
423
424         havocbot_setupbot(this);
425 }
426
427 void bot_removefromlargestteam()
428 {
429         CheckAllowedTeams(NULL);
430         GetTeamCounts(NULL);
431
432         entity best = NULL;
433         float besttime = 0;
434         int bestcount = 0;
435
436         int bcount = 0;
437         FOREACH_ENTITY_FLOAT(isbot, true,
438         {
439                 ++bcount;
440
441                 if(!best)
442                 {
443                         best = it;
444                         besttime = it.createdtime;
445                 }
446
447                 int thiscount = 0;
448
449                 switch(it.team)
450                 {
451                         case NUM_TEAM_1: thiscount = c1; break;
452                         case NUM_TEAM_2: thiscount = c2; break;
453                         case NUM_TEAM_3: thiscount = c3; break;
454                         case NUM_TEAM_4: thiscount = c4; break;
455                 }
456
457                 if(thiscount > bestcount)
458                 {
459                         bestcount = thiscount;
460                         besttime = it.createdtime;
461                         best = it;
462                 }
463                 else if(thiscount == bestcount && besttime < it.createdtime)
464                 {
465                         besttime = it.createdtime;
466                         best = it;
467                 }
468         });
469         if(!bcount)
470                 return; // no bots to remove
471         currentbots = currentbots - 1;
472         dropclient(best);
473 }
474
475 void bot_removenewest()
476 {
477         if(teamplay)
478         {
479                 bot_removefromlargestteam();
480                 return;
481         }
482
483         float besttime = 0;
484         entity best = NULL;
485         int bcount = 0;
486
487         FOREACH_ENTITY_FLOAT(isbot, true,
488         {
489                 ++bcount;
490
491                 if(!best)
492                 {
493                         best = it;
494                         besttime = it.createdtime;
495                 }
496
497                 if(besttime < it.createdtime)
498                 {
499                         besttime = it.createdtime;
500                         best = it;
501                 }
502         });
503
504         if(!bcount)
505                 return; // no bots to remove
506
507         currentbots = currentbots - 1;
508         dropclient(best);
509 }
510
511 void autoskill(float factor)
512 {
513         float bestbot;
514         float bestplayer;
515
516         bestbot = -1;
517         bestplayer = -1;
518         FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
519                 if(IS_REAL_CLIENT(it))
520                         bestplayer = max(bestplayer, it.totalfrags - it.totalfrags_lastcheck);
521                 else
522                         bestbot = max(bestbot, it.totalfrags - it.totalfrags_lastcheck);
523         ));
524
525         LOG_TRACE("autoskill: best player got ", ftos(bestplayer), ", ");
526         LOG_TRACE("best bot got ", ftos(bestbot), "; ");
527         if(bestbot < 0 || bestplayer < 0)
528         {
529                 LOG_TRACE("not doing anything");
530                 // don't return, let it reset all counters below
531         }
532         else if(bestbot <= bestplayer * factor - 2)
533         {
534                 if(autocvar_skill < 17)
535                 {
536                         LOG_TRACE("2 frags difference, increasing skill");
537                         cvar_set("skill", ftos(autocvar_skill + 1));
538                         bprint("^2SKILL UP!^7 Now at level ", ftos(autocvar_skill), "\n");
539                 }
540         }
541         else if(bestbot >= bestplayer * factor + 2)
542         {
543                 if(autocvar_skill > 0)
544                 {
545                         LOG_TRACE("2 frags difference, decreasing skill");
546                         cvar_set("skill", ftos(autocvar_skill - 1));
547                         bprint("^1SKILL DOWN!^7 Now at level ", ftos(autocvar_skill), "\n");
548                 }
549         }
550         else
551         {
552                 LOG_TRACE("not doing anything");
553                 return;
554                 // don't reset counters, wait for them to accumulate
555         }
556
557         FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.totalfrags_lastcheck = it.totalfrags));
558 }
559
560 void bot_calculate_stepheightvec()
561 {
562         stepheightvec = autocvar_sv_stepheight * '0 0 1';
563         jumpstepheightvec = stepheightvec +
564                 ((autocvar_sv_jumpvelocity * autocvar_sv_jumpvelocity) / (2 * autocvar_sv_gravity)) * '0 0 0.85';
565                 // 0.75 factor is for safety to make the jumps easy
566 }
567
568 float bot_fixcount()
569 {
570         int activerealplayers = 0;
571         int realplayers = 0;
572         if (MUTATOR_CALLHOOK(Bot_FixCount, activerealplayers, realplayers)) {
573                 activerealplayers = M_ARGV(0, int);
574                 realplayers = M_ARGV(1, int);
575         } else {
576                 FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
577                         if(IS_PLAYER(it))
578                                 ++activerealplayers;
579                         ++realplayers;
580                 ));
581         }
582
583         int bots;
584         // add/remove bots if needed to make sure there are at least
585         // minplayers+bot_number, or remove all bots if no one is playing
586         // But don't remove bots immediately on level change, as the real players
587         // usually haven't rejoined yet
588         bots_would_leave = false;
589         if (teamplay && autocvar_bot_vs_human && AvailableTeams() == 2)
590                 bots = min(ceil(fabs(autocvar_bot_vs_human) * activerealplayers), maxclients - realplayers);
591         else if ((realplayers || autocvar_bot_join_empty || (currentbots > 0 && time < 5)))
592         {
593                 float realminplayers, minplayers;
594                 realminplayers = autocvar_minplayers;
595                 minplayers = max(0, floor(realminplayers));
596
597                 float realminbots, minbots;
598                 realminbots = autocvar_bot_number;
599                 minbots = max(0, floor(realminbots));
600
601                 bots = min(max(minbots, minplayers - activerealplayers), maxclients - realplayers);
602                 if(bots > minbots)
603                         bots_would_leave = true;
604         }
605         else
606         {
607                 // if there are no players, remove bots
608                 bots = 0;
609         }
610
611         // only add one bot per frame to avoid utter chaos
612         if(time > botframe_nextthink)
613         {
614                 //dprint(ftos(bots), " ? ", ftos(currentbots), "\n");
615                 while (currentbots < bots)
616                 {
617                         if (bot_spawn() == NULL)
618                         {
619                                 bprint("Can not add bot, server full.\n");
620                                 return false;
621                         }
622                 }
623                 while (currentbots > bots)
624                         bot_removenewest();
625         }
626
627         return true;
628 }
629
630 void bot_serverframe()
631 {
632         if (intermission_running)
633                 return;
634
635         if (time < 2)
636                 return;
637
638         bot_calculate_stepheightvec();
639         bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
640
641         if(time > autoskill_nextthink)
642         {
643                 float a;
644                 a = autocvar_skill_auto;
645                 if(a)
646                         autoskill(a);
647                 autoskill_nextthink = time + 5;
648         }
649
650         if(time > botframe_nextthink)
651         {
652                 if(!bot_fixcount())
653                         botframe_nextthink = time + 10;
654         }
655
656         bot_ignore_bots = autocvar_bot_ignore_bots;
657
658         if(botframe_spawnedwaypoints)
659         {
660                 if(autocvar_waypoint_benchmark)
661                         localcmd("quit\n");
662         }
663
664         if (currentbots > 0 || autocvar_g_waypointeditor || autocvar_g_waypointeditor_auto)
665         if (botframe_spawnedwaypoints)
666         {
667                 if(botframe_cachedwaypointlinks)
668                 {
669                         if(!botframe_loadedforcedlinks)
670                                 waypoint_load_links_hardwired();
671                 }
672                 else
673                 {
674                         // TODO: Make this check cleaner
675                         IL_EACH(g_waypoints, time - it.nextthink > 10,
676                         {
677                                 waypoint_save_links();
678                                 break;
679                         });
680                 }
681         }
682         else
683         {
684                 botframe_spawnedwaypoints = true;
685                 waypoint_loadall();
686                 if(!waypoint_load_links())
687                         waypoint_schedulerelinkall();
688         }
689
690         if (bot_list)
691         {
692                 // cycle the goal token from one bot to the next each frame
693                 // (this prevents them from all doing spawnfunc_waypoint searches on the same
694                 //  frame, which causes choppy framerates)
695                 if (bot_strategytoken_taken)
696                 {
697                         bot_strategytoken_taken = false;
698                         if (bot_strategytoken)
699                                 bot_strategytoken = bot_strategytoken.nextbot;
700                         if (!bot_strategytoken)
701                                 bot_strategytoken = bot_list;
702                 }
703
704                 if (botframe_nextdangertime < time)
705                 {
706                         float interval;
707                         interval = autocvar_bot_ai_dangerdetectioninterval;
708                         if (botframe_nextdangertime < time - interval * 1.5)
709                                 botframe_nextdangertime = time;
710                         botframe_nextdangertime = botframe_nextdangertime + interval;
711                         botframe_updatedangerousobjects(autocvar_bot_ai_dangerdetectionupdates);
712                 }
713         }
714
715         if (autocvar_g_waypointeditor)
716                 botframe_showwaypointlinks();
717
718         if (autocvar_g_waypointeditor_auto)
719                 botframe_autowaypoints();
720
721         if(time > bot_cvar_nextthink)
722         {
723                 if(currentbots>0)
724                         bot_custom_weapon_priority_setup();
725                 bot_cvar_nextthink = time + 5;
726         }
727 }