Turrets
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Turrets
The branch https://github.com/fluffyfreak/pioneer/tree/turrets is where all of jaj22's gun refactor stuff went.
I've basically stalled on it now, it's just horrible code to work on and saps my enthusiasm everytime I do :/
It's not too far from the latest master so could be updated fairly easily but it's a long way from done.
Just thought I better post about it before I forgot, again.
I've basically stalled on it now, it's just horrible code to work on and saps my enthusiasm everytime I do :/
It's not too far from the latest master so could be updated fairly easily but it's a long way from done.
Just thought I better post about it before I forgot, again.
Re: Turrets
I'd hold it for the moment. Its a big one with lots of interesting interactions between different game systems, and we've already got a ton of crap in progress. :)
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Turrets
Righto, revival of the fittest.
I ditched jaj22's stuff as it was all about camera manipulation and manual aiming which maybe someone else will care about... I don't, always thought it was the dumbest part of Frontier.
https://github.com/fluffyfreak/pioneer/tree/new-turrets - so break out the model loading stuff and build up from that instead I thought earlier, NB: there's no model which uses it in that branch, I'm keeping that out of the branch and using a mod that Nozmajner supplied to me a (long) while ago.
The idea this time: Just get it loading in and attaching separate turret models/objects onto the body in orientations defined by the model, the turrets will be given named parts and a defined hierarchy so that animating (rotation & elevation) them will be easier to add later. That way turrets can be modelled, ships can get turrets, the two will be magically duct-taped together so they look correct even if they don't do anything yet.
Plan? Plan!
I ditched jaj22's stuff as it was all about camera manipulation and manual aiming which maybe someone else will care about... I don't, always thought it was the dumbest part of Frontier.
https://github.com/fluffyfreak/pioneer/tree/new-turrets - so break out the model loading stuff and build up from that instead I thought earlier, NB: there's no model which uses it in that branch, I'm keeping that out of the branch and using a mod that Nozmajner supplied to me a (long) while ago.
The idea this time: Just get it loading in and attaching separate turret models/objects onto the body in orientations defined by the model, the turrets will be given named parts and a defined hierarchy so that animating (rotation & elevation) them will be easier to add later. That way turrets can be modelled, ships can get turrets, the two will be magically duct-taped together so they look correct even if they don't do anything yet.
Plan? Plan!
Re: Turrets
Plan. That means that all we need to do is bolt on some controller objects that either take player input or look at nearby targets and turn them into an appropriate orientation transform. Easy!
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Turrets
The test asset with initial turrets attached.
The test assets themselves (EDIT: updated with turret hierarchy model).
Last edited by FluffyFreak on Sat Mar 29, 2014 2:52 pm, edited 1 time in total.
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Turrets
Test turret assets now have hierarchy defining the turret_base as the root/parent, turret_head is a child of it and there is a locator at the end of the barrel called: "tag_weapon_emit" so that we can find it and it's location and then spawn bullets or whatever from it.
I've just made this in Max, this stuff is a lot harder when you're a bit hungover! ;)
The orientation works like this:
I've just made this in Max, this stuff is a lot harder when you're a bit hungover! ;)
Code: Select all
- turret_base
|
- turret_head
|
- tag_weapon_emit
- +Z = forwards
- +Y = upwards
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Turrets
Updated the test assets. NB: the texturing / lighting / material is foobar'd on the turret model.
What this does is add some extra info to the ship definition which defines a table of data saying which: tag to attach to 'tag_turret_0', the model to attach 'simple_turret', and the equipment to give it 'PULSECANNON_1MW':
I can't really think of a simpler way of doing it than that right now.
This version, which I'm currently writing the initial PR for, is only about adding visual turrets.
What I mean by this is that you can create a turret and give it a ".model" file, then you can add those tag points named "tag_turret_#", and when the game loads your ship it will also load the turret model and stick them together.
There is no other functionality, they do not fire, spin, aim, anything - which is what I mean by visual turrets.
There is some code in there which gets setup but then the update is disabled, this code was originally written by jaj22 for an older attempt to implement turrets like in Frontier with no actual model to animate. However a lot of the logic seems sound and I reckon it should be adaptable to our needs so I've gone to the effort of setting up most of the data it needs.
Orientation:
Tags have the following orientation
+X is left
+Y is upwards
+Z is forwards
Z & Y are the ones to focus on, they are the direction the barrel should be pointing in when the model loads (+Z), and which way UP it is (+Y).
The turrets themselves come in 3 parts, a base "turret_base", a head "turret_head", and a tag called "tag_weapon_emit".
The base and head are separate meshes: you place the base centred at (0, 0, 0) in your scene in the 3D editor and then you move the whole head mesh - NOT it's geometry but the mesh itself - upwards so that it's pivot point / origin is directly above the base and (0, 0, 0).
Look at the test assets to make sure you're getting these correct because fixing it up later will be a pain in the arse!
What this does is add some extra info to the ship definition which defines a table of data saying which: tag to attach to 'tag_turret_0', the model to attach 'simple_turret', and the equipment to give it 'PULSECANNON_1MW':
Code: Select all
turrets =
{
{ 'tag_turret_0', 'simple_turret', 'PULSECANNON_1MW' },
{ 'tag_turret_1', 'simple_turret', 'PULSECANNON_1MW' },
{ 'tag_turret_2', 'simple_turret', 'PULSECANNON_1MW' },
{ 'tag_turret_3', 'simple_turret', 'PULSECANNON_1MW' },
},
This version, which I'm currently writing the initial PR for, is only about adding visual turrets.
What I mean by this is that you can create a turret and give it a ".model" file, then you can add those tag points named "tag_turret_#", and when the game loads your ship it will also load the turret model and stick them together.
There is no other functionality, they do not fire, spin, aim, anything - which is what I mean by visual turrets.
There is some code in there which gets setup but then the update is disabled, this code was originally written by jaj22 for an older attempt to implement turrets like in Frontier with no actual model to animate. However a lot of the logic seems sound and I reckon it should be adaptable to our needs so I've gone to the effort of setting up most of the data it needs.
Orientation:
Tags have the following orientation
+X is left
+Y is upwards
+Z is forwards
Z & Y are the ones to focus on, they are the direction the barrel should be pointing in when the model loads (+Z), and which way UP it is (+Y).
The turrets themselves come in 3 parts, a base "turret_base", a head "turret_head", and a tag called "tag_weapon_emit".
The base and head are separate meshes: you place the base centred at (0, 0, 0) in your scene in the 3D editor and then you move the whole head mesh - NOT it's geometry but the mesh itself - upwards so that it's pivot point / origin is directly above the base and (0, 0, 0).
Look at the test assets to make sure you're getting these correct because fixing it up later will be a pain in the arse!
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Turrets
The Pull Request is now up.
-
- Posts: 155
- Joined: Thu Jul 04, 2013 10:01 pm
Re: Turrets
Hey this looks cool :)
On an alternate topic, the Wave PR update is taking longer than expected - but I have been working on it sporadically - should be done soon.
On topic:
Had to resize and shorten the gun barrel somewhat but..
A composite showing a possible weapons tag placement for a turret on the top side of the Wave (at least suitable for the Wave-e).
Athough there may be places under or on top of the standard wave for similar but much smaller turret variants.
The same turret attachment points could also be great places for attaching small cupolas or observation domes with optional telescopes
or alternative sensor apparatus. This IMO, would be more appropo for science and civilian transport vessels.
edit: Forgot to add in recon as a viable military option for having observation domes on the smaller more nimble craft.
A selection of the above attachments available via the shipyard enabling the customizing of ones own ship in such a manner, would make
for a nice option in game.
On an alternate topic, the Wave PR update is taking longer than expected - but I have been working on it sporadically - should be done soon.
On topic:
Had to resize and shorten the gun barrel somewhat but..
A composite showing a possible weapons tag placement for a turret on the top side of the Wave (at least suitable for the Wave-e).
Athough there may be places under or on top of the standard wave for similar but much smaller turret variants.
The same turret attachment points could also be great places for attaching small cupolas or observation domes with optional telescopes
or alternative sensor apparatus. This IMO, would be more appropo for science and civilian transport vessels.
edit: Forgot to add in recon as a viable military option for having observation domes on the smaller more nimble craft.
A selection of the above attachments available via the shipyard enabling the customizing of ones own ship in such a manner, would make
for a nice option in game.