Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (602)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 7
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-31 04:42:04
It actually works pretty well.
Nice ^^
I want make someting same =)
http://pixologic.com/zbrush/features/shadowbox/
http://docs.pixologic.com/user-guide/3d-modeling/modeling-basics/creating-meshes/shadowbox/

but still don't sure how to improve it
+ my drawing skills is so low so i can't properly see result from visual side, and easy to draw - not as programmer)
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-30 09:02:44
Start making separate file – AST File Header.
If some one say me before that for parsing code I need separate Header AST
–I say to him: why? I don’t need it Wink
And now I need it - because no one wants reparse every text file in big project when you run IDE =)
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-28 10:03:43
Parse this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
DFG T_Class_Fun_Call_Prim_0{&

   Data B_Extra{~
      b4 int_0
      Static b4 int_1
   ~}
   
   Fun Class_Call{@
      Class fun_Class_Call(^ b4 a, ..b #= 3 ^){$
         b4 aa = 1;
         a = a + 1;
         int_0 = aa - a;
         int_1 = aa - a;
         return
      $}
   @}
&}


to this =)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
package AS.Parse.Pars_Basick;
import AS.Class_Inst;
import AS.Class_Type;
import AS.Fun_Data_Call_CL;
import AS.Fun_Data_Use;
import AS.Fun_Type;

public class T_Class_Fun_Call_Prim_0 extends Class_Inst{
   static protected T_Class_Fun_Call_Prim_0_Type Cl_S = new T_Class_Fun_Call_Prim_0_Type();

   public int int_0;
   static public int int_1;

   @Override
   public T_Class_Fun_Call_Prim_0_Type get_Class(){return Cl_S;}

   static protected class fun_Class_Call extends Fun_Type{
      public fun_Class_Call(Class_Type CL, int pos, int line){super(CL, pos, line);}
      @Override
      protected Fun_Data_Call_CL cr_Data_Call(){return new fun_Class_Call_C(this);}
      @Override
      protected Fun_Data_Use cr_Data_Use(){return new fun_Class_Call_U();}

      static public class fun_Class_Call_U extends Fun_Data_Use{
         int a;
         int b;

         @Override
         public void Set_Def(){
            b = 3;
         }
      }

      static public class fun_Class_Call_C extends Fun_Data_Call_CL<T_Class_Fun_Call_Prim_0, fun_Class_Call_U>{

         int aa;

         public fun_Class_Call_C(Fun_Type type){super(type);}
         @Override
         public void F(T_Class_Fun_Call_Prim_0 c_S, fun_Class_Call_U D_U){
            aa = 1;
            D_U.a = D_U.a + 1;
            c_S.int_0 = aa - D_U.a;
            T_Class_Fun_Call_Prim_0.int_1 = aa - D_U.a;
            return;
         }
      }
   }

   static protected class T_Class_Fun_Call_Prim_0_Type extends Class_Type{
      public T_Class_Fun_Call_Prim_0_Type(){super("T_Class_Fun_Call_Prim_0");}
      public fun_Class_Call fun_Class_Call = new fun_Class_Call(this, 15, 9);
   }
}

What i am doing?
I don't know  Clueless
It's madness... XD
(its only like 10-20% from something fully worked Sad )

(strange brackets is for visual and later IDE formater will be adding them self)
4  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-28 01:09:15
Adding lerping
add lerp to code, don't know why)
on 12 bits %f give Largest Error 0,000003)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
   static final private float Pi = (float)Math.PI;
   static final private float Pi_D = Pi * 2;
   static final private int Size_SC_Bits_Ac = 12;
   static final private int Size_SC_Ar = 1 << Size_SC_Bits_Ac;
   static final private int Size_SC_Bits_M = Size_SC_Ar - 1;
   static final private float Sin[] = new float[Size_SC_Ar + 1];
   static final private float Cos[] = new float[Size_SC_Ar + 1];
   static final private float Pi_SC_D = Pi_D / Size_SC_Ar;
   static{
         for(int i = 0; i < Size_SC_Ar + 1; i++){
            double d = i * Pi_SC_D;
            Sin[i] = (float) Math.sin(d);
            Cos[i] = (float) Math.cos(d);
         }
   }

   static final public float sin_L_theagentd(float rad) {
         float index = rad / Pi_SC_D;
         
         int ii = (int)index;
         float alpha = index - ii;
         
         int i = ii & Size_SC_Bits_M;
         
         float sin1 = Sin[i];
         float sin2 = Sin[i + 1];
         
         return sin1 * (1f - alpha) + sin2 * alpha;
   }
   
     
   static final public float cos_L_theagentd(float rad) {
         float index = rad / Pi_SC_D;
         
         int ii = (int)index;
         float alpha = index - ii;
         
         int i = ii & Size_SC_Bits_M;
         
         float cos1 = Cos[i];
         float cos2 = Cos[i + 1];
         
         return cos1 * (1f - alpha) + cos2 * alpha;
   }

p.s try add lerp to atan - but code becomes too heavy visual, so trow it)
5  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-27 20:33:34
now replace
r / Pi_SC_Dp
with
r * Inv_Pi_SC_Dp
and you copied my code exactly Roll Eyes
Yep ^^
i can't say copy i change "if with %" on "&" with size align to bit natural grov =)
but y, i see such optimization first time here, so thanks for share it Wink

(technically it one algo so no need add duplicate in chart)

But i don't know why
1  
2  
3  
-0.5PI .. +0.5PI   min err      max err      avg err      stddev
icecore         0.000000   0.001532   0.000485   0.000391
riven           0.000000   0.002299   0.000609   0.000559

on 12 BITS
6  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-27 20:16:28
Use Riven Bit =)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
   static final private float Pi = (float)Math.PI;
   static final private float Pi_D = Pi * 2;
   static final private int Size_SC_Bits_Ac = 12;
   static final private int Size_SC_Ar = 1 << Size_SC_Bits_Ac;
   static final private int Size_SC_Bits_M = Size_SC_Ar - 1;
   static final private float Sin[] = new float[Size_SC_Ar];
   static final private float Cos[] = new float[Size_SC_Ar];
   static final private float Pi_SC_D = Pi_D / Size_SC_Ar;
    static{
         for(int i = 0; i < Size_SC_Ar; i++){
            double d = i * Pi_SC_D;
            Sin[i] = (float) Math.sin(d);
            Cos[i] = (float) Math.cos(d);
         }
    }
     
   static final public float sin(float r){
      return Sin[(int)(r / Pi_SC_D) & Size_SC_Bits_M];
   }
   
   static final public float cos(float r){
      return Cos[(int)(r / Pi_SC_D) & Size_SC_Bits_M];
   }
7  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-27 20:00:39
(i thnk magic in % Remainder operation float)
Fix it)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
   static final private float Pi = (float)Math.PI;
   static final private float Pi_D = Pi * 2;
   static final private int Size_SC_Ac = 5000;
   static final private int Size_SC_Ar = Size_SC_Ac + 1;
   static final private float Sin[] = new float[Size_SC_Ar];
   static final private float Cos[] = new float[Size_SC_Ar];
   static final private float Pi_SC_D = Pi_D / Size_SC_Ac;
   static final private int Pi_SC_D_Rem = (int)(Pi_D / Pi_SC_D);
    static{
         for(int i = 0; i < Size_SC_Ar; i++){
            double d = i * Pi_SC_D;
            Sin[i] = (float) Math.sin(d);
            Cos[i] = (float) Math.cos(d);
         }
    }
     
   static final public float sin(float r){
      if(r < 0){
         return Sin[((int)(r / Pi_SC_D) % Pi_SC_D_Rem) + Pi_SC_D_Rem];
      }
      else{
         return Sin[(int)(r / Pi_SC_D) % Pi_SC_D_Rem];
      }
   }
   
   static final public float cos(float r){
      if(r < 0){
         return Cos[((int)(r / Pi_SC_D) % Pi_SC_D_Rem) + Pi_SC_D_Rem];
      }
      else{
         return Cos[(int)(r / Pi_SC_D) % Pi_SC_D_Rem];
      }
   }


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
linear progression -0.5PI..+0.5PI:
    java.math   64.369 ns/op
    devmaster   29.441 ns/op
    icecore     13.827 ns/op
    riven       11.395 ns/op
    kappa        8.976 ns/op

linear progression -8PI..+8PI:
    java.math   93.948 ns/op
    devmaster   30.792 ns/op
    icecore     14.076 ns/op
    riven       11.319 ns/op
    kappa        9.439 ns/op

input float[]/L1 -0.5PI..+0.5PI:
    java.math   75.743 ns/op
    devmaster   34.110 ns/op
    icecore     23.574 ns/op
    riven        3.197 ns/op
    kappa       16.083 ns/op
8  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-27 18:40:35
Not so fast as i hope)
(i thnk magic in % Remainder operation float)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
linear progression -0.5PI..+0.5PI:
    java.math   68.584 ns/op
    devmaster   30.111 ns/op
    icecore     29.352 ns/op
    riven       13.923 ns/op
    kappa       10.247 ns/op

linear progression -8PI..+8PI:
    java.math   96.521 ns/op
    devmaster   31.088 ns/op
    icecore     29.686 ns/op
    riven       10.896 ns/op
    kappa       10.368 ns/op

input float[]/L1 -0.5PI..+0.5PI:
    java.math   73.849 ns/op
    devmaster   34.602 ns/op
    icecore     20.253 ns/op
    riven        3.180 ns/op
    kappa       14.639 ns/op
9  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-27 01:51:20
this is my lookup table)

(Riven's looks fastest)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
   static final private int Size_SC_Ac = 5000;
   static final private int Size_SC_Ar = Size_SC_Ac + 1;
   static final private float Sin[] = new float[Size_SC_Ar];
   static final private float Cos[] = new float[Size_SC_Ar];
   static final private float Pi = (float)Math.PI;
   static final private float Pi_D = Pi * 2;
   static final private float Pi_SC_D = Pi_D / Size_SC_Ac;
   static{
      for(int i = 0; i < Size_SC_Ar; i++){
         double d = i * Pi_SC_D;
         Sin[i] = (float)Math.sin(d);
         Cos[i] = (float)Math.cos(d);
      }
   }
   
   static final public float sin(float r){
      float rp = r % Pi_D;
      if(rp < 0){
         rp += Pi_D;
      }
      return Sin[(int)(rp / Pi_SC_D)];
   }
   
   static final public float cos(float r){
      float rp = r % Pi_D;
      if(rp < 0){
         rp += Pi_D;
      }
      return Cos[(int)(rp / Pi_SC_D)];
   }
10  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-27 00:04:59
Well, devmaster's critically errors past 180
then we need 2 performance lists.

I think i fix it )

(i think +-  can be easy align somewhere in formula but i don't see it)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
    static final private float Pi_D = Pi * 2;
    private static float devmaster_sin(float x){
       float x1 = x % Pi;
       float x2 = x % Pi_D;
         
        if(x > 0){
           float y = x1 * (B + C * x1);
           y = (y > 0) ? (y = P * (y * y - y) + y)
                     : (y = P * (-y * y - y) + y);
           float xp = x2 - Pi_D;
           if(!(xp < 0 && xp < -Pi)){
              y = -y;
           }
            return y;
        }
        else{
           float y = x1 * (B - C * x1);
           y = (y > 0) ? (y = P * (y * y - y) + y)
                     : (y = P * (-y * y - y) + y);
           float xp = x2 + Pi_D;
           if(xp > 0 && xp < Pi){
              y = -y;
           }
            return y;
        }
    }

    private static float devmaster_cos(float x) {
       float x0 = x + PI_2;
       float x1 = x0 % Pi;
       float x2 = x0 % Pi_D;
         
        if(x0 > 0){
           float y = x1 * (B + C * x1);
           y = (y > 0) ? (y = P * (y * y - y) + y)
                     : (y = P * (-y * y - y) + y);
           float xp = x2 - Pi_D;
           if(!(xp < 0 && xp < -Pi)){
              y = -y;
           }
            return y;
        }
        else{
           float y = x1 * (B - C * x1);
           y = (y > 0) ? (y = P * (y * y - y) + y)
                     : (y = P * (-y * y - y) + y);
           float xp = x2 + Pi_D;
           if(xp > 0 && xp < Pi){
              y = -y;
           }
            return y;
        }
    }


1  
2  
3  
A lower average means higher accuracy. Results over 18 001 samples.
math_devmaster_sin : Average Error 0,00050 / Largest Error 0,00109
math_devmaster_cos : Average Error 0,00050 / Largest Error 0,00110
11  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-26 22:59:40
1  
2  
3  
4  
 
    // Accuracy
    public static void main(String[] args) {
        int range = 90;

I think range must be bigger like 9000;
For any unnatural values, who knows when function can return critical error)
12  Game Development / Shared Code / Re: Extremely Fast atan2 on: 2015-07-26 22:47:48
I'm assuming they had a contract to fulfill in terms of accuracy that prevented the heavy optimization that we're doing in this thread.

With  lookup table: we can increase it size to increase accuracy.
1  
static final private int Size_Ac = 1000000;

1000000 give "Largest Error 0,000001"
(1000000  = 4mb float[])

+ This also can be used to decrease memory usage with low performance decrease
1  
2  
3  
4  
5  
Atan2_RMP[i] = -Pi_H + v;

Atan2_RMP[(int)(x / y * Size_Ac)];
==
-Pi_H + Atan2[(int)(x / y * Size_Ac)];

p.s increase sin, cos lookup table size can also work with Riven lookup table.
13  Game Development / Shared Code / Re: Extremely Fast atan2 on: 2015-07-26 20:54:50
I ran the benchmark with the addition of Icecore's atan2. I'll be updating the main post shortly. It appears to be in first place by a large margin.
Also, I updated the accuracy measure to actually have somewhat relevant data.
Nice)

Most interesting is – in theory this pattern:
Can be used to cache any returns function data with 2 primitive params like float.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
         double d = (double)i / Size_Ac;
         double x = 1;
         double y = x * d;
         Ar_PP[i] = fun(y, x);
         Ar_PM[i] = fun(y, -x);
         Ar_MP[i] = fun(-y, x);
         Ar_MM[i] = fun(-y, -x);
         
         Ar_RPP[i] = fun(x, y);
         Ar_RPM[i] = fun(x, -y);
         Ar_RMP[i] = fun(-x, y);
         Ar_RMM[i] = fun(-x, -y);
         
         //return save as atan2

But keep in mind because accuracy have errors,
result may be previous or next cached value.

Example
(1,2,3,4,5) want 3 return 4
(4,0,9,1,2,4) want 9 return 0

1  
         float ep = (Max - Min return val) / (Size_Ac * 4);

On practice all not so easy and usage only on certain condition
but why not try on custom function )
(don't forget to check results epsilon equal)
14  Game Development / Shared Code / Re: Extremely Fast atan2 on: 2015-07-26 07:46:36
Last op ^^
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
   static final private int Size_Ac = 1000;
   static final private int Size_Ar = Size_Ac + 1;
   static final private float Pi = (float)Math.PI;
   static final private float Pi_H = Pi / 2;
   
   static final private float Atan2[] = new float[Size_Ar];
   static final private float Atan2_PM[] = new float[Size_Ar];
   static final private float Atan2_MP[] = new float[Size_Ar];
   static final private float Atan2_MM[] = new float[Size_Ar];
   
   static final private float Atan2_R[] = new float[Size_Ar];
   static final private float Atan2_RPM[] = new float[Size_Ar];
   static final private float Atan2_RMP[] = new float[Size_Ar];
   static final private float Atan2_RMM[] = new float[Size_Ar];
   static{
      for(int i = 0; i <= Size_Ac; i++){
         double d = (double)i / Size_Ac;
         double x = 1;
         double y = x * d;
         float v = (float)Math.atan2(y, x);
         Atan2[i] = v;
         Atan2_PM[i] = Pi - v;
         Atan2_MP[i] = -v;
         Atan2_MM[i] = -Pi + v;
         
         Atan2_R[i] = Pi_H - v;
         Atan2_RPM[i] = Pi_H + v;
         Atan2_RMP[i] = -Pi_H + v;
         Atan2_RMM[i] = -Pi_H - v;
         // or
         /*
         Atan2[i] = (float)Math.atan2(y, x);
         Atan2_PM[i] = (float)Math.atan2(y, -x);
         Atan2_MP[i] = (float)Math.atan2(-y, x);
         Atan2_MM[i] = (float)Math.atan2(-y, -x);
         
         Atan2_R[i] = (float)Math.atan2(x, y);
         Atan2_RPM[i] = (float)Math.atan2(x, -y);
         Atan2_RMP[i] = (float)Math.atan2(-x, y);
         Atan2_RMM[i] = (float)Math.atan2(-x, -y);
         */

      }
   }
   static final public float atan2_Op_2(float y, float x){
      if(y < 0){
         if(x < 0){
            //(y < x) because == (-y > -x)
            if(y < x) return Atan2_RMM[(int)(x / y * Size_Ac)];
            else return Atan2_MM[(int)(y / x * Size_Ac)];  
         }
         else{
            y = -y;
            if(y > x) return Atan2_RMP[(int)(x / y * Size_Ac)];
            else return Atan2_MP[(int)(y / x * Size_Ac)];
         }
      }
      else{
         if(x < 0){
            x = -x;
            if(y > x) return Atan2_RPM[(int)(x / y * Size_Ac)];
            else return Atan2_PM[(int)(y / x * Size_Ac)];
         }
         else{
            if(y > x) return Atan2_R[(int)(x / y * Size_Ac)];
            else return Atan2[(int)(y / x * Size_Ac)];
         }
      }
   }

Value check

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
   static public void main(String[] args){
         int range = 100;
      float ep = (Pi * 2) / (Size_Ac * 6); // pass check
      //float ep = (Pi * 2) / (Size_Ac * 4); // regular
      //float ep = (Pi * 2) / (Size_Ac * 8); // theoretical but result dif on float error val calc
      System.out.println("Accuracy Check: " + ep);
      for(int x = -range; x <= range; x++){
         for(int y = -range; y <= range; y++){
            float a = (float)Math.atan2(x, y);
            float b = atan2_Op_2(x, y);
            float dif = a - b;
            if(Math.abs(dif) > ep){
               System.out.println("Dif x=" + x + " y= " + y);
               System.out.println(a);
               System.out.println(b);
            }
         }
      }
      System.out.println("Accuracy Check End");
   }

15  Game Development / Shared Code / Re: Extremely Fast atan2 on: 2015-07-25 22:00:31
I want also try  Tongue
"Ifs" can be optimize for better performance. ^^

UP:add atan2_Op

(May have bugs because write in 30 minutes, but test don't find them =) )
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
   static int Size_Ac = 10000;
   static double Atan2[] = new double[Size_Ac + 1];
   static double Pi = Math.PI;
   static double Pi_H = Pi / 2;
   static{
      for(int i = 0; i <= Size_Ac; i++){
         double d = (double)i / Size_Ac;
         double x = 1;
         double y = x * d;
         Atan2[i] = Math.atan2(y, x);
      }
   }
   
   static final public double atan2(double y, double x){
      double res;
      boolean ym = false;
      boolean xm = false;
      if(y < 0){
         ym = true;
         y = -y;
      }
      if(x < 0){
         xm = true;
         x = -x;
      }

      if(y > x){
         double d = x / y;
         int p = (int)(d * Size_Ac);
         res = Atan2[p];
         res = Pi_H - res;
      }
      else{
         double d = y / x;
         int p = (int)(d * Size_Ac);
         res = Atan2[p];
      }
     
      if(xm){
         res = Pi - res;
      }
     
      if(ym){
         res = -res;
      }
      return res;
   }
   
   static final public double atan2_Op(double y, double x){
      double res;
      if(y < 0){
         y = -y;
         if(x < 0){
            x = -x;
            if(y > x){
               double d = x / y;
               int p = (int)(d * Size_Ac);
               res = -Pi_H - Atan2[p];
            }
            else{
                 double d = y / x;
                 int p = (int)(d * Size_Ac);
                 res = -Pi + Atan2[p];
            }
         }
         else{
            if(y > x){
               double d = x / y;
               int p = (int)(d * Size_Ac);
               res = -Pi_H + Atan2[p];
            }
            else{
                 double d = y / x;
                 int p = (int)(d * Size_Ac);
                 res = -Atan2[p];
            }
         }
      }
      else{
         if(x < 0){
            x = -x;
            if(y > x){
               double d = x / y;
               int p = (int)(d * Size_Ac);
               res = Pi_H + Atan2[p];
            }
            else{
                 double d = y / x;
                 int p = (int)(d * Size_Ac);
                 res = Pi - Atan2[p];
            }
         }
         else{
            if(y > x){
               double d = x / y;
               int p = (int)(d * Size_Ac);
               res = Pi_H - Atan2[p];
            }
            else{
                 double d = y / x;
                 int p = (int)(d * Size_Ac);
                 res = Atan2[p];
            }
         }
      }
      return res;
   }
   static public void main(String[] args){
      double ep = 1d / Size_Ac;
      for(int x = -100; x <= 100; x++){
         for(int y = -100; y <= 100; y++){
            double a = Math.atan2(x, y);
            double b = atan2(x, y);
            double dif = a - b;
            if(Math.abs(dif) > ep){
               System.out.println(x + "Dif " + y);
               System.out.println(a);
               System.out.println(b);
            }
         }
      }

      System.out.println("End");
      System.out.println(Math.atan2(2222, -45454));
      System.out.println(atan2(2222, -45454));
   }
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-25 05:23:20
Finally cleaned up the re-sizing code and my game now supports any screen resolution! Well, nearly any..
Draw to PBO and then draw PBO window size ?)
(same with handle - simple mult X:Y on dif real PBO size with win draw size)
17  Games Center / Showcase / Re: Shard Master 3D Demo on: 2015-07-22 16:56:20
High Quality:
20-21 FPS
Mem: 14k - 18k

Low Quality:
20-21 FPS
Mem: 10k - 14k

20 fps OMg =)
Do you render on Cpu? don't see any native lib in jar (
>Up: find answer in main project thread - yes =)

Imho: nothing personal - i also doing software rendering - and it was fun.
but Fact:
in 1994 we have this
Click to Play

with 100 MHz Cpu and FPS 20-30

and now we have 4000 MHz * 4 cores – 120 fps =)

i think something wrong ^^
18  Games Center / Cube World Projects / Re: [LibGDX] Project Tranquil on: 2015-07-19 01:00:06
Made some pretty crazy performance improvements.
Want advice?)
Forget about performance. Terrain generation,
Visual Img quality, Code optimization (for now).
Make raw gameplay – inventory, craft – Stupid NPC etc.
As faster as you can, without optimize code, without plug-in system and another time consuming features
 – forget about everything else (you can returns to it later).
Or you projects eats you ^^

You even can’t imagine how many time will be spend on code optimization
Even if its looks like optimization is fun same as creating cool engine system.

First make raw gameplay – even without NPC models (use box instead), sound, textures,
And after you will have at least minimal playable game, add properly quality content to it.
This is very important for one man project.

Hope you listen me and this help make project real)
19  Game Development / Newbie & Debugging Questions / Re: How to handle exceptions in other threads on: 2015-07-01 11:21:57
1  
2  
3  
4  
5  
6  
7  
static ArrayList<Exception> exeptions;

   ...catch (Exception e){
         synchronized(exeptions){
            exeptions.add(e);
         }
   }

=)
20  Discussions / General Discussions / Re: Error handling and reporting on: 2015-06-18 13:29:55
I think IMHO: better way: when user have crash is:
Show button "send crash report", with field where hi can enter own email for back answer.
But it can be anonymous.

It’s easy - one click send and it can be anonymous – perfect for crash harvesting ^^
21  Discussions / Miscellaneous Topics / Re: What IDE colour theme do you use? on: 2015-06-18 13:22:52
For now i using dark eclipse.
But before i used default white - couple years)

my IMHO: with white you can see all code at once,
with black i can focus on some part but it hard to watch all at once as with white,
but black is less tired eyes, so i use black Smiley
22  Discussions / Business and Project Management Discussions / Re: Android publishing problem, need a helping hand on: 2015-06-15 20:01:54
Here's a video I just took
I want help but don't have Google account Sad
But I have good advice “I think so”
Port game on Html 5 (for small games)
First it will run on android and IOS + Pc
Second you can give it many publishers with mini games,
Simple google “publishers html 5” and “games html 5”
I think its perfect for small games + even can make small income.
http://www.truevalhalla.com/

Don’t think that you can make same money as he Smiley
(IMHO: i really skeptic about numbers of income hi show)
But attest it some small money.

Pc: I don’t try this but keeps this in my mind, when finish with own non game project Wink
i want try this or maybe make some social MMo game - times will show.
23  Discussions / General Discussions / Re: Making a wiki about voxel games on: 2015-06-01 14:07:31
Tell me what you think? Should I or shouldn't I?

I will be happy see good wiki )
Same as one big list voxel games by categories.
(yes I see such list in many places but they not updating )
+ maybe list other similar creative games like factorio etc…

and I realized that I was teaching bad code.
We all start from bad code Wink
and many tutorial in google same bad unoptimaze code but its work
And main task of tutorial: make it work - without critical bugs, as simples as possible.

Or, do you want to help me with this?
We all want, but not many from us want do this full time in any time of day or night.
In free time when we have mood.
(We all want wiki’s ^^ because wiki is one place when you can find all info)

But its hard find full time helping hand.
So need someone who lead wiki and other can help and edit errors)

so if you like do this: be prepare at beginning do big part of work,
and after some time ppl will help you – same as they start creating mods in minecraft =)

p.s ask on minecraft forum maybe find there full time help on couple days.
24  Discussions / General Discussions / Re: How many projects do you go through? on: 2015-05-31 08:45:22
Suddenly lying on bed I understand how many project I pass and fill sad because some of them i not completed ;(

I will write only viewable projects and commercial, leavening many prototypes.
2 my own project.

Polyrun - Monopoly http://www.java-gaming.org/index.php?topic=29126.0
World of change – minecraft http://www.java-gaming.org/topics/world-of-change/23947/msg/199589/view.html

Site is off but this old version:
http://tureal.uk.to/About_Game.php?Game=1

Commercial projects)
Worked on evil company that make projects as long as they can to many more money ;(

Be part off 5-8+  Hog games – make mini games for them and gameplay mechanics

http://www.iwin.com/games/the-cursed-island-mask-of-baragus-collectors-edition
http://www.bigfishgames.com/games/7727/into-the-haze/?pc
http://www.bigfishgames.com/games/8215/christmas-adventure-candy-storm/?pc

else 5+ projects not realized (dropped but many of them was finished on 60-80%)
– and I don’t have screens on local PC Sad

plus four more games (I very sad about them)
they almost ready, but company close them.

first is like zuma + tetris with story achievements – rd on 50%:

all game mechanics, easy lvl editor – need make art, story, lvl and twist items, bonuses etc.
   
second is like My Tribe - http://www.bigfishgames.com/games/2773/my-tribe/
Very sad about is rd on 85% i was Team Lead ther Roll Eyes  - it was 3 month to realize with polish month.

I make Ai, resource, research, buildings, editor etc.
We do almost all – but last programmer leave except me and Chief), and sponsor
Think to froze project:
(not without Chief help, hi want change art and sell game from self name XD)

Third: is game like road to Rome http://www.bigfishgames.com/online-games/12058/roads-of-rome/index.html
Rd on 50-60% - 4-5 moths to realize.
and here Team Lead.
(but no programmers left to lead for XD)

Harvest Building, Units Road Ai (it harder then may think its like Srettlers), custom lvl editor agane) (its not unity wher 1 editor on all games)

Four: is 15-puzzle game – even don’t know who pay for this, as single game even with commercial art)
rd - 95%

(need Main menu and game polish), when I leave company

And this because its Weird ^^
http://www.java-gaming.org/topics/real-4d-world-rendering/29604/msg/271996/view.html

up Forgot: 6 projects with other ppl 10-20% rd max=)

+Have HOG engine on Unity )
Rd on 30-40% like for full game.
With excel scripts, and Photoshop export XD
Made it for custom work project but… sponsor disappear (I make all for free in own time ^^)

p.s can find screens if find harder in google, company task tracker but this is not relized games - so no one care ;(

If someone think that I make big money working on middle indie games (there budget is 50k – 300k)
I must say no ;( working in USA MacDonald’s gives bigger salary,
but it was fun and salary in MacDonald’s in my country lower so it's not so bad ^^


pp.s
Am I the only one?
I think we all go thru this time over time.
It become easier when you already do something same,
It looks hard only when you need make something new, that you never do before.
So in this case – create new concept, and make something basical
is like make something simple what you already do so many times Smiley
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-27 23:12:05
JVM does not have a native FFI.
Do you try JNA http://en.wikipedia.org/wiki/Java_Native_Access ?

after decompiling the JDBC driver we use and seeing the horrors that laid inside. Bad API and bad implementations and everyone's using this shit.

no words, only sad  Sad
26  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-23 23:10:22
There is no other way than to delete directory structures recursively.
Lol, Yes you right - even don't now how i forgot this XD
I think about move folder to recycle Bin windows,
(because file manager move separately all files and folders and java simple delete all)
its no so easy in java, but it possible using JNI.
http://en.wikipedia.org/wiki/Java_Native_Access
27  Discussions / Miscellaneous Topics / Re: What are your current personal projects? on: 2015-05-23 09:08:23
Well it's pretty basic right now. Just your basic GDT/IDT/ISR, 32 bit kernel. I'm working on keyboard input as I'm typing this. After that I'll implement some sort of filesystem, mostly likely some FAT variant.
What reference do you Use?)
My personal code reference for OS development – is KolibriOs and Linux Kernel (maybe FreeDOS, BSD) ^^.
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-23 08:58:17
I find myself funny... Grin
Don’t delete folders like that, really )
Simple delete Top folder.
It may be strange but File manager that i use Multi commander (like it color customization)
Delete files such way and this is nightmare, Why hi doing this???
29  Discussions / Miscellaneous Topics / Re: What are your current personal projects? on: 2015-05-22 19:37:01
Making own programming language with IDE for him ^^
Always have a dream make own language, but without working IDE its like programming in notepad.
(I understand this after couple years of programming)

So now making IDE.
(even don’t have idea how make custom debugger Sad, so in theory for start will convert code to java and debug on java)

Try find at lest some one rd solution, but all I find in internet is custom script language with sad syntax upgrade, same as IDE they so hard to modify even eclipse with plug-in support (rewrite java eclipse AST is hard)
So because I in any case will rewrite so many things I decide make own IDE =)
IDE its like game engine with good window system.

Do this already 6 months Wink
(Custom render, windows, repaint, file tree, etc – nonsense when we have java fx, etc - but its funny)

Current task is: make Save load IDE status – like open windows, etc…

p.s its only personal project: because in practical purposes – no one care 1 more language or IDE
we already have so many them, with big Development team, tutorials and great support.
30  Discussions / Miscellaneous Topics / Re: I'm baaaaack... on: 2015-05-20 20:42:04
No, they can't.
They can't do fallout or skyrim, but they can do flappy bird - copy past tutorials, or tweak ready project )
(if not self then with parents not programmers help - only by video tutorials)
https://www.youtube.com/watch?v=FiHrFGd7Iro

They just get the impression that they could, because everything is so visual oriented and shiny.
This was a talking about
– the problem not in “they can do games”
– problems in “they never make it or even try to make and think that’s easy”
– because so many engines, tutorials etc.
But we can’t change that.

Don't spend years of your life on something that will give you almost nothing in return.

And this is most important question in our life for all of us =)

What you can do more important in free time then programming?
In most cases: drink, make fun, play games, watch videos, sleep and another stuff “that will give you almost nothing in return” in next days even not talking about next months or years.

Let flame this question, really I want know you’re opinion – what alternative you have? =)
Pages: [1] 2 3 ... 7
 
Jesse (15 views)
2015-07-29 04:35:27

Riven (37 views)
2015-07-27 16:38:00

Riven (18 views)
2015-07-27 15:35:20

Riven (21 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (30 views)
2015-07-25 00:14:37

BurntPizza (41 views)
2015-07-24 22:06:39

BurntPizza (24 views)
2015-07-24 06:06:53

NoxInc (31 views)
2015-07-22 22:16:53

NoxInc (18 views)
2015-07-22 22:13:39
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!