#  ![](https://www.realm667.com/media/kunena/topic_icons/realm667_repo/user/rep_approved.png) \[SUBMISSION\] AI Marines (Intelligent marine NPCs)

##

- **inkoalawetrust**
- ![inkoalawetrust's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar11669.jpg?1718890853) Topic Author
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 254
-
-

   4 years 2 months ago [\#9816](#9816) by inkoalawetrust  Replied by *inkoalawetrust* on topic *[\[SUBMISSION\] AI Marines (Intelligent marine NPCs)](https://www.realm667.com/forum/closed-submissions/1755-submission-ai-marines-intelligent-marine-npcs?start=10#9816 "Information:

Name: AI Marines
Difficulty: Easy/Medium, Hard (When on a turret or in groups and squads.)
Connections: None
Summon: SmartMarine, TurretMarine, SmartMarineMGTurret, SM_NoCrouchZone, VanillaRifle
Melee: Yes (Rifle swing, can also use berserk packs if they get in their inventory)
Distance: Hitscan (Rifle), Projectile (Grenades and turrets)
Type: Human, Military
Brightmaps: No
Actor modification: No
ACS: No

Credits:
Code: Inkoalawetrust, Lewisk3 (Base code for making turrets usable by players), Boondorl (Swimmable 3D floor detection)
GLDEFS: inkoalawetrust
Sounds: Valve, FreeSound, GDC Audio Library, edited by Inkoalawetrust etc, check credits.txt
Sprites: id Software, Sergeant_Mark_IV, Ghastly_Dragon, Das M., Superdave938, Mryayayify, Tabijaky, Gorman Freebmane, Inkoalawetrust, TG5, Vader, etc, check credits.txt
Sprite edit: TG5, Tabijaky, inkoalawetrust
Idea Base: Having NPCs in Doom with a higher IQ than a wet towel. Half-Life 1 HECU (Partially)

Description:
A Doom NPC with a brain for a change. They can do dozens of different things, such as avoid danger, work in groups, move in squads, dodge projectiles, take cover and so on, can easily be used as allies by being set to friendly, have multiple weapons, including turrets that both they and players can use, and are highly customizable. For more detailed information on all the stuff they are capable of (A lot), and how to properly and fully use them. Check the included Document.txt file.

Sprite:

Showcase video:
https://www.youtube.com/watch?v=PlZSs5XyEdU

Download Link (Includes a demo map):
https://drive.google.com/file/d/1EIVL8G8sLCLaAOwdDNtrSgNgVAPxoF9B/view?usp=sharing

This is my latest major project, the marines included in this resource are far more intelligent than any of the vanilla monsters, and can do A TON of things, here's a list of most of them, from 's readme:

* Attack stuff by:
* Bashing it with their rifle. But they normally avoid it if they can help it. (Melee)

* Can also use berserk packs, if one is somehow in their inventory, which triple their melee damage, and make them more likely to engage in melee.
* Shoot at it, with a random chance of changing position while doing so. (Ranged)

* Throw a grenade at it, more likely to throw it at crowds of enemies. (Area of effect)
* They avoid firing their rifles, grenades, or turrets if their line of fire to the target is blocked by obstacles or allies.

* Run away from the grenades they throw, if those grenades are about to explode.
* Intelligently dodge enemy or extremely harmful projectiles heading their way. More information can be found inside Document.txt

* Dynamically take cover behind sufficiently tall level geometry or shootable actors when attacking enemies. More information can be found inside Document.txt
* Can be set up into squads in which they stick together and follow a designated leader. And can change leaders if the previous one died. More information can be found inside Document.txt

* They have multiple death animations that can play randomly.
* Reload their rifles for every 20 rounds they fire in total.

* They first try a few times to run away from their target until out of sight, to not reload while vulnerable.
* Chase around their target for some time before losing track of it, if they can't hear or see it for too long.

* When not set to friendly, they attack friendly NPCs on sight, unlike normal enemy NPCs/monsters, that don't attack friendly NPCs unless provoked by them first.
* Alert other marines that are on their side of their current target, if the other marines have no target they are dealing with already. They can also hear the alerts of enemy marines.

* Retreat and keep a distance away from very powerful or large enemies like Cyberdemons. Or enemy players and marines on turrets.
* Marines friendly to the player can be ordered to stand still or wander around by pressing use on them. This only works if they aren't currently fighting.

* They work with ZDoom's built-in patrol system, so you can have them walk around set paths. To do stuff like guard areas.*
* Has placeable machine gun turrets that both players and the marines can use, you can press the use key on a friendly marine to get him off of one.

* Includes a separate marine that permanently stays on the turret until killed, who can also be colored like below. Pressing use on them will get them off, if they are friendly, and User_DisobeyCommands is off.
* Can be colored with a variety of colors:

* Red
* Gray

* White
* Black

* Blue
* Yellow

* Orange
* Pink

* Dark Green
* Random (Randomly pick a color.)

* Default (Use the default shade of green. Similar to just leaving User_Color empty.)
* Most of the marines' behaviour can be configured on a per actor basis using user variables.

* They also have a rifle that they sometimes drop, which you can pick up and use yourself.
* The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too.

* It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well.
* The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine.

Information on all the user variables they have can be found inside Document.txt. If I need to split the rifle weapon they drop into a separate submission on the armory section for Realm667, I can do that. But the turret, which is a weapon both the player and the marine NPCs can use, is pretty much inseparable from the rest of the resource.")*

 Alright, the crouching mechanic is finished, tomorrow I'll be adding a new section to the demonstration map to demos this mechanic, along with also publicly updating the resource.

 [ ![[img](https://cdn.discordapp.com/attachments/762804188807168010/978921606623670272/unknown.png) ](https://cdn.discordapp.com/attachments/762804188807168010/978921606623670272/unknown.png "[img")

 [ ![[img](https://cdn.discordapp.com/attachments/762804188807168010/978921606959222844/unknown.png) ](https://cdn.discordapp.com/attachments/762804188807168010/978921606959222844/unknown.png "[img")

 [ ![[img](https://cdn.discordapp.com/attachments/762804188807168010/978921607261224961/unknown.png) ](https://cdn.discordapp.com/attachments/762804188807168010/978921607261224961/unknown.png "[img")

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzU1LXN1Ym1pc3Npb24tYWktbWFyaW5lcy1pbnRlbGxpZ2VudC1tYXJpbmUtbnBjcz9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **inkoalawetrust**
- ![inkoalawetrust's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar11669.jpg?1718890853) Topic Author
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 254
-
-

   4 years 2 months ago [\#9822](#9822) by inkoalawetrust  Replied by *inkoalawetrust* on topic *[\[SUBMISSION\] AI Marines (Intelligent marine NPCs)](https://www.realm667.com/forum/closed-submissions/1755-submission-ai-marines-intelligent-marine-npcs?start=10#9822 "Information:

Name: AI Marines
Difficulty: Easy/Medium, Hard (When on a turret or in groups and squads.)
Connections: None
Summon: SmartMarine, TurretMarine, SmartMarineMGTurret, SM_NoCrouchZone, VanillaRifle
Melee: Yes (Rifle swing, can also use berserk packs if they get in their inventory)
Distance: Hitscan (Rifle), Projectile (Grenades and turrets)
Type: Human, Military
Brightmaps: No
Actor modification: No
ACS: No

Credits:
Code: Inkoalawetrust, Lewisk3 (Base code for making turrets usable by players), Boondorl (Swimmable 3D floor detection)
GLDEFS: inkoalawetrust
Sounds: Valve, FreeSound, GDC Audio Library, edited by Inkoalawetrust etc, check credits.txt
Sprites: id Software, Sergeant_Mark_IV, Ghastly_Dragon, Das M., Superdave938, Mryayayify, Tabijaky, Gorman Freebmane, Inkoalawetrust, TG5, Vader, etc, check credits.txt
Sprite edit: TG5, Tabijaky, inkoalawetrust
Idea Base: Having NPCs in Doom with a higher IQ than a wet towel. Half-Life 1 HECU (Partially)

Description:
A Doom NPC with a brain for a change. They can do dozens of different things, such as avoid danger, work in groups, move in squads, dodge projectiles, take cover and so on, can easily be used as allies by being set to friendly, have multiple weapons, including turrets that both they and players can use, and are highly customizable. For more detailed information on all the stuff they are capable of (A lot), and how to properly and fully use them. Check the included Document.txt file.

Sprite:

Showcase video:
https://www.youtube.com/watch?v=PlZSs5XyEdU

Download Link (Includes a demo map):
https://drive.google.com/file/d/1EIVL8G8sLCLaAOwdDNtrSgNgVAPxoF9B/view?usp=sharing

This is my latest major project, the marines included in this resource are far more intelligent than any of the vanilla monsters, and can do A TON of things, here's a list of most of them, from 's readme:

* Attack stuff by:
* Bashing it with their rifle. But they normally avoid it if they can help it. (Melee)

* Can also use berserk packs, if one is somehow in their inventory, which triple their melee damage, and make them more likely to engage in melee.
* Shoot at it, with a random chance of changing position while doing so. (Ranged)

* Throw a grenade at it, more likely to throw it at crowds of enemies. (Area of effect)
* They avoid firing their rifles, grenades, or turrets if their line of fire to the target is blocked by obstacles or allies.

* Run away from the grenades they throw, if those grenades are about to explode.
* Intelligently dodge enemy or extremely harmful projectiles heading their way. More information can be found inside Document.txt

* Dynamically take cover behind sufficiently tall level geometry or shootable actors when attacking enemies. More information can be found inside Document.txt
* Can be set up into squads in which they stick together and follow a designated leader. And can change leaders if the previous one died. More information can be found inside Document.txt

* They have multiple death animations that can play randomly.
* Reload their rifles for every 20 rounds they fire in total.

* They first try a few times to run away from their target until out of sight, to not reload while vulnerable.
* Chase around their target for some time before losing track of it, if they can't hear or see it for too long.

* When not set to friendly, they attack friendly NPCs on sight, unlike normal enemy NPCs/monsters, that don't attack friendly NPCs unless provoked by them first.
* Alert other marines that are on their side of their current target, if the other marines have no target they are dealing with already. They can also hear the alerts of enemy marines.

* Retreat and keep a distance away from very powerful or large enemies like Cyberdemons. Or enemy players and marines on turrets.
* Marines friendly to the player can be ordered to stand still or wander around by pressing use on them. This only works if they aren't currently fighting.

* They work with ZDoom's built-in patrol system, so you can have them walk around set paths. To do stuff like guard areas.*
* Has placeable machine gun turrets that both players and the marines can use, you can press the use key on a friendly marine to get him off of one.

* Includes a separate marine that permanently stays on the turret until killed, who can also be colored like below. Pressing use on them will get them off, if they are friendly, and User_DisobeyCommands is off.
* Can be colored with a variety of colors:

* Red
* Gray

* White
* Black

* Blue
* Yellow

* Orange
* Pink

* Dark Green
* Random (Randomly pick a color.)

* Default (Use the default shade of green. Similar to just leaving User_Color empty.)
* Most of the marines' behaviour can be configured on a per actor basis using user variables.

* They also have a rifle that they sometimes drop, which you can pick up and use yourself.
* The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too.

* It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well.
* The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine.

Information on all the user variables they have can be found inside Document.txt. If I need to split the rifle weapon they drop into a separate submission on the armory section for Realm667, I can do that. But the turret, which is a weapon both the player and the marine NPCs can use, is pretty much inseparable from the rest of the resource.")*

 The new update to the submission has been finished, now the marines can attack while dodging at the same time and also take cover behind level geometry and actors that can block both hitscans and projectiles. The demo map has also been updated, and[ I made a bunch of other changes too](https://github.com/inkoalawetrust/Smart-Marines/releases/tag/1.2.0) since last weeks' update. Such as adding liquid explosions to their grenades when they fall on a liquid surface.

The reason it took me so long to make this update was because of a combination of IRL issues and struggling, and eventually failing, to make the new bullet and explosion splashes actually detect swimmable 3D floors reliably.

Either way, the new download link is in the original post. Also here's a video I recorded of 5 hostile marines fighting 25 friendly demons, including Hell Knights and Cacodemons. The video showcases them taking cover behind level geometry and objects, and dodging projectiles and sometimes also shooting while doing so. At around 45 seconds into the video you can also see one of the marines that is behind cover dodging a Hell Knight's fireballs by ducking back down again.

https://streamable.com/9ifqiz

All that aside, this should be the final version of the marines aside from small bugfixes and changes here and there. Just had to add those two major new features because I always wanted them from the start, but didn't realize I could actually code them in until two weeks ago. So this will be more or less the final version of the marines.

 Warning: Spoiler!

Until TG5 finishes the sprite sets for the rocket marine at least, but for now the submission is basically final.

 [ ![[img](https://cdn.discordapp.com/attachments/840278600107163658/979350470441205780/GIF-220526_120819.gif) ](https://cdn.discordapp.com/attachments/840278600107163658/979350470441205780/GIF-220526_120819.gif "[img")

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzU1LXN1Ym1pc3Npb24tYWktbWFyaW5lcy1pbnRlbGxpZ2VudC1tYXJpbmUtbnBjcz9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **Gothic**
- ![Gothic's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar320.png?1619787674)
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 1329
-
-
-

   4 years 2 months ago - 4 years 2 months ago [\#9825](#9825) by Gothic  Replied by *Gothic* on topic *[\[SUBMISSION\] AI Marines (Intelligent marine NPCs)](https://www.realm667.com/forum/closed-submissions/1755-submission-ai-marines-intelligent-marine-npcs?start=10#9825 "Information:

Name: AI Marines
Difficulty: Easy/Medium, Hard (When on a turret or in groups and squads.)
Connections: None
Summon: SmartMarine, TurretMarine, SmartMarineMGTurret, SM_NoCrouchZone, VanillaRifle
Melee: Yes (Rifle swing, can also use berserk packs if they get in their inventory)
Distance: Hitscan (Rifle), Projectile (Grenades and turrets)
Type: Human, Military
Brightmaps: No
Actor modification: No
ACS: No

Credits:
Code: Inkoalawetrust, Lewisk3 (Base code for making turrets usable by players), Boondorl (Swimmable 3D floor detection)
GLDEFS: inkoalawetrust
Sounds: Valve, FreeSound, GDC Audio Library, edited by Inkoalawetrust etc, check credits.txt
Sprites: id Software, Sergeant_Mark_IV, Ghastly_Dragon, Das M., Superdave938, Mryayayify, Tabijaky, Gorman Freebmane, Inkoalawetrust, TG5, Vader, etc, check credits.txt
Sprite edit: TG5, Tabijaky, inkoalawetrust
Idea Base: Having NPCs in Doom with a higher IQ than a wet towel. Half-Life 1 HECU (Partially)

Description:
A Doom NPC with a brain for a change. They can do dozens of different things, such as avoid danger, work in groups, move in squads, dodge projectiles, take cover and so on, can easily be used as allies by being set to friendly, have multiple weapons, including turrets that both they and players can use, and are highly customizable. For more detailed information on all the stuff they are capable of (A lot), and how to properly and fully use them. Check the included Document.txt file.

Sprite:

Showcase video:
https://www.youtube.com/watch?v=PlZSs5XyEdU

Download Link (Includes a demo map):
https://drive.google.com/file/d/1EIVL8G8sLCLaAOwdDNtrSgNgVAPxoF9B/view?usp=sharing

This is my latest major project, the marines included in this resource are far more intelligent than any of the vanilla monsters, and can do A TON of things, here's a list of most of them, from 's readme:

* Attack stuff by:
* Bashing it with their rifle. But they normally avoid it if they can help it. (Melee)

* Can also use berserk packs, if one is somehow in their inventory, which triple their melee damage, and make them more likely to engage in melee.
* Shoot at it, with a random chance of changing position while doing so. (Ranged)

* Throw a grenade at it, more likely to throw it at crowds of enemies. (Area of effect)
* They avoid firing their rifles, grenades, or turrets if their line of fire to the target is blocked by obstacles or allies.

* Run away from the grenades they throw, if those grenades are about to explode.
* Intelligently dodge enemy or extremely harmful projectiles heading their way. More information can be found inside Document.txt

* Dynamically take cover behind sufficiently tall level geometry or shootable actors when attacking enemies. More information can be found inside Document.txt
* Can be set up into squads in which they stick together and follow a designated leader. And can change leaders if the previous one died. More information can be found inside Document.txt

* They have multiple death animations that can play randomly.
* Reload their rifles for every 20 rounds they fire in total.

* They first try a few times to run away from their target until out of sight, to not reload while vulnerable.
* Chase around their target for some time before losing track of it, if they can't hear or see it for too long.

* When not set to friendly, they attack friendly NPCs on sight, unlike normal enemy NPCs/monsters, that don't attack friendly NPCs unless provoked by them first.
* Alert other marines that are on their side of their current target, if the other marines have no target they are dealing with already. They can also hear the alerts of enemy marines.

* Retreat and keep a distance away from very powerful or large enemies like Cyberdemons. Or enemy players and marines on turrets.
* Marines friendly to the player can be ordered to stand still or wander around by pressing use on them. This only works if they aren't currently fighting.

* They work with ZDoom's built-in patrol system, so you can have them walk around set paths. To do stuff like guard areas.*
* Has placeable machine gun turrets that both players and the marines can use, you can press the use key on a friendly marine to get him off of one.

* Includes a separate marine that permanently stays on the turret until killed, who can also be colored like below. Pressing use on them will get them off, if they are friendly, and User_DisobeyCommands is off.
* Can be colored with a variety of colors:

* Red
* Gray

* White
* Black

* Blue
* Yellow

* Orange
* Pink

* Dark Green
* Random (Randomly pick a color.)

* Default (Use the default shade of green. Similar to just leaving User_Color empty.)
* Most of the marines' behaviour can be configured on a per actor basis using user variables.

* They also have a rifle that they sometimes drop, which you can pick up and use yourself.
* The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too.

* It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well.
* The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine.

Information on all the user variables they have can be found inside Document.txt. If I need to split the rifle weapon they drop into a separate submission on the armory section for Realm667, I can do that. But the turret, which is a weapon both the player and the marine NPCs can use, is pretty much inseparable from the rest of the resource.")*

 There's an error with the rifle, if you die while the zooming animation plays, the zoomed rifle stays and the screen flashes green.
Grenades spawned by marines keep making bounce sounds even if they stay still on the floor.

 Last edit: 4 years 2 months ago by Gothic.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzU1LXN1Ym1pc3Npb24tYWktbWFyaW5lcy1pbnRlbGxpZ2VudC1tYXJpbmUtbnBjcz9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **inkoalawetrust**
- ![inkoalawetrust's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar11669.jpg?1718890853) Topic Author
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 254
-
-

   4 years 2 months ago - 4 years 2 months ago [\#9826](#9826) by inkoalawetrust  Replied by *inkoalawetrust* on topic *[\[SUBMISSION\] AI Marines (Intelligent marine NPCs)](https://www.realm667.com/forum/closed-submissions/1755-submission-ai-marines-intelligent-marine-npcs?start=10#9826 "Information:

Name: AI Marines
Difficulty: Easy/Medium, Hard (When on a turret or in groups and squads.)
Connections: None
Summon: SmartMarine, TurretMarine, SmartMarineMGTurret, SM_NoCrouchZone, VanillaRifle
Melee: Yes (Rifle swing, can also use berserk packs if they get in their inventory)
Distance: Hitscan (Rifle), Projectile (Grenades and turrets)
Type: Human, Military
Brightmaps: No
Actor modification: No
ACS: No

Credits:
Code: Inkoalawetrust, Lewisk3 (Base code for making turrets usable by players), Boondorl (Swimmable 3D floor detection)
GLDEFS: inkoalawetrust
Sounds: Valve, FreeSound, GDC Audio Library, edited by Inkoalawetrust etc, check credits.txt
Sprites: id Software, Sergeant_Mark_IV, Ghastly_Dragon, Das M., Superdave938, Mryayayify, Tabijaky, Gorman Freebmane, Inkoalawetrust, TG5, Vader, etc, check credits.txt
Sprite edit: TG5, Tabijaky, inkoalawetrust
Idea Base: Having NPCs in Doom with a higher IQ than a wet towel. Half-Life 1 HECU (Partially)

Description:
A Doom NPC with a brain for a change. They can do dozens of different things, such as avoid danger, work in groups, move in squads, dodge projectiles, take cover and so on, can easily be used as allies by being set to friendly, have multiple weapons, including turrets that both they and players can use, and are highly customizable. For more detailed information on all the stuff they are capable of (A lot), and how to properly and fully use them. Check the included Document.txt file.

Sprite:

Showcase video:
https://www.youtube.com/watch?v=PlZSs5XyEdU

Download Link (Includes a demo map):
https://drive.google.com/file/d/1EIVL8G8sLCLaAOwdDNtrSgNgVAPxoF9B/view?usp=sharing

This is my latest major project, the marines included in this resource are far more intelligent than any of the vanilla monsters, and can do A TON of things, here's a list of most of them, from 's readme:

* Attack stuff by:
* Bashing it with their rifle. But they normally avoid it if they can help it. (Melee)

* Can also use berserk packs, if one is somehow in their inventory, which triple their melee damage, and make them more likely to engage in melee.
* Shoot at it, with a random chance of changing position while doing so. (Ranged)

* Throw a grenade at it, more likely to throw it at crowds of enemies. (Area of effect)
* They avoid firing their rifles, grenades, or turrets if their line of fire to the target is blocked by obstacles or allies.

* Run away from the grenades they throw, if those grenades are about to explode.
* Intelligently dodge enemy or extremely harmful projectiles heading their way. More information can be found inside Document.txt

* Dynamically take cover behind sufficiently tall level geometry or shootable actors when attacking enemies. More information can be found inside Document.txt
* Can be set up into squads in which they stick together and follow a designated leader. And can change leaders if the previous one died. More information can be found inside Document.txt

* They have multiple death animations that can play randomly.
* Reload their rifles for every 20 rounds they fire in total.

* They first try a few times to run away from their target until out of sight, to not reload while vulnerable.
* Chase around their target for some time before losing track of it, if they can't hear or see it for too long.

* When not set to friendly, they attack friendly NPCs on sight, unlike normal enemy NPCs/monsters, that don't attack friendly NPCs unless provoked by them first.
* Alert other marines that are on their side of their current target, if the other marines have no target they are dealing with already. They can also hear the alerts of enemy marines.

* Retreat and keep a distance away from very powerful or large enemies like Cyberdemons. Or enemy players and marines on turrets.
* Marines friendly to the player can be ordered to stand still or wander around by pressing use on them. This only works if they aren't currently fighting.

* They work with ZDoom's built-in patrol system, so you can have them walk around set paths. To do stuff like guard areas.*
* Has placeable machine gun turrets that both players and the marines can use, you can press the use key on a friendly marine to get him off of one.

* Includes a separate marine that permanently stays on the turret until killed, who can also be colored like below. Pressing use on them will get them off, if they are friendly, and User_DisobeyCommands is off.
* Can be colored with a variety of colors:

* Red
* Gray

* White
* Black

* Blue
* Yellow

* Orange
* Pink

* Dark Green
* Random (Randomly pick a color.)

* Default (Use the default shade of green. Similar to just leaving User_Color empty.)
* Most of the marines' behaviour can be configured on a per actor basis using user variables.

* They also have a rifle that they sometimes drop, which you can pick up and use yourself.
* The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too.

* It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well.
* The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine.

Information on all the user variables they have can be found inside Document.txt. If I need to split the rifle weapon they drop into a separate submission on the armory section for Realm667, I can do that. But the turret, which is a weapon both the player and the marine NPCs can use, is pretty much inseparable from the rest of the resource.")*

 Alright, I made a new update to the marine that along with fixing a bunch of things like the marines trying to dodge harmless projectiles like Hexen's leaves, or the bugs that you reported. Also adds a new No Crouch Zone map spot, that can be used to prevent marines from crouching in certain areas such as certain staircases. Which as a bit of emergent gameplay, they tend to do, it had not even crossed my mind that they would be using staircases as cover.

 [ ![[img](https://cdn.discordapp.com/attachments/762804188807168010/981863484847448064/unknown.png) ](https://cdn.discordapp.com/attachments/762804188807168010/981863484847448064/unknown.png "[img")

More information on it is inside Document.txt.

[ And here is the changelog for 1.2.1](https://github.com/inkoalawetrust/Smart-Marines/releases/tag/1.2.1)

Also, it seems that the site is broken, and does not allow me to make new threads, or make new posts on the full editor. So I have to use the quick reply editor to even post this. If this bug isn't gone by tomorrow we'll probably need to tell Tormentor. Weirdly enough though, I can bring up the full page editor to edit existing posts such as this one just fine.

 Last edit: 4 years 2 months ago by inkoalawetrust.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzU1LXN1Ym1pc3Npb24tYWktbWFyaW5lcy1pbnRlbGxpZ2VudC1tYXJpbmUtbnBjcz9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **inkoalawetrust**
- ![inkoalawetrust's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar11669.jpg?1718890853) Topic Author
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 254
-
-

   4 years 2 months ago - 4 years 2 months ago [\#9828](#9828) by inkoalawetrust  Replied by *inkoalawetrust* on topic *[\[SUBMISSION\] AI Marines (Intelligent marine NPCs)](https://www.realm667.com/forum/closed-submissions/1755-submission-ai-marines-intelligent-marine-npcs?start=10#9828 "Information:

Name: AI Marines
Difficulty: Easy/Medium, Hard (When on a turret or in groups and squads.)
Connections: None
Summon: SmartMarine, TurretMarine, SmartMarineMGTurret, SM_NoCrouchZone, VanillaRifle
Melee: Yes (Rifle swing, can also use berserk packs if they get in their inventory)
Distance: Hitscan (Rifle), Projectile (Grenades and turrets)
Type: Human, Military
Brightmaps: No
Actor modification: No
ACS: No

Credits:
Code: Inkoalawetrust, Lewisk3 (Base code for making turrets usable by players), Boondorl (Swimmable 3D floor detection)
GLDEFS: inkoalawetrust
Sounds: Valve, FreeSound, GDC Audio Library, edited by Inkoalawetrust etc, check credits.txt
Sprites: id Software, Sergeant_Mark_IV, Ghastly_Dragon, Das M., Superdave938, Mryayayify, Tabijaky, Gorman Freebmane, Inkoalawetrust, TG5, Vader, etc, check credits.txt
Sprite edit: TG5, Tabijaky, inkoalawetrust
Idea Base: Having NPCs in Doom with a higher IQ than a wet towel. Half-Life 1 HECU (Partially)

Description:
A Doom NPC with a brain for a change. They can do dozens of different things, such as avoid danger, work in groups, move in squads, dodge projectiles, take cover and so on, can easily be used as allies by being set to friendly, have multiple weapons, including turrets that both they and players can use, and are highly customizable. For more detailed information on all the stuff they are capable of (A lot), and how to properly and fully use them. Check the included Document.txt file.

Sprite:

Showcase video:
https://www.youtube.com/watch?v=PlZSs5XyEdU

Download Link (Includes a demo map):
https://drive.google.com/file/d/1EIVL8G8sLCLaAOwdDNtrSgNgVAPxoF9B/view?usp=sharing

This is my latest major project, the marines included in this resource are far more intelligent than any of the vanilla monsters, and can do A TON of things, here's a list of most of them, from 's readme:

* Attack stuff by:
* Bashing it with their rifle. But they normally avoid it if they can help it. (Melee)

* Can also use berserk packs, if one is somehow in their inventory, which triple their melee damage, and make them more likely to engage in melee.
* Shoot at it, with a random chance of changing position while doing so. (Ranged)

* Throw a grenade at it, more likely to throw it at crowds of enemies. (Area of effect)
* They avoid firing their rifles, grenades, or turrets if their line of fire to the target is blocked by obstacles or allies.

* Run away from the grenades they throw, if those grenades are about to explode.
* Intelligently dodge enemy or extremely harmful projectiles heading their way. More information can be found inside Document.txt

* Dynamically take cover behind sufficiently tall level geometry or shootable actors when attacking enemies. More information can be found inside Document.txt
* Can be set up into squads in which they stick together and follow a designated leader. And can change leaders if the previous one died. More information can be found inside Document.txt

* They have multiple death animations that can play randomly.
* Reload their rifles for every 20 rounds they fire in total.

* They first try a few times to run away from their target until out of sight, to not reload while vulnerable.
* Chase around their target for some time before losing track of it, if they can't hear or see it for too long.

* When not set to friendly, they attack friendly NPCs on sight, unlike normal enemy NPCs/monsters, that don't attack friendly NPCs unless provoked by them first.
* Alert other marines that are on their side of their current target, if the other marines have no target they are dealing with already. They can also hear the alerts of enemy marines.

* Retreat and keep a distance away from very powerful or large enemies like Cyberdemons. Or enemy players and marines on turrets.
* Marines friendly to the player can be ordered to stand still or wander around by pressing use on them. This only works if they aren't currently fighting.

* They work with ZDoom's built-in patrol system, so you can have them walk around set paths. To do stuff like guard areas.*
* Has placeable machine gun turrets that both players and the marines can use, you can press the use key on a friendly marine to get him off of one.

* Includes a separate marine that permanently stays on the turret until killed, who can also be colored like below. Pressing use on them will get them off, if they are friendly, and User_DisobeyCommands is off.
* Can be colored with a variety of colors:

* Red
* Gray

* White
* Black

* Blue
* Yellow

* Orange
* Pink

* Dark Green
* Random (Randomly pick a color.)

* Default (Use the default shade of green. Similar to just leaving User_Color empty.)
* Most of the marines' behaviour can be configured on a per actor basis using user variables.

* They also have a rifle that they sometimes drop, which you can pick up and use yourself.
* The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too.

* It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well.
* The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine.

Information on all the user variables they have can be found inside Document.txt. If I need to split the rifle weapon they drop into a separate submission on the armory section for Realm667, I can do that. But the turret, which is a weapon both the player and the marine NPCs can use, is pretty much inseparable from the rest of the resource.")*

 Alright, posting on the forum works again after I reported the issue to Tormentor. Now that GZDoom 4.8.0 is out earlier than expected, I'm working on the optimization update I had planned for when it comes out. It's mostly optimizations and code cleanups as you can probably guess. And also an overhaul to the friendly marine commands, to split the "Wander" command into actual wandering, and into a new following command, that makes the marine follow the player that pressed use on them. Hopefully I will finish it by tomorrow. And not end up taking way longer due to coding complications and life issues like last time. This is the changelog so far:

 [ ![[img](https://i.imgur.com/45k8dRi.png) ](https://i.imgur.com/45k8dRi.png "[img")

 Warning: Spoiler!

I think I have found a way to make a basic squad system.
 [ ![[img](https://c.tenor.com/z2e-HheqmYIAAAAC/jim-carrey-grinch-face.gif) ](https://c.tenor.com/z2e-HheqmYIAAAAC/jim-carrey-grinch-face.gif "[img")

 Last edit: 4 years 2 months ago by inkoalawetrust.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzU1LXN1Ym1pc3Npb24tYWktbWFyaW5lcy1pbnRlbGxpZ2VudC1tYXJpbmUtbnBjcz9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **inkoalawetrust**
- ![inkoalawetrust's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar11669.jpg?1718890853) Topic Author
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 254
-
-

   4 years 1 month ago [\#9829](#9829) by inkoalawetrust  Replied by *inkoalawetrust* on topic *[\[SUBMISSION\] AI Marines (Intelligent marine NPCs)](https://www.realm667.com/forum/closed-submissions/1755-submission-ai-marines-intelligent-marine-npcs?start=10#9829 "Information:

Name: AI Marines
Difficulty: Easy/Medium, Hard (When on a turret or in groups and squads.)
Connections: None
Summon: SmartMarine, TurretMarine, SmartMarineMGTurret, SM_NoCrouchZone, VanillaRifle
Melee: Yes (Rifle swing, can also use berserk packs if they get in their inventory)
Distance: Hitscan (Rifle), Projectile (Grenades and turrets)
Type: Human, Military
Brightmaps: No
Actor modification: No
ACS: No

Credits:
Code: Inkoalawetrust, Lewisk3 (Base code for making turrets usable by players), Boondorl (Swimmable 3D floor detection)
GLDEFS: inkoalawetrust
Sounds: Valve, FreeSound, GDC Audio Library, edited by Inkoalawetrust etc, check credits.txt
Sprites: id Software, Sergeant_Mark_IV, Ghastly_Dragon, Das M., Superdave938, Mryayayify, Tabijaky, Gorman Freebmane, Inkoalawetrust, TG5, Vader, etc, check credits.txt
Sprite edit: TG5, Tabijaky, inkoalawetrust
Idea Base: Having NPCs in Doom with a higher IQ than a wet towel. Half-Life 1 HECU (Partially)

Description:
A Doom NPC with a brain for a change. They can do dozens of different things, such as avoid danger, work in groups, move in squads, dodge projectiles, take cover and so on, can easily be used as allies by being set to friendly, have multiple weapons, including turrets that both they and players can use, and are highly customizable. For more detailed information on all the stuff they are capable of (A lot), and how to properly and fully use them. Check the included Document.txt file.

Sprite:

Showcase video:
https://www.youtube.com/watch?v=PlZSs5XyEdU

Download Link (Includes a demo map):
https://drive.google.com/file/d/1EIVL8G8sLCLaAOwdDNtrSgNgVAPxoF9B/view?usp=sharing

This is my latest major project, the marines included in this resource are far more intelligent than any of the vanilla monsters, and can do A TON of things, here's a list of most of them, from 's readme:

* Attack stuff by:
* Bashing it with their rifle. But they normally avoid it if they can help it. (Melee)

* Can also use berserk packs, if one is somehow in their inventory, which triple their melee damage, and make them more likely to engage in melee.
* Shoot at it, with a random chance of changing position while doing so. (Ranged)

* Throw a grenade at it, more likely to throw it at crowds of enemies. (Area of effect)
* They avoid firing their rifles, grenades, or turrets if their line of fire to the target is blocked by obstacles or allies.

* Run away from the grenades they throw, if those grenades are about to explode.
* Intelligently dodge enemy or extremely harmful projectiles heading their way. More information can be found inside Document.txt

* Dynamically take cover behind sufficiently tall level geometry or shootable actors when attacking enemies. More information can be found inside Document.txt
* Can be set up into squads in which they stick together and follow a designated leader. And can change leaders if the previous one died. More information can be found inside Document.txt

* They have multiple death animations that can play randomly.
* Reload their rifles for every 20 rounds they fire in total.

* They first try a few times to run away from their target until out of sight, to not reload while vulnerable.
* Chase around their target for some time before losing track of it, if they can't hear or see it for too long.

* When not set to friendly, they attack friendly NPCs on sight, unlike normal enemy NPCs/monsters, that don't attack friendly NPCs unless provoked by them first.
* Alert other marines that are on their side of their current target, if the other marines have no target they are dealing with already. They can also hear the alerts of enemy marines.

* Retreat and keep a distance away from very powerful or large enemies like Cyberdemons. Or enemy players and marines on turrets.
* Marines friendly to the player can be ordered to stand still or wander around by pressing use on them. This only works if they aren't currently fighting.

* They work with ZDoom's built-in patrol system, so you can have them walk around set paths. To do stuff like guard areas.*
* Has placeable machine gun turrets that both players and the marines can use, you can press the use key on a friendly marine to get him off of one.

* Includes a separate marine that permanently stays on the turret until killed, who can also be colored like below. Pressing use on them will get them off, if they are friendly, and User_DisobeyCommands is off.
* Can be colored with a variety of colors:

* Red
* Gray

* White
* Black

* Blue
* Yellow

* Orange
* Pink

* Dark Green
* Random (Randomly pick a color.)

* Default (Use the default shade of green. Similar to just leaving User_Color empty.)
* Most of the marines' behaviour can be configured on a per actor basis using user variables.

* They also have a rifle that they sometimes drop, which you can pick up and use yourself.
* The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too.

* It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well.
* The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine.

Information on all the user variables they have can be found inside Document.txt. If I need to split the rifle weapon they drop into a separate submission on the armory section for Realm667, I can do that. But the turret, which is a weapon both the player and the marine NPCs can use, is pretty much inseparable from the rest of the resource.")*

 Alright, [ the 1.3.0 update is finished](https://github.com/inkoalawetrust/Smart-Marines/releases/tag/1.3.0). I had also finished the optimization update I mentioned last week, but didn't update the submission until I finished the new squad system. The information on the squad system is written down in the document.txt file.

This is the final major update to the marines until TG5 finishes the sprites for the rocket launcher armed marines.

Also, here are some screenshots of the marine squads (Only friendly marine squads display icons over their heads.):

 Warning: Spoiler!

 [ ![[img](https://i.imgur.com/6mEjIJj.png) ](https://i.imgur.com/6mEjIJj.png "[img")

 [ ![[img](https://i.imgur.com/A8ZZb1G.png) ](https://i.imgur.com/A8ZZb1G.png "[img")

 [ ![[img](https://i.imgur.com/PZTEFY9.png) ](https://i.imgur.com/PZTEFY9.png "[img")

 [ ![[img](https://i.imgur.com/SrZD2rC.png) ](https://i.imgur.com/SrZD2rC.png "[img")

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzU1LXN1Ym1pc3Npb24tYWktbWFyaW5lcy1pbnRlbGxpZ2VudC1tYXJpbmUtbnBjcz9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **Gothic**
- ![Gothic's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar320.png?1619787674)
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 1329
-
-
-

   4 years 3 weeks ago [\#9847](#9847) by Gothic  Replied by *Gothic* on topic *[\[SUBMISSION\] AI Marines (Intelligent marine NPCs)](https://www.realm667.com/forum/closed-submissions/1755-submission-ai-marines-intelligent-marine-npcs?start=10#9847 "Information:

Name: AI Marines
Difficulty: Easy/Medium, Hard (When on a turret or in groups and squads.)
Connections: None
Summon: SmartMarine, TurretMarine, SmartMarineMGTurret, SM_NoCrouchZone, VanillaRifle
Melee: Yes (Rifle swing, can also use berserk packs if they get in their inventory)
Distance: Hitscan (Rifle), Projectile (Grenades and turrets)
Type: Human, Military
Brightmaps: No
Actor modification: No
ACS: No

Credits:
Code: Inkoalawetrust, Lewisk3 (Base code for making turrets usable by players), Boondorl (Swimmable 3D floor detection)
GLDEFS: inkoalawetrust
Sounds: Valve, FreeSound, GDC Audio Library, edited by Inkoalawetrust etc, check credits.txt
Sprites: id Software, Sergeant_Mark_IV, Ghastly_Dragon, Das M., Superdave938, Mryayayify, Tabijaky, Gorman Freebmane, Inkoalawetrust, TG5, Vader, etc, check credits.txt
Sprite edit: TG5, Tabijaky, inkoalawetrust
Idea Base: Having NPCs in Doom with a higher IQ than a wet towel. Half-Life 1 HECU (Partially)

Description:
A Doom NPC with a brain for a change. They can do dozens of different things, such as avoid danger, work in groups, move in squads, dodge projectiles, take cover and so on, can easily be used as allies by being set to friendly, have multiple weapons, including turrets that both they and players can use, and are highly customizable. For more detailed information on all the stuff they are capable of (A lot), and how to properly and fully use them. Check the included Document.txt file.

Sprite:

Showcase video:
https://www.youtube.com/watch?v=PlZSs5XyEdU

Download Link (Includes a demo map):
https://drive.google.com/file/d/1EIVL8G8sLCLaAOwdDNtrSgNgVAPxoF9B/view?usp=sharing

This is my latest major project, the marines included in this resource are far more intelligent than any of the vanilla monsters, and can do A TON of things, here's a list of most of them, from 's readme:

* Attack stuff by:
* Bashing it with their rifle. But they normally avoid it if they can help it. (Melee)

* Can also use berserk packs, if one is somehow in their inventory, which triple their melee damage, and make them more likely to engage in melee.
* Shoot at it, with a random chance of changing position while doing so. (Ranged)

* Throw a grenade at it, more likely to throw it at crowds of enemies. (Area of effect)
* They avoid firing their rifles, grenades, or turrets if their line of fire to the target is blocked by obstacles or allies.

* Run away from the grenades they throw, if those grenades are about to explode.
* Intelligently dodge enemy or extremely harmful projectiles heading their way. More information can be found inside Document.txt

* Dynamically take cover behind sufficiently tall level geometry or shootable actors when attacking enemies. More information can be found inside Document.txt
* Can be set up into squads in which they stick together and follow a designated leader. And can change leaders if the previous one died. More information can be found inside Document.txt

* They have multiple death animations that can play randomly.
* Reload their rifles for every 20 rounds they fire in total.

* They first try a few times to run away from their target until out of sight, to not reload while vulnerable.
* Chase around their target for some time before losing track of it, if they can't hear or see it for too long.

* When not set to friendly, they attack friendly NPCs on sight, unlike normal enemy NPCs/monsters, that don't attack friendly NPCs unless provoked by them first.
* Alert other marines that are on their side of their current target, if the other marines have no target they are dealing with already. They can also hear the alerts of enemy marines.

* Retreat and keep a distance away from very powerful or large enemies like Cyberdemons. Or enemy players and marines on turrets.
* Marines friendly to the player can be ordered to stand still or wander around by pressing use on them. This only works if they aren't currently fighting.

* They work with ZDoom's built-in patrol system, so you can have them walk around set paths. To do stuff like guard areas.*
* Has placeable machine gun turrets that both players and the marines can use, you can press the use key on a friendly marine to get him off of one.

* Includes a separate marine that permanently stays on the turret until killed, who can also be colored like below. Pressing use on them will get them off, if they are friendly, and User_DisobeyCommands is off.
* Can be colored with a variety of colors:

* Red
* Gray

* White
* Black

* Blue
* Yellow

* Orange
* Pink

* Dark Green
* Random (Randomly pick a color.)

* Default (Use the default shade of green. Similar to just leaving User_Color empty.)
* Most of the marines' behaviour can be configured on a per actor basis using user variables.

* They also have a rifle that they sometimes drop, which you can pick up and use yourself.
* The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too.

* It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well.
* The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine.

Information on all the user variables they have can be found inside Document.txt. If I need to split the rifle weapon they drop into a separate submission on the armory section for Realm667, I can do that. But the turret, which is a weapon both the player and the marine NPCs can use, is pretty much inseparable from the rest of the resource.")*

 [ Added](https://www.realm667.com/en/beastiary-mainmenu-136-69621/doom-style-mainmenu-105-73113/2462-ai-marines)

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzU1LXN1Ym1pc3Npb24tYWktbWFyaW5lcy1pbnRlbGxpZ2VudC1tYXJpbmUtbnBjcz9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

[Powered by](https://www.realm667.com/forum/credits) [Kunena Forum](https://www.kunena.org)
