AtomicTorch Studio Forums

VoidExpanse => Modding info => Topic started by: FlessenGreendart on December 24, 2014, 04:23:10 PM

Title: Turret Scaling
Post by: FlessenGreendart on December 24, 2014, 04:23:10 PM
Just a quick question for you guys; is it possible to adjust the scale of a turret on a hull without increasing the size of the hull itself and using the xml to scale it back down?
No rush on an answer, just curious really.
Merry Christmas folks!
Title: Re: Turret Scaling
Post by: ai_enabled on December 24, 2014, 08:19:16 PM
Hello!
Not yet, we will add it with the next release.
Also the "firing point" will be made adjustable, so it will be possible to set the exact point where the projectiles are coming from.
Regards!
Title: Re: Turret Scaling
Post by: Hammish on December 24, 2014, 10:02:52 PM
Wait, next release is going to have build-in scalar values for turret models and the code for the shot origin is confirmed?

Suuuuuhweet.  Now I won't have to bug Flessen for multiple scaling of turret sizes because Blender hates me. :D
Title: Re: Turret Scaling
Post by: ai_enabled on December 25, 2014, 02:07:22 AM
Sure, and it will be available soon.
Title: Re: Turret Scaling
Post by: ai_enabled on December 25, 2014, 03:41:20 AM
Syntax example:

<item_data>
<durability>25000</durability>
<gfx>
<model>turrets/energy_turret_01.obj</model>
<textures>
<diffuse>turrets/energy_turret_01/dif_256.jpg</diffuse>
<specular>turrets/energy_turret_01/spec_256.jpg</specular>
<normal>turrets/energy_turret_01/nrm_256.jpg</normal>
</textures>
<scale>1.5</scale> <!-- huge! -->
<offset>0;0;-0.25</offset> <!-- little bit up -->
</gfx>
<weapon>
<fire_origin>0.241;0.000;0.000</fire_origin>
...
                        </weapon>


So you can offset turret position, scale it and set the fire origin.
The fire origin work best for rays. The projectiles always firing from zero height (Z=0, because they are physics objects). But you still can offset projectiles by X/Y.
Also the fire origin is the point where muzzle flashes appears.
Title: Re: Turret Scaling
Post by: FlessenGreendart on December 25, 2014, 04:39:33 PM
That is really good news! :)
Will the fire origin be able to be set for multi-barrel type weapons (two fire origins)?

What I actually meant with the question, though, was could weapons have different scales on different hulls, e.g. Machine Gun being smaller on a Banshee than an Avalanche?
Title: Re: Turret Scaling
Post by: Hammish on December 25, 2014, 11:21:38 PM
Quote from: FlessenGreendart on December 25, 2014, 04:39:33 PM
That is really good news! :)
Will the fire origin be able to be set for multi-barrel type weapons (two fire origins)?

What I actually meant with the question, though, was could weapons have different scales on different hulls, e.g. Machine Gun being smaller on a Banshee than an Avalanche?

AI will be able to tell you for sure, but I still doubt it on the two fire origins given that the origin point seems to be set to the overall turret data and not as a component in the projectiles.
Title: Re: Turret Scaling
Post by: ai_enabled on December 26, 2014, 04:23:50 AM
Syntax is changed, thanks for response!

<item_data>
<durability>25000</durability>
<gfx>
<model>turrets/energy_turret_01.obj</model>
<textures>
<diffuse>turrets/energy_turret_01/dif_256.jpg</diffuse>
<specular>turrets/energy_turret_01/spec_256.jpg</specular>
<normal>turrets/energy_turret_01/nrm_256.jpg</normal>
</textures>
<scale>1.5</scale> <!-- huge! -->
<offset>0;0;-0.25</offset> <!-- little bit up -->
</gfx>
<weapon>
<projectiles>
<projectile>
<gfx>
<!-- other data -->
<muzzle_flash_sprite>
<width>0.4</width>
<height>0.4</height>
<textures>
<diffuse>projectiles/muzzle_flash_01.png</diffuse>
<color>1;0.7;0.5;1</color>
</textures>
<flash_origin>0.118;0.000;0.000</flash_origin>
</muzzle_flash_sprite>
<fire_origin>0.2;0.000;0.000</fire_origin>
</gfx>
<!-- other data -->
</projectile>
</projectiles>
<fire_origin>0.241;0.000;0.000</fire_origin>
...
                        </weapon>

Let's make multibarrel weapons! :-)

About scaling - currently scale of turret is set by the weapon XML and it's independent from hull XML. If you have any ideas how we can do it without over-complication of syntax - we're listening!

Update is available now!
Regards!
Title: Re: Turret Scaling
Post by: FlessenGreendart on December 26, 2014, 08:39:45 AM
Honestly, the flash origins and fire origins are a wonderful addition!

What I was thinking was something like this:

<root>
<header>
<id>hull_banshee</id>
<title>Banshee</title>
<description>Fast, maneuverable interceptor type hull. Perfect ship for quick attacks.</description>
<enabled>1</enabled>
</header>

...

<weapon_slots>
<!-- energy (left) -->
<weapon_slot>
<id>0</id>
<slot_type>1</slot_type>
<slot_size>1</slot_size>
<display_type>1</display_type>
<direction>-30</direction>
<rotation_angle>120</rotation_angle>
<rotation_speed>200</rotation_speed>
<position>0.020;0.300;-0.122</position>
<!-- smaller than average -->
<weapon_scale>0.75</weapon_scale>
</weapon_slot>

<!-- ballistic (center) -->
<weapon_slot>
<id>1</id>
<slot_type>2</slot_type>
<slot_size>1</slot_size>
<display_type>1</display_type>
<direction>0</direction>
<rotation_angle>100</rotation_angle>
<rotation_speed>100</rotation_speed>
<position>-0.140;-0.120;-0.180</position>
<!-- larger than average -->
<weapon_scale>1.3</weapon_scale>
</weapon_slot>

</weapon_slots>

This way, smaller hulls could have smaller turrets, rather than looking like a gun attached to an engine :P
If you think it complicates things too much, as I said before, you can work around it by making the mesh larger and then scaling it down in the hull xml.
Title: Re: Turret Scaling
Post by: Hammish on December 27, 2014, 11:13:07 AM
That actually seems pretty feasible to me, Flessen.  I mean, scale is just going to be a final multiplicative value anyway, so maybe the game could just put them together.  On a hull with turret scale 1.3 sporting a gun set to scale 1.5, maybe the game just sets the final model to scale 1.95.  I would think it'd just be small tweak to the math check.

I don't think I'd use it, personally, but I can see how it'd lead to some fun effects. :)

And now, off to fix the hell out of BTC, lol.  I'll have to check and see how the effect ends up looking on the tri-lasers I have, though, and may just keep them as they are so they all stay parallel to one another for nice visuals.  I get the feeling that with beam weapons they'll all converge at the cursor, which is another cool effect that I'd like to try, just not for those particular guns. ;)
Title: Re: Turret Scaling
Post by: FlessenGreendart on December 27, 2014, 04:20:07 PM
Admittedly, it's more for custom hulls than the vanilla ones. The best example I can give is my starfighter mod I'm working on, where the hulls are smaller than the Banshee, and if I want visible turrets, they cover most of the ships.
I've scaled them to about the size of the banshee mk2 and used the xml scale to bring it down:
(https://www.dropbox.com/s/3o5e4kj4kdprqlb/VoidExpanse_Screenshot_2014-Sep-25_21-06-07.jpg?dl=1)
(https://www.dropbox.com/s/sq6xv9sb0oo98w2/VoidExpanse_Screenshot_2014-Sep-25_21-26-16.jpg?dl=1)

To give you an idea. (also, sneak peak  ;))
Title: Re: Turret Scaling
Post by: Hammish on December 28, 2014, 04:23:26 PM
Nice work on that!

And yeah, I can see what you mean; I always liked the aesthetic of underslung guns being fairly oversized, but it can stretch realism with the scaling you were mentioning. ;)

Would be nice to be able to upscale them, too, if my other buddy ever finishes modeling the battleship I commissioned.
Title: Re: Turret Scaling
Post by: Hammish on December 28, 2014, 04:53:36 PM
Also, quick question, in the new core.cpk I'm not seeing any turrets thus far that make use of the turret scaling, just the fire origin.  Are either/both optional tags and if they are, what if they are left off?  It just goes with 1.0 scale and 0,0,0 origin?
Title: Re: Turret Scaling
Post by: ai_enabled on December 28, 2014, 07:32:28 PM
They're optional, you can add <scale> and <offset> tags in turret GFX description where you need them.
About scaling of the weapon slot on the hull - it's a good idea, we can implement it when we finish other tasks.
Regards!
Title: Re: Turret Scaling
Post by: FlessenGreendart on December 29, 2014, 12:09:15 PM
Cool, I look forward to using it  :)
Title: Re: Turret Scaling
Post by: Hammish on December 30, 2014, 08:05:40 AM
Today's quick question (I haven't actually tested it in-game yet):

If I give a muzzle flash a Z-coord, will it invert the value for a flipped (bottom-mount) turret?  Just curious, 'cuz otherwise bottom-mount turrets shooting are going to look very strange. ;)

Just a small little thing I was curious about; for now I'm just trying to get X and Y lined up, I can always change Z later on, and only on the flashes; I'm keeping all projectiles originating on 0 z-axis just for simplicity and to avoid strange visual effects as to when a shot should connect.
Title: Re: Turret Scaling
Post by: ai_enabled on December 30, 2014, 07:06:55 PM
The muzzle flashes and ray weapons fire origin should work ok with flipped turrets, no need to manually invert values in that case.
If you noticed, we improved how projectiles (bullet sprites & 3d-models like missiles) spawning in the latest release - they're offsetted by Z-axis when spawned, and then Z smoothly decreasing to the zero value. A little bit tricky, but the result is worth it - no more projectiles flying through the hull! You can test it with a  slow projectiles to see how it works now. So I'm sure it will work correctly with the non-flipped turrets, but for the flipped turrets projectiles may be spawned as turret is non-flipped - we didn't tested that case. Would be glad if you try it and let us know how it works for you!
Regards!
Title: Re: Turret Scaling
Post by: ai_enabled on January 07, 2015, 12:51:56 AM
We added weapon slot turret scaling as FlessenGreendart asked.
We're using it the new hull_stingray_mk2:

<weapon_slot>
<id>1</id>
<slot_type>3</slot_type>
<slot_size>2</slot_size>
<display_type>1</display_type>
<direction>0</direction>
<rotation_angle>360</rotation_angle>
<rotation_speed>50</rotation_speed>
<position>-0.489;0.0;-0.287</position>
<scale>1.5</scale>
</weapon_slot>

The <scale> element is optional. It also increases muzzle flash size.
Title: Re: Turret Scaling
Post by: FlessenGreendart on January 07, 2015, 06:30:26 AM
Fantastic! I look forward to employing that! :)