Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Scene2D, utter tedious on: 2014-04-18 00:45:00
Having worked with some other (some of them "homebrew") ui libraries I have to say I love scene2d and scene2d.ui. Sometimes the ui creation and handling code can become a bit messy, but you can make your code a lot cleaner by using factories to create the ui elements you are using...

The backbone of my UI's is the table actor/widget. If you know what the table is capable of and are a bit creative you can achieve pretty much very fast. Also it's not bad to already have some nice widgets ready... Would not wan't to implement the scrollpane or textboxes myself Wink

Check the readme on the github page of the table layout: https://github.com/EsotericSoftware/tablelayout
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [libgdx/gradle] Won't load gdx nightlies on: 2014-04-12 23:15:37
I think I have found the problem. I have tried to setup libgdx with maven some time ago, but I didn't manage to get it running, so (after I wasted some time) i decided to not use maven. From then I had an older snapshot release in my local maven repository. I wasn't aware of that. After deleting the badlogicgames folder in my local repo, gradle loaded the most recent nightlies.

Now this leads me to another question. How do I tell gradle to force update the snapshot releases? I tried the refresh references buttons in eclipse and in the command line, but it seems that this didn't really work. Any clues?
3  Java Game APIs & Engines / Engines, Libraries and Tools / [libgdx/gradle] Won't load gdx nightlies on: 2014-04-12 21:51:16
I'm trying to convert my libgdx project to the new gradle build format. I'm more or less done, but I'm running into a strange problem. I used gradle for the first time today, so it might be that I overlooked something obvious.

What I want is that my project uses the libgdx nightlies. When I check out the project on my build server and build it with gradle this seems to be working fine. But on my development machine it looks like gradle is using the stable releases instead of the nightlies.

Why I think that? I got some compile errors when building with gradle on my machine. I knew the places in the code, because I had changed them, when I updated my project from the stable 0.9.9 release to the nightlies. All of my changes had to be reverted...

One error I get is related with the scene2d actor SelectBox. I was using the class with a generic paramter, but now suddenly the compiler tells me, that select box does not has any generic types. I checked in the gdx github and it seems that the changes that introduced the generic type were added this february. I also checked some other cases with the same result, that the gdx lib does not match the code on github.

Here is my build.gradle file: http://pastebin.com/Etcb9T2G

What I have tried so far:
- Refresh references via eclipse
- Refresh references via command line
- Clear the gradle cache
- Clone the repository once more on both systems (dev machine / build server) and testing the gradle build with that version.

Everything yielded the same results and what's giving me most headaches is that the behavior is different on the server. I would appreciate the help, if somebody knows what I'm doing wrong.
4  Java Game APIs & Engines / OpenGL Development / Re: Per-pixel lighting (NO SHADERS!) on: 2014-04-12 16:30:59
When he says offscreen texture he most likely means an FBO. Just clarifying.

Yeah, that is correct, sir Wink
5  Game Development / Newbie & Debugging Questions / Re: Reading/Writing JSON Constantly on: 2014-04-11 19:49:23
...but shouldnt I really use JSON? Will thrre be performance issues later on using this over XML or CSV or something?

There's an old saying about premature optimization. If JSON is working for you, then stick with it. If you've structured your code correctly, then all access to the JSON functionality should be abstracted through your SaveSystem class. If JSON stops being a good fit for your game down the road, you're free to change the internal implementation of SaveSystem to another technology with minimal (if any) impact on the other classes in your game. Pointing

I think this is the right mindset Wink

What I like to do to do is to make my data objects themselves implement the libgdx Serializable interface. The serialization code is then located with the object instead of some other code file.

Here is an example of a class in my project.

http://pastebin.com/k13G0EHX

At the bottom are two methods to read from or write to a file. Normally I have the loading and saving code located somewhere else, but I put it here so I just have to post one file Wink

[Edit]
Ah sorry, I think I just see know what you are asking exactly. Take my file as example. Better make a class like that where you store your data, like hp etc. When you save, you simply save this class via serialization. You can instance this class in your main code and store it as a field or variable where you need it (or where you need it) instead of accessing the file directly. When you load a game, you can simply read the file via the json object and have your object ready.
[/Edit]
6  Discussions / General Discussions / Re: Creating dev team Java 2d!! on: 2014-04-11 11:02:35

- Know when to do ctrl - z, we will use Saros as our multi coding plug-in! that's why!


Can you tell me more about saros? I've never heard of it before. What are the main advantages of saros over a more classic approach like svn or git? What has this to do with CTRL+Z? Don't you think that it will be quite a pain to work with multiple people in the same project like this? Just from my coding experience, except for pair programming sessions, I don't want any other developer working in my code base. How will you work if one developer works on(and breaks) the rendering code and another developer is working on let's say the enemy AI. As long as the rendering is broken, the other developer is doomed to wait until the problems are resolved.
7  Discussions / Jobs and Resumes / Re: Ryuno's music store: custom music and SFX for your projects! on: 2014-04-11 10:55:25
Very nice sounds... The cinematic scores sound very good. Quality Stuff Wink

The short jazz track link does not work? Wrong link or private track?
8  Discussions / Business and Project Discussions / Re: Sound/Music Artists. on: 2014-04-11 10:50:50

If you need more info just ask.  Pointing


Can you give more infos Wink ? What setting is the game in? What genre or style should the music be? Will you buy /pay for the music or are you looking for free resources? Currently there is not really enough information to work with...
9  Java Game APIs & Engines / OpenGL Development / Re: Per-pixel lighting (NO SHADERS!) on: 2014-04-11 10:43:23
A nice and easy way to do simple per pixel lighting is to create an offscreen texture, render the lights to the offscreen texture (using additive blending) and than multiply this texture with the screen.

Here is how it could look like: https://www.youtube.com/watch?v=0MiVrE5-IhE  You can see that the player pointer and each of the cells emit some light. If many light sources are at the same place, the scene gets lighter, as the light sources add up to eachother (why we use additive blending for the light texture).

I have the idea from a post here (and I think the explanation is much better with the example images as mine): http://www.java-gaming.org/topics/realistic-lighting-in-a-2d-game/20161/view.html


10  Game Development / Newbie & Debugging Questions / Re: Reading/Writing JSON Constantly on: 2014-04-11 10:32:12
Don't save all the time to disk, when you change a value. It doesn't cost much to save a smal json file once, but if you save it every time you update a value you will run into problems sooner or later. Store your values in a class (or multiple classes) and find on which occasions in your game you should save.

I am to persisting my game state to json, but I only do it at certain points in the game (when starting a level, when watching a sequence or when quitting the game or exiting to the main menu etc.).
11  Games Center / WIP games, tools & toy projects / Re: Battles In The Sky on: 2014-04-02 08:36:39
Hi there. Looks nice.

If you want to start with libgdx I would advice you to download the latest libgdx version and setup a project with the libgdx-ui.jar. Don't start right away with porting your game. Make some prototypes to get to know the library. The wiki is a good starting point for that. Check out the basic rendering and input methods, file access and scene2d/scene2d.ui for 2d and ui rendering. Cameras can also be very important...

Once you know the library better, you can start porting over your game. If it is too big for you to grasp how to do it, breakt the task down into smaller problems and solve each problem on it's own.

Oh, and don't be affraid of asking questions (after having used google).
12  Game Development / Newbie & Debugging Questions / Re: Projectile and Mob collision? on: 2014-04-01 23:46:19
I think this depends entirely on how you want your game to function. It might be a nice tactical gameplay mechanic.

Proper collision detection would be important, if you have very slow projectiles and very fast enemies, but i think for most tower defense games, a simpler approach might work as well. I would simply do 2 checks, before firing.

1. Is the targetted enemy in weapons range?
2. Has the tower an unobstructed view on the target? (it may be that another tower is between the target and the shooting tower).

If one of those two criterias is not met, the tower does not shoot or looks for another target. If those criterias are met, the tower shoots and the projectile hits.
13  Game Development / Game Play & Game Design / Re: Start, Pause and Game Over screens on: 2014-03-24 16:48:38
i usually have a screen implementation for the main menu and one for the gameplay.  I have set up a scene2d stage in my gameplay screen for the ui. If I wanted to implement a pause screen, I add an additional UI element as overlay and make it small or translucent.
 
To pause the game you simply have to stop updating the game logic, when you enter pause mode. When you continue the game you start updating again.

You don't need to do much to persist the state, if you just wan't to implement pause and play. If you want the ability the exit the game and reopen and continue, then you need to write the game state to disk.

You can use my code to understand what's going on, but you have to keep in mind that this "game" was hacked in 3 days and I'm still getting to know libgdx, so it is not exactly a prime example of a libgdx project Wink
14  Game Development / Game Play & Game Design / Re: Start, Pause and Game Over screens on: 2014-03-22 19:28:05
I'm using the Screen interface... If your main class derives from the Game class, you can call setScreen and set the game screen.

Edit:
Here is an example from our LD28 entry.

The main class: https://github.com/tomvangreen/ch.digitalmeat.ld28/blob/master/ld28/src/ch/digitalmeat/ld28/ConcertSmugglers.java
Implementation of a screen: https://github.com/tomvangreen/ch.digitalmeat.ld28/blob/master/ld28/src/ch/digitalmeat/ld28/RulesScreen.java

15  Game Development / Newbie & Debugging Questions / Re: Looking for 'professional' indie game-code to read. on: 2014-03-22 19:13:06
We learned it like this. In a perfect world with an unlimited amount of time and budget you can write perfect code. The thing is, both time and budget is limited. So you have to take shortcuts.

I've worked with people that were geniouses in their field, but they never managed to complete a project on budget, because something in the code was always badly engineered (even though it was working completely ok) and they had to fix it. A friend once got a week of work thrown out of source control, because our architect thought "It just doesn't feel right", without having any specific reason why.

It makes me cringe a little to not go the clean way, but sometimes you have to sacrifice clean code for getting a project done. The problem is that most customers (or players in games) don't really care how nice the code is. They just want that damn thing to run.
16  Games Center / Showcase / Re: Concept on: 2014-03-21 19:49:03
looks very nice. I like the landscapes and caves very much. whish you look with the game, I might be a potential new user Wink let's see how this develops.
17  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX]Update game logics in ApplicationListener.render() method? on: 2014-03-17 17:02:13
Yes
18  Game Development / Shared Code / Image Splitter on: 2014-03-15 15:14:21
I ran into a minor problem that bugged me a lot. When working on my graphics I like to have everything in a sprite sheet, but to continue working with the images, I often needed to split them up in single images, which I had to do by hand everytime I changed something in the spritesheet. That bothered me so I've written a small tool which I could use from the command line (batch files FTW Wink) to do this task for me. So basically it is the opposite of a texture packer.

Short disclaimer: I didn't do a long research to find other tools that could do this and the funcitonality covers exactly what I needed and nothing more, hence it only supports the png file format.

You can grab the code from github: https://github.com/tomvangreen/ImageSplitter/

There is also a short documentation of how to use the tool.

It is really not that big of a thing, but it improved my workflow in the content pipeline (and I'm not good at graphics, I'm a programmer). Maybe someone else could also profit from it Wink

I have used the splitter to work on my bot Wink Here is the spritesheet with my graphics in 32x32 tiles:


With the correct parameters, it will take the image and export all non empty tiles to my spine working directory:

19  Discussions / General Discussions / Re: Plagiarism on: 2014-03-03 18:02:08
. Pay to play simply does not appeal to the consumer any longer.

I hear this all the time, yet I still have to find someone who prefers pay to win/free to play.
20  Game Development / Newbie & Debugging Questions / Re: Static tile properties with Tiled on: 2014-01-28 17:32:21
I think it should be possible to do in code, when you load your tmx, to check which tileset and wich tile a cell belongs to. Like this you could define a mapping (either in code or in an external text file). Then you just need to check if the level cell belongs to the blocked tiles.

I'm commuting right now, so I can't make any example code. But it should be pretty straight forward to implement.
Maybe you could tell us what library you use to load the tmx (slick, libgdx or something different?)

Edit:
A short piece of code of how it could look like in libgdx with TiledMap (but it is not tested, so maybe you have to fiddle around a bit).

This code iterates through all tile sets and tiles. The isBlockingTile method simply checks some constraints (in this case the tilesets name needs to be "foo" and the tile id 2 or 4) and if they are met, it adds the property to the tile.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
   public void bar() {
      TiledMap map = null;
      // TODO: Load tiled map
     TiledMapTileSets sets = map.getTileSets();
      for (TiledMapTileSet set : sets) {
         for (TiledMapTile tile : set) {
            if (isBlockingTile(set, tile)) {
               tile.getProperties().put("blocks", true);
            }
         }
      }
   }

   private boolean isBlockingTile(TiledMapTileSet set, TiledMapTile tile) {
      String name = set.getName();
      if (name == "foo" && (tile.getId() == 2 || tile.getId() == 4)) {
         return true;
      }
      return false;
   }
21  Game Development / Newbie & Debugging Questions / Re: Trying to Simplify the Addition of New Objects to a Game on: 2013-12-19 08:42:53
Your question is very broad but from what I've read I would advice you to use a map editor like tiled ( http://www.mapeditor.org ). There are already loaders and renderers for several libraries,  like libgdx and slick2d. Like this you create your levels externally in the editor and simply load them in your game code. You need to change a level? Fire up tiled and fix it... tiled is also pretty generic, so it allows you to create multiple layers, create polygon objects, assign properties to layers, tiles, objects, which you can in turn read from your code.
22  Games Center / Contests / Re: Ludum Dare 28: "You Only Get One" on: 2013-12-17 03:32:14
Yaaaay. I submitted my entry page one minute before the time for the jam competition was up (didn't know about the submission hour). Here's what I got: http://www.ludumdare.com/compo/ludum-dare-28/?action=preview&uid=7738

<a href="http://www.youtube.com/v/vdBHOj_nxAI?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/vdBHOj_nxAI?version=3&amp;hl=en_US&amp;start=</a>

Now I need a big bag of sleep. Good night Wink
23  Games Center / Contests / Re: Ludum Dare 28: "You Only Get One" on: 2013-12-14 18:42:04
is anyone else making code that makes their eyes want to bleeeed?!!?!  Lips Sealed

Hahaha... reminds me of one of the threads here in the forum. Currently I'm cutting every corner I can find XD
24  Games Center / Contests / Re: Ludum Dare 28: "You Only Get One" on: 2013-12-14 18:31:12
This is what we currently have:


It looks shitty, but thats because the background graphics are made by me Wink My friend has already made some nice sprites for the persons, but currently I only display one specific (and yeah, not the whole person should be tinted Wink ).

I think our idea could be best compared with a game like lost vikings (if we manage to complete it), where you control multiple units and have to get to a target zone...
25  Games Center / Contests / Re: Ludum Dare 28 on: 2013-12-13 12:19:14
I'm joining the jam compo with a friend. We both are excited since weeks Cheesy i just hope that we manage to complete our game Wink

we'll use libgdx (and some other tools for graphics and sfx).

I think here in europe (+1 GMT) it starts at 2 or 3 am, so we will start on saturday morning, after a good round of sleep and a nice breakfast.

do any of you have a blog or twitter account to follow? would be nice to see the progress (or the lack off Wink ) from others here Wink

wish you good look and much fun for the compo.
26  Discussions / General Discussions / Re: The ignorance of the android industry about good porting solutions like Libgdx on: 2013-08-14 14:24:20
The only thing C# has that Java doesn't is the ability to use pointers... which a JIT compiler I'm sure will create with equatable Java code. Java has been multi-platform for a long time, C# is just starting... it will have years of hiccups I'm sure.

(I'm talking about Java 8 )

That's not correct. C# has a lot of small features java is missing (Properties, Real Generics, operator overloading, optional parameters, Extension Methods, LINQ, nice operators like "??", the "var" keyword, real dynamic objects etc.). All in all those are mostly some small code syntax improvements, but it makes working with C# a pleasure and removes a big amount of boilerplate code Cheesy in my opinion (this is important, it's only my opinion) C# is simply the more beautiful language than java (i notice it everytime i code something in java). But I still have to say, that I prefer eclipse over visual studio.
27  Games Center / Featured Games / Re: Demise of Nations (turn-based strategy) on: 2013-06-18 10:45:34
looks great from the screenshot... the graphics have a nice settlers 2 vibe... i'd be a happy playtester Wink
28  Games Center / Showcase / IMBARINTH - LD26 Jam Entry on: 2013-05-02 15:06:02
Hi all. I wan't to present our entry for the Ludum Dare 26 Jam Compo.

IMBARINTH is a simple maze solving puzzle with shifting tiles, that make the whole thing a bit more complicated.



Ludum Dare Entry Page: http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=14127
Play it online: http://32k.eu/ld26/

The game concept is pretty simple. You are in a maze. You have to reach the goal. Rows or columns in the level may be shifted away from new tiles. Don't fall off the board.

You can use the arrow keys or ASWD to control the player dot, use R for retry (during the game or in the retry menu). In the main menu you can press C to start challenge mode and S to start seed mode.
If you play the web version and the sound is out of sync, refresh your browser, as the preloading sometimes messes with the syncing.

For me (and one of the other developers), it was the first time using libgdx. It was really fun and we had some good help from our dev lead, who has already some experience in building apps/games in libgdx. We all three coded a good part of the whole thing. I also did the music and some placeholder sprites (that were removed during development. I'm really not the art guy and my graphics were simple "programmer art" XD you can see them in my timelapse). I also made a second track for the game, but in the end we simply forgot to add a switch between those two tracks. So only my first song got into the game Wink

The whole thing runs on desktop, web and we are currently improving some of the code to get it running on android too (it actually runs on android, but the background effects and particle systems currently are to heavy to let it run smoothly).

If you're interested in the source code, you can find it on github: https://github.com/brookman/Ludum-Dare-26/
We're not really proud of our code base, but we had to sacrifice some best practices to get the game finished Wink But maybe you can learn something from it (I definitely learned a lot about LibGDX during this weekend).

I hope you enjoy our game as much as we do.

A video of the gameplay can be found here:
<a href="http://www.youtube.com/v/tBujv4enmoQ?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/tBujv4enmoQ?version=3&amp;hl=en_US&amp;start=</a>

My timelapse:
<a href="http://www.youtube.com/v/DvvclvJWHrs?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/DvvclvJWHrs?version=3&amp;hl=en_US&amp;start=</a>

More Screenshots:

29  Games Center / Contests / Re: Ludum Dare 26 starting 26th April! on: 2013-04-30 10:17:01
So we finished our jam entry 1 hour before the deadline...

Imbarinth


You are a dot in a shifting and changing labyrinth which pulsates colorfully to the music.
Your aim is to reach the goal tile marked with a different color and a sparkling orb.
Try not go get pushed out of the labyrinth (or you lose).


Ludum Dare Entry: http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=14127
Play Online: http://32k.eu/ld26
A desktop version is available on the ludum dare page.

I hope you like it (we are already addicted to it XD).

Some gameplay footage from the last hours of development:
http://www.youtube.com/watch?v=tBujv4enmoQ

Timelapses are in the working Wink
30  Discussions / General Discussions / Re: custom font on: 2012-07-31 09:46:20
Usually you have the font present in one color, that is blended into another one when needed. I don't know what tool set you use, so I cannot give you direct advice on how you can do it. Generally your font renderer (or loader) takes care of the font color.

Slick2d for example has two classes (AngelcodeFont and UnicodeFont) to handle font rendering. AngelcodeFont works with a pregenerated image and definition file (generated with a tool like hiero or the TWL font creator). UnicodeFont does basically the same, but it takes a *.ttf file as input and the images for the glyphs are generated directly in memory (so UnicodeFont takes a bit longer to load). Basically you instantiate a version of the font. Version in this context means that you apply settings like color, style (bold or italic), a font size etc. For each font and font style, you can keep an instance.

I think you can apply an outline effect with the unicode font. On the font class, you have a method "getEffects" to retrieve the active effects (at least I think thats what it does).  => http://slick.cokeandcode.com/javadoc/org/newdawn/slick/UnicodeFont.html

There you can add a new OutlineEffect => http://slick.cokeandcode.com/javadoc/org/newdawn/slick/font/effects/OutlineEffect.html

If you wan't to have a better (or more suitable) explanation, you would have to provide more infos about what you work with (java2d, lwjgl, slick, jogl etc.)



I'm not your friend, buddy!
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (51 views)
2014-04-15 18:08:23

BurntPizza (47 views)
2014-04-15 03:46:01

UprightPath (63 views)
2014-04-14 17:39:50

UprightPath (45 views)
2014-04-14 17:35:47

Porlus (62 views)
2014-04-14 15:48:38

tom_mai78101 (86 views)
2014-04-10 04:04:31

BurntPizza (144 views)
2014-04-08 23:06:04

tom_mai78101 (243 views)
2014-04-05 13:34:39

trollwarrior1 (202 views)
2014-04-04 12:06:45

CJLetsGame (209 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!