Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 25 Vote(s) - 4.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Us To Improve the Wiki!
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#81
RE: Help Us To Improve the Wiki!

One thing I have noticed is that music priority info is damn wrong. It says 0 is highest priority and 1 is lower what is damn wrong.

As much I have used it, 1 is higher priority then 0. 2 is higher then 1. Meaning that 0 is lowest :/

The Interrogation
Chapter 1

My tutorials
08-21-2011, 10:23 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#82
RE: Help Us To Improve the Wiki!

0 always worked as highest priority for me!

Ba-da bing, ba-da boom.
08-21-2011, 10:49 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#83
RE: Help Us To Improve the Wiki!

Tested:
"0" works better than "1"

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

08-22-2011, 04:54 AM
Website Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#84
RE: Help Us To Improve the Wiki!

Weird, works opposite to me.

The Interrogation
Chapter 1

My tutorials
08-22-2011, 10:01 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#85
RE: Help Us To Improve the Wiki!

I was thinking about what other sort of resources might be worth while producing (Hoping to get what would amount to maybe 5 pages or so - enough to kick off a new "resources" script category). In a previous post i put up some basic string parsing & a proper dynamic list structure - which covers two pages. Math functions (sin/cos/tan and inverses + sqrt) are certainly worth considering for a third. Perhaps stacks/queues? or maybe something a little more interesting?



The second part of this is of course what formatting I should use. I've been writing with folding regions as defined by my updated notepad++ files (I want to have these replace the outdated version but I can't upload files to the wiki! If somebody would be so kind as to upload the latest version it would be v. useful).
But perhaps it is better to strip out all but very simplistic comments - moving the documentation into the wiki page for each resource?

Of course, I don't want to be soloing this resources idea so if anyone would like to get working on it too it'd help out alot! Smile I probably wont get around to this until after my map for teamnesia & have made more progress on my current WIP anyway.

Edit:
Here's the progress i'm willing to make on the math part for now - i'm tired and mathed out - not all fully tested (atan2 is untested but simply lifted from gamedev so it should work?) Again, all of this has folding regions as per the updated np++ files.
//Begin Math
//+ Constants
const float PI = 3.1415926535f;
const float HPI = PI * 0.5f;
const float PI2 = PI * 2.0f;
//-
//+ Sign Of
int sign(float &in x) { if(x==0.0f) return 0; return (x>0.0f)?1:-1; }
int sign(int &in x)   { if(x==0)    return 0; return (x>0)?1:-1; }
//-
//+ Abs
float abs(float &in x) { return (x>0.0f)?x:-x; }
int abs(int &in x)     { return (x>0)?x:-x; }
//-
//+ Approx
//Determines if two numbers are approximately equal (Differ by no more than epsilon)
bool approx(float &in x, float &in y, float &in epsilon) {
float delta = x-y; return ((delta>0?delta:-delta) <= (epsilon>0?epsilon:-epsilon)); }
//-
//+ Sqrt
//Prereq: Approx
//Returns the squareroot of x
const uint32 _SQRTITERATIONS=16; //Maximum number of iterations for sqrt computation
const float  _SQRTDELTA=0.00001f; //Margin of error allowable if complete before iteration ceiling
float sqrt(float &in x) {
  if(x<=0) return 0; //Early out - not valid input.
  uint32 i = 0; float o = x * 0.5f;
  while( i<_SQRTITERATIONS && !approx(o*o,x,_SQRTDELTA) && o != 0)
    { o = 0.5f * (o + x/o); i++; }
  return o;             }
//-
//+ Max/Min
//Max: Returns largest of two numbers
//Min: Returns smallest of two numbers
float max(float &in x, float &in y) { return x>y?x:y; }
int max(int &in x, int &in y) { return x>y?x:y; }
float min(float &in x, float &in y) { return x<y?x:y; }
int min(int &in x, int &in y) { return x<y?x:y; }
float clamp(float &in x, float &in upper, float &in lower) { return (x<lower?lower:(x<upper?x:upper)); }
int clamp(int &in x, int &in upper, int &in lower) { return (x<lower?lower:(x<upper?x:upper)); }
//-
//+ Factorial
uint32 fact(uint32 &in x) { if(x==0) return 1;
    uint32 y = x; for(uint32 i=x-1; i>0; i--) y*=i; return y; }
int fact(int &in x)       { if(x<=0) return 1;
    int y = x; for(int i=x-1; i>0; i--) y*=i; return y; }
//-
//+ Conversions
//Degrees to radians
float degtorad(float &in x) { return x * 0.0174532925f; }
//Radians to degrees
float radtodeg(float &in x) { return x * 57.2957795f; }
//-
//+ Trig Functions
//+ ..Helper
const float  _TRIGARCTANLIM=128.0f; //Value when x exceeds 90 is returned
const uint32 _TRIGITERATIONS=32; //Maximum number of iterations for sqrt computation
const float  _TRIGDELTA=0.00001f; //Smallest diff for trig vals
//Constrains X : -PI<X<PI
float trigClamp(float &in x) {
if(x > PI || x < -PI)
  { int t = x/PI2; return x-t*PI2; }
else return x;
}
//-
//+ ..Sin/Cos/Tan
//COSINE
float cos(float &in y) {
  float x = trigClamp(y);
  float t,s; t=1.0f; s = 1.0f; uint32 p=0;
  while( p<_TRIGITERATIONS)
   { p++; t = (-t * x * x) / ((2 * p - 1) * (2 * p)); s+=t; }
  return s;
}
//SINE
float sin(float &in y) {
  return cos(y-HPI);
}
//TAN (Tan(90 deg) Returns 0xFFFFFFFF [Use isInf()])
float tan(float &in y) {
  float x = trigClamp(y);
  float c = cos(x);
  if(c > -_TRIGDELTA/2 && c <_TRIGDELTA/2) return float(0xFFFFFFFF); //Return #+INF                                        
  return cos(x-HPI)/c;
}
//-
//+ ..ARC Sin/Cos/Tan [APPROX]
float arccos(float &in x) {
return trigClamp((-0.69813170079773212f * x * x - 0.87266462599716477f) * x + 1.5707963267948966f); }
float arcsin(float &in x) { return trigClamp(HPI-arccos(x)); }
float arctan(float &in x) {  if(x > _TRIGARCTANLIM) return HPI;
else if(x < -_TRIGARCTANLIM) return -HPI; else return trigClamp(HPI-arccos(x/sqrt(x*x+1.1f))); }
float arctan2(float &in x, float &in y) {
float c1 = HPI * 0.5f;    float c2 = 3.0f * c1; float abs_y = abs(y); float angle;    
if (x >= 0) { float r = (x - abs_y) / (x + abs_y);    angle = c1 - c1 * r;    }
else { float r = (x + abs_y) / (abs_y - x);    angle = c2 - c1 * r;    }    
return y<0?-angle:angle; }
//Can somebody actually get a good expansion to work here?
//-
//-
//+ Rounding
int floor(float &in x) { return int(x); }
int ceil(float &in x)  { int y = int(x); return (y==x?y:y+1); }
int round(float &in x) { int y = int(x); return (y+0.5f>x)?y:(y+1);}
//-
//End

Edit 2:
arctan2 works.
(This post was last modified: 12-09-2011, 05:37 AM by Apjjm.)
09-05-2011, 06:13 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#86
RE: Help Us To Improve the Wiki!

I'll start adding my stuff then Smile

edit: Would be nice to get permission. I would prefer creating new pages for some stuff Smile

The Interrogation
Chapter 1

My tutorials
(This post was last modified: 10-19-2011, 08:16 PM by Elven.)
10-19-2011, 08:13 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#87
RE: Help Us To Improve the Wiki!

When you create a new account, you get the permission to write new articles, create new pages or even edit and improve existing ones.

10-19-2011, 09:13 PM
Website Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#88
RE: Help Us To Improve the Wiki!

Oh, I can edit... But I have no idea how to write new articles tho, or create new pages :/

The Interrogation
Chapter 1

My tutorials
10-19-2011, 10:17 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#89
RE: Help Us To Improve the Wiki!

I think Jens explained it in previous pages.

10-19-2011, 10:52 PM
Website Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#90
RE: Help Us To Improve the Wiki!

Thanks Smile! I think I found it Smile!

Edit: I noticed that you can't add youtube videos into wiki ;P.

The Interrogation
Chapter 1

My tutorials
(This post was last modified: 10-19-2011, 11:32 PM by Elven.)
10-19-2011, 10:59 PM
Find




Users browsing this thread: 13 Guest(s)