Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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 ... 71
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: How to install Eclipse on: 2014-09-29 17:12:32
Well,  I dont use eclipse and hate it with a passion, so I can't say if the support is that bad. Seing maven support as superfluous for game dev might be true. But a good SCM support should not qualify as bloat or junk...
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: How to install Eclipse on: 2014-09-29 15:58:59
Well. You should rename this to "how to install a downstripped Eclipse". Also (if I understand this correctly) removing git and maven support might not be everybodies cup of tea...
3  Game Development / Newbie & Debugging Questions / Re: Image flickering when moved (slick2d) on: 2014-09-29 07:49:09
You should really switch to LibGDX as you are wasting your time with that buggy crap
While switching to LibGDX might be worthwile, calling Slick2D buggy crap is a big NONO and very disrespectful!
4  Game Development / Game Mechanics / Re: Issues with gravity on: 2014-09-28 22:12:44
I can't think of any way I could possible fix this, does anyone have any ideas?

Let the ship collide with the planet and explode?  Shocked

Seriously, this kind of cornercases are inavoidable in simulations. For every kind of glitch that occurs due to limited accuracy,  you need to include special cases in your calculations, that "hard-codes" a plausible outcome utilizing minimas, maximas and ranges covering the inaccuracies.

Basils answer is a good example. If it's not what you assume to be a plausible outcome, implement something else in a similar fashion - or just let the ship explode  Wink

5  Game Development / Newbie & Debugging Questions / Re: Android Studio or that sexy LibGDX? on: 2014-09-28 08:39:28
Well. Just understand the errors, investigate the possible causes, fix them and go on. You'll learn a lot in this process, too!

I am doing enterprise admin, hardware/software infrastructure and devop at work and some developers' attitude of giving up or crying for spoon feeding if even the simplest problems occur drives me mad Angry

I don't mean it personal,  though  Wink
6  Game Development / Newbie & Debugging Questions / Re: [LibGDX]Looking for methods equivalent to the following on: 2014-09-28 08:21:21
Mul should be equivalent to transform. TransformNormal probably just normalizes the vector after the multiplication, so just call nor() on the resulting vector. Maybe you might also need to call nor() on the source vector to get the identical behavior to transformnormal.
7  Game Development / Newbie & Debugging Questions / Re: Adding gravity on: 2014-09-27 09:45:54
Ah ok. Just learn vectormath and the difference will go away  Tongue
8  Game Development / Newbie & Debugging Questions / Re: Adding gravity on: 2014-09-27 09:17:31
Sure,  but why complicate the issue. If that effect is needed, he can add it later.  Your first suggestion was just right.
9  Game Development / Newbie & Debugging Questions / Re: Adding gravity on: 2014-09-27 09:06:28
Actually gravity is independent of mass.
10  Game Development / Game Mechanics / Re: Moddius - A simple Modloader compatible with ANY Java game! on: 2014-09-26 12:04:57
The topic says that this library is Reflection-based...  Cranky
Which means this library uses Reflections (the library).
But its bundled onto 1 jar, so you have the reflections library if you load this lib in.
What I am missing is some hint how to use your library to make your game moddable. It looks like it's just a wrapper for getting annotated classes. What does it provide on top of Reflections?

I would at least expect an api to manage mods inside a folder and to load,  enable or disable them dynamically. Maybe also some Resource abstraction to help exchanging textures and sounds in a running game. Sources, javadocs and examples would be nice,  too.

You did a fat jar with all dependencies. This might introduce conflicts with other versions of the included dependencies used by a game. Also I don't know, if the license of Refllections (or some of the dependencies) allows rebundling like this...

All in all a good idea, but not ready for prime time. Keep it up nonetheless!
11  Discussions / Miscellaneous Topics / Re: Whays the story behind your name on: 2014-09-25 10:30:36
Long long ago there was a time that I was the programmer of an unknown short lived Atari ST demo group called TPN.  It was the time of the first US/German space mission called SkyLab. But since we targetted cyberspace instead of the sky,  the name cylab was born.

Only 15 years later when I tried to register some domain names,  I realized that there is a industrial band of the same name. I briefly thought about sueing them for prior art, but decided to not be mean  Wink
12  Discussions / Miscellaneous Topics / Re: I'm scared of Unity on: 2014-09-24 20:59:10
Even though it may not be possible to use with Unity, at least have it integrated...
It is:
http://docs.unity3d.com/Manual/VisualStudioIntegration.html
http://blogs.msdn.com/b/visualstudio/archive/2014/07/29/visual-studio-tools-for-unity-1-9.aspx
13  Discussions / Miscellaneous Topics / Re: I'm scared of Unity on: 2014-09-24 20:07:48
Monodevelop will take away your pleasure in programming.  Emo
You should spend some money and use visual studio + resharper. It'll probably boast your productivity by an order of magnitude.  You may even import an Eclipse Keymap (havent tried)
14  Game Development / Newbie & Debugging Questions / Re: Libgdx android xml saving on: 2014-09-18 13:16:59
Well, no stacktrace, no help Undecided It's just impossible to debug an error, if you don't have any information.

Also don't use static variables. The stuff they hold will never be collected by the garbage collector. Especially never hold anything outside of a method that you don't need outside of the method!
15  Discussions / General Discussions / Re: FlipFlop - Examn f(CLK) on: 2014-09-18 10:54:06
Think about it.  The NAND resets all flip flops every twelve ticks. The question is asking about the output of Q3. There is only one low->high flip for Q3 at the 9th tick (on that paper) ...

Now again - this does not??? affect the frequency of Q3 - really,  come on...  Tongue
16  Game Development / Newbie & Debugging Questions / Re: libgdx saving map on: 2014-09-17 15:37:50
Also you could try using kryo, but I don't know how good this works on android. But I would assume, that it works good enough, since the author also was a core contributor to libgdx.
17  Game Development / Newbie & Debugging Questions / Re: libgdx saving map on: 2014-09-17 15:35:31
Just looked up the source. XmlWriter directly writes through to the given writer object, so nothing is stored. Post your source again.
18  Game Development / Newbie & Debugging Questions / Re: libgdx saving map on: 2014-09-17 15:12:10
Just change it to

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  
package com.hawk.engine.game.xml;

import java.io.IOException;
-import java.io.StringWriter;
+import java.io.Writer;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.XmlReader.Element;
import com.badlogic.gdx.utils.XmlWriter;
import com.hawk.engine.game.level.Level;
import com.hawk.engine.game.level.Tile;

public class XMLMap {

-   private static XmlWriter xml;
-   private static StringWriter writer;
-   private static FileHandle file;
   
   public static void saveMap(String name){
-      writer = new StringWriter();
-      xml = new XmlWriter(writer);
-      file = Gdx.files.local(name);
+      FileHandle file = Gdx.files.local(name);
+      Writer writer = file.writer(false);
+      XmlWriter xml = new XmlWriter(writer);

      try {
         //int whatisit, int blockID, float x, float y, float width, float height, Vector2 velocity, boolean hasCollision, boolean object, int objectID
              for(int i = 0;i < Level.lengthX;i++){
                  for(int j = 0;j < Level.lengthY;j++){
                     
                     Tile t = Level.tiles[i][j];
                     xml.element("t").attribute("w", t.getBlockDef()).attribute("bID", t.getBlockID())
                     .attribute("x", t.getX()).attribute("y", t.getY()).attribute("wi", t.getWidth()).attribute("he", t.getHeight()).attribute("vx", 0).attribute("vy", 0)
                     .attribute("co", t.isCollision()).attribute("o", t.isObject()).attribute("oID", t.getObjectID());
                  }
               }
         
         
-               file.writeString(writer.toString(), false);
      } catch (IOException e) {
         e.printStackTrace();
      }
+      finally {
+         try { writer.close(); } catch (Exception ignore) { /*ignored*/ }
+      }
   }
}

19  Game Development / Newbie & Debugging Questions / Re: libgdx saving map on: 2014-09-17 15:03:21
Doing 200x200 tiles as xml will probably result in a 10-20mb string. Don't know how the xml builder you are using handles that internally and if file.writeString() might create a copy of that. Best bet is to increase the heap to see if it works then or if there is some kind of memleak and use a memory profiler to inspect the size of the actual used memory and if it is stored/copied redundantly.

Can't you use the xml builder you are using with an FileOutputStream, so you skip the intermediate string in memory completely?
20  Game Development / Newbie & Debugging Questions / Re: libgdx saving map on: 2014-09-17 14:55:14
well, increase heap then Smiley
21  Discussions / General Discussions / Re: Java 8 Default Methods and Multiple Inheritance on: 2014-09-15 16:11:26
This also makes me wonder what happens if two interfaces define the same default function...?

You'll get a compilation error and are required to implement the method. You can then explicitely delegate to the default implementation you want to use.

Edit: Sometimes I think I am invisible...  persecutioncomplex
                    VVV
22  Game Development / Performance Tuning / Re: Check for null or check for implementation? on: 2014-09-15 10:40:42
Because I see Interfaces used as components right here in this thread Cheesy
Actually it's the oposite way around. Entity systems use components as replacement for interfaces Tongue
23  Game Development / Performance Tuning / Re: Check for null or check for implementation? on: 2014-09-15 07:50:18
It's in both lists because Entity would be the most generic type in this example and Drawable is a subset. So if you want to do something with all entities you would iterate only the entities list. This makes more sense, if you have more subsets, especially if they might overlap partly, so you can't just iterate over all lists to so something with all entities once.
24  Game Development / Performance Tuning / Re: Check for null or check for implementation? on: 2014-09-14 18:01:21
I actually like instanceof, especially when designing object hierarchies. I never got why so many people try to work around it. It's quite straight forward and easy to just ask an object what it is to decide what to do with it. Why would you not want to use such an important attribute of an object like it's type?

Having said that, the OPs problem is easy to solve by just calling
entity.draw(batch)
on any type of entity and implement the
draw(batch)
empty for entities not having a sprite... I doubt that using the null-check to prevent calling an empty method will boost performance significantly for any kind of game we are doing here.

I would do it different though (using instanceof). Something along the lines of:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
class World
{
    List<Entity> entities=new ArrayList<Entity>();
    List<Drawable> drawables=new ArrayList<Drawable>();

    add(Entity e) {
        entities.add(e);
        if(e instanceof Drawable)
            drawables.add((Drawable)e);
    }

    draw(Batch batch){
        int l=drawables.size();
        for(int i; i < l; i++)
            drawables.get(i).draw(batch);
    }
}


You can do this kind of specialized "caches" with all kind of "filters" that create more or less static lists of objects you need to iterate over and handle type (or otherwise) specific. The only downsides are slightly increased memory foodprint (multiple references to the same object) and some performance overhead for adding and removing objects to/from multiple lists.

I really can't see, why this kind of desing is bad practice, inperformant or "stinks".  
25  Game Development / Newbie & Debugging Questions / Re: Is it Possible to use Java and send sounds through the microphone? on: 2014-09-12 12:54:39
Using a speaker or headset in an unpowered microphone jack does not harm it. Dont know about phantom powered iinputs. Using a microphone as speaker probably would harm it.
26  Discussions / Miscellaneous Topics / Re: How to call police/ambulance from a different country on: 2014-09-12 12:49:47
Probably just call your local police hotline and let them forward the request.  Other than that google for emergency phone numbers and the international access code of the country in question.
27  Game Development / Newbie & Debugging Questions / Re: Is it Possible to use Java and send sounds through the microphone? on: 2014-09-11 21:50:03
Using speakers as microphones is actually possible and as easy as just connecting the speaker to the mic input...

If mics would produce sound if connected to a speaker out would probably depend on the type of mic – and of course on the wattage you try to put through  Grin
28  Game Development / Newbie & Debugging Questions / Re: Is it Possible to use Java and send sounds through the microphone? on: 2014-09-11 14:03:46
Why do you want to do this in java? If you want to create a soundboard, thats easy enough by just implementing sound playing when pressing on buttons. But simulating a microphone in java is not directly possible.

Just use the existing skype/os feature or google and install "virtual audio devices" to wire up a mixer.
29  Game Development / Game Mechanics / Re: Entity Component Manager on: 2014-09-10 06:42:27
You can do exactly the same in java. component_class would be of type Class and then you can pass in Position.class.
30  Game Development / Newbie & Debugging Questions / Re: How to port a java game to android on: 2014-09-09 08:19:07
Don't try to port it. Just rewrite it using LibGDX. Doing the "same" the second time is just good practice...
Pages: [1] 2 3 ... 71
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-25 04:13:29

Pippogeek (30 views)
2014-09-25 04:12:22

Pippogeek (19 views)
2014-09-25 04:12:06

Grunnt (45 views)
2014-09-24 02:38:19

radar3301 (28 views)
2014-09-22 11:33:17

BurntPizza (63 views)
2014-09-21 14:42:18

BurntPizza (33 views)
2014-09-21 13:30:30

moogie (41 views)
2014-09-21 12:26:15

UprightPath (50 views)
2014-09-21 08:14:06

BurntPizza (54 views)
2014-09-19 15:14:18
List of Learning Resources
by Longor1996
2014-08-16 22:40:00

List of Learning Resources
by SilverTiger
2014-08-06 07:33:27

Resources for WIP games
by CogWheelz
2014-08-02 04:20:17

Resources for WIP games
by CogWheelz
2014-08-02 04:19:50

List of Learning Resources
by SilverTiger
2014-08-01 04:29:50

List of Learning Resources
by SilverTiger
2014-08-01 04:26:06

List of Learning Resources
by SilverTiger
2014-07-31 23:54:12

HotSpot Options
by dleskov
2014-07-08 13:59:08
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!