Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Feb 2011
Offline Last Active Sep 15 2012 01:09 AM

#4969035 File IO

Posted by on 13 August 2012 - 06:30 AM

Just study the documentation of BufferedReader#readLine.

#4946158 Why is C++ the industry standard?

Posted by on 04 June 2012 - 11:01 AM

You can tell my friend who works on database servers where the client interface is written in Java that.

Oh yes, loading the database into memory and blaming Java for being slow...

...Or any Android mobile developer.

FYI: You don't run Java on Android.

#4945510 Why is C++ the industry standard?

Posted by on 02 June 2012 - 01:24 AM

Actually, Java using more memory can very much be a problem depending on what you're doing. Mobile devices (Android's Dalvik comes to mind) or large industry systems may see this. I have a friend who works for one of the large database providers, and with so many virtual instances running, their Java implementation constantly drives down the available system memory. Even in normal game development, Java tends to simply eat up memory, and depending on what you're doing, memory might be in short supply. I do a lot of procedural work, and end up using a lot of memory. I've hit the 4 GiB limit in the past with C++; Java would have been worse.

Java does not tend to eat up memory.
Excessive memory usage has nothing to do with Java itself, it all depends on your very own coding style and that of used libraries.
Please do not feed age-old myths.
True is, that automated garbage collection can lead to mindless programming habits, but that usually has bad consequences in each and every language and environment.

#4942638 Multiple switches vs if-else conditions

Posted by on 23 May 2012 - 11:31 AM

Don't use ifs or switches for that.
Create some kind of a dialog manager class which gets a game context as input and returns the appropriate dialog.
Store the dialog mapping in some external format so you can add, modify and delete without compiling.

#4924552 Game Engine with Virtual Machine + Game Script Compiler + IDE

Posted by on 23 March 2012 - 02:21 AM

These days there is almost no way to earn money with development tools except you have a high reputation and a very good established product, like the UnrealEngine (and you can even a get community license for free).
People expect everything to be free on the internet.
I don't know your developer's quality, but there is actually no way a single person can develop a quality product consisting of a game engine plus virtual machine plus script compiler plus IDE before retiring...
For example, it took many years for the Java VM to reach the current status performance wise.
There would be many games needed to actually evolve the product into the right direction. But who wants to be the test person ?

I don't want to discourage you, but you can still do for fun (and benefit from learning a lot) without monetary payback expectations.
Or just develop games.

#4923017 Implementing Objects with specifications

Posted by on 18 March 2012 - 05:38 AM

Something like this:

public enum WeaponClass {

public class Weapon {
private enum WeaponClass weaponClass;

public Weapon(WeaponClass weaponClass, int weight, int minDamage, int maxDamage) {

Only if you have use of it...

#4922196 Whats wrong with java?

Posted by on 15 March 2012 - 02:08 AM

I've been looking around the web and I've seen a deep hatred towards java? I mean to me it seems like a decent language (then again i'm a noob that doesn't know sh*t about programming other then "If then's" statements.) I also have seen that C++ has a very good rep. can someone explain this to me in VERY VERY LAYMEN TERMS? (noticed how i bolded, underlined AND CAPITALIZED, very very laymen.)

That is simply because looking around the web and actually finding professional statements which are not highly subjective, emotional, dogmatic or show even religious tendencies is not an easy task.
For certain topics it is always the same. Use the right keyword and off they go.
Java vs C++
C++ vs C#
C# vs Java
Apple vs Microsoft
.net vs Java
Linux vs Windows
Coca Cola vs Pepsi

That's the answer to your question.

#4921902 Need some help with planning/organizing game structure

Posted by on 14 March 2012 - 01:55 AM

- identify your game entities
- think about responsibilities of each entity
- keep responsibility as narrow as possible
- do not introduce cyclic relations
- only communicate between entities through well defined interfaces
- only put required methods in the entity interfaces
- use interfaces to declare method parameters not specific implementations

- get several good books about software development and ... read them Posted Image

#4908708 Listen to your song with a fresh perspective?

Posted by on 02 February 2012 - 08:05 AM

Put your song in a playlist with professionell music of similiar style, I'd say at least three other tracks before. Listen to all of them with your eyes closes, don't change position or anything. Any flaw will become brutally obvious.

#4904505 Loading only part of an image

Posted by on 20 January 2012 - 01:44 AM

Take a look at the JavaDoc of drawImage(). You can specify the source rectangle to draw. So, no need to split up while loading.

#4862972 Singleplayer / Multiplayer Approach

Posted by on 18 September 2011 - 12:41 AM

In singleplayer mode I only exchange the network components by using a direct in-memory approach instead of TCP or UDP.
The game's core with its client and server components stays the same.

#4841756 Design-tips

Posted by on 28 July 2011 - 12:27 PM

view, input controller, options, game launcher, sim disease, game saver, brain, soul, animals, family, money, house, relationship, clothes, furniture, events (internal/technical), events (in sim life), navigation stuff, world, ...

#4832655 How do people stand Java?

Posted by on 07 July 2011 - 11:37 PM

I've done a little C# and Python programming, and they are much nicer to work with.

What exactly is so much nicer in C# ?

But Java is a commonly used language. So I feel I'm missing something. Perhaps due to my unfamiliarity with the language, I don't understand all the tricks and idioms that people use in Java to make programming easier. So the question is, how do people stand Java?

You miss considering the entire development environment, available frameworks, IDEs, etc.
The last time I looked into Visual Studio for instance, it felt like being years behind Eclipse, IntelliJ or Netbeans. The overall productivity is just much higher in Java.
Naturally, choosing the language AND environment that suits your tasks best is what professionals do. And for commercial business applications that is definitely not C++ with its ugly and error prone features (like operator overloading).
Java is far from being perfect, compare it to more modern languages, but C++ or its cloned sibling C# are for sure no ideal models to follow.