Hi !
Featured games (86)
games approved by the League of Dukes
Games in Showcase (649)
Games in Android Showcase (181)
games submitted by our members
Games in WIP (699)
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 ... 26
1  Discussions / Business and Project Management Discussions / Re: Naturact! A terraria-like with a twist. Need parterns to continue development! on: 2016-02-05 19:43:34
Yeah, we're all *cough* real professionals *cough* here, right? Grin
2  Discussions / General Discussions / Re: Oracle kills webstart on: 2016-02-05 19:40:23
To be honest, I think any Java application that can be run from a browser is just too insecure to ever be a success. Either you get stringent security which is too much bother for many users, or any malware creator gets a free pass to basically do anything whenever someone visits a website. Java is not sandboxed enough for that (like many other languages). Now if you were to use Google Web Toolkit or something like it, you could compile your Java code to Javascript, which runs in a more secure sandbox. Like LibGDX supports when deploying to web. If you want to deploy on the web you'd better look into that route, I think.
3  Discussions / General Discussions / Re: Oracle kills webstart on: 2016-01-29 22:14:37
Yes, the reply by your overlord.
4  Discussions / General Discussions / Re: Simulating simple 2D mist on: 2016-01-29 20:06:51
One thing to consider is using a "lightning" effect. I've seen that used in games before: make some clouds light up randomly in flashes.

Anyway, good luck!
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-01-29 19:08:00
Put the baby to bed. Played Nuclear Throne for a while. Must be the most awesome and well-tuned fun game I've played in a long, long time. You should check it out!

<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

Now I'll go work on eXo, for which I dug up the source code a couple of weeks ago. I found it on my phone some time ago and really, it's got the potential to be quite fun. I've just fixed scaling the GUI to compensate for display density, now back to working on gameplay.
6  Discussions / General Discussions / Re: Simulating simple 2D mist on: 2016-01-29 15:22:21
If you want to make an atmosphere-like effect I'd go for rendering a number of layers of cloud sprites. First you'd need a cloud texture (or multiple for variety), e.g. something like this (you'll need it to have a transparent background):

You could draw one using and an approach like this.

Then render a number of these clouds in layers, with the further layers scrolling more slowly than the closer layers (parallax effect), and possibly with a lower alpha so they fade out in the distance. You could throw in some slow rotation.
7  Discussions / General Discussions / Re: Oracle kills webstart on: 2016-01-29 15:15:30
They could have deprecated/removed both deployment methods two versions of Java ago and the world would not have been worse off... Even better yet, I think Java as a language would be more popular if they had, with Java browser plugins giving Java security such a bad name.
8  Discussions / General Discussions / Re: Releasing on Steam for a (very) indie developer on: 2016-01-29 15:12:56
It's good to know some facts about this, thanks for that. The article by arcengames is especially enlightening: the whole company basically floated on a single month of income. There's no stable sales, nor can you expect to have that.

Anyways, for me it's a hobby with a job brining in the money, which is much less stressful.
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-12-01 16:28:41
Yeah it sure is great looking Grin
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-30 15:45:29

The past days I have added three different types of weapons (burst cannon, plasma torpedo, flak cannon) to my game. The weapons are fully operational: they aim towards the cursor (as far as the weapon type allows), fire bullets and the bullets impact and eventually destroy modules on the enemy ship.

In addition, I have added a nice configurable effects system that lets me add special effects (combinations of particle emitters) easily through editing a json file.
11  Game Development / Newbie & Debugging Questions / Re: Strange 9 patch black borders issue - libgdx on: 2014-11-18 12:12:21
Some possibilities:
- the transparent pixels along the border are not fully transparent
- you do not load it as a ninepatch (can you show us some code?)
12  Discussions / Miscellaneous Topics / Re: Buying "Complete" games is official dead on: 2014-11-07 20:16:48
The computer games market has grown up.

McDonalds: buy crappy and unhealthy food for a high price.

Need for Speed The Crew: buy crappy and unsatisfying DLC for a high price.

Both the food at McDonalds and the gameplay at Need for Speed (or any other pay to win game) are designed with one goal in mind: extract as much money as possible from the gullible majority who is unable to grasp the money-farming tactics used.

The food is salty to make people thirsty and to increase soda sales, and the soda is sugary to speed up digestion and make peope more hungry. The gameplay is tuned to lure players into the game at a low entry price (or *cough* "free" *cough*), make them addicted to the progression and then slowly tuning up the difficulty so that there is no other realistic option than to buy moar DLC, even though theoretically you could play the entire game for "free" .... if you enjoy mindlessly grinding for a couple of years.

It's capitalism, it's business, and it's fine as far as I'm concerned. I do not like fast food, I believe the business models behind it are unethical, and neither do I like the fast food equivalent of games. Running a business like that is bad for your soul. But it's how businesses work.

However, luckily, with rising awareness of unhealthy food and pay-to-win games some of the customers choose to buy quality food and buy quality games. Often quality food can be found in small-scale local shops, and often real quality games can be found with small-scale independent developers. It's how it works: business gets too large, the money milking machine takes over. Just know how it works and make your own choices on what you eat and what you play.

And choose: you want to run the game-development equivalent of a fast food restaurant (easier to make money) or of a local quality food shop (much harder to make money).

p.s. Gibbo, loved your mad photoshopping skillz bro Grin
13  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2014-11-07 19:42:52
Do you guys seriously think any user ever looks at a version number? Maybe a handful of modders, otherwise nobody cares Wink
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-06 20:51:08
Blogged a little about how great Star Control 2 is, and I added rudimentary weapons and damage to the Coreward prototype. So far it's working well but missing special effects, and ship damage is not handled completely yet (energy systems stay functional even though they should be damaged):
15  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-05 18:20:44
I've added a simple console the my in-progress-game that makes it easy to set several balancing parameters and turn off and on debugging features. It's quite helpful in speeding up development:

Also, looks interesting, theagentd, even though I still don't get it Wink
16  Discussions / General Discussions / [duplicate] Re: Great reading material: Game Programming Patterns on: 2014-11-04 14:13:58
Ah, sorry, never mind then  Wink I missed that post. Thanks!
17  Game Development / Newbie & Debugging Questions / Re: Libgdx JSON saving problem? on: 2014-11-04 12:35:26
It's also not clear to me what the problem is. Could you specify what you mean by "all of the tasks within the facility are different, as if they have generated all new ones"? Because I have no idea what the result looks like.

As for this:
Output of old task vs. new task:

This is not unexpected to me. The number you are seeing behind the @ sign is the object's hash code, which by default in most cases is the object's internal address. If you serialize an object, then deserialize it, you in fact create a new object (which is identical to the old object, but may be located somewhere else in memory). At least, that's how I always understood it to be.

As far as I know the LibGDX json serializer is not really smart enough to serialize references to objects (please correct me if I'm wrong), which means that if your save structure contains multiple references to the same object (e.g. many buildings refer to the same task objects) then things will get messed up. While serializing, every single time the task is encountered it is serialized to disk as a seperate object. When deserializing, these objects are instantiated again, but now as many seperate task objects instead of one. Maybe this is the problem you are having.

One way to fix this is to use custom serialization and assign ID's to your task objects, then reconstruct everything while deserializing. This is a bit messy, though. An alternative, and better, approach would be to use another serialization approach, e.g. just using Java's default serialization(which is actually quite good and easy to use) or use a library such as Kryo which is really fast.
18  Discussions / General Discussions / [duplicate] Great reading material: Game Programming Patterns on: 2014-11-04 07:02:33
Bob Nystrom just released a book on game programming patterns,  you can buy a physical book, ebook or read it online for free. It looks really interesting I must say, great for learning more about architecture of games:
19  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-30 10:49:26
Are you adding the electricity system tiles by code, or during gameplay? And how do YOU iterate the system, iterate the node tiles by calling the tick method?

Btw looking super great there, i wish i was that far Tongue

Thanks Wink This thing is progressing quite nicely, but it's actually the second attempt at a game like this (first one was a design-and -crash-your-own-moonlander-type thing which I didn't think through good enough and did not work out very well).

On how I do this: here's some code I use. First of all, I build the energy networks whenever I spawn a new ship (which is based on a design). Also, I will probably have to do this, or something like it, whenever blocks on the the ship are damaged or repaired. producers is an array filled with all generators in the grid (I just do a full scan of the grid to find them). temp is an attribute of the Ship where I store the things that do not need to be saved but can be generated based on the saved data, like the energy networks.
  // Build energy networks starting at the generators
      while (producers.size > 0) {
         Cell producer = producers.pop();
         if (producer.temp.eNetwork == null) {
            EnergyNetwork eNetwork = buildNetwork(producer);

Each network is built by doing a flood fill from the selected generator outward. Along the way the total generator output and buffer capacity is calculated:

EnergyNetwork buildNetwork(Cell producer) {
      EnergyNetwork eNetwork = new EnergyNetwork();
      Array<Cell> queue = new Array<>();
      while (queue.size > 0) {
         Cell cell = queue.pop();
         // Is this an energy cell?
         if (cell.temp.eNetwork == null
               && cell.module != null
               && ( || > 0f
                     || > 0f || > 0f)) {
            ModuleDesign mDesign =;
            // Add surrounding cells to queue to examine whether these are connected as well
            addSurroundingCells(queue, cell.gridX, cell.gridY);
            // Add to totals of network
            if (mDesign.epsGenerated > 0f) {
               eNetwork.epsGenerated += mDesign.epsGenerated;
            if (mDesign.epsConsumed > 0f) {
               eNetwork.epsConsumed += mDesign.epsConsumed;
            if (mDesign.eBufferSize > 0f) {
               eNetwork.eBufferSize += mDesign.eBufferSize;
            cell.temp.eNetwork = eNetwork;
      return eNetwork;

And some supporting functions for the flood fill:
 void addSurroundingCells(Array<Cell> cells, int gridX, int gridY) {
      addCellIfExists(cells, gridX - 1, gridY);
      addCellIfExists(cells, gridX + 1, gridY);
      addCellIfExists(cells, gridX, gridY - 1);
      addCellIfExists(cells, gridX, gridY + 1);

   void addCellIfExists(Array<Cell> cells, int gridX, int gridY) {
      if (gridX > 0 && gridX < design.width && gridY > 0 && gridY < design.height) {
         if (this.cells[gridX][gridY].module != null) {

And once I have this I update the networks each game loop by determining consumption and calculating the effectiveness of devices that consume energy from the network:
 // Update energy production and consumption
      for (int i = 0; i < temp.eNetworks.size; i++) {
         EnergyNetwork eNetwork = temp.eNetworks.get(i);
         eNetwork.epsConsumed = 0f;
         for (int j = 0; j < eNetwork.eConsumers.size; j++) {
            Cell consumer = eNetwork.eConsumers.get(j);
            if (consumer.controlActive) {
               eNetwork.epsConsumed +=;
         eNetwork.eBuffered += eNetwork.epsGenerated * delta;
         float consumption = eNetwork.epsConsumed * delta;
         if (consumption <= eNetwork.eBuffered) {
            eNetwork.eBuffered -= consumption;
            eNetwork.effectiveness = 1f;
         } else if (consumption > 0f) {
            eNetwork.effectiveness = eNetwork.eBuffered / consumption;
            eNetwork.eBuffered = 0f;
         if (eNetwork.eBuffered > eNetwork.eBufferSize) {
            eNetwork.eBuffered = eNetwork.eBufferSize;

Effectiveness is for example used when determining the number and speed of particles generated by thrusters, and the force which thrusters apply to the ship body:

                  float force = * Attributes.THRUST_FACTOR
                        * cell.temp.eNetwork.effectiveness;
                  ship.body.applyForce(ship.body.getWorldVector(tempVec), tempPoint, true);

And that's it. It's not the prettiest or fanciest solution, but it works quite well for my case.
20  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-30 06:58:29
Great stuff Smiley I like the tick-wise solution by Riven, it's somewhat like the spread of water. Easy to understand.

Here's what I ended up with (note this is a simple approach where the production, consumption and buffering is handled cumulatively: as in I just add everything up). However, networks that are not connected behave independently. Also, the network graphics give an indication on the state of the network: the left network is empty (buffer and lines are dark), while the right network is full (everything glows more brightly).

Later I'll add damage: as blocks get destroyed the network may get interrupted and hence I need to recalculate / split networks in such cases.

Edit: the indicators in the top-left are broken at the moment
21  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-29 13:07:21
I wouldn't implement that with any node-tree system. My system would simply be implemented with two arrays containing the Consumers and Producers:
public class EnergySystem {
  private final ArrayList<Consumer> consumers;
  private final ArrayList<Producer> producers;

And if you build a wire that is not connected to anything, that creates a new EnergySystem.
If you connect a wire to a wire, that wire is going to take the EnergySystem of the wire it's connected to.
If you connect a wire to two or more wires, that wire merges the EnergySystem of all the wires it was connected to.
If you connect a consumer or producer to a wire, it's added to the array of the EnergySystem.
If you remove a wire, you need to split the Energy system. Thats the only thing that might be a little tricky Smiley

Yeah that's precisely what I'm doing. Splitting energy systems is indeed a bit of an issue, but it's pretty easy to update the networks using a flood fill search.
22  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-29 11:53:15
I have seen your node tree solution and i found a possible problem

Good point. I think it just depends on how you process the node tree. My plan was originally (before I thought of using a much simplified model) to go through the tree from consumers to producers ("upstream" if you like). Each move up the tree I would check the incoming energy (which may be from multiple sources/blocks) and outgoing energy (also possibly from multiple sources/blocks), and make some "smart" decision about that.

Will the Generator(2) affect the Consumer(1)? For example if the Consumer(1) does consume more, then the Generator(1) produces, will it take some power of the Generator(2)?

If consumer(1) knows about both Generator(1) and Generator(2) then a rule could for example be that it will take 50% from generator (1) and 50% from generator(2), or more if any of the generators is unable to supply 50%.

Will the Generator(1) affect the Consumer(2)? For example if the Consumer(2) does consume more, then the Generator(2) produces, will it take some power of the Generator(1)?

Same as the above. I was thinking of doing this by moving all energy one "step" from generators to consumers during one update of the network. The interval between updates would then influence how fast energy would move. With electricity, however, this is pretty much instant, so maybe it will not work well then.
23  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-29 09:59:13
I was grinding the internet the whole day, and i think i've come up with a very performant, simple technique, that will work for pretty much everything(power sources, switches etc).
It is basically a node tree, and when using recursion(allthough i still have to find out why recursion is told, to be such a 'bad' thing to do ? Oo )

There is nothing wrong with recursion in itself, it can be a quite elegant solution to many problems. However, the issue with recursion is that for each recursive call, some things get stored on the stack (a piece of memory where local variables are stored). So if you do many recursive calls (e.g. because you are parsing a large tiled grid using this approach) you may run out of stack memory and get exceptions.

So if you want to use recursion, you should be aware of this and ensure that there is an acceptable maximum "depth" of recursion. This means that the size of electricity networks must be limited somehow.
24  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-28 11:14:32
There's topics that are easy and topics that are hard. I think physics is generally a pretty difficult topic to do yourself, and I guess making somewhat realistic simulations of electrical networks is also pretty hard stuff.

I have now settled on an even simpler system: each seperate network of generators, consumers, buffers and conduits is collectively an "EnergyNetwork". For simulation I do not take the structure of the network into account, I just simply calculate total production, consumption and buffering of the entire network. If there is enough energy generated or buffered then all consumers work at 100% effectiveness, if it is less, then effectiveness goes down. Effectiveness is a variable that I then use when calculating things like generated thrust or torque.

Updating the network is then quite simple:
1. add generated energy to buffer
2. calculate total energy needed by all consumers in the network (buffer capacity and production output is stable as long as the network does not change)
3. if energy-need <= buffered-energy then effectiveness = 1
   else effectiveness = buffererd-energy / energy-need (if energy-need > 0)
4. subtract consumed energy from buffered energy (check if buffer is not < 0 or > max capacity)

And that's basically it. It's not useable for things like switches etc, though.

Creating the network is done using a "flood fill", starting from each generator in the grid. Every grid tile has a "visited" boolean that I use in the flood fill. So:
1. Clear "visited" flag of all cells
2. Go through entire grid, add all generators to a stack (or LibGDX Array)
3. while stack is not empty
    - pop topmost generator from stack
    - if generator is not yet visited, buildnetwork(generator)

The buildnetwork(generator) function then does the following:
1. Create a stack of cells to visit (visitStack)
2. Add the generator to the visitStack
3. While visitStack is not empty
   - pop topmost cell from visitStack
   - is the current cell not visited yet and an energy cell? (i.e. conduit to energy, producer, consumer or buffer?)
   - if true
     - add all surrounding cells (not outside grid ofcourse) to visitStack
     - add energy production, buffer size to totals in EnergyNetwork
     - add consumer cells to a list of consumers to quickly calculate energy consumption (which is dynamic since thrusters, etc may be on or off)
   - mark cell as visited

You can find more about this if you look into "flood fill" as a search term. This may not be what you are looking for, but I thought I'd share what approach I'm taking now.
25  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-27 19:05:21
I haven't 100% worked it out yet, so it may be a little time until I got a system working. The idea of creating a seperate model for the energy (/ electricity) network is that you can make it much simpler by removing all non-functional blocks in between producers and consumers and directly link those. Then I'll go from consumer to producer, moving energy one step (node) at a time.

Unfortunately, I haven't figured it out in enough detail yet to give you really helpful examples.

The idea is somewhat inspired by how Creeper World 3 transmits energy "pulses". A cool game, by the way.

Btw, i might have to investigate your technique for thrusting and torque calculation on tile based space ships later on Tongue

For the thrust and torque I just use Box2D (in LibGDX) with a little custom code for generating the Box2D shapes based on the ship tiles and for applying force on the location of the tiles that contain thrusters. The shape generation code is pretty simple, but works well (I go through the grid line by line and create square shapes basically, then add each square shape to the ship body).
26  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-27 10:55:55
I've been thinking about a similar system for the power systems on my prototype ship design / shooter game. The general idea would be that energy flows from generators (optionally via buffers) to consumers.

The approach I'm now thinking of requires a simple algorithm to be run after a block/tile is placed or removed:
1. Start from one of the generators (does not matter which one). This will form an energy network, lets call it network "A".
2. Do a "fill" from the generator outwards along all tiles that conduct energy, and for each tile:
   - if a conduit (only function of which is conducting flow of energy) do nothing and continue the fill
   - if generator, buffer or consumer, assign it to this network (say set attribute network="A")
3. Repeat from 1 for each generator that is not in a network yet untill all generators are assigned (creating network "B", "C" etc)

In addition, my plan is to construct a graph of connected nodes for each network while the above algorithm is running. The graph's "roots" would be generators, the leaves would be consumers, and in between could be buffers in any configuration (i guess there also could be switches etc).
A simple network could be:
          Producer   Producer
             |          |
           Buffer       |
            /  \       /
     Consumer   Consumer

Energy flows from the top to the bottom. One consumer would then receive energy from both producers, with one source buffered (if consumption is lower than production), and the other consumer would only receive buffered energy from a single producer.

Constructing such a energy network graph would be somewhat expensive, but would only be needed during construction (or destruction, heh) time, whenever the network could be altered. Simulating the network operation would be much faster, as it would be a matter of following the graph from producers to consumers.

Anyway, I have no idea if you are thinking along these lines, but maybe it is of some us to you.
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-26 12:16:35
Found some time today in between baby & housekeeping to make some improvements to the prototype I'm working on. The thrust and torque is now applied to the ship model depending on where the thrusters and reaction wheels are placed. I also fixed many small issues. It runs smooth even with very big ships:
Holy shit. That looks like a merge of FTL and StarDrive. *___*

Also: Reminds me of Robocraft (currently playing that game, I really love it)

FTL was certainly an inspiration, and I loved stardrive (I guess the ship design part is also pretty like StarDrive's). I envision a mix between the two, I guess.

Robocraft looks interesting, but it's waaaay more advanced stuff than I'm making. Great stuff. I limit myself to 2D space top-down setting.
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-26 12:14:29
@Grunnt: Still reminds me of what I'm doing, in some aspects even more now, in quite some also better probably...

Hey Drenius, looks interesting! I have no doubt we're doing quite different things, though. I'm planning on this to be somewhat like FTL-meets-space opera, with the player controlling a single ship in detail and battling it out with one or a few other ships. Do you have a WiP thread or page about your game?
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-25 15:55:55
Found some time today in between baby & housekeeping to make some improvements to the prototype I'm working on. The thrust and torque is now applied to the ship model depending on where the thrusters and reaction wheels are placed. I also fixed many small issues. It runs smooth even with very big ships:
30  Discussions / General Discussions / Re: How to make an experience, not a game. on: 2014-10-25 09:46:15
A great story is just one of many ways in which a game can convey a message. Take, for example, Defcon: Everybody Dies. The "happy" website does not do it justice. The graphics are simple but the atmosphere is highly immersive. I cannot help but feel as if I am in a bunker somewhere, in command of a nuclear arsenal and helplessly fighting a nuclear war that nobody can win.

It's the subtle things that bring this message across extremely powerfully. Like the message whenever a nuke hits a city:

"Great! That was a good hit! But wait, did I just say hurray at killing 8 million people?"

The feeling is very much amplified by a simple monotonous humming sound in the background of machines in a bunker, and, sometimes, the sound of a woman softly crying.

The game creeps me out. And it makes me realise so strongly what an all-out nuclear war would mean as no other media has ever done (including documentaries about the horrors of the bombs on Japan in WW2). In a nuclear war, everybody dies.
Pages: [1] 2 3 ... 26
KaiHH (57 views)
2016-01-31 23:15:29

sci4me (85 views)
2016-01-23 21:47:05

sci4me (73 views)
2016-01-23 21:46:58

KaiHH (106 views)
2016-01-19 13:26:42

theagentd (188 views)
2016-01-05 17:10:00

ClaasJG (207 views)
2016-01-03 16:58:36

chrisdalke (195 views)
2015-12-28 06:31:21

Guerra2442 (225 views)
2015-12-25 03:42:55

Guerra2442 (223 views)
2015-12-25 03:27:21

theagentd (261 views)
2015-12-21 14:43:24
List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48 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‑
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!