-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
518 lines (438 loc) · 24.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zombie Ai for unity</title>
<link href="css/style.css" rel="stylesheet">
<link href="favicon.ico" rel="icon" type="image/icon">
<!--Google Fonts-->
<!--Roboto Font-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<!--Dancing Font-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Dancing+Script:[email protected]&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<!-- Include Anime.js via CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
<!--Lottie Library-->
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.4/lottie.min.js"></script-->
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.9/lottie.min.js"></script-->
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<!--Image Animation cdn-->
<!--codepen link https://codepen.io/nathan-sr/pen/JjqERpE -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://jaysalvat.github.io/vegas/releases/latest/vegas.js'></script>
<!--MathJax-->
<!-- Load MathJax from CDN -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<!--Prism to show colorful code-->
<link rel="stylesheet" href="css/style.css">
<script src="js/prism.js"></script>
</head>
<body>
<div id="loading">
<h1 class="typewritter">
<span class="text-wrapper">
<span class="letters">Loading...Please Wait....</span>
<span class="line"></span>
</span>
</h1>
</div>
<div id="content">
<div id="readingProgress"></div>
<button id="goTopButton" onclick="goToTop()">Go to Top</button>
<button id="goBottomButton" onclick="goToBottom()">Go to Bottom</button>
<div class="banner">
<div class="image-container">
<img id="animatedImage" src="ScreenShots/Social_pic.png" alt="Social Picture Banner" >
</div>
<h1 class="typewritter">
<span class="text-wrapper">
<span class="letters">Zombie NPC or Zombie AI for Unity Game Engine</span>
<span class="line"></span>
</span>
</h1>
</div>
<div class="page-container">
<hr>
<div class="badge-container">
<!--Badges-->
<a href="https://unity.com/releases/editor/whats-new/2020.3.0">
<img src="https://img.shields.io/badge/Unity-2020-maker?style=plastic&logo=unity&logoSize=small&labelColor=blue&color=black" alt="Unity Badge">
</a>
<a href="https://dotnet.microsoft.com/en-us/languages/csharp">
<img style="width: 8%;"
src="https://img.shields.io/badge/C-%23-maker?style=plastic&logo=csharp&logoSize=small&labelColor=blue&color=black" alt="CSharp Badge">
</a>
<a href="https://github.com/baponkar/Simple-FPS">
<img src="https://img.shields.io/badge/FPS-Unity-maker?style=plastic&logo=unity&logoSize=small&labelColor=blue&color=black" alt="FPS">
</a>
<a href="https://github.com/baponkar/zombie-ai/issues">
<img src="https://img.shields.io/github/issues/baponkar/zombie-ai" alt="Issue">
</a>
<a href="https://github.com/baponkar/zombie-ai/forks">
<img src="https://img.shields.io/github/forks/baponkar/zombie-ai" alt="fork">
</a>
<a href="https://github.com/baponkar/zombie-ai/stargazers">
<img src="https://img.shields.io/github/stars/baponkar/zombie-ai" alt="star">
</a>
<a href="https://github.com/baponkar/zombie-ai/blob/main/LICENSE.md">
<img src="https://img.shields.io/github/license/baponkar/zombie-ai" alt="License">
</a>
<a href="https://github.com/baponkar/zombie-ai/blob/main/Assets/__baponkar__/Tutorials.pdf">
<img src="https://img.shields.io/badge/Wiki-Page-maker?style=plastic&logo=wikipage&logoSize=small&labelColor=blue&color=black" alt="Wiki Badge">
</a>
<a href="https://github.com/baponkar/zombie-ai?tab=readme-ov-file">
<img src="https://img.shields.io/badge/Fork-me-maker?logo=github&logoColor=black&color=white&cacheSeconds=green" alt="fork me badge">
</a>
</div>
<hr>
<h2>Description : </h2>
<p>A Fully State Machine and <s style="color: rgb(207, 42, 42);">Behavior Tree</s> controlled advanced Zombie Non Playable Character(NPC) or AI for Unity Project with a Demo Scene.You can use this asset for your Game development.You can use the given states or introduced your own new state then you need to import the corresponding state animation and state transition logic. You also can use the zombie prefab for any kind mesh character by importing corresponding mesh and animation.</p>
<hr>
<h2>See following demo videos : </h2>
<ul>
<li>
<p>
<a href="https://www.youtube.com/watch?v=JxbXT3MU_9M">
<img src="https://img.shields.io/badge/youtube%20demo-2.0.0-maker?style=flat-square&logo=YouTube&logoColor=red&color=red" alt="YouTube demo Badge">
</a>
</p>
</li>
<div class="video-container">
<iframe width="500" height="300" src="https://www.youtube.com/embed/JxbXT3MU_9M" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<li>
<p>
<a href="https://www.youtube.com/watch?v=486w7NuyBWo"><img src="https://img.shields.io/badge/youtube%20demo-1.0.0-maker?style=flat-square&logo=YouTube&logoColor=red&color=red" alt="YouTube demo Badge"></a>
</p>
</li>
<div class="video-container">
<iframe width="500" height="300" src="https://www.youtube.com/embed/486w7NuyBWo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</ul>
<h2>Latest Stable release : </h2>
<ul>
<li>
<img src="https://img.shields.io/badge/%E2%AC%87%EF%B8%8F%20download%20-latest-maker?style=flat-square&labelColor=red&color=blue&cacheSeconds=https%3A%2F%2Fgithub.com%2Fbaponkar%2Fzombie-ai%2Freleases%2Ftag%2Fv2.3.3" alt="Download Badge">
</li>
</ul>
<hr>
<h2>Roughly It has following Characteristics : </h2>
<ul>
<li>
<input type="checkbox" id="task1" name="task1" checked>
<label for="task1">Zombie - Idle State</label>
</li>
<li>
<input type="checkbox" id="task2" name="task2" checked>
<label for="task2">Zombie - Chasing Player State</label>
</li>
<li>
<input type="checkbox" id="task3" name="task3" checked>
<label for="task3">Zombie - Patrolling State</label>
</li>
<li>
<input type="checkbox" id="task4" name="task4" checked>
<label for="task4">Zombie - Attack State</label>
</li>
<li>
<input type="checkbox" id="task5" name="task5" checked>
<label for="task5">Zombie - Flee State</label>
</li>
<li>
<input type="checkbox" id="task6" name="task6" checked>
<label for="task6">Zombie - Dead State</label>
</li>
<li>
<input type="checkbox" id="task7" name="task7" checked>
<label for="task7">Zombie State - Waypoint based Patrolling</label>
</li>
<li>
<input type="checkbox" id="task8" name="task8" checked>
<label for="task8">Zombie - Call Near NPC to attack Player</label>
</li>
<li>
<input type="checkbox" id="task9" name="task9">
<label for="task9"><s>State Control by Behavior Tree</s></label>
</li>
<li>
<input type="checkbox" id="task10" name="task10" checked>
<label for="task10">Statemachine [Both prefabs have]</label>
</li>
<li>
<input type="checkbox" id="task11" name="task11" checked>
<label for="task11">Zombie - Sound Sensor</label>
</li>
<li>
<input type="checkbox" id="task12" name="task12" checked>
<label for="task12">Zombie - Vision Sensor</label>
</li>
<li>
<input type="checkbox" id="task13" name="task13" checked>
<label for="task13">Sensor Memory for Target</label>
</li>
<li>
<input type="checkbox" id="task14" name="task14" checked>
<label for="task14">FPS Player</label>
</li>
<li>
<input type="checkbox" id="task15" name="task15" checked>
<label for="task15">A Demo Scene</label>
</li>
<li>
<input type="checkbox" id="task16" name="task16" checked>
<label for="task16">Walking Audio</label>
</li>
<li>
<input type="checkbox" id="task17" name="task17" checked>
<label for="task17">Camera Shake</label>
</li>
</ul>
<hr>
<h2 id="screenshots-">Screenshots : </h2>
<div class="center" id="anim-imageContainer">
<img id="image1" src="ScreenShots/screenshot_with_weapon.png" alt="Image 1">
<img id="image2" src="ScreenShots/screenshot_with_multiple_zombie.png" alt="Image 2">
<img id="image3" src="ScreenShots/screenshot_with_weapon.png" alt="Image 3">
<img id="image4" src="ScreenShots/screenshot_with_multiple_zombie.png" alt="Image 4">
</div>
<div id="dotsContainer">
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
</div>
<p>You can make your own custom transition then you need to update the state csharp script files according to your logic.</p>
<hr>
<h2 classid="behavior-tree-">Behavior Tree:</h2>
<p>I have dropped this feature.</p>
<div class="imageContainer">
<img src="ScreenShots/behavior_tree.png" alt="Flowchart of State transition" width="300" height="auto">
</div>
<hr>
<h2 classid="behavior-tree-">State Transition:</h2>
<div class="imageContainer">
<a href="https://colab.research.google.com/drive/14w90fm0O1CPNVTPYqNnic9xqHehyHnAs?usp=sharing">
<img src="ScreenShots/flowchart.png" alt="Flowchart of State transition" width="300" height="auto">
</a>
</div>
<hr>
<h2 id="documentation-">Documentation :</h2>
<ul>
<li>
<p>You can see scene setup tutorial on <a href="https://github.com/baponkar/zombie-ai/blob/main/Assets/__baponkar__/Tutorials.pdf"><img src="https://img.shields.io/badge/Wiki-maker?logo=wiki" alt="Wiki Badge"></a> or included PDF file.</p>
</li>
<li>
<p>This is a complete Unity Project with included depending assets and also included a Demo Scene.</p>
</li>
<li>
<p>If You download this project and open it with Unity then it may works perfectly but sometimes may not works the way because of layers absence in the project then you need to add corresponding layers and set by the below instruction.</p>
</li>
</ul>
<ul>
<li>
<p>If you use this project with your old project then first put '_Zombie_ai_Fsm' folder in your project then create and add the layers in your project by below instruction.Zombie NPC is a navmesh agent which detect player by using vision sensor and sound sensor.Vison Sensor have a sensory memory to memorize sense which can be set by config scriptable object.</p>
</li>
<li>
<p>vison sensor can sense <strong>Character</strong> layers which is attached to the player prefab.</p>
</li>
<li>
<p>The NPC Zombie have different inter related states you can manage those states by set up in config scriptable object found in the project.</p>
</li>
<li>
<p>Project setup instructions : </p>
</li>
</ul>
<hr>
<ol>
<li>
<p>Add following layers in the following orders </p>
</li>
<li>
<input type="checkbox" id="layer3" name="layer3" checked>
<label for="layer3">Layer 3 - <strong>Player</strong></label>
</li>
<li>
<input type="checkbox" id="layer6" name="layer6" checked>
<label for="layer6">Layer 6 - <strong>NPC</strong></label>
</li>
<li>
<input type="checkbox" id="layer13" name="layer13" checked>
<label for="layer13">Layer 13 - <strong>Character</strong></label>
</li>
<li>
<input type="checkbox" id="layer14" name="layer14" checked>
<label for="layer14">Layer 14 - <strong>Mini Map</strong></label>
</li>
<li>
<p>NPC : Change Default layer of Zombie/Romero Prefab into <strong>NPC</strong>, and also Change Tag of Zombie/Romero Prefab into <strong>NPC</strong>.</p>
</li>
<li>
<p>Change Layer of <strong>Player</strong> into <strong>Character</strong> which will be seen by NPCs, and also Change Tag of <strong>Player</strong> with "<strong>Player</strong>".</p>
</li>
<li>
<p>Change Layer of all prefabs <strong>indicator plane</strong> into "<strong>Mini Map</strong>" Layer.Which will be seen only by Mini Map Camera.</p>
</li>
<li>
<p>See <strong>NPCVisionSensor</strong> Script which attached with npcs i.e. zombie/Romero prefabs and change its <strong>Occulation Layer</strong> with corresponding<strong>Ground Layer</strong> i.e. if ground plain be <strong>Defult</strong> then change into <strong>Defult</strong> Layer.</p>
</li>
<li>
<p>See NPCVisionSensor.cs Script which attached with npcs i.e. zombie/Romero prefabs and change its <strong>Target Layer</strong> into <strong>Character</strong> Layer which is the Layer of Player.So NPCs can see the player by vision sensor.</p>
</li>
</ol>
<ol>
<li>
<p>Bake Navmesh with Humanoid Agent which should be in NavMeshAgent(Which attached to the Zombie Prefab).</p>
</li>
<li>
<p>Now put zombie prefab and player prefab in your scene.Player has attached a Health script which is damageable by Zombie/Romero.</p>
</li>
<li>
<p>Zombie also has attached a Health Script which can be damagable by external player which has a weapon which can be used to damage zombies health.</p>
</li>
<li>
<p>Change or tweak zombie behavior by setting up zombie config scriptable object.</p>
</li>
<li>
<p>To Change custom sensor detection layer edit 'NPCSensoryMemory.cs' file</p>
</li>
<li>
<p>If you don't see the npcs then you need to add 'NPC' layer into the culling mask section of FPSCamera which have attached to theplayer prefab</p>
</li>
</ol>
<p>Zombie sensor sense "Character" Layer for this NPCSensoryMemory.cs Script.Find <strong>"NPCSensoryMemory.cs"</strong> Script inside Scripts folder i.e.</p>
<div class="codebox">
<header>
<span></span>
<span></span>
<span></span>
</header>
<pre>
<code class="language-bash">
$ cd Zombie_Ai/Assets/Zombie_ai/Zombie_NPC/ Scripts/NPCSensoryMemory.cs
</code>
</pre>
</div>
<div class="codebox">
<header>
<span></span>
<span></span>
<span></span>
</header>
<!---->
<pre>
<code class="language-csharp">
<!---->
{
int targets = sensor.Filter(characters, 'TargetLayer');
//Here put the player layer name in 'TargetLayer'
//Here I have use 'Character' as Player Object Layer is that.
void UpdateSenses(NPCVisionSensor sensor)
....
}
<!---->
</code>
</pre>
</div>
<div class="imageContainer">
<img src="ScreenShots/set_sensor_layer.png" alt="Changing Target Layer">
</div>
<li>
This Project has a Demo Scene with necessary setup.
</li>
<h2 id="license-">License :</h2>
<p><a href="LICENSE.md">GNU GPL v-3.0 License</a> But you are requested to see the dependency assets licences.</p>
<hr>
<h2 id="credits-">Credits 😊:</h2>
<ol>
<li>
<p>I have get ideas from Youtuber 'Kiwi Coder's tutorials<a href="https://www.youtube.com/watch?v=znZXmmyBF-o&t=629s">1</a><a href="https://www.youtube.com/watch?v=1H9jrKyWKs0">2</a></p>
</li>
<li>
<p>I have get ideas from Youtuber <a href="https://www.youtube.com/watch?v=UjkSFoLxesw&t=7s">'Dev/GameDevelopment'</a>s tutorials</p>
</li>
<li>
<p><a href="https://learn.unity.com/tutorial/introducing-behaviour-trees?uv=2020.2&projectId=60645258edbc2a001f5585aa">Unity Learn - BehaviorTree</a> </p>
</li>
<li>
<p>Sound Effect from <a href="https://pixabay.com/sound-effects/?utm_source=link-attribution&utm_medium=referral&utm_campaign=music&utm_content=6419">Pixabay</a></p>
</li>
<li>
<p><a href="https://www.mixamo.com">Mixamo Character</a></p>
</li>
</ol>
<hr>
<h2 id="dependency">Dependency :</h2>
<ol>
<li>
<p>This Assets depend on <a href="https://assetstore.unity.com/packages/3d/characters/humanoids/zombie-30232">'Zombie assets by Pxltiger'</a>. So You need to download this package from Unity assets store along with this Zombie_Enemy_AI assets.</p>
</li>
<li>
<p><a href="https://github.com/Unity-Technologies/Standard-Assets-Characters">Standard-Assets-Characters</a> I am using Audio files for footstep sound.</p>
</li>
<li>
<p><a href="https://assetstore.unity.com/packages/3d/props/guns/rifle-25668">Rifle by Game-Ready Studios</a></p>
</li>
<li>
<p><a href="https://github.com/baponkar/Unity-Simple-FPS">Unity Simple FPS</a> by me.</p>
</li>
<li>
<p><a href="https://github.com/baponkar/My-Behavior-Tree">My Behavior Tree</a> by me.</p>
</li>
<li>
<p><a href="https://github.com/baponkar/Traffic-System-in-Unity">Traffic-System</a> by me.</p>
</li>
<li>
<p><a href="https://thekiwicoder.com/behaviour-tree-editor/">Kiwi coder Behavior Tree</a> by Kiwi Coder.</p>
</li>
<li>
<p>I have put all the above packages file and folder inside of this project.</p>
</li>
</ol>
<hr>
<h2 id="unity-version">Unity Version </h2>
<p>Unity 2020.3.15f2 or higher version.</p>
<h2 id="contact-">Contact:</h2>
<div class="center">
<div class="badge-container">
<a href="mailto:[email protected]">
<img src="https://img.shields.io/badge/Gmail-maker?style=plastic&logo=gmail&logoSize=small&labelColor=blue&color=black" alt="Gmail">
</a>
<a href="https://x.com/kar_bapon">
<img src="https://img.shields.io/badge/-x.com-maker?style=plastic&logo=x&logoSize=small&labelColor=blue&color=black" alt="X">
</a>
<a href="https://in.linkedin.com/in/bapon-kar-815098200">
<img src="https://img.shields.io/badge/-LinkedIn-maker?style=plastic&logo=linkedin&logoSize=small&labelColor=blue&color=black" alt="LinkedIn">
</a>
<a href="https://youtube.com/@gamingjam8394?si=cElodqeKqe5PgX_o">
<img src="https://img.shields.io/badge/-Youtube-maker?style=plastic&logo=youtube&logoSize=small&labelColor=blue&color=black" alt="YouTube">
</a>
</div>
</div>
<hr>
<div class="center">
<p>Copyright © <a href="https://github.com/baponkar">baponkar</a> 2024</p>
</div>
<audio id="bgMusic" src="perfect-beauty-191271.mp3" loop autoplay></audio>
<button id="playButton">Play Music</button>
<button id="pauseButton">Pause Music</button>
<hr>
<p style="font-size: 10px;">\[ a^2+b+c=0 \]</p>
</div>
</div>
<!--Javascript scripts-->
<script src="js/typewriting_anim.js"></script>
<script src="js/pdf_control.js"></script>
<script src="js/slide_show.js"></script>
<script src="js/banner_image_anim.js"></script>
<script src="js/page_loading_animation.js"></script>
<script src="js/read_percentage.js"></script>
<script src="js/go_top_bottom.js"></script>
<script src="js/play_background_audio.js"></script>
</body>
</html>