Jump to content

In need of coding help


Recommended Posts

Hi,

So I have recently started planning out an idea of a small SP mod for the source engine which i plan to make over the summer and release around October. Without going into the intricate details of the mod it's self Im toying with using either hl2's npc zombies or ideally having slightly modified versions which act slightly differently than they currently do.

Of course the latter needs code work which as an artist is way out of my league, but im wondering if anyone here would be willing to help me out, or at least give me an idea how hard it would be, from a coders point of view, to implement it into a mod.

To give you an idea of exactly what im looking for here is a basic description:

A way of LODing out the AI if the zombie is at a certain distance from the player.

For example: Once the player is 2048 units away from the NPC it will cease all AI and just play an idle animation remaining in a 'sleep state' until the player is within 2048 units radius of the NPC.

The reason for this is that im thinking of ways to have alot of zombie NPCs spread over a large area without clogging up the CPU on pointless walking and pathfinding stuff like they do now while they idle.

Secondly, I recently played the latest version of SMOD and noticed they they added a pretty cool new type of zombie as shown in this video from SMOD: Tactical:

It seems like a pretty simple AI modification to an NPC citizen or something, where they are idle until they see or hear the player then just run straight at them causing damage if they come into close contact with the player. They also seem to run to random path nodes whilst searching for the player also which also crude looks pretty convincing!

If you're now thinking "why dont you just use SMOD?" its because they have no source code to implement the zombie LOD system which is more important atm and SMOD is not very mapper/modder friendly (it doesnt even have a FDG entity file for hammer). I also need to use some Orange box specific features for the mod to have some outstanding visuals.

Anyway any advice or help anyone can offer would be greatly appreciated!

Thanks!

Link to comment
Share on other sites

yeah i was about to say you could probably do it with some I/O scripting. having a trigger parented to a zombie that toggles the zombie state depending on where the player is located. it would get messy, and i am not sure how well you could actually incapsulate it to save resources, but none the less, it is possible.. although yeah, source could benefit from a decent scripting language :\

Link to comment
Share on other sites

yeah i was about to say you could probably do it with some I/O scripting. having a trigger parented to a zombie that toggles the zombie state depending on where the player is located. it would get messy, and i am not sure how well you could actually incapsulate it to save resources, but none the less, it is possible.. although yeah, source could benefit from a decent scripting language :\

Yes this is similar to something to a method I thought of also, the problem I encountered was that when I need to spawn additional zombies how do I create additional trigger brushes dynamically for them?

I've yet to look at the zombie npc's "sleep state" yet to see how optimised it is, but I will perform some tests this evening to determin if its useful or not.

NPCs can change state depending on the distance to the player

Are you referring to Sentura's method above or something else? If so please elaborate.

Thanks!

Link to comment
Share on other sites

that would be tricky. i can imagine it done through a point_template entity, where the first template is the actual zombie and the second being the trigger, the trigger STILL parented to the zombie. this could reduce the mess quite a lot since you just keep making an instance of the template.

Link to comment
Share on other sites

that would be tricky. i can imagine it done through a point_template entity, where the first template is the actual zombie and the second being the trigger, the trigger STILL parented to the zombie. this could reduce the mess quite a lot since you just keep making an instance of the template.

Thanks! I think i may give this a try later tonight and see what happens.

I hope you make those zombies far back from the player culled from view as well... :P

Yeah exactly, thats why I want them to be dormant when at a certain distance when they are not visible and culled (by fog for example). Atm, they still take up cpu time idling around walking in circles etc.

theres lots of info on the sdk about the subject, take a look here: http://developer.valvesoftware.com/wiki/Npc_zombie and scroll down to sleepstate :)

Gonna browse though that now, thanks.

Any coders have ideas about the modified zombie citizen in the video I posted?

Thanks!

Link to comment
Share on other sites

I'm interested in this kind of AI related things, I could try to help but can't assure any success heh. I'm experienced enough to give it a try at least, but I'm new to AI as that's not used in FoF. The LOD control should be easy, sure, but I'm not available at this moment. I'm preparing the next update for my mod, after that I should have more free time for other stuff.

Try these places and maybe someone will help you, if that's not the case I should be free in 2 or 3 weeks (not cash involved, just voluntary help) :)

http://forums.steampowered.com/forums/f ... .php?f=195

GameSurge IRC network: #hlcoders

Coders mail list http://list.valvesoftware.com/mailman/listinfo/hlcoders

Link to comment
Share on other sites

Hmm well just thought i'd have an experiement with triggering the zombie to go into a sleep state today, and discovered to my joy, that there isnt an input to make the zombie go back to sleep!

:(

This is really frustrating since I cant even experiment with it myself now. Looks like it has to be coded after all.

Link to comment
Share on other sites

×
×
  • Create New...