NPCs and Dedicated servers

  • Thread starter Thread starter JohnnyJigglez
  • Start date Start date
J

JohnnyJigglez

Guest
Am I to understand that this is impossible?
In my dedicated server console:

npc_create npc_anynpchere = server crash

If so, then the post(s) that have been made in regards to creating npcs in servers need to be appended with the following disclaimer:

This works on listen servers only.

I have made numerous attempts at facilitating the creation of an antlion or headcrab in my dedicated HL2DM server, with no success. Has anyone else had this difficulty, if you have not have had this difficulty, could you post a solution for the rest of us?

EDIT: using rcon commands as a client to said dedicated server also results in a server crash.
 
you cant do it with the server itself. Anyone can do it in game however. The only reason listen servers work is because you are technically doing it through the game not the server when you go into console


one thing you may notice is that if you type status in console, you will see the position of the server, which is always 0,0,0. This might be the cause.
 
Anyone can do it on the clientside?
That would be true if the rcon_password wasn't set...

At any rate, I'm implying that the CC: npc_create does not work on dedicated servers. I HAVE rconed to my own server and the server will crash, and my client will sit there trying to reconnect to a crashed server.

Again, can this be verified?
Any suggestions?

my test setup:
Source Dedicated Server: Teamplay Deathmatch
Map: dm_overwatch
Rcon password: cheese
no commands entered on dedicated server console

Client commands parsed:
rcon_password cheese
rcon sv_cheats 1
rcon sk_antlion_health 100
rcon sk_antlion_swipe_damage 10
rcon sk_antlion_jump_damage 20
rcon npc_create npc_antlion (intended to spawn at the crosshair)
SERVER CRASH

Does anyone else have this problem?
 
I figured out how to do it.

BUT, now there are no sounds being emitted from the npcs. NOt a peep, even the heli bombs make no sound.

Anyone else have this problem?
 
hey... I haven't experienced the same problem... but I haven't played much with dedicated servers and HL2... IM me on AIM/AOL at Jimbro727 when you see me online and I'll join your server and see if I can figure out what's up for ya.

I know that you figured out the NPC spawning thing, but incase it wasn't already made clear, and because it's obvious you read my tutorial and got all pissed off because you couldn't do it: npc_create is not a server command (but those sk variables have to be set server side). You don't need rcon for it to work, you need sv_cheats to be set to 1. In fact, using rcon COULD cause the server to crash, i'm not sure, but also note that spawning NPCs is not a science.. you're not supposed to be able to spawn them in DM, or any other mod, for that matter, we're just messing with the source engine. So, sometimes you'll try to do something, and the game will crash.. some common offenders (so you don't do them and complain) are using "impulse 203" on players, using alt fire from the pulse rifle on an NPC, and using npc_create with weapons. All of these will crash the server... as will random things, such as spawning alot of NPCs and them blowing them up (simply spawning alot could crash the server, too)... so I mean, i'm not saying that you're not experiencing a real problem that should be looked at, but I am saying that if things don't work perfectly, it's because it's not supposed to... NPC spawning and messing with the source engin in other people's mods isn't a feature of the game, it's a perk of the engine.

In any event.. i'll take a look at your sound issue, maybe you've discovered a bug or something.

--Jimbro
 
Well that was an... interesting read. I must say, your tutorial was a definite step in the right direction. Most of the tutorials on the web in regards to dm do not say a thing about the differences between using CCs and Cvars in dedicated and listen servers. I don't quite understand why you think that I got "all pissed off" but I suppose I should tell you that I'm only upset over the fact that npc sounds are not working in dedicated servers.(nothing to do with you, but another crack in the source engine) I suppose this is because a dedicated server should not, and does need to load the sounds that would take up valuable ram serverside. I don't really know, that's why I'd thought I'd ask around. Seems like it matters to you somewhat, with your lengthly tutorial there and all.

Still, I ran a bit of testing with other players using my homebrew spawning script... listen servers are a blast, providing we don't use AR2 altfire'o death (and server crash!) dedicated servers are a dud with the sound not working...

Tell me what you think.
 
hehehe hey! See that's the problem with conversing in forums or via instant message.. you can't tell the tone in the other person's voice.. i was being sarcastic hahaha... and I take it you weren't being angry.. in any event... i'd be upset too if I couldn't get NPC sound to work (there's nothing more satisfying than hearing alyx gasp as you kill her hahahah) :D Your theory about dedicated servers and sounds seems like a good one... do you get any console output when an NPC is supposed to speak? If not, on the dedicated server, set developer to 2 (developer 2 in console) and then spawn an NPC, do something that would normally make it respond with some sort of sound, and see if there's any console output on the server. Anything that you see, even if you think it's unimportant, post it on this thread, maybe myself or someone else can help find the problem :)

--Jimbro
 
I should have known you're being sarcastic, I'm way too serious...

I always keep my developer mode on when doing this testing, and yes, the dedicated servers give console errors to the effect it can find the target sound files of the npc entity's function calls.
Below is the spewing of my dedicated server console. I have highlighted the problem.

The commands are scripted as noted in the linked forum post above.

"[AE] 7769 *TKZ*<STEAM_ID_LAN>" STEAM USERID validated
Compressing fragments (6381 -> 6165 bytes)
input <NULL>: weapon_pistol.HideWeapon()
input <NULL>: weapon_stunstick.HideWeapon()
unhandled input: (OnPlayerJoin) -> (game_player_manager), from (player,); target entity not found
unhandled input: (OnPlayerSpawn) -> (game_player_manager), from (player,); target entity not found
CSoundEmitterSystemBase::GetParametersForSound: No such sound NPC_CombineS***nFootstepLeft
CSoundEmitterSystemBase::GetParametersForSound: No such sound NPC_CombineS***nFootstepRight
rcon from "192.168.1.101:1166": command ""sv_cheats" "1""
rcon from "192.168.1.101:1166": command ""sk_antlion_health" "150""
rcon from "192.168.1.101:1166": command ""sk_antlion_jump_damage" "30""
rcon from "192.168.1.101:1166": command ""sk_antlion_swipe_damage" "15""
rcon from "192.168.1.101:1166": command ""sk_antlionguard_health" "1500""
rcon from "192.168.1.101:1166": command ""sk_antlionguard_dmg_charge" "99""
rcon from "192.168.1.101:1166": command ""sk_antlionguard_dmg_shove" "33""
rcon from "192.168.1.101:1166": command ""sk_headcrab_health" "25""
rcon from "192.168.1.101:1166": command ""sk_headcrab_melee_dmg" "10""
FCVAR_CHEAT cvars reverted to defaults.
rcon from "192.168.1.101:1166": command ""sv_cheats" "0""
rcon from "192.168.1.101:1166": command ""sv_cheats" "1""
loading models/combine_helicopter/helicopter_bomb01.mdl
PrecacheScriptSound 'NPC_AttackHelicopterGrenade.Ping' failed, no such sound script entry
FCVAR_CHEAT cvars reverted to defaults.
rcon from "192.168.1.101:1166": command ""sv_cheats" "0""
CSoundEmitterSystemBase::GetParametersForSound: No such sound NPC_AttackHelicopterGrenade.Ping
input <NULL>: env_explosion.Explode()
input <NULL>: weapon_physcannon.HideWeapon()
rcon from "192.168.1.101:1166": command ""sv_cheats" "1""
loading models/headcrabclassic.mdl
PrecacheScriptSound 'NPC_HeadCrab.Gib' failed, no such sound script entry
PrecacheScriptSound 'NPC_HeadCrab.Idle' failed, no such sound script entry
PrecacheScriptSound 'NPC_HeadCrab.Alert' failed, no such sound script entry
PrecacheScriptSound 'NPC_HeadCrab.Pain' failed, no such sound script entry
PrecacheScriptSound 'NPC_HeadCrab.Die' failed, no such sound script entry
PrecacheScriptSound 'NPC_HeadCrab.Attack' failed, no such sound script entry
PrecacheScriptSound 'NPC_HeadCrab.Bite' failed, no such sound script entry
PrecacheScriptSound 'NPC_Headcrab.BurrowIn' failed, no such sound script entry
PrecacheScriptSound 'NPC_Headcrab.BurrowOut' failed, no such sound script entry

Found npc_headcrab that isn't in a squad
input : npc_headcrab.setrelationship(player D_HT 99)
input : npc_headcrab.setrelationship(npc_antlionguard D_HT 99)
FCVAR_CHEAT cvars reverted to defaults.
rcon from "192.168.1.101:1166": command ""sv_cheats" "0""
CSoundEmitterSystemBase::GetParametersForSound: No such sound NPC_HeadCrab.Idle

I npc_created the helicopter bomb and a headcrab using my script.

Anyone have any clue as to how to load these sounds?
 
After spending a bit of time with the issue, I stumbled upon a script file in the sdk directory for the source engine. This file contained a list of all the player sounds used in hl2. these were only a few, just player sounds. I realized I needed to open the gcf files to find out what is going on with these easy-to-read sound scripts... that are not present in the sdk.
With some investigation, I discovered that while the script directory within the source dedicated server.gcf contained a "game_sounds_manifest" script, this manifest was the exact copy of one in the hl2 game content.gcf
Still, with the npc_sounds_headcrab script listed in the manifest, there was NO FILE listed in the dedicated server directory or in the corresponding gcf. And it so happens that hl2dm uses most of the files from the normal hl2 content gcf. I was assured of the fact that a dedicated server, in ANY of the source titles, would not include certain game content from those games.
With this in mind, I extracted the npc_sounds_headcrab script from the hl2 content (or is it source?) gcf and placed it in my source dedicated server/ hl2dm/scripts/ directory. you have to create the scripts directory...

SUCCESS!!!

Sounds for a variety of the game's entities can now be used in multiplay with the addition of a few files that are included in HL2DM clientside. Technically, a dedicated server is aurally castrated. For people that do not wish to physically extract the scripts, I will be hosting them in the near future on another forum.
This way, my cfg files and bindings for my monster script will work perfectly WITH sounds on a dedicated server... Since there are no actual coded mods out there yet for monster inclusion.

Perhaps soon I can also find a way to simply create path points so npc ai will function properly.

Some admins want monsters, without having to resort to a fully featured "sven coop" type game mod.
 
ahh excellent work! Definitely start a new thread, with a tutorial, similar to your last post, on how to fix the problem, it would be greatly appreciated by the community. The amount of people who know how to spawn and use NPCs are small, and the number that do it on dedicated servers are even smaller, so that's probably why this hasn't been discovered yet. I'd also make Valve aware of the issue, if they care :D

As far as waypoints go, I'd definitely like to see it.. and would be willing to help.. there would be nothing cooler than setting up waypoints to get a chopper to circle a map looking for players to kill.. hehe :D Do you currently know how to place path points, or is this just an idea in the working? If you do, pleasee let me know.. even if it's not yet automated, I'd be interested in knowing how to do it manually.

And yes, it is very true that admins would like monsters.. if we could work out the flaws.. it would be nice to place them around the map.. maybe get them on teams.. have them engage in battle.. I mean it's limitless.. one thing that I love about the new engine is its AI capabilities.. and I see no reason why that should be limited to single player..

Excellent work!

--Jim
 
I read over something in another forum about how someone got path points in a map. Does anyone know what an AIN file does? Someone out in the great cybervoid wrote that its an AI Navigation file for every dm map (though, its normally blank...)

The week begins soon, so don't expect too much tomorrow. I will be looking into pathing. Its because there are no nav-path entities that the strider and helicopter and flying things don't move. Furthermore, the ground npcs like headcrabs have a hard time reaching players because they lack path points to help them go upstairs and such. If I had the map srcs in front of me, it would be a walk in a park, but all we have is lockdown.
 
Hmmm.. i did a search for .ain files in my valve folder, hoping to turn up some .ain files for the single player game, but I found the following in every file:

Code:
Version	27
NumNodes:         0
TotalNumLinks      0

Except for one file, cs_assault_lith.ain in valve/steam/steamapps/name/counter-strike source/cstrike/maps/graphs/. Why this map has an ain file is beyond me (i'll be looking into that, too), but at least we can get a look at what one may look like.. perhaps CS maps need this .ain file to tell the bots where to go... it's 14KB of text, so here's an excerpt from the top:

Code:
Version	27
NumNodes:         95
-1450.47,2456.83,276.00 0.000000 -19.87 0.13 -19.87 -19.87 -19.87 -19.87 -15.87 -19.87 18.13 2 0 4 1 -1434.49,2640.00,276.00 0.000000 -19.87 0.13 -19.87 -19.87 -19.87 -19.87 -15.87 -19.87 18.13 2 0 4 2 -1257.07,2634.89,276.00 0.000000 -19.87 0.13 -19.87 -19.87 -19.87 -19.87 -15.87 -19.87 18.13 2 0 4 2 -1255.90,2434.75,276.00 0.000000 -19.87 0.13 -19.87 -19.87 -19.87 -19.87 -15.87 -19.87 18.13 2 0 4 2 -1089.15,2425.25,265.00 0.000000 -8.87 11.13 -8.87 -8.87 -8.87 -8.87 -4.87 -8.87 29.13 2 0 4 2 -1081.16,2524.93,265.00 0.000000 -8.87 11.13 -8.87 -8.87 -8.87 -8.87 -4.87 -8.87 29.13 2 0 4 2 -917.33,2521.32,265.00 0.000000 -8.87 11.13 -8.87 -8.87 -8.87 -8.87 -4.87 -8.87 29.13 2 0 4 3 -654.43,2518.22,265.00 0.000000 -8.87 11.13 -8.87 -8.87 -8.87 -8.87 -4.87 -8.87 29.13 2 0 4 3


Towards the bottom, the format of the file changes.. here's an excerpt from that:

Code:
TotalNumLinks      182
0 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 3 1 1 1 1 1 1 1 1 1 3 4 1 1 1 1 1 1 1 1 1 4 5 1 1 1 1 1 1 1 1 1 5 6 1 1 1 1 1 1 1 1 1 6 7 1 1 1 1 1 1 1 1 1 6 20 2 0 2 2 0 0 2 0 0 7 8 1 1 1 1 1 1 1 1 1 7 16 0 0 0 0 0 0 2 0 0 8 9 1 1 1 1 1 1 1 0 1 8 16 2 2 2 2 2 2 2 0 0 9 10 1 1 1 1 1 1 1 1 1 10 11 1 1 1 1 1 1 1 0 1 11 12 1 1 1 1 1 1 1 0 1 12 13 1 1 1 1 1 1 1 0 1 13 14 1 1 1 1 1 1 1 0 1 14 15 1 1 1 1 1 1 1 0 1 14 21 0 0 0 0 0 0 1 0 0 15 16 1 1 1 1 1 1 1 1 1 15 18 0 2 0 2 0 0 2 0 0 15 19 2 2 2 2 2 2 2 0 0 15 20 1 1 1 1 1 1 1 1 1 15 22 1 1 1 1 0 1 1 0 0 16 17 1 1 1 1 1 1 1 1 1 16 19 1 2 1 1 2 1 1 0 0 16 20 1 1 1 1 1 1 1 1 1 16 21 1 1 1 1 1 1 1 1 1 16 25 2 2 2 2 2 2 2 0 0 16 86 2 2 2 2 2 2 2 2 2 17 18 1 1 1 1 0 1 1 0 0 17 19 0 0 0 2 0 0 2 0 0 17 20 1 1 1 1 1 1 1 1 1 17 21 1 1 1 1 1 1 1 1 1 17 24 2 2 2 2 2 2 2 2 2 17 86 2 2 2 2 2 2 2 2 2 17 87 2 2 2 2 2 2 2 2 2 18 19 1 1 1 1 1 1 1 1 1 18 20 0 2 0 2 0 2 2 0 0 18 86 2 2 2 2 2 2 2 0 2 18 87 2 2 2 2 2 2 2 2 2 19 20 1 1 1 1 1 1 1 1 1 21 22 1 1 1 1 1 1 1 1 1 21 24 2 2 2 2 2 2 2 2 2 21 85 2 2 2 2 2 2 2 2 2 21 86 2 2 2 2 2 2 2 2 2 21 88 2 2 2 2 2 2 2 0 0 22 23 1 1 1 1 0 1 1 0 0 22 24 2 2 2 2 2 2 2 2 2 22 85 2 2 2 2 2 2 2 2 2 22 86 2 2 2 2 2 2 2 2 2 23 27 2 2 2 2 0 2 2 0 0 23 28 1 1 1 1 0 1 1 0 0 24 25 1 1 1 1 1 1 1 1 1 24 85 1 1 1 1 1 1 1 1 1 24 86 1 1 1 1 1 1 1 1 1 24 89 2 2 2 2 2 2 2 2 2 25 26 1 1 1 1 1 1 1 1 1 25 85 1 1 1 1 1 1 1 1 1 25 88 2 2 2 2 2 2 2 2 2 25 89 2 2 2 2 2 2 2 2 2 25 90 2 2 2 2 2 2 2 2 2 26 27 1 1 1 1 1 1 1 1 1 26 88 2 2 2 2 2 2 2 2 2 26 90 2 2 2 2 2 2 2 2 2 27 28 2 2 2 2 2 2 2 2 2 27 94 1 0 1 1 0 1 1 0 0 29 30 1 1 1 1 1 1 1 1 1 29 94 1 0 1 1 0 1 1 0 0 30 31 1 1 1 1 1 1 1 1 1 31 32 1 1 1 1 1 1 1 1 1 32 33 2 2 2 2 2 2 2 2 2 32 34 2 2 2 2 2 2 2 2 2 33 34 2 2 2 2 2 2 2 2 2 33 37 1 1 1 1 1 1 1 1 1 33 38 1 1 1 1 1 1 1 1 1 34 35 1 1 1 1 1 1 1 1 1 34 38 2 2 2 2 2 2 2 2 2 35 36 1 1 1 1 1 1 1 1 1 35 38 1 2 1 1 2 1 1 2 2 37 38 1 1 1 1 1 1 1 1 1 37 39 1 2 1 1 2 1 1 2 2 37 41 1 1 1 1 1 1 1 1 1 38 39 1 1 1 1 1 1 1 1 1

I don't really know what I'm looking at here... i see some sets of three numbers (seperated by commas), which indicate coordinates in 3-dimensional space.. but I have no idea what the other numbers mean. There are way too many numbers, and they are way too precise to be man made.. so I assume there is some sort of tool that does this for developers.. so I think our search should be for that tool.

--Jim
 
How about you let inquisitive people like us enjoin the engine, and play with it so that we can play the game how we want to.. and you stop bitching. One of the problems with the community is that people like you don't want to learn anything.. it's always well let's just wait for someone else to make this.. svencoop won't even be what we're looking for... if the developers of these mods said.. let's wait for someone else.. we'd still be sitting here with HL1, because there is no way it would have been popular enough to release a sequel..

--Jim
 
If you'd actually read this post you might actually understand why we're doing this.

To reiterate: Sven will be a full blown third party game-type that not every HL2DM server will be running, in fact, the servers will not be HL2DM servers anymore but really Sven servers...
This is a large task for the Sven team, but at least they get around OUR problem by laying down some C++ smack-down.

My question is:
What if an admin could include npcs for fun in an HL2DM game? Perhaps even without having the clients download files and perhaps, a full-blown mod?

I've written this to make sure everyone understands why this post exists, for the exploration and exploitation of NPCs on Dedicated servers. Perhaps to make a tutorial for everyone's gain. Furthermore, I do expect the occasional piece of forum SLIME to come in here to make pathetic and uneducated comments on the matter.

In regards to the information gathered by the knowledgable and "educated" jimbro727,

I think the files are generated by compiling tools during the map building process by the maker. I wish I could find out the specification on the file to determine its use. I still think that each set of coordinates is an ai "node" of some-sort.

Why all this?

After a great deal of investigation into the sdk on these npcs, Valve is using an algorithm for each npc to give it a behavior schedule. I found out why when sometimes when you create an antlion, give it hate towards you, and then go up some stairs or a ledge, it moves away to a wall or corner and attempts a burrow command. Yes. I checked the code, and sure enough, this is an "instinct" that Valve programmed into the antlion. Unfortunately, like most games, npcs in HL2 still need path nodes to help them navigate a map. I've used developer tools to determine this fact. DM maps have no path nodes for the npc behavior scheduler to follow (also known as the "ai"). Without path nodes, the npc will not think to go another way to get to a player (other than within 20 degrees of its facing angle).

I'm only assuming that path nodes will solve the problem. What amazes me is that flying npcs will not move at all, even when given the npc_go Command. Ground npcs will certainly go to where you tell them, so long as that location is in a direct line of sight from the npc.

I'm sure a few people are wondering how the command works, and how I got it to work, I'll post more on that when I have the time.

Here is a list of to-do's:

1. Determine why combine-ball kills against NPCs crash the game. (how, what, when, why)

EDIT: I noticed that it happens after the function for npc-cleanup is called. running devmode on singleplayer vs devmode on DM results in this assertion.

2. Find a way to get the bullets working for the strider and the gunship. (although, their cannons work fine)

3. Slay irrelevant forum slime.

4. Investigate the path/node lackings of npcs and decypher the ain file type. (includes the issues with flying npcs)
 
Yep.. it's slime like that guy that keep me from reading alot of forums.. but this one is just so darned good.. and every once in a while someone like myself meets someone like yourself, who share the same interest, and can now help the community out by making the game a little bit better :D

Anywho.. what you say makes sense about the ain files.. my thoughts exactly.. now to find this tool! I guess we'd need the map source too.. which for now limits us to custom maps and lockdown.. unless we figure out some other way to do it.. maybe an in-game solution or something... I do know that in Garry's Mod, the NPCs react differently than they do in DM.. for example, when you spawn an alyx, she reacts to you.. when you go near her she backs away.. and her body is fully animated... in DM she just stands there.. lifeless.. is this code that Garry wrote, or is this just some simple command that we could be using.. perhaps bringing these NPC's "to life" would be a good start to getting them to do other stuff... just a thought

the to-do list looks great.. I'll get cracking on those items when I get a chance.. it would be great to create a sort of minimod that is in the form of a script.. it would place all of the players on the same team.. spawn NPCs in select (or completely random) spots.. and let the fun begin :) As you said, it's not a full blown mod.. so you don't need a special server.. and it would be the same great DM, just with a little twist.. and the admins could change the script around to be a little different.. so every server runs a slightly different "mod".. plus everyone likes to play against the computer sometimes.. especially when the AI is as sophisticated as it is in HL2.


Just a thought.. I think we should move this to a new thread... you decide if it should remain in this forum.. but at least a new thread.. because it started with a completely different problem.. and we might get more support if we started fresh.. posted what we have so far.. and had a new name for the thread.. just a suggestion..

Good luck! =)

--Jim
 
I've made progress!

I discovered that yes, npcs need nodes for navigation... they need a little help ya know.
Eell, these entities are known as info_node in the mapping world.
I have used hammer before a while back while making TFC maps, so I know how it works. So, using the map source for dm_lockdown in the sdk, I added info_node entities in a circle around the showerroom... hoping that wherever you run to in that area, the NPC will have no problems reaching you behind obstructions... or if you run out of sight.

Sure enough, after doing a non-comprehensive compile on the map, I ran the map in DM and the info_nodes worked.
the npc navigated to my noclipped position... it was really neat when it couldn't get around a wall I made in a doorway, it went around the only way it could... BACKTracking... I was like.. wahoo!!
Furthermore, the AIN file associated with my modified lockdown map grew, and increased by 15 nodes!

I believe the ain file is written during map loadup, not during compilation.

The lockdown map we all know and love/hate has 1 node in it, I'm not sure where, but I can find out.. this is in the ain file on everyone's hl2dm map/graphs directory. So realizing that the map I modified is only different in the info_node area... and the ain file generated is long, and has 15 nodes extra in it, I renamed dm_lockdownmod.ain to dm_lockdown.ain... Hehe, a little basic file renaming.

I fired up hl2dm, I entered the ai_nographrebuild 1 command, and created a server with dm_lockdown... unmodded. Sure enough, the ain file swap works... and now I have dm_lockdown with more intelligent npcs.

The only challenge left is to decypher the ain file and find out what the bytecode means, and then find a way to get airnodes to work (so flying stuff works!!!)
 
What I have been able to decypher


Version 27
NumNodes: 5
//the nodes in order of node id, the node id is generated by the map maker during build.
-3864.00,4944.00,69.00 0.000000 -4.87 15.13 -4.87 -4.87 0.10 -4.87 -0.87 0.10 38.10 2 0 1 0
-3423.25,1817.55,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 0.10 37.13 2 0 4 2 (last digit = linked to how many others nodes?)
-3462.00,1818.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 0.10 38.10 2 0 4 3
-3503.00,1818.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3462.00,1780.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 3
//numlinks != numnodes in Most cases
TotalNumLinks 5
//the first 2 bits signify a link between 2 nodes. in the first case, there is a link between node 1 and node 2.
//the last 2 bits are unknown, but have signficance.
1 2 1 1 1 1 1 1 1 0 0
1 4 1 1 1 1 1 1 1 0 1
2 3 1 1 1 1 1 1 1 0 0
2 4 1 1 1 1 1 1 1 0 0
3 4 1 1 1 1 1 1 1 1 1
//These are node ids for all the nodes in this file.
1000 1436 1437 1440 1441

What I have proven is that the ai bots/npcs use the ain file, and the ain files are made and synced by the server in a multiplayer game. Unfortunately, the LINKS are made in this file too, this makes it very very very hard to artificially construct the file without using HL's built in ain maker.
 
And...
it seems as though the nodes use line of sight, so if you place a node on one side of a wall and another node on the other, they will not be linked. Another big damper on handmaking the file.
 
Excellent, excellent, excellent!! Are the airnodes any different than the regular ones? I haven't actually sat down and looked at all this in game yet.. but it sounds like they would be created in hammer too? I'm also not familiar with HL levels.. but there are a few single player levels that should have these "air nodes".. since I didn't turn up any ain files during my search, I'll assume that the maps and ain files are compiled into some sort of level file.. just a guess, though, since each map doesn't have to be differentiated from each other as they do in DM.. but rather different sections are seperated.. that's why all of a sudden you'll be walking and it'll have to load.. probably because you've entered a new level, and thus a new file has to be loaded..

Anyway.. it seems like these nodes are based upon coordinates.. so wouldn't we be able to figure out coordinates in certain maps, such as steamlab, and just artificially make this ain file? Or write some sort of script to do it for us.. if anyone knows how to mod.. someone could write a simple mod that would allow us to load maps, and then use some tool.. like how Garry's mod replaces the shotty, we could replace the shotty with an "info_node placer".. so we just point and shoot at places where we want to place nodes.. and link them with some other tool.. the mod would have some custom C++ function taht turns the points and links into an ain file.. this would allow us to place nodes in maps that we don't have the source for.. just an idea.. and a request by you modders out there (I do have experience in C++, and alot of programming experience elsewhere.. so when I have time, I might be able to take a look at this and see what I can do).

Anyway... decyphering this ain file is top priority.. and you've already done an awesome job! If I weren't in school right now, I'd be working hard at this, too.. I can't wait until I get back.. haha.. i get home at 9.. hopefully I'll have some progress posted before tomorrow...

Excellent work, man!

--jim :cheers:

Edit: You posted as I was writing this post.. so let me respond to that: That sucks haha... but that's a hammer feature.. what would happen if we were to handmake a link that runs through a wall? I'd assume the AI wouldn't just walk through the wall.. maybe something we should try.. or if we use my in-game idea.. just don't link nodes on opposite sides of walls.. we're bright enough to not do something without software telling us not to
 
Well get this.... I've gone as far as creating my very first, handmade ain file... Back to my little sample file:

Version 27
NumNodes: 5

//the nodes in order of node id, the node id is generated by the map maker during build. the first group of digits is the coordinate of the node on 3 axes. The next number is unknown, the next set of numbers is an angle on each axis, there are 3 sets of 3 axes.m, the next 3 numbers are unknown to me, and the last number is how many nodes this node is linked to.
-3864.00,4944.00,69.00 0.000000 -4.87 15.13 -4.87 -4.87 0.10 -4.87 -0.87 0.10 38.10 2 0 1 0
-3423.25,1817.55,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 0.10 37.13 2 0 4 2 (last digit = linked to how many others nodes?)
-3462.00,1818.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 0.10 38.10 2 0 4 3
-3503.00,1818.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3462.00,1780.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 3

//numlinks != numnodes in Most cases
TotalNumLinks 5
//the first 2 bits signify a link between 2 nodes. in the first case, there is a link between node 1 and node 2.
//the last 2 bits are unknown, but have signficance.
1 2 1 1 1 1 1 1 1 0 0
1 4 1 1 1 1 1 1 1 0 1
2 3 1 1 1 1 1 1 1 0 0
2 4 1 1 1 1 1 1 1 0 0
3 4 1 1 1 1 1 1 1 1 1
//These are node ids for all the nodes in this file.
1000 1436 1437 1440 1441

With this information, I made the following file, with no help from an editor.

Version 27
NumNodes: 16
-3864.00,4944.00,69.00 0.000000 -4.87 15.13 -4.87 -4.87 0.10 -4.87 -0.87 0.10 38.10 2 0 1 0
-3010.00,2960.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 0.10 37.13 2 0 4 2
-3495.00,2960.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 0.10 38.10 2 0 4 2
-3980.00,2960.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3010.00,2545.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 3
-3360.00,2545.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 3
-3495.00,2545.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3600.00,2545.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 3
-3980.00,2545.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 3
-3010.00,2100.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3360.00,2100.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3600.00,2100.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3980.00,2100.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3010.00,1730.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3495.00,1730.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
-3980.00,1730.00,1.00 0.000000 -0.87 19.13 -0.87 -0.87 -0.87 -0.87 3.13 -0.87 37.13 2 0 4 2
TotalNumLinks 18
1 2 1 1 1 1 1 1 1 0 0
1 4 1 1 1 1 1 1 1 1 1
2 3 1 1 1 1 1 1 1 1 1
2 3 1 1 1 1 1 1 1 1 1
3 8 1 1 1 1 1 1 1 1 1
4 5 1 1 1 1 1 1 1 1 1
4 9 1 1 1 1 1 1 1 1 1
5 6 1 1 1 1 1 1 1 1 1
5 10 1 1 1 1 1 1 1 1 1
6 7 1 1 1 1 1 1 1 1 1
7 8 1 1 1 1 1 1 1 1 1
7 11 1 1 1 1 1 1 1 1 1
8 12 1 1 1 1 1 1 1 1 1
9 13 1 1 1 1 1 1 1 1 1
10 11 1 1 1 1 1 1 1 1 1
12 15 1 1 1 1 1 1 1 1 1
13 14 1 1 1 1 1 1 1 1 1
15 15 1 1 1 1 1 1 1 1 1
1000 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515

Basically, I sat in game with my cl_showpos 1 enabled. I got the game coordinates for where I was standing, and I wrote those down on paper. Using another diagram I made on paper of the layout of the floor layout of the showers/baths of dm_lockdown, I took down the coordinates of the nodes I wanted to place in "artificially".

Try it yourself, replace your current dm_lockdown.ain file with the one above, and you'll be hard pressed to evade a pissed off antlion guard! (make sure you spawn him and give him a relationship!) This should work on servers too. Also notice that using the CC, npc_go_random now works!

EDIT: Make sure you also do ai_norebuildgraph 1 in the console too, before you play lockdown.

BTW, does your HL2DM crash when you quit the game after doing any monster spawning?
 
Hey! Very, very nice!! No, my DM doesn;t crash after spawning NPCs.. well usually... it's weird.. sometimes it will crash, and sometimes it won't.. i remember it used to crash more, now it doesn't.. I haven't found the source of this yet..

Now.. I was hoping to catch you on AIM to discuss this all with you.. I just got home.. so I want to catch up on all of your progress.. I'll just post questions here for all to see... so nodes.. they are just points on the map? And you link them? Why do you link them? Does this tell the npcs which nodes to travel in which order? Do they deviate from the path when they find an enemy? If there are no enemies, will they just follow the path? I just want to fully understand the purpose of these nodes and links..

Now I understand the 3d coords.. but what is the deal with these angles? I see that you copied the angles over and over again.. but they're there for a reason.. and what is it? And lastly.. did you ever find out the significance of the last two bits in each link line? Oh yeah.. and do you just make the node IDs up?

Okay.. sorry for the questions.. just want to clarify these things for myself and the community... and also.. will any NPC follow these nodes? Or do you somehow write the paths for certain NPCs, only?

As always.. great work!

--jim :cheers:

PS When we're all done.. I'd love to see our conclusions as an addition to my sticky :D
 
Okay.. news! By far the most useful CC is "find".. whenever I'm venturing into uncharted territory.. as we are.. the find command proves useful.. I ran "find node" to turn up any commands pertaining to nodes.. I was actually looking for a command that would show me the nodes (and I did.. and it was useful).. this helped me answer most of my own questions.. I played against an antlion without your ain file.. and then with.. huge difference.. ahahah.. pretty much cleared up the use of nodes :) I didn't notice any graphical representation of a link between the nodes, however.. that might just because the command I was using doesn't display them.. or because they don't work.. I dont know.. I did this literally two minutes ago... more importantly.. I turned up a series of commands.. "wc_" commands.. "wc_create" was one of them.. and the command's description is "creates a node where the player is looking"... all of these commands require that you place the game in "WC edit" mode.. as soon as I figure out what this is, we just might be able to edit that AIN file in game.. and better yet... Valve may have already provided us with the commands to do it!

Okay I had to report.. I'll update soon :)

--Jim :cheers:
 
A node is a special place... the antlion along with other npcs actually search for nearby nodes when they are out to do something...

Two important somethings,
1. npc_go, they will use nodes near them to get to whatever destination use desire, they will stop if they are too far from a node to continue.
2. combating players/general combat, they will use nodes as a pathing to help them navigate the map to their target.

Nodes are linked together, to form a chain, this chain is what the npc "sees" and thus helps them get from place to place.
If the nodes and their links weren't working, then telling your antlion to "npc_go_random" would not result in an infinite loop. The loop would end if they weren't linked properly.

WC edit mode I think is world craft map editor. But, worldcraft was spankified by Valve and renamed into Hammer (Hammer is a slightly newer version of World Craft) The map editor has to be run outside of the program... Perhaps there was an ingame editor that was used in developing the hl series.
 
To moderator, we really need this moved to the source editting forum. under general editing please.
 
There is no way around it without coding the game, or waiting for a patch. HL2DM cannot handle ragdolls other than the default player models. It's not caching something or I don't know what, all I know is that I need Visual Studio to trace the error, something I don't have.
This failure to code the ragdoll handling/cleanup properly is what's crashing the game and it will continue to do so. No way around it now.
As it stands there's no way around the issue; a server wishing to play with monsters without a full-blown mod will have to do so on only 1 map (mapchange = crash), with an admin present (manage the npcs), with the removal of ar2 secondaries.

With this new limitation, I'm going to continue my work on ain files and adding nodes for future use. Furthermore, I am working on the flying npc issue still...
 
Sounds good.. talk to me on AIM, because I have Visual Studio.

--Jim :cheers:
 
Back
Top