|
Post by DaJMasta on Apr 17, 2005 12:09:48 GMT -5
Ok new thread cause I cant keep track of all the others and because I really need to get some stuff straitened out.
I believe I have a simpleish solution, which I can implement, and requires only a little bit of code for bots or humans to use.
The Punt function. Basically when the AI player sees a target, you trace from his knees or so to the other player. If it collides with a NetKActor, then it tells the NetKActor it plans to punt the object, as long as the pawn is strong enough of course. Then the NetKActor waits for up to 5 seconds, and if the pawn comes in contact with the object, it sends it sailing, up to 5 times the normal kick force. It will also deal damage so weaker objects would fragment and go flying.
Now this will involve only one function you need to use, bool CheckPunt and u need to trace and call that if its found, the NetKActor will take care of the rest. The function will probably need the pawn as a parameter and a strength value of the pawn. Because the mass property of an object is a modifier, and the Karmic mass isnt available to get, the object will have a strength value as well. If the 2 strengths =, then it kicks 3 times as hard, if the player's strength is 1.5 times the objects, it will kick 5 times as hard, and if its half as much it will kick 1.5 times as hard. Below .5 of the required strength will not move it differently than normal, and anything over 1.5 will kick it with 5 times the force.
Just an idea, but simple to implement, and it could be very cool. You could also code it up so that you could target an object and send it sailing as a human player.
Thoughts?
|
|
|
Post by Slinky on Apr 17, 2005 13:23:32 GMT -5
The problem is, like I said, we have a lot of different behaviors we want the bots and zombies to have regarding the KActors. We really need something that works in tandem with the pathfinding function. For instance, I want to be able to do up the bots to know that there's a barricade between them and the zombie they're after and therefore not try and circumvent it.
I mean, you said that you have a system that involves blocked nodes and KActors. Can't you run findpathtoward, get the results, apply your node thingies, and then run findpathtoward again, compare the results, and remove the nodes from the net? It's very important that (A) Karma actors can block pathfinding and (B) they only do so when we want them to. Theoretically, with just those two capabilities and an ability to iterate through all the karma actors, we're set.
As far as simply applying forces, there are a few functions we need to work out- an impulse that takes two actors and applies the force in the direction between actor1 and actor2 (so a lot like punt), and an "explosion" one which applies a force outward from a point come to mind immediately.
|
|
|
Post by DaJMasta on Apr 17, 2005 13:48:01 GMT -5
Ok well the first problem is all the pathnode network is setup upon compiling the map, so you really cant delete or add nodes. Blocked paths can be switched on and off, so thats y i used them in the current version.
A is done, its set in their code to not block the creation of paths, but since all path nodes are line of sight, couldnt you just look at the node from where you stand to determine if theres anything in the way? this would have to be redone after every node is reached, but it would probably work.
As for the 2 kinds of impulse functions, for the second look in the code for the rocket or grenade projectiles, which propel anything away from them if they touch the explosion. As for the other, if you want one to hit the other use take damage, and the damage type determines how hard it will hit it, and if you want one thing to push 2 in different directions, i can either code something up or u can do the same technique as the rocket launcher again, just with a smaller blast radius.
Trace will return the actor that is in the way first going down the vector, so you can use that to determine LOS blockages, and with punt you can get them through it, or you can tell them to find an alternate route by leaving the blocked paths off. I think there will also be an attack function so the bots may just decide to hack it into pieces.
I think with this it may give u all the functionlity u need, but in a different way.....
|
|
|
Post by Saint on Apr 17, 2005 16:22:07 GMT -5
i have no ide what u guys r talking about lol...but if its like scripting and it certainly sounds like it...you might wanna be carefull implamenting too much...with multiple zombies kicking multiple things it could lag to all hell...then again like i said i have NO idea what u guys r talkin about so i just shutup lol...
|
|
|
Post by Alex on Apr 17, 2005 16:59:32 GMT -5
You're off base there.
From what i've seen, you can have like 20 karma objects bounding around at once without too much lag
|
|
|
Post by DaJMasta on Apr 17, 2005 17:04:50 GMT -5
pretty much, though it all depends on the server. As long as you only hit em around in one part of the map at a time, you could have a hundred with out bad pings on a decent server.
They may be further optimized at some point....
|
|
|
Post by Saint on Apr 17, 2005 19:25:26 GMT -5
oh okay well i figured i was outta my league here lol ;D
|
|
|
Post by DaJMasta on Apr 17, 2005 19:38:12 GMT -5
as confusing as it may be, it probably makes sense on at least one level. For anyone who's still confused, im trying to work out how NPCs push around Karma objects, and determine which one to move, if its moveable, and how the NPC will move it out of the way. Now slinky, is it acceptable?
|
|
|
Post by Saint on Apr 17, 2005 22:52:44 GMT -5
yah like i said outta my league ;D
|
|
|
Post by Slinky on Apr 17, 2005 23:37:17 GMT -5
It's cool, but I can't guarantee we'll use it, like I've said before. That's why I keep asking for general-use functions rather than specific functionality.
As for tracing node to node to determine whether it's blocked, I mean.... that doesn't necessarily tell me much. There can be a little hole in a big stack of boxes that makes it look like the path between two nodes is clear, when it isn't. I'll look into how the pathnodes are built, and what it uses to determine how "wide" a particular path is, and get back to you on this.
|
|
|
Post by Slinky on Apr 18, 2005 1:17:32 GMT -5
Okay, and I've been thinking about it, and I've decided on an answer that will work for everything you want to do. No doubt, this will sound insanely complicated, but I'm pretty sure it'll allow all the implementation we need. First, we use a different class of pathnode- let's call it a GKPathNode. The difference between this and the regular NavigationPoint are numerous: 1. It has nice placeholders to hold its default pathnode information, generated at runtime. This pathnode information is like the width of a given path, and whether or not it's blocked. 2. It has a function to revert to its default, Level-generated info. 3. It has a list of "afflictors" for each path- karma actors which are affecting its path info. 4. It has functions to generate new replacement path width & block info based on its afflictors (and may be given filter for those afflictors). Second, we give the GKActors a list of their afflictions- the pathnodes that they're affecting currently. Third, whenever a GKActor is moved, we update the afflictions, add new ones, remove ones that are no longer afflicted, etc. We can use this basic algorithm when the GKActors are moved: MAX_WIDTH = the amount of space required for the width of the path's default
FOR all nodes in level IF Node is one of our afflictions Node.UpdateAffliction(us,afflictedpath) CONTINUE ELSE IF NOT FastTrace from us to the node FOR all paths in node Endnode is the endpoint along the afflicted path closestpoint = node.loc + Normal( endnode.loc - node.loc ) * (((Endnode.loc - node.loc ) dot ( us.loc - node.loc )) / VSize( node.loc - endnode.loc )); //NOTE: The above was basically copy/pasted //off the wiki. It's a big fat formula that gives us //the closest point along the line between the two //nodes to the GKActor's position IF the distance between us and the closest point is less than MAX_WIDTH node.AddAffliction(us,path,distance) BREAK ENDIF ENDFOR ENDIF ENDFOR
|
|