Author Topic: Rotation question  (Read 15745 times)

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Rotation question
« on: February 26, 2016, 04:33:10 am »
Okay, so, simple question:   The "rotates with firing entity" tag.   ....what in the heck does this actually DO?

I've been experimenting with it for like 25 minutes, and as best I can tell, it does literally nothing at all. 

This is in relation to shots that are spawned by other shots, naturally, as opposed to shots that are spawned by ships.

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Rotation question
« Reply #1 on: February 26, 2016, 05:52:40 am »
To my knowledge rotate_with_firing_entity requires the move_with_firing_entity tag.
move_with_firing_entity causes the shot to move with whatever fires it.
The combination of the two tags causes the shot to move with whatever fired it and to keep at the same angle relative to the heading of the firing entity. It might be the case that the shots do rotate even without move_with, but since the shots are round it might be hard to see.

In a bullet pattern you can control the movement of the shots much more precisely.
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline Ayrix

  • Newbie Mark III
  • *
  • Posts: 42
Re: Rotation question
« Reply #2 on: February 26, 2016, 01:05:46 pm »
you have set offset_is_relative_to_parent_bullet_instead_of_firing_entity="true" right?
and there is no "rotates with firing entity" tag

you mean
Quote
moves_with_firing_entity (bool, optional)
the shot maintains its position relative to the firing entity, as that entity moves around. Primarily useful for quasi-melee weapons
rotates_around_firing_entity (bool, optional)
the shot rotates with the firing entity, combined with the previous flag it updates its position to also stay constant relative to the firing ship's central axis (so if it's to the upper right, and you do a 180, it will be to the lower left on the screen)

correct, it's how you code the melee weapons.

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: Rotation question
« Reply #3 on: February 26, 2016, 06:02:00 pm »
To my knowledge rotate_with_firing_entity requires the move_with_firing_entity tag.
move_with_firing_entity causes the shot to move with whatever fires it.
The combination of the two tags causes the shot to move with whatever fired it and to keep at the same angle relative to the heading of the firing entity. It might be the case that the shots do rotate even without move_with, but since the shots are round it might be hard to see.

In a bullet pattern you can control the movement of the shots much more precisely.

Yeah, I'd done all that already.  It still didn't appear to be doing anything of use.  I read the XML's explanation of the thing too, but... that didn't really help much.  It only really points out that it needs to be with the moves with entity thing.

I ended up just saying "Well this isnt accomplishing anything" and using other things instead.  Things that did stuff.  And thus, stuff was done.

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: Rotation question
« Reply #4 on: February 26, 2016, 06:30:39 pm »
The biggest problem with it is that ships actually turn instantly, so when using rotate_around_firing_entity, if you've set any speed to the visual rotation of the ship, the bullets will snap instantly and the break the visual effect.

Offline Pepisolo

  • Arcen Volunteer
  • Master Member Mark II
  • *****
  • Posts: 1,511
Re: Rotation question
« Reply #5 on: February 26, 2016, 07:43:54 pm »
Speaking of rotation -- although not the same rotation as this discussion is about -- has anybody figured out how non_sim_rotation_speed_rand_min works, yet?

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: Rotation question
« Reply #6 on: February 26, 2016, 09:35:28 pm »
I've never even heard of that one.

"non sim"?

Offline Pepisolo

  • Arcen Volunteer
  • Master Member Mark II
  • *****
  • Posts: 1,511
Re: Rotation question
« Reply #7 on: February 26, 2016, 09:41:17 pm »
I've never even heard of that one.

"non sim"?

Yeah, it's supposed to be used for getting bullets to spin visually, like a shuriken, but I don't think anybody's got it working, yet.

non_sim_rotation_speed_rand_min (float), non_sim_rotation_speed_rand_max (float)

    For each NonSim-only entity spawned by this definition, applies an ongoing rand(min,max) degrees-per-second rotation


I too am not particularly au fait with the non-sim stuff...........I know it's a thing, though! Definitely some kind of thingy that does stuff.

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Rotation question
« Reply #8 on: February 26, 2016, 09:58:07 pm »
I have defined bullets as nonSim game entities. I believe the rotation has to be specified using one of those. You might also be able to define a ship or obstacle as a non-sim entity, I wonder if category is needed at all?
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: Rotation question
« Reply #9 on: February 26, 2016, 10:28:40 pm »
I've never even heard of that one.

"non sim"?

Yeah, it's supposed to be used for getting bullets to spin visually, like a shuriken, but I don't think anybody's got it working, yet.

non_sim_rotation_speed_rand_min (float), non_sim_rotation_speed_rand_max (float)

    For each NonSim-only entity spawned by this definition, applies an ongoing rand(min,max) degrees-per-second rotation


I too am not particularly au fait with the non-sim stuff...........I know it's a thing, though! Definitely some kind of thingy that does stuff.

Oh... so it's just a visual spinning effect, nothing more.  Not even really necessary then since there's other ways of doing that.

Unless it has another use?

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Rotation question
« Reply #10 on: February 26, 2016, 10:32:06 pm »
Well, there actually isn't a lot of other ways to do it. The other ways require changing the angle of the actual shot and not just its image, except with you do location based movement. And those also require using change over time statements which may conflict with other movement based instructions.
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: Rotation question
« Reply #11 on: February 26, 2016, 10:36:03 pm »
I believe non_sim means it isn't part of the physics simulation but handled only in the graphics layer. That means it likely has less impact on the system which would be important with large numbers of shots. So if a boss is spitting out a ton of spinning shots, I believe the intention is to make the spin effect non_sim to improve performance.

Incidentally, why are the Cracker (see CrackerMediumGreen in Shots\Medium for example) shots not centered? It makes them spin terribly :( .

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: Rotation question
« Reply #12 on: February 26, 2016, 11:50:30 pm »
Well, there actually isn't a lot of other ways to do it. The other ways require changing the angle of the actual shot and not just its image, except with you do location based movement. And those also require using change over time statements which may conflict with other movement based instructions.

I've got spinning shots used by Crystal Mother though... the shots on misery mode in the second phase, the ones that spray all those blue and green bolts, are spinning shots; they're attached to a normal shot that just moves forward, while they just spin in place constantly and fire.  And then that spinning has no effect on the shot underneath it that's controlling the actual movement. 

The shots underneath are visible though, but there are invisible shots too, arent there?  Not something I've messed with as it never occurs to me.

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Rotation question
« Reply #13 on: February 27, 2016, 12:04:14 am »
re: Cracker centering
I think Blue has fixed, not sure when it is being pushed.

re: Shots under Shots
Yes. That's exactly when the invisible shots should be used. The bottom one can't be seen, so it should be invisible.
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline Pepisolo

  • Arcen Volunteer
  • Master Member Mark II
  • *****
  • Posts: 1,511
Re: Rotation question
« Reply #14 on: February 27, 2016, 01:45:04 am »

I've got spinning shots used by Crystal Mother though... the shots on misery mode in the second phase, the ones that spray all those blue and green bolts, are spinning shots; they're attached to a normal shot that just moves forward, while they just spin in place constantly and fire.  And then that spinning has no effect on the shot underneath it that's controlling the actual movement. 


Yeah, good idea, I'll have to try attaching shots if I want to create a spinning effect. One of these days someone will crack the non_sim_rotation_speed_rand code, though. One of these days.