SEN2 Functionality Revealed

For those of us who are curious and like to poke around in the game's data files and scripts as well as glitching. Caters to anything from unit/building stats to level data to telling how to glitch and stories of game errors.
Post Reply
User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

SEN2 Functionality Revealed

Post by CharlotteLabyrinth » Mon Jul 31, 2017 6:05 pm

So... after a rather long break from UA modding scene, I recently started to work on a casual modification of in-game unit and building models once again. Well, at the moment with nothing but a hex-editor... but still I'm having a lot of fun making silly (but also very scary too!) 4x Drones like in this screenshot. :P


Anyway, on to the original title topic: I think I may have figured out the function of SEN2 section. As we know, the length of SEN2 sections in all skeleton files are always identical - 96 bytes allocated for determining the coordinates of 8 vertices that seem to form cuboids around the models.

These invisible cuboid formations are exclusively used for drawing the effective 'rendering box' of the objects from a first-person field of view. In other words, a particular object will remain rendered in the 3D world as long as a part of the object's designated SEN2 formation is being displayed on the viewer's screen.

It is because normally, UA engine does not render objects if the centre (0, -0, 0 coordinates of models) of the objects are positioned at the outside of the field of view from a viewer, regardless of how large the actual sizes of the models are. :mrgreen:

As you might expect by now, these SEN2 sections are present in order to prevent the vehicles and buildings from abruptly disappearing back and forth when the objects are located at the edge of the screen. Therefore, they are an essential part of the game and should not be disregarded easily.
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

teuzzz
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 42
Joined: Sun Feb 15, 2015 3:04 am

Re: SEN2 Functionality Revealed

Post by teuzzz » Mon Jul 31, 2017 8:24 pm

Hey CharlotteLabyrinth :) i'm very curious, but i'm not able to see the screenshot, can you repost it pls?
Regards
TeuZzZ

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: SEN2 Functionality Revealed

Post by CharlotteLabyrinth » Mon Jul 31, 2017 9:09 pm

teuzzz wrote:Hey CharlotteLabyrinth :) i'm very curious, but i'm not able to see the screenshot, can you repost it pls?
Regards
TeuZzZ
Hello TeuZzZ! I'm sorry about the slow image loading... :oops: The forums seem to be working a little bit slower than the usual tonight.

The screenshot is uploaded to our FTP server and is still present in the directory; but yes it does seem to take more time to load than normal. Maybe I should avoid using *.bmp format from now on, or simply use Img tags straight away in the future posts...
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

GoldStar611
BlackSect Creator
BlackSect Creator
Posts: 860
Joined: Sun Dec 02, 2007 1:16 am
Location: USA
Contact:

Re: SEN2 Functionality Revealed

Post by GoldStar611 » Tue Aug 01, 2017 2:54 am

Hi Charlotte, this is a very interesting thought! Have you been able to do any testing to see if that is true? It seems like it would be a quick test just to scale the sen2 section (for me at least)
Image
Image

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: SEN2 Functionality Revealed

Post by CharlotteLabyrinth » Tue Aug 01, 2017 7:56 am

GoldStar611 wrote:Hi Charlotte, this is a very interesting thought! Have you been able to do any testing to see if that is true? It seems like it would be a quick test just to scale the sen2 section (for me at least)
GoldStar, I should have made the statements more clear in my previous post. :) Yes, I have verified it myself and that is exactly what SEN2 sections exist for. Here is the quick comparison with building models:

SEN2 On
SEN2 Off

The first screenshot is normal vanilla SET data with valid SEN2 sections. As you can see, the power station and the Stoudson Bomb are rendered properly in the world, despite the centres of their models are not directly visible from the viewer's field of view.

In the second screenshot, the formation of SEN2 sections for both power station and Stoudson Bomb trigger are minimised to be a very small cube model, and as a result both building models on the sectors are not being drawn anymore.


Another quick comparison with unit models; in this case the user host station.

SEN2 On
SEN2 Off

So apparently, it is the reason why SEN2 sections are always containing the entire models! :D



Off-Topic: Talk about power stations, although the beta Ghorkov power station model has been changed in the final version of UA to provide enough space for ground units when passing over the sector, I always thought it would be interesting to have the model matching with its map icon... Anyway, here is my incomplete attempt at the imitation replica of the Ghorkov power station model.
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

User avatar
Zidane
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 168
Joined: Mon Nov 22, 2010 8:38 pm
Location: Novosibirsk, Russia

Re: SEN2 Functionality Revealed

Post by Zidane » Tue Aug 01, 2017 5:44 pm

Code: Select all

size_t NC_STACK_skeleton::skeleton_func132(skeleton_arg_132 *arg)
{
    UAskeleton::Data *sklt = this->stack__skeleton.data;
    int result = 1;

    if ( sklt->SEN_NUM )
    {
        if ( sklt->SEN_NUM < (sklt->POO_NUM / 4) )
            result = TransformVertexes(arg, sklt->SEN, sklt->tformedVertex, sklt->SEN_NUM);
    }

    if ( result )
        result = TransformVertexes(arg, sklt->POO, sklt->tformedVertex, sklt->POO_NUM);

    return result;
}
Only one place where SEN was used.
It will perform transformations for SEN only if number of SEN is smaller then 1/4 of POO, else perform POO transformation. After SEN transformation it will return if any part is visible. If yes - do POO transform and return if it visible, if else return not visible.
It's only for fast visibility check.
合体! ライオカイザー

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: SEN2 Functionality Revealed

Post by CharlotteLabyrinth » Tue Aug 01, 2017 7:08 pm

Zidane wrote:

Code: Select all

size_t NC_STACK_skeleton::skeleton_func132(skeleton_arg_132 *arg)
{
    UAskeleton::Data *sklt = this->stack__skeleton.data;
    int result = 1;

    if ( sklt->SEN_NUM )
    {
        if ( sklt->SEN_NUM < (sklt->POO_NUM / 4) )
            result = TransformVertexes(arg, sklt->SEN, sklt->tformedVertex, sklt->SEN_NUM);
    }

    if ( result )
        result = TransformVertexes(arg, sklt->POO, sklt->tformedVertex, sklt->POO_NUM);

    return result;
}
Only one place where SEN was used.
It will perform transformations for SEN only if number of SEN is smaller then 1/4 of POO, else perform POO transformation. After SEN transformation it will return if any part is visible. If yes - do POO transform and return if it visible, if else return not visible.
It's only for fast visibility check.
Ah, many thanks for the further elucidation Zidane! ;)

So does it mean that skeleton files will only attempt to employ SEN2 sections when the sizes of POO2 sections are larger than 0x00000180? That might also explain why some files do not have any SEN2 parts at all as well.

Additionally now I admit that my 'centre rendering' theory was nothing but a merely hypothetical assumption. Next time I should be more attentive to avoid stating such faulty premises and quick generalisations before the fact.
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

Post Reply