Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (OptimusPrime, AndrewAMD), 14,580 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 5 1 2 3 4 5
Re: Pointer troubles: Need Help [Re: EvilSOB] #267720
05/26/09 01:29
05/26/09 01:29
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
Yes, I do want to keep that. Why you ask? I've seen it happen in games I play! laugh It's funny to see be firing at someone, who's firing at you, then you suddenly see your tracer and their's skip off in opposite directions, lol. Doesn't happen often, but is always a kick to see. But you don't have to write that for me. I get your idea.

I'm noticing that this really only seems to happen when firing straight ahead with the MG. The BB is longest from front to back, naturally, because the tank has a long gun. I wish I knew some way of making my own invisible collision model, rather than using just a big box. That's how it's done in most games I've played, IL-2 Sturmovik for example.

Thanks again for your help. I'm going to try this.

P.S.- When an entity event is run, what's the "default" pointer of the entity you hit? Is it "you"?

Re: Pointer troubles: Need Help [Re: Jaeger] #267722
05/26/09 02:03
05/26/09 02:03
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
Ahhh... I think you're right about the "lodging" inside the mesh of the object they hit. I set up a little function that gives MG bullets a slight chance of ricocheting before they're removed, and some just "stick" into the ground.

Re: Pointer troubles: Need Help [Re: Jaeger] #267727
05/26/09 02:16
05/26/09 02:16
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I ask because I prefer to keep it, but it MAY degrade overall performance if there is LOTS of bullets in the air at once.
I'll give you the change, its simple.
Code:
if(you)    event_type = EVENT_ENTITY;    //hit an entity

becomes

if(you)
{
    if(you.push>me.push)  event_type = EVENT_ENTITY;    //hit an equal or larger entity
    else                  event_type = EVENT_IMPACT;    //hit a smaller or equal object
}


Another thing to try. At the start of "mg_action", YOU may be empty,
because ME may be empty in "fire_turrmg, I cant tell.
In which case, IGNORE_YOU in the c_move does nothing.
Put this line at the top of "mg_action" you = player; to remove this chance.

And another, IF your player-tank is a physics entity, try adding
phent_setgroup(me,2); at physics setup time to both player and any projectiles HE fires.
Members of the same physics group NEVER physics-COLLIDE WITH EACH OTHER.
It should allow you to drop the initial c_move at the start of firing things.


And let me know IF the manual event trigger works, please.

PS Answer. Yeah, if you call c_trace, c_move, or c_rotate (at least), they will all set
the YOU pointer to whoever they hit.
If YOU is null after a sucessful hit (c_trace <> zero), then the ME hit something that ISNT an entity.
Which means WED blocks (or terrains, I think).


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Pointer troubles: Need Help [Re: Jaeger] #267731
05/26/09 02:26
05/26/09 02:26
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Originally Posted By: Jaeger
I wish I knew some way of making my own invisible collision model, rather than using just a big box. That's how it's done in most games I've played, IL-2 Sturmovik for example.

Easy.
Create a low poly, unskinned "match" of your model, bones and mesh-changing animations to match real model.
Use this as your player model, physics and all, just set to INVISIBLE.
Then your real model can be a visible but PASSABLE "ghost" positioned/rotated/animated every frame on top of it.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Pointer troubles: Need Help [Re: EvilSOB] #267748
05/26/09 04:21
05/26/09 04:21
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
Originally Posted By: EvilSOB
Originally Posted By: Jaeger
I wish I knew some way of making my own invisible collision model, rather than using just a big box. That's how it's done in most games I've played, IL-2 Sturmovik for example.

Easy.
Create a low poly, unskinned "match" of your model, bones and mesh-changing animations to match real model.
Use this as your player model, physics and all, just set to INVISIBLE.
Then your real model can be a visible but PASSABLE "ghost" positioned/rotated/animated every frame on top of it.



And I can use that to set the bounding zone of my entity? Rather than a perfectly squared box/rectangle encompassing it? That would be great. I understand fully the concept you're talking about, and I could do that quite easily... I just don't know how to implement it in game. Would I set phenttype to PH_POLY in that case? Even though it's a moving entity (which manual advises against)?

I'm about to try the other things you mentioned right now, and I'll let you know how it works.

I played with the movement coding, and noticed something funny. No matter what I do (applying force/velocity relative to entity's position) I can only move the tank parallel to the world's x and y axes. If I try to go at any angle to that, it's like I hit a brick wall and skid sideways, until it forces the tank parallel to the world's x or y axis.

Example of one thing I tried:

Code:

      	 vAhead.x = (key_cuu - key_cud) * 75; // Gives vAhead strong vector/force
         
      	   vAhead.y = 0; // Makes sure vector y is 0...
      	   vAhead.z = 0; // Makes sure vector z is 0...
      	
      	VECTOR myspeed;
      	
      	myspeed.y = 0;
      	myspeed.z = 0;
      	
      	myspeed.x = (key_cuu - key_cud) * 10;
      	
      	      	
            // Update vAhead again....     	
      	   vec_rotate(vAhead, player.pan);
      	   vec_rotate(vAhead, player.tilt);

      	  vec_rotate(myspeed, player.tilt);
      	  vec_rotate(myspeed, player.pan);
     	      	
            // Now apply physics force on the Panzer...      	
      	   phent_addvellocal(me,myspeed,NULLVECTOR);
 



I've done this in a bunch of different ways, and don't know what the problem is, lol. Sorry to keep bogging you down with questions, heheh.

Re: Pointer troubles: Need Help [Re: Jaeger] #267750
05/26/09 04:33
05/26/09 04:33
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
That improved the situation a little. Now we know the bullets aren't touching the tank in anyway. Great advice! But some still don't run their event function, which I know, because they don't "kick up dust" when hitting the ground. The majority of them do though. It seems this is happening only when particular parts of the terrain mesh are hit, which probably means your original diagnosis was correct.

But I had an idea. Since I did what you said and set the bullets and tank to the same phent group, does that mean I could do away with the c_move all together now? I know it's a fairly slow instruction, and it would be nice to eliminate. Hmmm... I could probably also start creating the bullets inside the actual barrel now too, huh? laugh

Re: Pointer troubles: Need Help [Re: testDummy] #267757
05/26/09 05:36
05/26/09 05:36
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
The simple model was only a mental concept Ive never tried using, except in rag-dolling.
And even then you have to use PH_BOX. 3DGS physics seriously sucks on collisions.

Eiieaglh... Really gone wrong with the move, in my best opinion. I cant even see why much of it is there?
This is all I see as being needed.
Code:
        vec_set(vAhead,  vector((key_cuu-key_cud)*75,0,0));   //feed keyboard into engine. 
        vec_rotate(vAhead, player.pan);                       //rotates by pan,tilt,roll ALL at the same time...
        phent_addvellocal(player,vAhead,NULLVECTOR);          // Now apply physics force in the directions it is facing....


But you should probably have a "phent_setmaxspeed" set on the player at physics setup time.
Also, you should 'probably' use phent_addforcelocal(player,vAhead,player.x); rather than
phent_addvellocal. I think it will give a smoother-looking acceleration.

Dont worry about the questions, its helping me kill a boring work-day.

Post2 ::

Yeah, ditch the c-move completely. And create the bullets/shells inside the tank at the breech.
BUT, I just remembered, be sure to use the PASSABLE flag on any entity during its physics setup.
eg
Code:
        set(me.PASSABLE);                    <<<<<<important
        phent_settype(me,PH_RIGID,PH_BOX);
	phent_setmass(me,0.012,PH_SPHERE);//45kg
	phent_setfriction(me,100);
	phent_setdamping(me,2,100);
	phent_setgroup(me,2);
        reset(me.PASSABLE);                  <<<<<<important

Otherwise collisions may be triggered (but not yet executed) BEFORE you get the
chance to phent_setgroup....


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Pointer troubles: Need Help [Re: EvilSOB] #267771
05/26/09 07:26
05/26/09 07:26
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
That was just an example of me trying random things, lol...

But I tried your code, and still the same problem. If I'm not traveling parallel to the world's x or y axis, it's like I hit a brick wall. I know the code is right. I don't know what's causing this though. I even opened the model and made completely sure it's centered about it's origin. No change.

Re: Pointer troubles: Need Help [Re: Jaeger] #267773
05/26/09 07:31
05/26/09 07:31
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
So the tank does rotate on the spot, to face for eg 45%, but then moves
diagonally when you say forward?

Any chance you can post, or PM, the whole tank-action?
The action that contains the movement.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Pointer troubles: Need Help [Re: EvilSOB] #267777
05/26/09 08:08
05/26/09 08:08
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
This is really odd. I commented out the tank's physics set up, and then used c_move to see what would happen. The same thing was occurring. I could only move parallel to the world x and y. When I moved it using c_move, the tank seemed to jerk back and forth quickly, as if it was performing thousands of collision detections per second. Then my whole computer crashed, lol. I think I totally overloaded it somehow.

EDIT: I've discovered the problem lies with the tank model itself, somehow. I tried using a plain cube, and it worked fine. Now I'm wondering what could be wrong with this gorgeous model. frown

It's 4,650 polies, btw. I've moved bigger poly models around before without such problems...

Last edited by Jaeger; 05/26/09 08:10.
Page 2 of 5 1 2 3 4 5

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1