Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Aug 2001
Online Last Active Today, 09:57 AM

#5165686 Indie Game Development - My Path Options?

Posted by Glass_Knife on 08 July 2014 - 05:22 PM

Welcome to Gamedev!


There's a FAQ for just these questions:



#5165602 Simple Socket Server Is Continuing To Crash

Posted by Glass_Knife on 08 July 2014 - 12:03 PM

I wasn't able to get the client to fail this way.  Everything worked.  What are you doing to cause the error?

#5164581 Where to include map data etc.

Posted by Glass_Knife on 03 July 2014 - 09:36 AM

Rick, there is no "right" way to do this stuff.  If you ask five different people to code an application, you'll get five completely different results.  But it doesn't matter if they all get the job done.  If you're the only one working on this, then do what makes sense to you.  You will make mistakes, and you'll design stuff that doesn't work.  That is just part of learning how to make games.


My first game, Tetris, had to be completely re-written because I designed the game loop so that I couldn't add sounds.  It is all part of the process.

#5164493 Where to include map data etc.

Posted by Glass_Knife on 02 July 2014 - 11:49 PM



Java has built in classes to process XML files.  You can store your maps in whatever format you need, and easily parse them.  For example, each map can have references to the other maps that are connected.  This gives you flexibility but is easy to adjust to your needs.

<?xml version="1.0"?>

  <map id="start">
    <north id="map1"/>
    <south id="map1"/>

  <!-- etc  -->

#5164344 How to transition into Game Dev with Java

Posted by Glass_Knife on 02 July 2014 - 10:15 AM

If you want to learn 3D programming on your own, you'll need an OpenGL wrapper, both LWJGL and JOGL are up and running. I use LWJGL but you can use whatever you like most. Oh, and you need a good tutorial on modern OpenGL like this one to get you up and running on all the math and rendering concepts (nevermind the C++, OpenGL calls are the same in whatever wrapper you use).


+1  Graphics programming is always changing.  It is less important to learn a specific technology (like Java) and more important to learn the concepts.  You can do it with Java, but it really doesn't matter on the language.  Right not, with all the bare metal APIs coming out, who knows if even learning the current OpenGL API will be that useful.  So don't worry too much about the technology, and learn the concepts.  


Use modern OpenGL to become familiar with a matrix, projections, lighting, materials, textures, collision detection, models, animation, etc...  Use Java because you're already familiar with it and don't need to learn new stuff.  But keep it in the back of your mind that all these libraries will keep changing, so it is more important to understand what they are doing than to memorize function names.

#5163878 Inconsistent Sending of Data

Posted by Glass_Knife on 30 June 2014 - 12:13 PM

It seems it works, but not consistently.


This is usually a sign of a Thread problem: race condition or something else.  But this is too complicated a situation without some code.  Try commenting stuff out until you have the smallest example that exhibits the behavior.  Odds are you'll figure it out before this, but if not, then you can post the code.


Also, try a network protocol analyzer to make sure it's really doing what you think it is doing... http://www.wireshark.org/

#5163021 SOLVED: Compute shader atomic shared variable problem

Posted by Glass_Knife on 26 June 2014 - 09:36 AM

SOLUTION: Ugh. Don't do 
    minDepth = atomicMin(minDepth, depth);
Just do
    atomicMin(minDepth, depth);
The assignment breaks the atomicity. 


I think the problem is that atomicMin() returns the original value of the variable.  If the depth variable is less than minDepth, it sets minDepth to depth, but then returns the original value of minDepth.  The problem isn't the atomic operation but just undoing the minimum comparison.

#5162607 java Constructor parameters

Posted by Glass_Knife on 24 June 2014 - 12:49 PM

that's what i was trying to avoid. I was trying to anticipate what I would need to re write.


Number of times I have designed an API and had the end result match the design = 0.


As an example, let us say you have an Equipable base class, and then a HealthItem which "is a" Equipable item.  Later you come up with different kinds of PowerUps, that aren't equipable but bestow some temporary benefit.  Then you make a MagicBooster that "is a" PowerUp.


Months later you try to create a MegaHealthBooster, that is a HealthItem and is a MagicBooster.  But now you have multiple inheritance, which is bad in C++ and not even allowed in many other languages.  To get around this, you'll have to redesign your classes or create some silly hacks that will cause weird bugs down the line.  


Just be aware that this will be an issue if you take the "BaseClass / ChildClass" design.


If you had game objects that are composed of other objects, then a MHB that contains a HealthItem and a MagicBooster is easier.

#5162586 java Constructor parameters

Posted by Glass_Knife on 24 June 2014 - 11:44 AM

I would have to agree with Glass_Knife, you should favor composition over monolithic inheritance trees. Basically what that means is that an in game object(or entity) is made up of mutiple components. So for example if you had a Iron sword, it could have a wieldable component, a sword component, an iron component, it might even have a firey enchantment component.


This is another way to go.  I'm actually not suggesting any design up front.  Just code up what you need doing the simplest thing possible (i.e. no inheritance or composition or anything).  When you find you keep writing the same stuff over and over again, refactor to common code.  This may be a base class with child classes, or it may be objects composed of other objects.

#5162566 What do you think of the agile method?

Posted by Glass_Knife on 24 June 2014 - 10:54 AM



I think that any software process like this is only effective if used correctly.  It takes really smart people to make software, and a good team will naturally evolve their process to fit the problem even if there is no language to describe it.  Agile is simply an example of a process that has worked.  It's not a generic solution.

#5162450 java Constructor parameters

Posted by Glass_Knife on 23 June 2014 - 07:56 PM

public class A {
   protected int x;
   public A(int x) { this.x = x; }

public class B extends A {
   private int y;
   public B(int x, int y) {
      this.y = y;

If the base class doesn't have an empty constructor, then all the need items need to be given to the constructor when the object is created.


Having said that, you may be trying to create an object structure when you don't need one.  You should favor composing items instead of inheriting.  Large, deep inheritance trees, while neat from a computer science aspect, can become hard to manage.

public class A {
   private int x;
   public A(int x) {
      this.x = x;

public class B {
   private int y;
   public B(int y) {
      this.y = y;

public AB {
   private A;
   private B;
   public AB( A a, B b ) {
      this.a = a;
      this.b = b;

#5161798 How can I learn Java ?

Posted by Glass_Knife on 20 June 2014 - 02:47 PM


#5161547 Quest scripting for 2D RPG

Posted by Glass_Knife on 19 June 2014 - 01:36 PM

Silly question, but if a libGDX project is compiled to Java, or Android *.apk, or html 5 Javascript, or robovm Java for iOS, then trying to call an embedded scripting language isn't going to work, right?  I would think trying to integrate a scripting language would be more trouble than it is worth.

#5161526 Backup Software for Small Teams

Posted by Glass_Knife on 19 June 2014 - 11:56 AM

I work with a few people, and we need to back up our stuff.  The problem is that the boss is paranoid, so no cloud backup service will work.  The only things I seem to find are simple linux shell scripts that don't really work, or grand enterprise solutions that want $1,000s per terabyte.  


I pinged everyone in my contacts, but they all use some kind of cloud storage, and when I mentions we need to run without an internet connection, I just got blank stares and silence.  


Is anyone using anything cheap/free but reliable?



#5161343 Unworkable project

Posted by Glass_Knife on 18 June 2014 - 11:26 AM

Why not look for a new job while you're still employed and bail out the moment you find one?



Just don't let anyone at your current job know you're searching. They aren't too happy if they find out.

Also, if you quit, make sure to give a couple week's notice (or whatever's required by law, if you have a law which covers this). I quit one of my summer jobs at a grocery chain once without notice and they blacklisted me from ever working there again.



A few years ago the group I was working with started letting people go.  I worked for a large company, so I began looking for a transfer so that I wouldn't be laid off too.  I found one and move my family across the U.S.  After about two months I realized that the group I worked remotely with (they were in another state) had no idea what they were doing.


To this day it is the worst code I've every seen.  I wasn't aware that a group of people could write such hideous and un-maintainable code.  You would think, way before it got to that point it would just implode and consume itself.  But somehow it just go more unwieldy.  It was Java, with a JBoss server that took minutes to start, had huge XML files that serialized all the data, and could only be stopped by using the linux 'kill' command.


And the customer paid millions for it.  In the span of one year, I was never even able to get the software to build, yet alone run.  I am not exaggerating.  The team would change the design of the system every few days, and never talk to anyone else about it.  Add a few developers doing that, and a boss who was only concerned with nice suits, good watches, and climbing the corporate ladder selling snake oil, and you had a nightmare.


There was no fixing it.  I found another job.  I bet they are still using it, and I feel sorry for whomever has come in contact with it.  I came to the hard realization that there are some groups out there where everyone is in one of two groups:  those too stupid to leave, and those too stuck to leave.