Archive: variable naming conventions


24th March 2003 09:16 UTC

variable naming conventions
of course its upto the artist to make variable name choices, but it would be convinient for the people here to decode the code for trouble shooting purposes.
so, what my idea is: everyone will use some standard variable names ( atleast while submiting here )
here's what my views are ( UnconeD's naming convention, suits me)

cx,sx,cy,sy,sz,sz: cosine/sine of rx,ry,rz (rotation angles)
cr,cg,cb: red,green,blue color used as the basis for the scope
ip: alternating 1,0 or 1,-1 variable
ox,oy,oz: camera position in a world-fixed 3D SSC or a 3D DM.
ot: usually used to normalize/equalize ox,oy,oz
k, dx, dy, dz (and k2, dx3, ...): used for raytracing a DM
ix,iy,iz: raytracing DM, coordinates of intersection of ray with object
af: aspect-ratio correction multiply factor
sd1, sd2, sd3: random generator registers
t, ti: time and timeshift (onbeat)

tpi: 2*pi
u is often a scaled value of i, used for evaluating paths
th,ph: often used as "theta, phi" for 3D polar coordinates
ph: sometimes used as phase for controlling the camera in a 3D dm. for example in Wolf3D, the camera can be in one of several 'modes' depending on where it is and what it has to do (face corridor, move ahead, stop and rotate, ...). Ph will have the values 1,2,3,4, for each possible phase a value.
bc: sometimes a beatcounter, when it will appear as bc=(bc+1)%8 (or different constant) in onbeat


24th March 2003 09:19 UTC

3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D



Why do want to bend everybody to your will anyway? Fight the system! This is racism against people who want to use variables as they damn well please.

This just pisses me off :mad:


24th March 2003 09:28 UTC

Nah, AVS convention is senceless until there are multiple ways to create 3D SSC's and DM's. And what about 2D or Semi 3D Stuff?

Forget it.


24th March 2003 20:34 UTC

I don't like the idea either. I suck way too much at making AVS at my current level to require those vars anyway, so I like to use my own to get a bit used to using vars.


24th March 2003 20:42 UTC

I'm not changing my already written code or changing my method of coding that i understand just because it's more convenient for everyone else. This is not a bad idea but i will not conform to it simply because my code is my code and i can write it however i want.


24th March 2003 20:49 UTC

I write my stuff how I want. It often uses many of the conventions, just because it helps me to see it as well.


25th March 2003 08:14 UTC

well, I already mentioned that it is upto the artist to use what variable names he wants..
but let me tell you.. I seriously try to help the people out, so this would be easier if we use some conventions ( or atleast tell which variables are used for what)


30th March 2003 00:35 UTC

i'm not going to waste my time telling what every single variable does...makes it WAY to easy to rip. plus, by looking at the code, it is easy to decipher a lot of variables. anyways, lots of my variables are self-explanitory: cnt, t, swtch, etc.

the only time when this would be useful is if the preset is meant to be customizable, like in some el-vis presets (drop in the bucket, corroded, etc.)


30th March 2003 10:14 UTC

well, atleast when you ask someone to figure out some problem in the code, you should explain the use


30th March 2003 19:30 UTC

well, that's a given