Raised This Month: $12 Target: $400
 3% 

Create functional NPC? (Boss-like, player-like)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 05-14-2021 , 17:13   Create functional NPC? (Boss-like, player-like)
Reply With Quote #1

Hello, i've been searching information about NPCs here in alliedmods, but still haven't found anything useful to achieve what i really need to do.

The idea is the following one:
- Im trying to make a replica of players, that has a pattern to hide in places, attack other entities and simulates to be a player, but NOT A BOT.

My idea's heart is to create a gamemode that you can play being alone in the server, creating waves of attackers while you have to survive.

These attackers cannot be bots, because they consume an actual slot in the server, so.. they must be NPCs.

But.. that's a very complex task to achieve this, i've found some includes, even modules with API that can create NPCs very easily, but the physics are not even close to be fine..

Those are the issues i found with that:
1. When you set the npc to be offensive to players, they approach players but if the player is at a mountain, and the npc is in the floor, it will fly towards the player.
2. No animation controller.
3. No pathroute can be defined so they look like common enemies.

And some more, does anyone have any piece of code or idea that figures this out?

I would thank a lot (and obviously release the final code when achieved)!!

This is from @rogeraabbccdd: https://github.com/rogeraabbccdd/CSGO-Monster-API
__________________
Massive Infection:: Piu-Games

Last edited by Desktop; 05-14-2021 at 17:16.
Desktop is offline
tpr
Junior Member
Join Date: Aug 2014
Location: where my heart is
Old 05-17-2021 , 18:31   Re: Create functional NPC? (Boss-like, player-like)
Reply With Quote #2

Quote:
Originally Posted by Desktop View Post
Hello, i've been searching information about NPCs here in alliedmods, but still haven't found anything useful to achieve what i really need to do.

The idea is the following one:
- Im trying to make a replica of players, that has a pattern to hide in places, attack other entities and simulates to be a player, but NOT A BOT.

My idea's heart is to create a gamemode that you can play being alone in the server, creating waves of attackers while you have to survive.

These attackers cannot be bots, because they consume an actual slot in the server, so.. they must be NPCs.

But.. that's a very complex task to achieve this, i've found some includes, even modules with API that can create NPCs very easily, but the physics are not even close to be fine..

Those are the issues i found with that:
1. When you set the npc to be offensive to players, they approach players but if the player is at a mountain, and the npc is in the floor, it will fly towards the player.
2. No animation controller.
3. No pathroute can be defined so they look like common enemies.

And some more, does anyone have any piece of code or idea that figures this out?

I would thank a lot (and obviously release the final code when achieved)!!

This is from @rogeraabbccdd: https://github.com/rogeraabbccdd/CSGO-Monster-API

Nice Idea.

I had this idea too .

I will give it a try for CsS.


For 1 : Maybe you can force NPCs to attack the players that are near to them and not too higher !?
for example not higher than 1 meter ?
__________________
Mireda

Last edited by tpr; 05-17-2021 at 18:35.
tpr is offline
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 05-18-2021 , 00:39   Re: Create functional NPC? (Boss-like, player-like)
Reply With Quote #3

Found some info:

- Creating a "monster" with the code attached in the previous post isn't really performant as it updates OnGameFrame, so, high resource demand is a fact.
- Func_track_train is not fully working in CSGO.
- Maybe creating a timer to update the entity is needed to create smart-like behaviour.
- Animating isn't as easy as i thought, but i added another ELSE so i can change animation's playbackrate:

PHP Code:
else if (StrEqual(attribute"playbackrate")){
            
            
float speed StringToFloat(value);
            
SetVariantFloat(speed);
            
AcceptEntityInput(monster"SetPlaybackRate");
            
SetArrayCell(MonsterPlayBackRatemIndexspeed);
        } 
This will help to use "move_knife_w" animation and make it walk forward instead of backward.

Still haven't tried it all, nor studied it all, but, path_track isn't a reliable option it seems.

And TrainTrack plugin (category ANY) isn't properly working, just couldn't make any model to follow a path_track, it just disappears doing nothing.
__________________
Massive Infection:: Piu-Games
Desktop is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 05-18-2021 , 07:14   Re: Create functional NPC? (Boss-like, player-like)
Reply With Quote #4

Maybe you get some inspiration by following this:

https://forums.alliedmods.net/showth...unc_tracktrain

path_track, func_tracktrain working Well in CSGO...
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<

Last edited by andi67; 05-18-2021 at 07:18.
andi67 is offline
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 05-18-2021 , 16:30   Re: Create functional NPC? (Boss-like, player-like)
Reply With Quote #5

I tried to use that, Stugger's plugin is based on that and seems to work fine in the video he uploaded

https://forums.alliedmods.net/showthread.php?t=318751


Tried creating a path and a train with that plugin and the behaviour is strange, it creates the track, the cans appear, but when i start the train it just makes cans disappear, no model is shown there.
(Yeah, i have set a model before that)

Console:
Setting CBaseEntity to non-brush model models/props/cs_office/vending_machine.mdl
PrecacheScriptSound 'none' failed, no such sound script entry
Dynamic prop [U:1:108073217]_trainprop0: no sequence named:idle
func_track_train must be on a path of path_track

Video of what i got
https://youtu.be/_GIV9FHuS2Q
__________________
Massive Infection:: Piu-Games

Last edited by Desktop; 05-18-2021 at 16:48.
Desktop is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 05-19-2021 , 15:20   Re: Create functional NPC? (Boss-like, player-like)
Reply With Quote #6

When I get home I could give you a working example....
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 05-20-2021 , 06:35   Re: Create functional NPC? (Boss-like, player-like)
Reply With Quote #7

So here is something I was working on for while but havenīt finished ....just upload all to your server and the material-/modelfiles to game- and fastdownloadserver..
Inside the sourcemod/sm_vec datafolder there is a generated navfile for de_lake , load the de_lake map than write in chat !test. A tank will spawn on the map in the near of the houses/rocks, to make it moving you need to go near the tank....
Attached Files
File Type: zip test.zip (3.12 MB, 54 views)
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 05-21-2021 , 01:52   Re: Create functional NPC? (Boss-like, player-like)
Reply With Quote #8

Quote:
Originally Posted by andi67 View Post
So here is something I was working on for while but havenīt finished ....just upload all to your server and the material-/modelfiles to game- and fastdownloadserver..
Inside the sourcemod/sm_vec datafolder there is a generated navfile for de_lake , load the de_lake map than write in chat !test. A tank will spawn on the map in the near of the houses/rocks, to make it moving you need to go near the tank....
Nice! im testing it, but i couldn't make it move, since i think the model cannot detect OnStartTouch, because i see it entirely black (no textures)
__________________
Massive Infection:: Piu-Games
Desktop is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 05-21-2021 , 02:46   Re: Create functional NPC? (Boss-like, player-like)
Reply With Quote #9

Well you can look at the code and see how path_tracks work...

Check ⁴if the files for the model are on Web and gameserver...sv_pure 0...


edit: added short video.

https://www.youtube.com/watch?v=pyRyy0Kwh3o
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<

Last edited by andi67; 05-21-2021 at 07:15.
andi67 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode