Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (683)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (751)
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 ... 28
1  Game Development / Game Mechanics / Re: [java] Rapid trigonometric calculations on: 2016-04-19 19:41:24
See this link:
Feel free to compare it against those implementations.

Thank you so much for that , I have copied over some of the methods and benchmarked against them , here are the results.

[0]   Valcalc.defcos!..........   6.33ns
[1]   Valcalc.defsin...........   6.33ns
[2]   Valcalc.deftan........!..........   6.34ns
[3]   Valcalc.devsin..!..........   51.7ns
[4]   Valcalc.kappasin..........   5.37ns
[5]   Valcalc.lcasssin..........   5.70ns
[6]   Valcalc.lcasssincostan.........!....!..........   5.69ns

The reason I found that Devmaster's method was so slow was due to the use of modulo which if used for different angles would be pretty slow.
Compared to the others mine held up quite well , it is quite clear that it is more efficient to calculate all three methods at the same time as shown by both my methods having almost identical times even though one produces three values. Naturally Kappa's wins because it was built to be as fast as possible with errors being allowed , it would be great for an explanation of how it works as it seems magical like the inverse square root calculation.

All values above use PI/6 as the input value which is pre calculated in order to effect the results as minimally as possible.
2  Game Development / Game Mechanics / [java] Rapid trigonometric calculations on: 2016-04-19 18:45:35
I was fairly bored earlier and decided to try to write a fast algorithm to calculate all the basic trig functions with optimizations made to their calculations due to similarities with their Taylor series.
Compared to functions such as the built in sin and cos it generally takes longer than each individual function but is faster that sin and cos performed at the same time and much faster than sin cos and tan calculated , I haven't compared it to more assembly based ones such as fsincos so I'm not really sure about that.

public double[] sincostan(double theta){
      int accuracy = 10;
      double sin = theta;
      double cos = 1;
      double exponential = theta;
      double factorial = 1;
      double even = -1;
      double increment = 2;
      for(int i = 1; i < accuracy; i++){
         exponential *=theta;
         factorial *= (increment);
         cos += (even/factorial) * exponential;
         increment ++;
         exponential *=theta;
         factorial *= (increment);
         sin += (even/factorial) * exponential;
         increment ++;
      double tan = sin/cos;
      return new double[]{sin,cos,tan};

It's simple enough to use , give a number of iterations as the accuracy variable (10 tends to give you the maximum accuracy when using doubles) and input theta as the angle in radians. If there are any improvements or comparisons please let me know!
3  Discussions / General Discussions / Re: Virtual machine ID on: 2015-07-23 15:52:58
For instance , on a piece of software called BYOND you are able to request a computer ID that returns an Integer of something like 384756237. This stays the same for the computer unlike the IP.
4  Discussions / General Discussions / Virtual machine ID on: 2015-07-23 13:40:58
This is more of a random question. Does a virtual machine running on a computer have a different ID number than the computer it's running on?
5  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-07-16 22:16:37
I played the recent one , I got to day 10 with a lot of success. My main issue is the firebolt towers , whilst useful for day 1 - 2 - 3 difficulty after that they just dont do enough damage. Maybe some splash damage towers? And buffing the fire bolt over time.
6  Game Development / Newbie & Debugging Questions / Re: Thread.Sleep(#) in gameloop on: 2015-07-13 15:14:45
ok so your cpu usage went straight up because the first loop you showed us had no pause , it would literally call that function asap every time. Which is really really bad. So you fixed it with your knowledge , which is good however thread.sleep() is not commonly used because it changes based on the types of operation in-between the calls. Calculating the difference between two points in time is much more viable. Take time at start , take time again store in a different variable. If the difference is large enough then call the update function , if not then just keep checking the time.
7  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-07-13 13:22:07
I would like to make a suggestion , currently the difficulty jumps up way too quickly to be able to build a village with even a lot of effort. considering that it can all go wrong at day 5 things should be pushed back a little bit.
8  Java Game APIs & Engines / Java 2D / Re: 2D Minecraft-Like Game, Rendering issue. on: 2015-07-12 21:09:09
it's not the logic tick that's the issue.
9  Java Game APIs & Engines / Java 2D / Re: 2D Minecraft-Like Game, Rendering issue. on: 2015-07-12 11:29:27
Java 2d , may god have mercy on your soul.
10  Games Center / Featured Games / Re: RFLEX - Playtesting! on: 2015-07-11 10:36:13
Is it going to be more than a 3 by 3 grid?
11  Discussions / Miscellaneous Topics / Re: What IDE colour theme do you use? on: 2015-07-09 11:36:38
I personally use a black text window with different coloured fonts and the standard surrounding. 1 I find it easier to navigate and 2 setting up the rest of the plugin is a bitch.
12  Games Center / WIP games, tools & toy projects / Re: Cosmic Menace on: 2015-07-05 12:48:45
I can feel the ss13 in here , nice work man I love it.
13  Game Development / Newbie & Debugging Questions / Re: How Do I Expand My Game? on: 2015-06-14 15:10:40
Firstly delete this post and move it to the newbie questions section. This isn't a wiki article.
14  Discussions / General Discussions / Re: Rayvolution's JGO Appreciation Thread (AKA: Free copies of Retro-Pixel Castles!) on: 2015-06-03 12:59:47
I bought it ages back , enjoy me cash!
15  Discussions / Miscellaneous Topics / Re: What is your opinion about ... on: 2015-06-01 16:53:35
System.out.println is love , System.out.println is life.
16  Game Development / Newbie & Debugging Questions / Re: Tile by tile lighting - Shader/alpha values/lightmap? on: 2015-05-24 21:11:23
So I just got done on my first try of implementing lighting! Sadly it only works for the player right now as I designed it around shadows where the player isn't rather than where the light is but I will change this. This method follows what Chrislo, Archive and Weston said

I will also need to learn how to only render the tiles on the screen as I had 45 fps with an i5 and GTX 970 persecutioncomplex but this was rendering a 2000x1900 world or so

I have a video! Smiley what do you guys think? (sorry about my coding music Roll Eyes)
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

Still you should be getting a few thousand fps with that. Something is definately wrong here , are you rendering the entire scene?
17  Game Development / Newbie & Debugging Questions / Re: Tile by tile lighting - Shader/alpha values/lightmap? on: 2015-05-24 12:35:33
Thats what I was thinking , libGDX . Doesn't it have a built in lighting system anyway? Sure you could tweak it.
18  Game Development / Newbie & Debugging Questions / Re: Libgdx 3D? on: 2015-05-24 12:35:03

I looked at your posts earlier , you have mentioned having troubles with 3d very frequently. The issue I have here is that when you started out less than a year ago you did'nt know where to start with a camera class , perfectly fine we were all beginners. But we didn't begin making magical games over night ,especially not 3d ones. Currently you should stick with 2D , the maths is simpler , your brain wont hurt as much and well it's just a lot faster to get a usable result from. When you have made a few 2D games , then start 3d because from what ive seen you cannot really understand it fully which is perfectly fine , but it also means that you need to be able to comprehend all the things you are doing in 2D first.
19  Game Development / Newbie & Debugging Questions / Re: Tile by tile lighting - Shader/alpha values/lightmap? on: 2015-05-24 11:52:19
Guess this depends on how you are doing it, are you using opengl? Could be simple to fit into a shader , just need some uniforms handed through.
20  Game Development / Newbie & Debugging Questions / Re: Image loading troubles on: 2015-05-21 09:51:50
Bit unreadable , put it into
21  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-19 21:01:08
Implemented projectiles and weapon tiles. Been a long time since I have developed this.

Please ignore the laggy gif , this one is usually able to occur at about 100fps (limited to 100fps)

Click to Play
22  Game Development / Newbie & Debugging Questions / Re: Voxel Engine Best way to render? on: 2015-05-16 15:33:24
Use google , there are a lot of ways to do this. The easiest is ray casting and suprisingly its the fastest. Go research it, seriously not difficult stuff.
23  Discussions / Miscellaneous Topics / Re: Data protection act on: 2015-05-16 14:10:51
Its in the uk , im just unsure . Say for instance I went to my bank and I wanted to see this data , they said yes but then removed my ability to transfer money to other accounts would they be allowed to do that?
24  Game Development / Newbie & Debugging Questions / Re: Voxel Engine Best way to render? on: 2015-05-15 15:20:07
Ok well , to edit each individual part you will need to regenerate the mesh . This can be expensive so I wouldnt suggest just meshing the entire object , meshing an object down by a power of 10 would improve performance but also prevent terrible lag. If you know it wont be modified ( through certain conditions) then mesh at will.
25  Game Development / Newbie & Debugging Questions / Re: Voxel Engine Best way to render? on: 2015-05-15 14:14:48
Ok so it doesnt look like they are actually meshed , I can still see all the lines inbetween them. Also if you want to improve performance you will need to implement face culling , currently from your render code I can see that you render all voxels with every face. If you are using opengl I think its something like glEnable(GlFaceCulling). Been a few months since ive done any opengl work so if someone could clarify this for me that would be great. Also , how many vbos do you have , if you have one for each voxel you are going to lag like crazy even with only a couple.
26  Discussions / Miscellaneous Topics / Data protection act on: 2015-05-15 14:04:20
Quick question.
If I make a request for a copy of my personal data from an organisation. Are they then allowed to persecute me (for example restrict certain things about my access to their service) for making that request?
27  Game Development / Newbie & Debugging Questions / Re: Setting pixels make blur around pixel!!! on: 2015-05-05 20:07:37
UGH , this clearly shows you firstly dont understand how your own code works. Which means you either copied it or posted on stack overflow first. I really would try to figure out how logic works before you attempt anything like this. ESPECIALLY IF YOU ARE USING JAVA2D **grumbles off
28  Game Development / Newbie & Debugging Questions / Re: Getting started with game programming on: 2015-04-28 16:27:04
You managed to find the forum through google ! Great work!
Now use your awesome powers of searching through the search bar at the top to find similar topics to what you are looking for before posting one. MAGIC many thousands of topics all saying exactly the same thing.
29  Discussions / General Discussions / Re: What do you think of Greenfoot? on: 2015-04-17 19:16:48
I personally despise greenfoot , whilst the concept is good the actual implementation is terrible , most of it isn't java , custom commands are common and actually getting it to do anything is almost as difficult as just teaching them the language seperately. For college? thats just silly.
30  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Shaders, implementing? on: 2015-04-15 10:06:22
If setting a global variable use GLUniform1f 2f 3f etc , this requires the program ID (which you can retreieve). I assume your render function also incorporates the currently active shader (very nice actually , gives me ideas), just put the glUniform before this to pass the value , if you want to send an attribute then you can do the same thing. Retrieving the locations of the variables within the shader is easy aswell , use GlUniformlocation(). Requires a bytechar[] (name) and a Shader ID (frag shader Vertex shader NOT program id).

I hope this helps. I apologise for my horrendous spelling it's early for me , well during the holidays that is. If this wasn't too clear ill post an example just give the word.
Pages: [1] 2 3 ... 28
orrenravid (210 views)
2016-07-16 03:57:23

theagentd (281 views)
2016-07-11 14:28:54

Hydroque (366 views)
2016-07-06 05:56:57

Hydroque (519 views)
2016-07-03 08:52:54

GrandCastle (392 views)
2016-07-01 09:13:47

GrandCastle (385 views)
2016-07-01 09:09:45

CopyableCougar4 (437 views)
2016-06-25 16:56:52

Hydroque (413 views)
2016-06-22 02:17:53

SwampChicken (379 views)
2016-06-20 13:22:57

SwampChicken (303 views)
2016-06-20 13:22:49
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17 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‑
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!