Skynes Member Posts: 202 From: Belfast, N Ireland Registered: 01-18-2004 |
I posted this on the Reality community already, but it doesn't hurt to have extra thoughts. I'm working on a simple AI to make enemy ships turn to face you and if you're so close, approach you. (shooting etc comes later) Problem: When you have multiple ships near one another, when they turn, they actually turn INTO one another. They ignore their collision boxes and enter into one another. If they were ghost ships this would be fine, but they're not :|
MVector direction is "location of player - location of enemy"
Moving forward is:
|
|||
GUMP Member Posts: 1335 From: Melbourne, FL USA Registered: 11-09-2002 |
RE comes with built in functions to check for actors within a specified radius. Also, you might be changing the Velocity variable of the actor itself (which it inherits from base classes) and not the variables attached to the PhysX object. btw, I realize you're doing some sort of contest but is your group interested in the REC? [This message has been edited by gump (edited July 05, 2007).] |
|||
Skynes Member Posts: 202 From: Belfast, N Ireland Registered: 01-18-2004 |
quote: I've been using the collision flags. Funny thing is that it picks up cannonball shots and my ship hitting it. But it seems to ignore enemy boats. They're all instances of the same class which shouldn't be a problem..
quote: I found it odd that I had to do Location += Velocity; since it worked automatically everywhere else without me having to do that.
quote: Not sure what REC is. [This message has been edited by gump (edited July 05, 2007).][/QUOTE] |
|||
GUMP Member Posts: 1335 From: Melbourne, FL USA Registered: 11-09-2002 |
REC = Reality Engine Community = Multiple companies merging all enhancements to RE for benefit of all. I'll give an example of what I meant with Smite's projectile. Velocity is inherited since Smite extends Destroyable. But I don't use Velocity very much. When Smite is generated:
Then during Tick I have some seeking code then:
That code turns the Smite projectile in the direction of the object it's locked onto. Elsewhere Velocity, etc. are updated with the stuff from physicalSmite. You can also use:
We detect physx objects in order to project a blast wave behind the Smite projectile. |
|||
Skynes Member Posts: 202 From: Belfast, N Ireland Registered: 01-18-2004 |
I looked up the REC on Rendernet, thanks for the invite but I doubt we'd have anything to offer to it. I see how your code is working, but how could I implement that? our enemy boat is an MActor. Tell you what... time to suck up screen space. The full Badboat script.
[This message has been edited by skynes (edited July 06, 2007).] [This message has been edited by skynes (edited July 06, 2007).] |
|||
Skynes Member Posts: 202 From: Belfast, N Ireland Registered: 01-18-2004 |
A mentor pointed out the flaw in my code. Velocity = should be Velocity += that one character stopped all physics being applied to EvilBoat, forcing me to do Location += Velocity. *beats himself on head* curse my inexperience of games programming... |
|||
GUMP Member Posts: 1335 From: Melbourne, FL USA Registered: 11-09-2002 |
heh, well, I didn't notice that myself in the code you posted. I had assumed you had a separate box mesh for collision and presumed it to be similar to Smite. [This message has been edited by gump (edited July 06, 2007).] |