Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 ... 9
1  Discussions / General Discussions / Re: Aspect Oriented Programming: Has anyone tried it? on: 2014-09-09 13:05:38
A bit long and not the most dynamic speaker but here is a talk attempting dispel some myths about AOP.
2  Discussions / General Discussions / Re: Aspect Oriented Programming: Has anyone tried it? on: 2014-09-08 23:24:18
Points taken. One of the things that piqued my interest in AOP is the ability to possibly consolidate code that might be spread across various classes into a smaller set of aspects. Counter balancing that was the worry about making the same code less comprehensible.
3  Discussions / General Discussions / Aspect Oriented Programming: Has anyone tried it? on: 2014-09-08 16:56:58
I have recently been taking a look at Aspect Oriented Programming. It seems like an interesting compliment to OOP and I can see some potential uses in game development. Looking at AspectJ it looks like the overhead is all (or mostly?) at compile time with little to no run time overhead.

Has anyone tried AOP programming before and if so what were your impressions?
4  Discussions / Miscellaneous Topics / Re: What other programming languages do you use & why? on: 2014-09-03 16:44:02
Scala because it is interesting. Javascript + HTML for the occasional web application at work. I also do a fair bit of SAS programming for work. SAS is a language for statistical computing that is pretty common in the pharmaceutical and financial industries.
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-09-03 16:33:56

For my game I am doing some very simple Graphics2D text rendering while I work on the simulation logic. Due to laziness and taking the "simplest thing that works" approach, my main game class has become an unholy mess of that rendering code, along with other game system level fields and methods. I was able to pull out all of the rendering code (~80 lines in the main game class and 4 other classes), make it a bit more generic, and move it into my game utilities library.

Right now I am trying to figure out how I can better structure some of the higher level systems and fields that I stuck in the main game class.

Refactoring feels good!
6  Game Development / Newbie & Debugging Questions / Re: Does anyone create custom annotations in their game code? on: 2014-05-21 14:42:35
I understand the basic mechanics of how annotations are created. I was more interested in the purposes people use custom annotations. Are there issues in game programming that people here use annotations to help solve.
7  Game Development / Newbie & Debugging Questions / Re: Does anyone create custom annotations in their game code? on: 2014-05-21 14:00:59
I think what you are referring to are comments. I am thinking more about Java Annotations which allow you to attach metadata to your code.
8  Game Development / Newbie & Debugging Questions / Does anyone create custom annotations in their game code? on: 2014-05-21 13:53:14
I know basically what annotations are and use ones like @Override. I was curious, do people here create custom annotations for their game code and if so why? I feel like I may be missing something here.
9  Discussions / General Discussions / Value Types Proposal for Java on: 2014-05-02 13:47:47
A fairly in depth proposal for value types by John Rose, Brian Goetz, and Guy Steele. Would be nice to see this in Java 9 or even sooner.
10  Discussions / General Discussions / Re: GameProgrammingPatterns.com is finished on: 2014-04-24 14:58:35
I found the Type Object and Subclass Sandbox chapters to be interesting and useful. I thought the Decoupling Patterns section interesting as well even though I am not directly applying them to my game.
11  Game Development / Newbie & Debugging Questions / Re: Raw material in a game on: 2014-04-22 22:51:10
I would lean towards new Material("wood",getTexture("wood.png")). It makes it easier to add new materials from a configuration file without having to change code.
12  Game Development / Newbie & Debugging Questions / Re: Raw material in a game on: 2014-04-22 22:14:25
You have the right idea in that most everything is specified as data, although your material class should not be abstract. How you structure it depends on how materials are used in your game. For instance if you have a set of materials that can be used to build walls and a set of precious metal materials (gold, gems, etc) that are defined by their value. In that case you may have two classes, BuildableMaterial and ValuableMaterial.

13  Discussions / Miscellaneous Topics / Re: f.lux on: 2014-04-16 16:06:21
Personally I love flux. Every now and then I will turn it off to see how I do without it, but it never lasts long.
14  Games Center / WIP games, tools & toy projects / Re: [LibGDX] GameUtils on: 2014-04-09 10:48:06
Looks good...I've been thinking about timers, intervals, etc a fair bit recently which is why these thoughts are coming to me. As for the last point, it might be nice to have a constructor for StopWatch that takes a Clock as a parameter. That way when you slow or speed up the clock time, the stop watches speed or slow down automatically.
15  Game Development / Newbie & Debugging Questions / Re: My most inefficient way of implementing running texts. How to optimize? on: 2014-04-09 10:30:00
Do you really intend on using words of 18 letters or more? It's nice to have a complete solution for these kinds of edge cases, but it may have little to no practical impact.
16  Games Center / WIP games, tools & toy projects / Re: [LibGDX] GameUtils on: 2014-04-09 05:26:31
A couple of random minor comments about StopWatch:

Is there a reason why the callback is implemented as a StopWatchCallback interface as opposed to a simpler no argument interface like execute()? I could see using this to schedule command pattern style code where I don't really care about the timer, I just want to do something when it goes off. Also, I may want to use my command object outside of the StopWatch and now I need to either pass in null to the execute or have a separate no-argument execute method.

It might be nice to have a setCallback(StopWatchCallback callback). Depending on what is going on in a game one may wish to change the callback while the stopwatch is counting down.

You may want to have more states for your StopWatch (start, stop, pause, resume). You could even assign different callbacks to each in case you wanted it to respond differently to it pausing vs. stopping prematurely.

EDIT:
Another random thought. Are or should StopWatches be associated with a Clock and if so, would the StopWatch count down at a rate equal to the Clock rate, so that if the Clock slows down, the StopWatch does as well?
17  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-28 17:54:53
Although Stripped implementations were ruled out for java 8, they may show up in a point release prior to java 9. While it's not a full module system, it would at least allow for the removal of unneeded classes in a way that is compliant with the license.
18  Game Development / Newbie & Debugging Questions / Re: vector formulas on: 2014-03-26 12:50:49
Yup.
19  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-19 22:21:41
I had downloaded the jdk pre-release builds and have been developing my game with those. Defender methods are pretty cool. It makes it easy to add certain types of functionality with very little boiler plate.

20  Discussions / Miscellaneous Topics / Re: what to do? on: 2014-03-08 00:49:42
You're there already so enjoy it. People watch. Have some fun. Be a little stupid yourself. You don't have to get high or drunk to do it, if it isn't your thing.
21  Game Development / Newbie & Debugging Questions / Re: Effecient way to use z-index for 2d games on: 2014-02-20 20:49:19
It might be more trouble than it is worth but if you have a relatively finite number of z-index values you can have a List for each layer. The layers can then be held in an array which you iterate over. Something like:

1  
2  
3  
4  
5  
6  
7  
8  
// Loop through each layer
for (int i=0; i< layers.length; i++) {

   // For each layer render everything on that layer.
  for (Renderable renderable : layers[i]) {
      renderable.render();
   }
}


if you want your z-index to take arbitrary values or if the z-index is changing frequently it may not be the best approach.
22  Discussions / General Discussions / Re: Simple JAR/Library repository on: 2014-01-30 02:10:11
I have been reading up more on Maven repositories and it looks like setting up an  "Internal Repository" may be what I want. There is a ton of documentation out there on Maven but so much of it seems impenetrable. My preference is to use something that already exists rather than write my own thing. From what I have been able to understand on how it is used, it might be worth writing a simple wrapper to interact with the repository outside of the scope of a project.

I know that Maven has those who love it and those who hate it. For me, my projects are small and simple enough that as long as the build system integrates into the IDE I think I will be fine.
23  Discussions / General Discussions / Re: Simple JAR/Library repository on: 2014-01-29 23:23:44
Yup, I can do that in IntelliJ too. I do like being able to deploy versions of even my internal projects rather than linking the source directly. This gives me more freedom to update the source without affecting downstream projects until I am ready to deploy. While attaching sources and docs are easy, it seems like something that a system could do for me.
24  Discussions / General Discussions / Simple JAR/Library repository on: 2014-01-29 23:05:16
Like most people I have multiple projects going. Some of them use similar external libraries (e.g. libgdx, guava, etc) and some projects are common code intended to be used as resources for other projects. Currently, I simply try to store my libraries under a common root directory. There are a number of things I don't like about this set up:
1. When I download libraries, I have to manually set up consistent directories to store them in.
2. Every time I create a new project, I have to navigate up and down the repository directory hierarchy adding the jars I need and also attach the javadoc, source, and natives.
3. Exporting my own common libraries into my directory structure seems overly cumbersome

What I would like is a simple system that:

1. Allows me to add a library to my local laptop my specifying a descriptor and have it create the appropriate directories and copy the file(s) over. For instance something like:
1  
2  
3  
4  
5  
6  
7  
8  
add { 
   library-name: libGDX,
   version:0.9.9,
   source-dir: c:\users\actual\downloads\
   file:libgdx.9.9.jar,
   source:libgdx-source.jar,
   javadoc:libgdx-javadocs.jar
   }

2. IDE integration: Allow me to select libraries from a flat list of projects in the repository and import them. It would also automatically find and attach javadoc/sources/natives as appropriate.

3. Simplifies the exporting of libraries that I create by automatically adding them to the correct place in the repository, and including the javadoc/source attachments.


I have a feeling that what I am looking for already exists. I looked at Maven and Apache Ivy, but both seem intended to be used as entire build systems whereas I am looking for something much simpler. Maybe I am just not understanding them properly. Since I am a solo developer, I also do not need to run repository servers, etc. and I am fine with having to first download libraries to my machine.

Creating a simple repository API to add, remove, and query libraries doesn't seem like it would be too hard but the IDE integration would be trickier. I currently use intellij, but am also comfortable with eclipse and netbeans.

Does anyone have any suggestions or thoughts?

(EDIT: Removed a bunch of white space at the end)
25  Game Development / Artificial Intelligence / Re: Active Time Battle AI :: Am I doing it right? on: 2014-01-10 19:14:27
One idea is to think about how you can turn your Behaviors into separate objects, which will come in handy as they get more numerous and more complex. Something like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public interface Behavior {
   
   float getDesirability();

   CombatAction getAction();
}


public class AttackBehavior implements Behavior { ... }

public class DefendBehavior implements Behavior {...}

// etc



This would also make it easier to do things like evaluate the most desirable Behavior:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
Behavior bestChoice = null;
float highestScore = -1;

// Assume a list of behaviors
for (Behavior behavior : behaviors) {
   float score = behavior.getDesirability();
   if  (score > maxScore) {
      bestChoice = behavior;
      maxScore = score;
   }
}


This seems easier than throwing everything in a tree map like you are doing. If there would only be a single instance of each behavior you could look into making them enums.
26  Discussions / General Discussions / Re: Bad Habits on: 2013-12-02 18:59:45
I don't document my code at a high enough level. I document the nuts and bolts of classes and methods well enough, but I find myself coming back to code later thinking....why did I do it this way? Why is this an interface? What was I planning on using this class for?

I find myself much more productive when I document my intentions. Something like: "My Action class is part of a GOAP framework. The idea is that all other Actions will inherit from this class and then only need to implement the update, onSuccess, and onFailure methods. These actions should really only be used when a GameEntity needs to do something that takes more than one time step."

This kind of document doesn't really fit into javadoc and needs its own file.
27  Game Development / Game Play & Game Design / Re: Card Battling System on: 2013-10-23 09:06:34
A "crap ton" of conditional statements is usually a bad idea. If you are looking to implement the game in OOP, then more typical style would be for the card to do its own calculations and carry out its own actions, rather than a separate system.

Some questions that might help clarify things:
  • Even though there are a wide variety of actions, can they be categorized (Damage causing, healing, stat improvement, etc)?
  • Will a given card have actions of more than one type?
  • Do all of the actions come into play all of the time or does the player choose among a set of available actions for a given card?

Without knowing more, I would create a class that represents an Action. A Card can own one or more Actions and would iterate through them to calculate the overall effect.
28  Games Center / Showcase / Re: Generic Zombie Shooter on: 2013-10-16 02:56:20
Your download URL isn't formatted correctly. this is what you are looking for.
29  Game Development / Shared Code / Re: Easy LibGDX sprite creator on: 2013-10-15 19:15:55
If you want to go with an enum type approach another option is to attach the methods directly to the enum itself. Something like:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
public enum Sprites {

   Rock("res/tiles/","rock.png"),
   Paper("res/tiles/","paper.png"),
   VoidTile("res/tiles/","void.png");
   
   
   private String imageFilePath;
   
   SpriteType(String path, String fileName) {
      imageFilePath = path + fileName;
   }
   
   
   public Sprite getSprite() {
      return new Sprite(new Texture(imageFilePath));
   }
}



Then you could call it by saying Sprite myRock = Sprites.Rock.getSprite();. This doesn't negate some of the other criticisms people have with the approach (caching, using pre-built solutions) but it is easier to use and doesn't involve multiple expanding switch statements.


30  Discussions / Miscellaneous Topics / Re: What would you like to see in Java? on: 2013-10-08 01:29:25
One thing I would like is the ability to better fine tune the visibility of classes and methods. Often times I will want a class to be accessible by another class in a different package (maybe a sub package) but not publicly accessible.
Pages: [1] 2 3 ... 9
 

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

The first screenshot will be displayed as a thumbnail.

Dwinin (21 views)
2014-09-12 09:08:26

Norakomi (55 views)
2014-09-10 13:57:51

TehJavaDev (65 views)
2014-09-10 06:39:09

Tekkerue (32 views)
2014-09-09 02:24:56

mitcheeb (54 views)
2014-09-08 06:06:29

BurntPizza (38 views)
2014-09-07 01:13:42

Longarmx (24 views)
2014-09-07 01:12:14

Longarmx (30 views)
2014-09-07 01:11:22

Longarmx (28 views)
2014-09-07 01:10:19

mitcheeb (36 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

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

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