Arcen Games

General Category => Starward Rogue => Starward Rogue Mods & Modding => : Misery February 26, 2016, 04:33:10 AM

: Rotation question
: Misery 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.
: Re: Rotation question
: ptarth 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.
: Re: Rotation question
: Ayrix 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
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.
: Re: Rotation question
: Misery 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.
: Re: Rotation question
: Hearteater 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.
: Re: Rotation question
: Pepisolo 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?
: Re: Rotation question
: Misery February 26, 2016, 09:35:28 PM
I've never even heard of that one.

"non sim"?
: Re: Rotation question
: Pepisolo 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.
: Re: Rotation question
: ptarth 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?
: Re: Rotation question
: Misery 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?
: Re: Rotation question
: ptarth 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.
: Re: Rotation question
: Hearteater 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 :( .
: Re: Rotation question
: Misery 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.
: Re: Rotation question
: ptarth 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.
: Re: Rotation question
: Pepisolo 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.
: Re: Rotation question
: ptarth February 27, 2016, 06:33:52 AM
:
GameEntity - Make sure to put the image in Images/NonSimEntities/
<root>
  <entity name="ZigzagPinkNonSim" category="NonSim" shader="Additive" image_name="ZigzagPink">
  </entity>
 </root>

BulletPattern
Note the use of the rotation tags
<root>
  <bullet_pattern name="NonSimTestPattern">
    <bullet speed="100" angle="0" shot_type="ZigzagPinkNonSim" non_sim_rotation_speed_rand_min="15" non_sim_rotation_speed_rand_max="180">
<wait time="10"/>
      <die/>
    </bullet>
  </bullet_pattern>
  </root>

System
The non sim pattern isn't a called through special pattern. It is called through non_sim_patterns or cue_non_sim_patterns. There may be other attributes that also use them, but I haven't used them. I think you can spawn them in normal special patterns and they are nonsims there, but I haven't tested that.
<root>
<system
name="NonSimTestSystem"
category="Weapon"
shot_type="CrossWhite"
damage_type="Ballistic"
attack_power="1"
fire_rate="1"
cue_time="0"
range_actual="600"
time_to_live="10"
shots_per_salvo="1"
shot_speed="100"
targeting_logic="Dumbfire"
image_name="Invisible"
firing_timing="AllTheTime"
initial_firing_delay ="0"
        non_sim_patterns ="NonSimTestPattern"
>
</system>
</root>
: Re: Rotation question
: Misery February 27, 2016, 06:35:11 AM
And what mystical effect does that one accomplish?
: Re: Rotation question
: ptarth February 27, 2016, 08:43:21 AM
Nothing really. It just demonstrates the use and creation of a nonsim pattern.
: Re: Rotation question
: Pepisolo February 27, 2016, 04:37:08 PM
:
GameEntity - Make sure to put the image in Images/NonSimEntities/
<root>
  <entity name="ZigzagPinkNonSim" category="NonSim" shader="Additive" image_name="ZigzagPink">
    <hitbox radius="8"/>
  </entity>
 </root>

BulletPattern
Note the use of the rotation tags
<root>
  <bullet_pattern name="NonSimTestPattern">
    <bullet speed="100" angle="0" shot_type="ZigzagPinkNonSim" non_sim_rotation_speed_rand_min="15" non_sim_rotation_speed_rand_max="180">
<wait time="10"/>
      <die/>
    </bullet>
  </bullet_pattern>
  </root>

System
The non sim pattern isn't a called through special pattern. It is called through non_sim_patterns or cue_non_sim_patterns. There may be other attributes that also use them, but I haven't used them. I think you can spawn them in normal special patterns and they are nonsims there, but I haven't tested that.
<root>
<system
name="NonSimTestSystem"
category="Weapon"
shot_type="CrossWhite"
damage_type="Ballistic"
attack_power="1"
fire_rate="1"
cue_time="0"
range_actual="600"
time_to_live="10"
shots_per_salvo="1"
shot_speed="100"
targeting_logic="Dumbfire"
image_name="Invisible"
firing_timing="AllTheTime"
initial_firing_delay ="0"
        non_sim_patterns ="NonSimTestPattern"
>
</system>
</root>

I'll give this a test soon. Thanks!
: Re: Rotation question
: Pepisolo February 27, 2016, 06:44:36 PM
I've tested, and now I understand this whole non-sim thing a bit better, thanks! :)
: Re: Rotation question
: ptarth February 27, 2016, 07:11:13 PM
Great!
You can also do some interesting things with the Shader. But I haven't really spent any time on it.