header general

[SUBMISSION] AI Marines (Intelligent marine NPCs)

  • inkoalawetrust
  • inkoalawetrust's Avatar Topic Author
  • Moderator
  • Moderator
More
2 years 8 months ago - 2 years 6 months ago #1 by inkoalawetrust
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 their GitHub repository '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.
Last edit: 2 years 6 months ago by inkoalawetrust. Reason: Updated the submission. Again.

Please Log in or Create an account to join the conversation.

  • DBJ87
  • DBJ87's Avatar
  • Wicked
  • Wicked
More
2 years 8 months ago #2 by DBJ87
Been wishing I could've added something like this to my Ally Marines WAD on here WAY back in developmental era, but only reference to go on back then was my general lack of knowledge, Alando1's Friendly Marines WADs (which behaved like mine do) & Brutal Doom (older version than what's around now by at least 3-4 years which had the basics for behaviour without an enemy in sight, sticking close to the player when needed & not shooting the player, best I could get in reference to that was the added states to "Patrol" or basically, wonder around aimlessly like a Strife NPC until a new enemy is in sight).

If you want to add some extra marines (more melee weapons, shotgunners, explosives & energy weapons* feel free to use them  . This is fantastic work! 

**I have more, but not submitted & up until now, I was considering to update my current submission with the full roster, including a Jetpack user, Ally Tank driver, Riot Shield w/ Pistol & more varieties of shotgunner, plasma weapon users & other explosives from Realm 667 such as the Hellstorm Cannon, Freeze Rifle & Quad-Shotgun. But seeing this, I think it's better to leave what I have & the risk of having over 32 marines in 1 file is a bit too much on paper & had been putting me off in the past, no way I could get them to the expected ZScript format either without help too)

Please Log in or Create an account to join the conversation.

  • CaptainToenail
  • CaptainToenail's Avatar
  • Wicked
  • Wicked
More
2 years 8 months ago #3 by CaptainToenail
Replied by CaptainToenail on topic [SUBMISSION] AI Marines (Intelligent marine NPCs)
This looks very impressive, nice work!

Would be cool to adapt this to the Strife rebels and guards and have an epic battle.

Please Log in or Create an account to join the conversation.

  • inkoalawetrust
  • inkoalawetrust's Avatar Topic Author
  • Moderator
  • Moderator
More
2 years 8 months ago #4 by inkoalawetrust
Replied by inkoalawetrust on topic [SUBMISSION] AI Marines (Intelligent marine NPCs)

Been wishing I could've added something like this to my Ally Marines WAD on here WAY back in developmental era, but only reference to go on back then was my general lack of knowledge, Alando1's Friendly Marines WADs (which behaved like mine do) & Brutal Doom (older version than what's around now by at least 3-4 years which had the basics for behaviour without an enemy in sight, sticking close to the player when needed & not shooting the player, best I could get in reference to that was the added states to "Patrol" or basically, wonder around aimlessly like a Strife NPC until a new enemy is in sight).
 
Yeah, your resource was one of the inspirations for this mod. And IIRC, the palette translations you can set using the User_Color variable, are also based on yours. I've used your resource on some of my projects too, like using a modified version of your marines for my APC NPC to drop . I was going to submit the APC last year too, like I did with the tank, but couldn't until I finished my own marine NPC. Except that it has been so long since then, that I'll now instead just be totally remaking the tank and APC instead. Since in hindsight, they are both really janky.

If you want to add some extra marines (more melee weapons, shotgunners, explosives & energy weapons* feel free to use them 

. This is fantastic work! 

I don't plan on adding many more marines, the first reason is that I spent an entire year trying to get this mod to not fall apart in a biblical flood of bugs and undefined behavior, and have had to rewrite it six times . Much to the dismay of my sanity.* The second reason is that if it's not obvious yet, I'm really going for quality over quantity here, plus I'd need a lot of sprites, for example, I do want to make a second (third ?) marine armed with a rocket launcher, that is as complex and in-depth as the normal marines, but while I do have sprites of the rocket marine walking around with the launcher . I also need sprites of him kneeling down and firing, and also sprites of him placing the launcher on his back and getting out a pistol to fire. As a secondary attack for when he is too close to his target to be able to fire the launcher at him.

**I have more, but not submitted & up until now, I was considering to update my current submission with the full roster, including a Jetpack user, Ally Tank driver, Riot Shield w/ Pistol & more varieties of shotgunner, plasma weapon users & other explosives from Realm 667 such as the Hellstorm Cannon, Freeze Rifle & Quad-Shotgun. But seeing this, I think it's better to leave what I have & the risk of having over 32 marines in 1 file is a bit too much on paper & had been putting me off in the past, no way I could get them to the expected ZScript format either without help too)

I think you should submit the new update, even if you don't want to add all the additional marine types in. I still think you should add the Jetpack, tank, and riot shield marine. Since they are distinct and interesting enough additions on their own. Also, you don't NEED to make them in ZScript, you can still use DECORATE for submissions. But if you do want to make them in ZScript, then I could probably help you with that.

*The previous fifth iteration of the mod was especially painful, because I had fully finished it. And THEN it fell apart. Causing me to become even more salty and bitter than the marines had ever made me before, and trust me. I have screamed out loud MANY times when the marines kept doing some nonsense, like completely ignoring an enemy in front of them that is mauling them to death.

Please Log in or Create an account to join the conversation.

  • Gothic
  • Gothic's Avatar
  • Moderator
  • Moderator
More
2 years 7 months ago #5 by Gothic
You're gonna need a demonstration map to showcase their AI, so modders have a better grasp on how to use them ingame. Doesn't need to be as detailed as the map on your video.
The rifle and turret could be submitted later as weapons for the Armory if you want to.
Also when I downloaded your pk3, Slade3 couldn't open because of an unsupported compression method, so I had to extract and re-zip it.

Please Log in or Create an account to join the conversation.

  • inkoalawetrust
  • inkoalawetrust's Avatar Topic Author
  • Moderator
  • Moderator
More
2 years 7 months ago #6 by inkoalawetrust
Replied by inkoalawetrust on topic [SUBMISSION] AI Marines (Intelligent marine NPCs)

You're gonna need a demonstration map to showcase their AI, so modders have a better grasp on how to use them ingame. Doesn't need to be as detailed as the map on your video.
 
Alright, I'm currently working on a pull request for Project Brutality that adds proper editor support for the mod. When I finish that I'll make a demo map.

The rifle and turret could be submitted later as weapons for the Armory if you want to.

I could make the rifle into a separate actor that is connected to the marines, though for the sake of simplicity for both myself and the code I'd rather not do that. But I probably have to anyway. But the turret can't be separated because like I said in the OP, it's basically inseparable from the NPC.

Also when I downloaded your pk3, Slade3 couldn't open because of an unsupported compression method, so I had to extract and re-zip it.

I think this may be caused because I compressed the PK3 using LZMA compression instead of DEFLATE, since the former is better. So I'll recompress it using DEFLATE.

Please Log in or Create an account to join the conversation.

  • inkoalawetrust
  • inkoalawetrust's Avatar Topic Author
  • Moderator
  • Moderator
More
2 years 7 months ago #7 by inkoalawetrust
Replied by inkoalawetrust on topic [SUBMISSION] AI Marines (Intelligent marine NPCs)
Alright, so while I was working on my pull request for Project Brutality, YouTube had begun recommending the showcase video for the submission, the one in the original post. So now it has over 80,000 views and thousands of eyes looking at me.

So because the development of the submission was already one year of suffering. Along with the anxiety that comes from becoming popular overnight. And many other factors that are just making things worse and worse for me mentally. Working on the demo map is really slow. Despite the map basically just being some basic rooms showcasing each major feature of the marine.



I feel like I should take another week long break. Even though I had taken one after finally finishing the marines and their video two weeks ago.

Please Log in or Create an account to join the conversation.

  • inkoalawetrust
  • inkoalawetrust's Avatar Topic Author
  • Moderator
  • Moderator
More
2 years 7 months ago - 2 years 7 months ago #8 by inkoalawetrust
Replied by inkoalawetrust on topic [SUBMISSION] AI Marines (Intelligent marine NPCs)
Alright, I have finished the demonstration map. And also made a few minor updates to the marine. Mostly fixes for some bugs.

Unlike the demo map that I had made for the tank. This demo map is mostly a bunch of unrelated abstract rooms connected together by corridors, that demonstrate each of the major features of the marine. Except for a few sections of the map, such as the section that covers the player and marine usable turrets included in the submission. That one takes place on a beach, and has you trying to get up a hill that has two squads of marines stationed and attacking you.



I have updated the download link in the original post to link to the new version. Since Google Driver considers the identically name LZMA and DEFLATE compressed archives to be different files. So it didn't treat the new version as, well, a new version of the original submission.

The changelog for the marine is here: https://github.com/inkoalawetrust/Smart-Marines/releases
Last edit: 2 years 7 months ago by inkoalawetrust.

Please Log in or Create an account to join the conversation.

  • inkoalawetrust
  • inkoalawetrust's Avatar Topic Author
  • Moderator
  • Moderator
More
2 years 7 months ago - 2 years 7 months ago #9 by inkoalawetrust
Replied by inkoalawetrust on topic [SUBMISSION] AI Marines (Intelligent marine NPCs)
Alright, I've made a few updates to the marine NPC since last time. Besides bug fixes like preventing players from commanding dormant marines. The biggest addition is that I have finally discovered a way to detect projectiles without either making invasive changes to the game that break mod compatibility, which means that marines can now intelligently jump out of the way of projectiles. Including not jumping in directions with things impeding the marines movement, such as walls or tall ledges.

This behavior is also configurable by the User_DodgeRange user variable. Which allows you to extend or lower the range in which marines detect projectiles. Or can be set to a value of -1 to turn off dodging entirely again. There is a longer and more detailed description of how the dodging behavior works in Document.txt.

Here's a clip of an early version of the dodging in action. The many debug messages being printed in the console that you see are not in the final version (Obviously):

https://streamable.com/45oxbt

I have also updated the demo map with a room to demo the dodging mechanic. And have also included the map as part of the submission. Which also means that the map is finally public. Because apparently I forgot to actually link the map last week.
Last edit: 2 years 7 months ago by inkoalawetrust.

Please Log in or Create an account to join the conversation.

  • inkoalawetrust
  • inkoalawetrust's Avatar Topic Author
  • Moderator
  • Moderator
More
2 years 6 months ago - 2 years 6 months ago #10 by inkoalawetrust
Replied by inkoalawetrust on topic [SUBMISSION] AI Marines (Intelligent marine NPCs)
I have made the marines able to also have a chance to shoot while jumping away from a projectile. They will try shooting at the projectiles' shooter, unless the projectile doesn't exist anymore, has no shooter attached to it, or the shooter is actually friendly to the marine. In which case the marine will instead shoot in mid air at his target. And if he has no target either, he just doesn't shoot.

In addition, they shoot faster while dodging, in exchange for accuracy, since they are hip firing while in mid air, marines will still be able to run out of ammo, in which case the rifles' clicking sound will play too. There's also a small easter egg that occurs sometimes when they dodge.

The primary reason I added this, is so marines won't be pretty much useless if fighting an enemy that spams a lot of projectiles in rapid succession, like the Paladin , or the plasma gun marine from DBJ87's Allied Marines Pack.  Previously just one plasma gun marine from his pack could kill 4 of my marines, by cheesing them with making them dodge plasma balls constantly until they whittle down their health.



I am also currently working on a system that actually makes the marines crouch behind cover dynamically, they won't be able to deliberately pathfind their way behind cover though, since GZDoom has no pathfinding system. And I sure as hell don't know how to write one. I'll make another post here or update this one when the crouching is done.

Last edit: 2 years 6 months ago by inkoalawetrust.

Please Log in or Create an account to join the conversation.