Modding, Mission Design, and Coding > The Scripting Workshop

Where to go from here

<< < (2/3) > >>

Bobboau:

--- Quote from: WMCoolmon on January 21, 2007, 02:47:07 am ---I hate the orientation object with a passion. Not because it's a bad piece of work, but because it's inherently bad. Matrices are not designed for access via p, b, and h. Period. Every single time one of those variables is changed, and one of the internal functions needs the actual matrix object, it has to rebuild the actual matrix based on those three values. That involves a lot of floating point math. This requires two function calls to make sure that the up-to-date values are calculated (for the matrix and pbh halves of the orientation object), as well as setting a flag every time either is changed so the computer knows that it needs to update the other in order to use it...it's a mess, and I think that making every single 'direction' variable in the code a vector normal is a great idea.

--- End quote ---

don't forget that translateing from PBH to matrix, or matrix to PBH, is not only slower than a molasses golem on pluto ordered to move slowly, but it is also inherently very much inaccurate as all hell.

WMCoolmon:

--- Quote from: Nuke on January 21, 2007, 04:02:20 am ---the only funcs ive used that dont properly scale to the game resolution are the io.getMouseX() io.getMouseY() and :getScreenCoords(). theyre might be others that im not familiar with.

as for the matrix would it be better to split the pbh and matrix into seprate objects? phb would be used on local stuff, like turrets, subobjects, physics ect. its hard to do things like turn rate with normals, but for stuff like creating weapons and cameras a normal is far more preferable. a matrix still has its uses for vector rotations and such but only as a read only entity or at least write all or nothing. for operations that require orientations you still need conversion functions. if i have a matrix that works i might as well use it but if i dont i can call a conversion function to generate a matrix off of a phb or a normal.

--- End quote ---

They'd still have to be converted to a matrix once they left the Lua environment though, so there wouldn't be any significant performance gain. In both cases you'd still have to do a matrix->angles (scripting)->matrix conversion. So it wouldn't really speed things up.

A vector->matrix conversion looks faster. I don't know about a matrix->vector conversion, or how easy it would be to make a rotate() function for a normalized vector that took three angles.

Bobboau:
well you know the orientation for subobjects IS PBH based, not matrix, which was why off axis rotation was such a *****. (I had to define what the matrix should have been in resting then make an inverse apply the PBH rotations to the inverse, then multiply that by the whatiswassuposedtobe matrix, and then send THAT to the rest of the game engine) you could make them separate objects return the one which is appropriate and have conversion functions. as it is now LUA is not reflecting what is actually in the game.

Nuke:
you can multiply matricies? maybe in c but im not sure about lua. i dont see that operator for the orientation object in scripting.html

WMCoolmon:

--- Quote from: Bobboau on January 23, 2007, 05:00:19 am ---well you know the orientation for subobjects IS PBH based, not matrix, which was why off axis rotation was such a *****. (I had to define what the matrix should have been in resting then make an inverse apply the PBH rotations to the inverse, then multiply that by the whatiswassuposedtobe matrix, and then send THAT to the rest of the game engine) you could make them separate objects return the one which is appropriate and have conversion functions. as it is now LUA is not reflecting what is actually in the game.

--- End quote ---

Well, yeah, right now Lua uses the orientation type that attempts to convert between the formats when needed and as little as possible. As much as it bugs me, it does seem less silly in the long run than using static angles types - which would _always_ have to undergo conversion for reading and writing. Normalized vectors - which couldn't specify ship roll, AFAIK. And pure matrices, which wouldn't be user editable at all. Or using all three, which now means that rather than learning two general datatypes, a modder has to learn four, and convert between them (manually) as needed.

I'm not sure what the 'bar' for the learning curve should be, since right now I have two respondents. One who specializes in 3D programming, and one modder with some years experience with FS2 and who's been following the SCP and development of the scripting system for a fair chunk of the last year or so. I'm not getting a good baseline for what I'd see as the 'average scripter' from this group. :p

I'll probably have to look up what they do in WoW or something.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version