Godotã¯ãäžè¬ã«ã2Dãšã³ãžã³ã«ãã䌌ãŠãããšããè©å€ããããŸãããããªãããŸããããŸãããã3Dæ©èœã«ãã£ãŠ3Dã²ãŒã ãäœæã§ããŸããç¹ã«ãèªåã§ããã€ããæé©åã§ããå Žåã¯ãéããŠè€éãªã²ãŒã ãäœããªãã§ãã ããããŸããçŸåšã®ã¬ã³ããªã³ã°ãªãã·ã§ã³ã«æºè¶³ããŠããŸãããŸãã¯ãå°æ¥ã®æé©åãšvulkanã®åºçŸãåŸ ã€ããšãã§ããŸãã
ç®±ããåºããŠããšã³ãžã³ã¯ãé¢ç¯ãè»èŒªä»ãè»äž¡ãå«ããããã€ãã®ç©çåŠãæã£ãŠããŸããçµã¿èŸŒã¿ã®å°åœ¢ãšãã£ã¿ã¯ãããŸãããããã©ã°ã€ã³ã䜿çšããããç¹æ®ãªããã°ã©ã ããã€ã³ããŒããããã3Dããã±ãŒãžã®ã¡ãã·ã¥ã®ããã«äœ¿çšãããã§ããŸããåŸè ã®å Žåãããã©ãŒãã³ã¹ã®ããã«ãã©ã³ãã¹ã±ãŒããåå¥ã«ãã£ã³ã¯ãã©ã°ã¡ã³ãã«ã«ããããå¿ èŠããããè¡çªã®ããã«ããããå¥ã ã®ã¡ãã·ã¥ã«ããå¿ èŠããããŸããã©ã³ãã¹ã±ãŒãè¡çªã®åœ¢ã®ã¡ãã·ã¥ã«ã€ããŠ-èŠèŠçãªäžäžèŽãåé¿ããããã«ã3Dããã±ãŒãžããã®ãšã¯ã¹ããŒãäžã«ã¢ãã«ãäžè§åœ¢åå²ããå¿ èŠããããŸããããšãã°ãBlenderã§ãããè¡ãæãç°¡åãªæ¹æ³ã®1ã€ã¯ãã¡ãã·ã¥ãcollada圢åŒïŒ.daeïŒã§ãšã¯ã¹ããŒãããããšã§ããããã©ã«ãã®äžè§ãã§ãã¯ããŒã¯ããããŸãã
å Žåã«ãã£ãŠã¯ãBlenderã®ã¢ãã«ãGodotå ã§180床å転ãããå¿ èŠããããŸããå°åœ¢ãèŠããªããŠãé©ããªãã§ãã ãããéåžžãæ³ç·ã«ãã£ãŠééã£ãæ¹åã«å転ããŸãã
Godotã¯ããã¹ãŠãã·ãŒã³ã§ãããã¢ãããŒããå®è·µããŠãããèŠçŽ ã®ããªãŒæ§é ã«é©åããŠããŸããå®éã«ã¯ãããã¯ãæ¢åã®ããŒããžã®ãã©ã³ããšããŠæ°ãããªããžã§ã¯ããã¬ãã«ã«è¿œå ããããã¬ããã«æããããŸããåå¥ã®å°ããªããŒã«ã«ã¯ãŒã«ãã®ããã«åå¥ã«éãããšãã§ããããšãæå³ããŸãããããã£ãŠãä¿åããããã¹ãŠã®çš®é¡ã®åæãªããžã§ã¯ããç·šéããã®ã¯éåžžã«äŸ¿å©ã§ããå¯äžã®ç¬éã¯ãã©ã€ããã¬ãã«ã«èšå®ãããŠããå Žåãããšãã°ããã£ã©ã¯ã¿ãŒã®å éšã«ããŒã«ã«ã·ãŒã³ã«å ¥ããšããã®ç §æã衚瀺ãããããããªã¢ã«ãèšå®ããŠãããªããžã§ã¯ããã©ã®ããã«èŠããããç解ã§ããŸãããå ããã®åé¡ã¯ããŸããŸãªæ¹æ³ã§è§£æ±ºã§ããŸããããšãã°ãã¬ãã«ãŠã£ã³ããŠã«åãæ¿ããŠãã·ãŒã³ãããã«ä¿åããåŸããã£ã©ã¯ã¿ãŒã§è¡ãããå€æŽãè©äŸ¡ããŸãããŸãã¯ãäžæçã«ãã£ã©ã¯ã¿ãŒãšäžç·ã«ãã¬ããã®äžã«å æºãæããŸãã
theEnergy, . Area, , , .
èšèªã«ã€ããŠã¯ãäœã¬ãã«ã®æ¹æ³ãé€ããŠãæãäžè¬çãªãªãã·ã§ã³ã¯ãã¹ã¯ãªããèšèªã®GDScriptãšCïŒãããã³åçŽãªãã®ã®ããã®ããžã¥ã¢ã«ã¹ã¯ãªããã§ãã GDScriptã¯ãšã³ãžã³ã«çµ±åãããããå€ãã®äŸããããå€éšç°å¢ãéå§ããå¿ èŠããããŸãããäžè¬çãªæ§é ã®ç¹ã§ã¯ããã¹ãŠãCïŒããªã¢ã³ããšåãã§ã-å€æ°ã®å®£èšãåæåé¢æ°ã®åŒã³åºããããã»ã¹ãµã€ã¯ã«ãç©çããã»ã¹ã®ãµã€ã¯ã«ãªã©ããããã£ãŠãäž»èŠãªéçºã¹ã¯ãªããèšèªãšããŠGDScriptãéžæããããšã«ã¯æå³ããããŸããããŒã«ã«ã®CïŒã«å€æŽãããšãé²é³ã®ç²ŸåºŠãšè©³çŽ°ãåäžããç°¡æœãã倱ãããŸãããç¶æ³ããããããããªããå¶åŸ¡ã匷åãããŸã-ã¿ããæ¹è¡ãããæ£åŒãªå ¥åã®ä»£ããã«äžæ¬åŒ§ã
äžèšã®ãªããžã§ã¯ãã«ã¢ã¿ãããããã³ãŒãïŒGDScriptèšèªïŒãå€æ°èå¥åãèšå®ããããã®å€ã¯ãšãã£ã¿ãŒã§èšå®ã§ããŸãã次ã«ãç¹å¥ãªããšãèµ·ãããªãïŒãããŠæ¶å»ãããå¯èœæ§ãããïŒ1åéãã®åæåé¢æ°ã次ã«ããªããžã§ã¯ããåé€ããå¿ èŠãããã·ã°ãã«ãã³ãã©ãŒã¡ãœããã«ã€ããŠèª¬æããŸãã
ã°ããŒãã«å€æ°ã«ã€ããŠã¯ãGDScriptãšCïŒã®äž¡æ¹ã§ãããã䜿çšããããã«ããããžã§ã¯ããã©ã¡ãŒã¿ãŒã«èªåããŒãããã°ããŒãã«ã¹ã¯ãªãããè¿œå ããå¿ èŠããããŸãããããã®å€æ°ã«ã¯ã°ããŒãã«ã«ã¢ã¯ã»ã¹ã§ããŸãã
ãŸããGodotã«ã¯å¶éããããŸã-åãªããžã§ã¯ãã«ã¯1ã€ã®ã¹ã¯ãªããããååšã§ããŸããããããããã®ç¹ã¯ãããšãã°ã2çªç®ã®ã¹ã¯ãªãããåãªããžã§ã¯ãã«ã¶ãäžããããšã§åé¿ã§ããŸãã
ä¿¡å·
ãªããžã§ã¯ãã¯ããªãŒãžã®åå²ã®ããã«äºãã«æ¥ç¶ãããŠãããããéå±€ã䜿çšããŠGodotã®ããŒãéã§ããŒã¿ã亀æããããšãã§ããŸãã確ãã«ããã®ã¢ãããŒãã«ã¯èœãšãç©ŽããããŸãããªããªããç§ãã¡ã®ã²ãŒã ã§ã¯éå±€ã¯åçã«å€æŽå¯èœã ããã§ããããã«ãåãã·ãŒã³å ã®éå±€ãåç §ããããšã¯1ã€ã§ãããã·ãŒã³å ã®ã·ãŒã³å ã«ã·ãŒã³ãããå Žåãäœãèµ·ãã£ãŠããã®ããçŽç²ã«ç解ããŠãããšããŠããããã«ã¯ããã€ãã®å°é£ããããŸãã
ããããã¹ãŠã管çããç¹å®ã®çŸåšã®éå±€ã«é床ã«é¢é£ä»ããããªãããã«ãã1ã€ã®æ¹æ³ã¯ãã·ã°ãã«ã䜿çšããããšã§ããç¹å®ã®æ°ã®äžè¬çãªä¿¡å·ããã§ã«ããªã€ã³ã¹ããŒã«ãããŠããŸãããªããžã§ã¯ãã®ä¿¡å·ããã«ã調ã¹ãŠãåããªããžã§ã¯ãã®ã¹ã¯ãªãããŸãã¯ã·ãŒã³å ã®ã¹ã¯ãªããã䜿çšããŠå¥ã®ãªããžã§ã¯ãã®ã¹ã¯ãªããã«ãããã®1ã€ãåä¿¡ããåŠçã§ã©ã€ã³ãã¢ã¿ããã§ããŸããç¬èªã®ä¿¡å·ãäœæããå¿ èŠãããå Žåã¯ã次ã®ããã«ããŸããä¿¡å·
ãéå§ã
ãŸãããã¿ã³ãæŒããããšããªã©ã®åãã¹ã¯ãªããã§ä¿¡å·ãçºä¿¡
ããŸããããã·ãŒã³ããå¥ã®ã·ãŒã³ã«ä¿¡å·ã転éããå¿ èŠããªãéããããã§åé¡ãããŸãããããšãã°ãã·ãŒã³ããã¬ãã«ãã³ãŒãã£ã³ã°ããŠããŠãçŸåšã®ã¬ãã«ãç Žæ£ããããšãã°æ¬¡ã®ã¬ãã«ãåéããå¿ èŠããããšããç¥ãå¿ èŠãããããã§ãã
ãã®å Žåãã³ãŒããã³ãã©ãŒããªããžã§ã¯ãã«ã¢ã¿ããããŠãã³ãŒãã«ãã£ãŠã¬ãã«ãæ§ç¯ããç¬éã«ã«ãŒãã·ãŒã³ã«ã·ã°ãã«ãéä¿¡ã§ããŸãããããã£ãŠãç§ãã¡ã¯ãããã°ããã®çæãããã¹ã¬ããã§ã¹ãã€ãšãŒãžã§ã³ããååŸãã圌ãç§ãã¡ã«èšãããšãèããŸãã
ã¬ãã«ã®çµã¿ç«ãŠæã«ãå®å®è¹ãèŠã€ããŠä¿¡å·ãªã¹ããŒãæ¥ç¶ãããã®ä¿¡å·ã®ã¡ãã»ãŒãžãåŠçããæ¹æ³ã瀺ããŸãã
ä¿¡å·ã«ããã€ãã®å€æ°ãä»å ããããšãã§ããŸããããã¯éåžžã«äŸ¿å©ã§ããããšãã°ããªããžã§ã¯ãã§ããŸããŸãªã·ã°ãã«ãéå§ãã代ããã«ãã·ã°ãã«ã1ã€å®è¡ã§ããŸãããããŸããŸãªãã©ã¡ãŒã¿ãŒã§éä¿¡ããåä¿¡æã«ããã«åŠçããŸãã
ãããŠãããã¯äžèšã§éå§ããã¡ãœããèªäœã®èª¬æã§ããã·ã°ãã«ãåä¿¡ãããšãäžç·ã«éä¿¡ãããå€æ°ãåŠçããŸãã
äžèŠãªä¿¡å·ã®æ°ãæžãããã1ã€ã®äŸ¿å©ãªç¹ã¯ãå人çãªä¿¡å·ãéä¿¡ãã代ããã«ããããªããžã§ã¯ããå¥ã®ãªããžã§ã¯ããããã¯ããŠã圌èªèº«ããã§ã«ãã®äžã«ããä¿¡å·ãéä¿¡ã§ããããšã§ããããšãã°ãççºã¯ãã¬ãŒã€ãŒã«è§Šãããšããã·ã°ãã«ãåãåãããã®ã·ã°ãã«ã®ãã³ãã©ãŒã§ãã¬ãŒã€ãŒãèªå·±ç Žå£ã¡ãœãããæã£ãŠãããã©ãããæ€åºããæ€åºãããå Žåã«ãããéå§ããŸãããã¬ãŒã€ãŒã¯ããã®åŒã³åºãããã¡ãœããã§ãæ»äº¡ããã«ãŒãã·ãŒã³ã«ä¿¡å·ãéä¿¡ããŸããã«ãŒãã·ãŒã³ã®ã¹ã¯ãªããã§ã¯ããã¬ã€ã€ãŒã®ãã¹ã·ã°ãã«ãã³ãã©ãŒãã¯ãŒã«ããæ¶å»ããã²ãŒã ã¡ãã¥ãŒãåéããŸãã
ã€ãã³ããçºçãããŸãŒã³ã«å ¥ã£ããªããžã§ã¯ãã«é©åãªã¡ãœããããããã©ããã確èªããŸãã
, , . , , .
CSG-
Godotã®äŸ¿å©ãª3DããŒã«ã®1ã€ã¯ã建èšçãªãœãªãããžãªã¡ããªããªããã£ãã§ããç°¡åã«èšããšããããã¯ããŒã«æŒç®ïŒäº€å·®ãé€å€ãåéåïŒããµããŒããããªããžã§ã¯ãã§ããããªããã£ãã®ã»ããã«å ããŠããã§ã«ä»»æã®ã¡ãã·ã¥ãèšå®ã§ãããã©ãŒã ãšããŠããŠãããŒãµã«CSGã¡ãã·ã¥ããããŸãã
è€éãªæ§é ãçµã¿ç«ãŠããšãã«å¿ èŠãªå Žåã¯ãæäœã®é©çšã®åªå é äœãå¶åŸ¡ããããã«éå±€ã§CSG CombinerãããŒã䜿çšããå¿ èŠããããŸãã
åšã®çãåãåãããäžå¯Ÿã®çã
CSGã®äž»ãªçšéã¯ãéçã¬ãã«ãšãã®èŠçŽ ã®ããã€ãããããã¿ã€ãåããéã®å©äŸ¿æ§ãšã·ã³ãã«ãã§ããå®éãã²ãŒã ãšãã£ã¿ãŒã®å€éšã§ãããè¡ãå¿ èŠããªãéãã3Dããã±ãŒãžã§ã¡ãã·ã¥ãäœæãããã®çµæãšããŠåã圢ç¶ãç¹°ãè¿ãããšãã§ããŸãã
éçCSGã®æ¬¡ã®ã¢ããªã±ãŒã·ã§ã³ã¯ãç Žå£æ§ãšæå·ãã·ãã¥ã¬ãŒãããããšã§ãããããè¡ãã«ã¯ãç©Žããã¹ã¿ããããžãã¿ãªã©ã®CSGããªããã£ããé€å€ã¢ãŒãã§é 眮ããé©åãªã¿ã€ãã³ã°ã§ã®è¡šç€ºãå«ããŠäžæçã«é衚瀺ã«ããå¿ èŠããããŸããããã§ã®å¶éã¯ãCSGãªããžã§ã¯ãã®è¡šé¢ã®ã¿ã«ããã¡ãŒãžãäžãããããšãã§ããããšã§ããããã«ãããã¡ãŒãžãã¯æåã«åãšããŠããã«ã¢ã¿ããããããåå«ãšããŠã³ãŒããä»ããŠã¢ã¿ããããå¿ èŠããããŸãããã ãããã®ãªãã·ã§ã³ã¯ã3Dããã±ãŒãžã§æºåãããç Žå£å¯èœãªãªããžã§ã¯ããšæ¯èŒããŠãæ§æã®æè»æ§ã®ç¹ã§ãã§ã«ããªãåªããŠããŸãã
äŸå€ã¢ãŒãã§ã¯ã3ã€ã®ã·ãªã³ããŒãããªããžã«çµã¿èŸŒãŸããŠããŸããããããé ãããŠããéãæ©ã¯ç¡å·ã§ãã
æå¹ã«ãããšãé€å€ããé åãåãåãããŸãã
次ã«ãCSGãåãããŸããã³ãŒããŸãã¯èšé²ãããã¢ãã¡ãŒã·ã§ã³ãéããŠãäžè¬ã«ããã®ã¡ãœããã䜿çšããŠããã€ãã®å¹æãå®è£ ã§ããŸããããã®ãããªã¢ãã¡ãŒã·ã§ã³ãã«ãŒãã®ã¹ããŒãžã§å転ããªãããšãéåžžã«æãŸããã§ããããã€ãã®ã¢ãã¡ãŒã·ã§ã³CSGã¯ããã©ãŒãã³ã¹ã«å€§ããªåœ±é¿ãäžããå¯èœæ§ããããGodotã¯ãã¹ãŠã®ãã®ãæé©åããããã§ã¯ãããŸãããã¢ãã¡ãŒã·ã§ã³CSGãèªåã§åãåããªããã°ãã«ã¡ã©ã®å¯èŠæ§ããããã©ãŒãã³ã¹ãæ¶è²»ãç¶ããŸãã
ããã«ãããããããã¢ãã¡ãŒã·ã§ã³åãããCSGã®å¹æã3Dããã±ãŒãžãœãªã¥ãŒã·ã§ã³ã§çœ®ãæããããšã¯æ¢ã«å°é£ã§ããããããããã䜿çšããããšã«èå³ããããããããŸããïŒå°ãªããšãã³ãŒãã§é«åºŠãª3Dãæç»ããäºå®ããªãå ŽåïŒãäž»ãªããšã¯ããããã®é©åãªäœ¿çšæ³ãèŠã€ããããšã§ããããªã¬ãŒã®ã¢ãã¡ãŒã·ã§ã³ãå«ãç¹å®ã®å Žæã§ããããããã€ã³ãããšã«äœ¿çšããã®ãæåã§ããéè·¯ãéãå¹æããã®ä»ã®äžæçãªç¹æ®å¹æãšããŠãåœç¶ãCSGãªããžã§ã¯ãã®åœ¢åŒã¯åçŽã§ããã»ã©è¯ãã§ãããããŠããããã¯éåäžã®æ¥è§Šã®éçšã§æ£ç¢ºã«äž»èŠãªèšç®è² è·ãçºæ®ããããã«ãã©ã®ãªããžã§ã¯ããä»ã®ãªããžã§ã¯ãã«å¯ŸããŠåãããã«ã¯ç¹å¥ãªéãã¯ãããŸããã
ã¢ãã¡ãŒã·ã§ã³ã®CSGã«ãã»ã«ãæ©ã®ã¢ãã«ãåããCSGã¡ãã·ã¥ãééãããšãã«ãè»ãæ©ã®ç©Žããèœã¡ãç¬éããããªã«ãããŸãã
ãã«ãã¡ãã·ã¥
ã¬ãã«ããšã«ç³ãæšãæ£ä¹±ããããªã©ã倧éã®ã¡ãã·ã¥ãè€è£œããå¿ èŠãããå Žåã¯ãMultimeshInstanceããŒãã圹ç«ã¡ãŸãã
ã·ãŒã³ã«è¿œå ããåŸããã«ãããã·ã¥ãã³ããŒãããªããžã§ã¯ããæå®ããã¯ããŒã³ã®ã¢ãã«ãšããŠäœãååŸããããæå®ããå¿ èŠããããŸããéäžã§ãã¯ããŒã³ã®ãµã€ãºãšæ°ãéžæã§ããŸãããã«ãããã¯ã¹ãããã€ã¯ããããŠããå Žåãããã¯å€ãã®ã¯ããŒã³ãè¡šããŠããã圌ã圌ã®äžä»£ã«äœ¿çšããç®æšã¯ãããããäžèŠã«ãªã£ãå Žåã¯åé€ããããšãã§ããŸãã
ãã«ãã¡ãã£ã¢ã¿ãŒã²ãããéžæããããã®ãã¿ã³ãéžæããããšãå³äžã®ãšãã£ã¿ãŒãŠã£ã³ããŠã«è¡šç€ºãããŸãããããæŒããšãçæçšã®èšå®ãå«ããã®ãŠã£ã³ããŠãããããã¢ãŠãããŸãã
ããã§ã¯ã2ã€ã®ãªããžã§ã¯ããMeshInstanceããŒããšããŠã·ãŒã³ã«è¿œå ãããŠããŸãã次ã«ãå·ŠåŽã®ãªããžã§ã¯ããå³åŽã«æ®ããŸããã
ãã«ãã¡ãã·ã¥ãååŸããŸãããã®å Žåãèšå®ã§ã¯10,000åã®ã¯ããŒã³ãèšå®ãããŠããŸãããã¡ãªã¿ã«ã3ã4åæããã°èŠèŠçã«ã¯ããã»ã©å€ãããªãã§ãããã
ããã€ã¯ããã«ãã¡ãã·ã¥ã¯ã©ãã«ã§ã移åã§ããããã«ãçæäžã«æå®ãããã¯ããŒã³ã®æ°ãæåã«è¡šç€ºããVisible Instanceãã©ã¡ãŒã¿ãŒããããŸãããã®å€ãå€æŽããããšã§ãçŸåšè¡šç€ºãããŠããã¯ããŒã³ã®æ°ãå¶åŸ¡ã§ããŸããããã©ã«ãã§ã¯-1ã§ãããããã¯ã¯ããŒã³ã®æ倧æ°ã衚瀺ããããã®ç¹å¥ãªå€ã§ãã 10ãæå®ãããšã10ã®ã¯ããŒã³ãäœæãããŸãã100ã®å Žåã¯100ã«ãªããŸããæ倧ã50ã®å Žåã¯ã100ã1000ã-1ã®å Žåã¯50ã®ãŸãŸã§ãã
ãã®ãã«ãã¡ãã·ã¥æ©èœã䜿çšããŠãã³ãŒããŸãã¯èšé²ãããã¢ãã¡ãŒã·ã§ã³ãéããŠVisible Instanceãã©ã¡ãŒã¿ãŒãã¢ãã¡ãŒã·ã§ã³åããããšã«ãããç¹æ®å¹æãäœæã§ããŸããã¯ããŒã³ã®å¯åºŠããã现ããå¶åŸ¡ããããã«ã3Dããã±ãŒãžã䜿çšããŠãã¯ããŒã³ã®æ倧å¯åºŠãå¿ èŠãªå ŽæãšãããªãŽã³ã§èŠãããŠã¯ãªããªãå Žæããééãã§ããŠããªãå Žæã§ããœãªããã¡ãã·ã¥ã®åå¥ã®ã¡ãã·ã¥ãæ£ç¢ºã«äœæã§ããŸãã
衚瀺ã€ã³ã¹ã¿ã³ã¹ã500ã«èšå®ãããšãå¡ãã€ã¶ãå¯åºŠãæ¥æ¿ã«äœäžããŸãã
éå€
Godotã®ã³ã³ãããŒã«ã¯ããšãã£ã¿ãŒã®äžéšããã«ã§ãããžã§ã¯ãé ç®ãéãããšã§æ§æã§ããŸãã次ã®ãããžã§ã¯ãèšå®ãã¢ã¯ã·ã§ã³ãªã¹ãã¿ãã
ã³ãŒããä»ããŠã¢ã¯ã»ã¹ãããååã«ãã£ãŠãããã©ã«ããã¿ã³ã®ååãããããŸãããŸããç¬èªã®ãã®ãè¿œå ããŸãã
ããšãã°ãPgUPãã¿ã³ã®ããã©ã«ãåã¯ãui_page_upãã§ãããGDScriptã§æ¬¡ã®è¡ãèšè¿°ããããšã«ãããã³ãŒãå ã§ã®ãã¿ã³ã®æŒäžãåŠçã§ããŸã
ãæŒãã®çµãã-æŒããç¶æ ããªãªãŒã¹ã«å€ãããŸãã
ïŒ
ãããªã¢ã«ã®ã¡ãã€ããã¢ãã¡ãŒã·ã§ã³åããå¿ èŠãããå Žåã¯ãèªå·±äœæã®ã·ã§ãŒããŒã䜿çšããŠãããè¡ãããšãã§ããŸãããããè¡ãã«ã¯ããªããžã§ã¯ããããªã¢ã«ãšããŠ[New ShaderMaterial]ãéžæããŸãã
次ã«ã空ã®ãã£ãŒã«ã㧠VisualShader ãéžæããŸããããã
ã¯ãªãã¯ãããšããšãã£ã¿ãŒã®äžã«ããžã¥ã¢ã«ãšãã£ã¿ãŒãéããŸãã
æåã«Input-All- Timeã次ã«Scalar-Common- ScalarFuncãè¿œå ããããããããŠã³ãªã¹ãã§èšå®ããŸãã眪ãååãšããŠããã§ã«ãã®ãããªæ§æã§ã¯ãé»ãšçœã®éã§ã¡ãã€ãã®ãããªãã®ãåŸãããŸããããããæ¹åããã«ã¯ããã1ã€ã®ããŒãScalar-Common- ScalarFuncãè¿œå ããŸãããã§AbsãéžæããŸããããŒããçžäºã«æ¥ç¶ãïŒåããŒãã®éããç®ãã¯ãªãã¯ãããšãããŒããéããŠãå段éã§ç»åãã©ã®ããã«å€åãããã確èªã§ããŸãïŒãã¢ã«ãã¡ãæŸåºããŸãã¯ã¢ã«ãããã£ãã«ã«æ¥ç¶ããŸããããã§ããªããžã§ã¯ããã¡ãã€ããŸãã
åœç¶ãããã¯å¯äžã®æ¹æ³ããã¯ã»ã©é ãã§ãããéåžžã«åçŽãªãªãã·ã§ã³ã®1ã€ã§ãããããŠãããªãã«ãŒã«è²ãä»ãããå Žåã¯ãè²ã§ããã€ãã®ããŒããäœæããããããç¹å¥ãªããŒãïŒAlbedoã«é¢ããŠããïŒã§æ··åããäžèšã§åéããããŒãã®ãã§ãŒã³ã®åºåã«ã¢ã¿ããããå¿ èŠããããŸãããããã£ãŠããã®ãã§ãŒã³ã¯ãããã®è²ã®æ··åèŠçŽ ãšããŠæ©èœããŸãã
ïŒ
éžæããããŒããå¥ã®ã·ãŒã³ã«ããã«ã¯ãããŒããå³ã¯ãªãã¯ããŠã[ãã©ã³ããã·ãŒã³ãšããŠä¿å]ãªãã·ã§ã³ãéžæããŸãã次ã«ããã®ã·ãŒã³ã®ååãèšå®ããŸãããã®åŸãããŒãã®ååã®æšªã«ããšãã£ã¿ãŒã§éããã¢ã€ã³ã³ã衚瀺ãããããããæ°ãããŠã£ã³ããŠã§çµæã®ã·ãŒã³ãç·šéã§ããŸãã
éã®æäœãå®è¡ããã«ã¯ãããšãã°ãä¿åããããã©ã³ãã®ãªããžã§ã¯ããçŸåšã®ã·ãŒã³ã«ååŸããŠäœããã®æ¹æ³ã§åæ§ç¯ãŸãã¯å€æŽããå¿ èŠãããå Žåãã·ãŒã³ãé衚瀺ã«ããŠããããŒããã¯ãªãã¯ããå³ã¯ãªãã¯ããŠ[ããŒã«ã«ã«ãã]ãéžæããŸãã圌ãè¡šããä¿åãããã·ãŒã³ã¯ç Žå£ãããŸããã
ïŒ
ã°ããŒãã«å€æ°ã䜿çšããã«ã¯ãã¹ã¯ãªãããäœæããŠãªãŒãããŒãã«æå ¥ããå¿ èŠããããŸãïŒãããžã§ã¯ã -ãããžã§ã¯ãèšå® - ã¹ã¿ãŒãã¢ããã ãã·ã³ã°ã«ãã³ããã§ãã¯ããã¯ã¹ããã§ãã¯ããå¿ èŠããããŸãã
SaveTheWorldã¹ã¯ãªããã®å 容ãå€æ°ãšããŠã°ããŒãã«ã«äœ¿çšããŸããçŸæç¹ã§ã¯ãç¹å®ã®ãã«ã¹ã€ã³ãžã±ãŒã¿ãŒãšäžé£ã®æµã®ç¶æ ãããã§å®£èšãããŠãããåæåã¹ãããã§å ¥åãããŸãã
ã³ãŒããããããã®ã°ããŒãã«å€æ°ã«ã¢ã¯ã»ã¹ããã«ã¯ãæåã«ã·ã³ã°ã«ãã³ãžã®ãªã³ã¯ãååŸããŠããããã®å€æ°ã䜿çšããå¿ èŠããã
ãŸããSaveTheWorldãèŠã€ãããã®ç¹å®ã®æµã®ç¶æ ããŒããã©ããã確èªããŸãããããããªããæµã¯é€å»ãããŸãã
UPDãã·ã³ã°ã«ãã³ã®å€æ°ã«ã¯ããã®ååã䜿çšããŠããã«ã¢ã¯ã»ã¹ã§ããŸããã€ãŸããäžèšã®äŸã§ã¯ãªã³ã¯ãåãå¿ èŠã¯ãªããmain.enemy_arr [myID]ã®ä»£ããã«ãSaveTheWorld.enemy_arr [myID]ã䜿çšããŸãããã ãããã®ããŒãã®èµ·åæã«ãsingletonãåã«ãã§ãã¯ããŒã¯ãä»ããŠããããšã確èªããå¿ èŠããããŸãã
ïŒ
ã¢ã³AnimationPlayerããŒãã¯ãã¬ã³ãŒãããã¬ã€åç»ãã·ãŒã³ã«è¿œå ãããŸããéå±€å ã®ä»»æã®å Žæã«é 眮ã§ããŸãã圌ã«ã¢ãã¡ãŒã·ã§ã³ãèšé²ããæ©äŒãäžããã«ã¯ãéããŠããã¿ã€ã ã©ã€ã³ã®äžã«ãã[ã¢ãã¡ãŒã·ã§ã³]ãã¿ã³ãã¯ãªãã¯ããŠãæ°ããã¢ãã¡ãŒã·ã§ã³ãäœæããå¿ èŠããããŸãã
ãã®åŸãçŸåšã®ã·ãŒã³ã§éžæå¯èœãªåããŒãã§ãã€ã³ã¹ãã¯ã¿ãŒã®å³åŽã«äž»èŠãªã¢ã€ã³ã³ã衚瀺ãããŸããããŒãã¯ãªãã¯ãããšãã¢ãã¡ãŒã¿ãŒã¯æ°ããã¢ãã¡ãŒã·ã§ã³ãã©ãã¯ãè¿œå ããããææ¡ããŸãã
次ã«ãã¿ã€ã ã©ã€ã³ã¹ã©ã€ããŒãç®çã®ãã€ã³ãã«ç§»åããŸããããããã®ãã€ã³ãã§ããªããžã§ã¯ãã€ã³ã¹ãã¯ã¿ãŒã§ã¢ãã¡ãŒã·ã§ã³å€ãå€æŽããããäžåºŠããŒãæŒããŠããã®ãã€ã³ããã¿ã€ã ã©ã€ã³ã«è¡šç€ºããŸããå³åŽã®æèšã䜿çšããŠããã£ãŒã«ãã§äœ¿çšå¯èœãªã¿ã€ã ã¬ãŒã³ãæ¡åŒµã§ããŸããããã©ã«ãã§ã¯1ç§ã§ããæèšã®å³åŽã«ã¯ãã¢ãã¡ãŒã·ã§ã³ã«ãŒããã¿ã³ããããŸãã以äžã®æåã®è¡ã¯ãã¢ãã¡ãŒã·ã§ã³ã®ãŽããŽããšäžé£ç¶ãŸãã¯é£ç¶çãªæ»ãããªãã£ã©ã¯ã¿ãŒãèšå®ãããé »ç¹ã«äœ¿çšããããªãã·ã§ã³ã®1ã€ã§ãã
äžå€®ããã«ã®å³åŽã«ã¢ãã¡ãŒã·ã§ã³ã®ååãä»ããèªåå®è¡ãã¿ã³ãããããããæŒããšãéžæããã¢ãã¡ãŒã·ã§ã³ãã¢ããªã±ãŒã·ã§ã³ã®èµ·åæã«åçãããŸããã«ãŒãã§åžžã«åçãããè€æ°ã®ã¢ãã¡ãŒã·ã§ã³åããããªããžã§ã¯ããå¿ èŠãªå Žåã¯ããããã«å ±éã®ã¢ãã¡ãŒã·ã§ã³ã1ã€äœæããããšã«ããã1ã€ã®AnimationPlayerã§ãããã®ãã©ãã¯ãäœæã§ããŸããç¹å®ã®ãªããžã§ã¯ãã®ã¢ãã¡ãŒã·ã§ã³ãåãæ¿ããå¿ èŠãããå Žåã¯ããã®ãªããžã§ã¯ãçšã«åå¥ã®AnimationPlayerãäœæããããã«ããŸããŸãªç¶æ ã®ã¢ãã¡ãŒã·ã§ã³ãããã€ãäœæã§ããŸãããèªåçã«éå§ããããã«ããŒã¯ã§ããã®ã¯1ã€ã ãã§ãã
ïŒ
æ§ã ãªããŒãã®å Žåã¯ãäŸãã°ãMeshInstanceãŸãã¯CollisionShapeã¯ãã¡ãã·ã¥ïŒã·ã§ã€ãïŒåéã§ã¯ãããªãã¯ïŒMeshInstanceã®å Žåã¯ãã«ã¹ã¿ã ã¢ãã«ã®ããŒããå«ãïŒããªããã£ãã®æºåãªã¹ãããéžæããããšãã§ããŸãã
MeshInstanceã®å Žåãæãé«äŸ¡ãªããªããã£ãã®1ã€ã¯çãšã«ãã»ã«ã«ãªããŸããããã¯ãå€ãã®ããªãŽã³ãå«ãŸããŠããå¯èœæ§ãé«ãããã§ãããããã£ãŠã3DããŒãã£ã¯ã«ã®å Žåã¯ãããªãŽã³ãç«æ¹äœãããªãºã ãªã©ãéžæããããšããå§ãããŸããå察ã«ãè¡çªã®å Žåããã©ã¡ãŒã¿ãŒã®ååŸã1ã€ãããªããããçã®åœ¢ç¶ãæãéãèªã¿åããŸããå®éãäžèšã¯Godotã ãã§ãªããä»ã®ã²ãŒã ãšã³ãžã³ã«ãåœãŠã¯ãŸããŸãã
Godotã¯ãMeshInstanceãéžæãããšãã«ãšãã£ã¿ãŒã®å³äžã«è¡šç€ºããã[é å]ãã¿ã³ãã¯ãªãã¯ããŠãMeshInstanceã®è¡çªåœ¢ç¶ãèªåçã«äœæããããšãã§ããŸãã次ã«ãææ¡ããããªãã·ã§ã³ããéžæããŸãããååãšããŠãåãå°åœ¢ã®å Žåããããæåã®é ç®ã«ãªããŸã-ãå¹åéçããã£ã®äœæãïŒãã®åŸãæ£ç¢ºãªè¡çªããã¹ããããStaticBodyããŒãããªããžã§ã¯ãã«ã¢ã¿ãããããŸãïŒãä»ã®ãã¹ãŠã®ã±ãŒã¹ã§ãç¹ã«æ£ç¢ºãªè¡çªãå¿ èŠãªãå Žåã¯ãç¬ç«ããŠå ¬éãããCollisionShapeããªããã£ããçããã3Dããã±ãŒãžã§è¡çªã«æé©ãªã¡ãã·ã¥ãåéããŠãããMeshInstanceãä»ããŠè¿œå ãã[é å]ãã¿ã³ã䜿çšããŠãã©ãŒã ã«è¡çªãäœæããŸãã
ïŒ
ã€ã³ã¹ãã¯ã¿ãŒã®æ°å€ãã£ãŒã«ãã®ããããã§ãããšãã°ãã©ã¡ãŒã¿ãŒã«ç¹å®ã®æ°å€ãè¿œå ããããå€ãä¹ç®ãããããå¿ èŠãããå Žåã次ã®ããã«ããŠããã¯ã¢ãŠãã§ããŸãïŒ "315-180"ã "20 + 40"ã "64 * 5" ...ç·šéè ããã£ãŒã«ãã§ã®æäœã®æçµçµæãèšç®ããŠçœ®ãæããŸãã