Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (612)
Games in Android Showcase (172)
games submitted by our members
Games in WIP (658)
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 ... 8
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-29 18:24:22
Finally decided to separate the big chunk of code that's always in my games for screens, registries, transitions, utilities, and the like into its own mini-engine/library. I can just access it using git submodules in my actual games. Hopefully this'll make it much easier to make a bunch of little games instead of tediously copying alllll the old files and refactoring it to death.
2  Game Development / Networking & Multiplayer / Re: Handling monsters on serverside on: 2015-08-29 16:46:39
Kryonet is not a game engine with its own update methods for you to run your logic. It is merely a networking library for general purposes.

As Drenius said, KN has its own internal update thread that can be started with start() where it continually updates itself, checking for incoming packets and processing them with the received method. It doesn't do any game related things, only networking.

For your server logic instance, you'll have to set up some loop that gets updated X times per second where it updates all your logic. After you compute the new positions, create/re-use a packet instance with the correct information and send it via the Kryonet Server instance using sendToAllTCP/UDP().
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-03 03:59:27
This is one of many apple cider vinegar traps I laid out.[/img]

Out of sheer curiosity, is it just apple cider vinegar inside that cup? Do they drown in vinegar or is there something else?
4  Game Development / Newbie & Debugging Questions / Re: World architecture and internal construction? on: 2015-08-03 03:03:10
Your WorldMap would have a list of Regions. Each Region has a list of Rooms and Connections between rooms. This is your current design, and it should work pretty well for what you want.

Think of each Region as a universe. The WorldMap has a lot of universes. The universes don't interact with each other, but they're all in an area where they're contained.

The Regions are universes. Each one has Rooms and Connections. Think of Rooms as galaxies and Connections as a wormhole found in the centre of each galaxy. Each wormhole can only go to one galaxy, but they you can potentially have multiple wormholes to multiple galaxies.

I don't know if that space analogy helped. I hope it did Grin

EDIT: more detail below

Rooms could be generic. They get rendering data from its region (so a brick wall theme for castles, etc.). Connections would do the same. You could also make rooms unique and have subclasses of Room for each rendering type that implement an abstract rendering method for different designs. You can also customize each room (different traps, loot) and make it more immersive that way.

5  Games Center / Showcase / Re: Block-Warefare (new original concept showcase) on: 2015-08-02 05:00:43
The concept is good. However I came across a few bugs:

Clicking and dragging the squares seems really awkward. What I mean is most of the time it doesn't actually get grabbed, or after moving it I am not able to move it again. Also, if I move it and leave it in the "tray" where the blocks start it will get stuck in there. The ball will never hit the blocks and I can "win" this infinite game.

For a 14 year old with just under a year of Java experience, this is a good learning tool. It's a simple game but in the future you can learn from it and create even better games. I'm a 14 year old developer too. My first game was pretty crappy but even if I didn't finish any of my games (still haven't for the last 4 years Tongue) each one gets better and better as I learn.

Good luck on your Java adventure! Grin
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-31 23:57:51
Decided since my new project will have a train theme to it, I should add a fitting scene transition that I stole from Mind the Gap.

GIF (warning: somewhat large!)
Click to Play

faster smaller gifv here
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-31 20:23:15
Thanks to all your kind feedback on my post about what to do when you feel like quitting making a game, I've decided to start a smaller game. I had to refactor many things and the first thing on my list was converting the UI from acting in 720p to a ratio-based system. It looks like a mobile game right now but everything looks so much better in 1080p.

Perhaps you can infer what the game will be about from the name? Tongue
8  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-07-31 16:20:02
Thank you all for the support. I think I need to stop making huge games and just try little things for once. I'll halt PMP progress for now since as a framework it's as complete as I want it to be and use it for the next small game.

4. Don't work on or think about the project full time - code on it every day for only 5-15 minutes. Do a little change, fix a thing, add a comment, debug a thing - baby steps
This so far has gotten me the farthest on Project MP (gotta get that github streak Pointing).

Again, thanks for all the feedback. Now I just have to find an idea for said small game... Tongue
9  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-07-31 05:51:40
I looked back at Mind the Gap and I just sat there. I didn't know what to do. It was so... strange seeing the thing I built just over a year ago. I looked back at Project MP and realized how much of a change it was between the two games. Even though I didn't complete either one, it still had a lot of progress made between the two.

I tried to fix a camera jitter bug but I have no idea how any of the code works any more (I might've made it worse persecutioncomplex).

Mind the Gap by now is kinda dead (I really don't remember how anything works, let alone trying to package it and distribute it). I seem to make a sandbox game so there's "unlimited possibilities" but realize the possibilities are too much and decide to make a linear game. I give up on the linear game because I don't want to make levels for it. The cycle viciously repeats itself.

I need to find something new to work on, that's why I'm looking for feedback on what to do. I tried to experiment on MTG but it just didn't work out. I also tried to make another level for Stray but I lost interest really rapidly. I just don't have the desire to make levels (for any game for that matter).

Thanks for the feedback though. It just doesn't feel the same to work on an old game because you know that old game has none of the new framework things you added in the most recent game and it just feels icky to touch the legacy code.
10  Discussions / General Discussions / Recurring issue with making games on: 2015-07-31 05:13:03
I invest a lot of time into each of my projects. The issue is I seem to abandon them really quickly after a lot of work (I have not ever come close to finishing a game for the last 4 years). Mind the Gap was abandoned after building the first level, a separate project (Stray) was abandoned after 3 levels, and right now I am considering halting Project MP (a multiplayer terraria-like game) in favour of a new one. Right now Project MP has very minimal gameplay features but a ton of behind-the-scenes stuff I worked on which makes it super easy to add things into multiplayer. I want to work on something unique, not just a Terraria clone.

I'm torn whether I should continue Project MP or start a new project using most of the code for framework related things. In a few days I'll be on vacation and won't have access to my computer for around a month so working on anything will be impossible. I was considering using the time to think about what I could do, but I'd like to see how you guys cope with wanting to work on another project.

I want to actually have a game with actual gameplay for once and post it here. Mind the Gap was somewhat polished, but it only had one level. Stray (never released) was a platformer that was supposed to have a story but ultimately given up for Project MP for a sandbox quality.

Any ideas on what I should do?
11  Discussions / General Discussions / Re: Windows 10 on: 2015-07-29 21:26:18
I am considering upgrading from Windows 7 to 10 (albeit a bit later when it's a bit more stable).

I want to ask how's the start menu compared to Windows 7. Is it familiar enough that it'll be easy to get used to or is it too Windows 8-esque? That's really all I have to ask for now, Windows 10 looks so much better than Windows 8 so my interest has been piqued.
12  Game Development / Newbie & Debugging Questions / Re: My map load parser is taking ages on android on: 2015-07-29 18:26:14
This code I have from my current project can read/write an array of bytes to a file and GZIP (compress) it.

public static void saveBytes(byte[] world, File location) throws IOException {
      FileOutputStream fos = new FileOutputStream(location);
      GZIPOutputStream gzipstream = new GZIPOutputStream(fos);



   public static byte[] loadBytes(File location) throws IOException {
      FileInputStream fis = new FileInputStream(location);
      GZIPInputStream gzipstream = new GZIPInputStream(fis);

      ByteArrayOutputStream byteStream = new ByteArrayOutputStream(2048);
      byte[] buffer = new byte[2048];
      int bytesRead;
      while ((bytesRead = > 0) {
         byteStream.write(buffer, 0, bytesRead);


      return byteStream.toByteArray();

If you're not in need of compression you can replace the GZIP streams with a FileInput/OutputStream instanceDataInput/OutputStream and it'll read/write uncompressed files.

EDIT: Riven said using Data(Input/Output)Stream is for binary data. I just assumed FileInput/OutputStream would work.
13  Game Development / Game Mechanics / Re: Electric network in a tile based game on: 2015-07-27 22:17:11
I implemented an iterative "splitting" version where it attempts to split at every connection it finds. It works quite well, although sometimes it will have leftover energy it didn't ration. Another side effect is that the amount of energy a machine can take at a time isn't limited by time, rather it's per pulse of energy. It can take an infinite number of pulses at any time but each pulse is limited, which is totally okay for my game.

Thank you BurntPizza and Longarmx for the help!
14  Game Development / Game Mechanics / Re: Electric network in a tile based game on: 2015-07-26 21:25:13
Thanks for the clarification BurntPizza.

I actually decided to play with the redstone flux system in minecraft and I saw that it changed. It seems that their method is very similar to my first one: energy in a cable will attempt to spread it to its neighbours. It seems recursive (probably using iterative methods for speed and no stack overflow possibility). I'll try this method first and implement a rough version of it and see what's wrong.
15  Game Development / Newbie & Debugging Questions / Re: How do you handle lots of entities with no lag? on: 2015-07-26 20:45:52
"Having" lots of entities and "rendering" lots of entities are two separate things. I assumed you were talking about the general optimization of having a lot of entities rather than controlling when to render an entity if it was on-screen.

A way to cull entity rendering is to use an invisible rectangle that is the screen object. You'll have to loop through all the entities and if they collide with the rectangle (using basic math) you can render them. Yes, you have to loop through all the entities but it's much better than rendering each one regardless if they were on screen.
16  Game Development / Newbie & Debugging Questions / Re: How do you handle lots of entities with no lag? on: 2015-07-26 20:37:19
It seems to me that his population count and the actual entity count is skewered, that is the population count is much larger than the actual number of entities. I noticed his population kept ticking up at a constant rate, which gave me the impression that it's a lot larger than the real population.

Your only question was related to that video, so my answer is above. If you have other questions (related to maybe another game or your own) do ask! Pointing

EDIT: I should clarify a bit more. His entity count isn't anything too extreme, it seems like it's no more than a few thousand real entities at a time which is do-able. Notably he doesn't have entity-to-entity collision. If you do have entity-to-entity collision the computation time will increase exponentially.
17  Game Development / Newbie & Debugging Questions / Re: TileRenderer Buggy lines on: 2015-07-26 17:04:37
I don't use the Tiled program to make maps but I think a tileset is actually a file of all the sprites and some extra data. I think the tileset itself has to be modified for padding.
18  Game Development / Newbie & Debugging Questions / Re: TileRenderer Buggy lines on: 2015-07-26 16:12:07
I'd thought you'd figured this out by now, but it's really hard to check someone else's code without their code.

Put in the tile rendering code (if it's long use the pastebin) please.
19  Game Development / Game Mechanics / Re: Electric network in a tile based game on: 2015-07-26 00:38:10
Instead of a separate cache (equivalent to an adjacency matrix?), every time the graph is updated, the the traversal is done and then the graph can be reduced:

      ■ <- just added

Traversal outward from the updated point (DFS or BFS) finds A, B, and C, so they are all connected, and added to each other's adjacency lists and can directly reference each other.
The blocks connecting them still have references, but only to inform ABCD etc. when the graph is changed.
So there's really two separate graphs: the 'wires' and the producers/consumers.

I kinda understand what you're saying, but do you think you could elaborate a bit more/dumb it down? What I (think) I'm getting is that wires act as "adjacent connections" for producers/consumers. A wire merely connects some set of blocks together so they can interact with each other.
20  Game Development / Game Mechanics / Re: Electric network in a tile based game on: 2015-07-26 00:02:23
Wouldn't the queue method be relatively slow if each producer was searching every time it pulsed for an update? It seems really slow especially for larger-scale networks.
21  Game Development / Game Mechanics / Re: Electric network in a tile based game on: 2015-07-25 22:06:06
My original plan was to propagate a jolt of electricity through cables, at intersections it would be split and going on their separate paths. In a loop it would eventually keep splitting until there was no more power to move. It was essentially a recursive function which may hit a stack memory limit as local variables get preserved, which is bad for long-distance networks such as large power lines.

Another option was making a network map of all connected producers (including battery blocks) and consumers, and evenly distributing power to all the consumers. I am probably going to go with this method, but I don't know how I would "throttle" energy transfer (some cables can only transfer X amount per update).

Some help on the network option would be greatly appreciated!
22  Game Development / Newbie & Debugging Questions / Re: Handling collisions in a platformer on: 2015-07-24 19:12:53
You rebuild the tree every logic tick AFTER all the movement and collision has been handled. It's a tiny bit slow but way faster than updating it every time one entity moves.
23  Game Development / Game Mechanics / Electric network in a tile based game on: 2015-07-24 17:59:58
Around 2 years ago, I played FTB which has a collection of Minecraft modpacks. The modpack I played with had several mods that each had their own energy system of sorts.

An example is IndustrialCraft2. There were generators, batteries, and cables. There were also machines that required power to operate. How its energy system worked was energy was literally sent in "packets": a cable could transfer an unlimited number of packets instantly but the only limitation was packet size. If a cable attempted to transfer an energy packet that it couldn't handle it would explode/melt.

My favourite is Thermal Expansion. There were also generators, storage devices, conduits, and machines. However all energy-capable devices were limited by a transfer in/out rate of X units per tick (a tick is 1/20th of a second). This meant that a cable could only transfer some amount of power per second to its adjacent connections, be it a battery, another cable, or machine.

I poked around the forums and found an old post about how this would work. It used node connections to transfer electricity. It didn't exactly have a way to throttle how much energy gets sent per second but it was a good start.

Any ideas about this? I was thinking of having a block that can accept/transfer energy. A generator would make energy, search the adjacent blocks for a conductor, and evenly spread as much energy as it can limited by transfer rate to all of the neighbouring conductors. This would probably work in practice except that cables may spread back and forth between each other.
24  Game Development / Newbie & Debugging Questions / Re: Handling collisions in a platformer on: 2015-07-24 17:09:04
If an entity is colliding with a tile/entity, that's as easy as calling the intersects method of your favourite Rectangle class (or just use if statements). You said you wanted platforms that can be accessible through the bottom face (or only be solid on the top face). You can generally find what face you collided with with some resolution.

This is definitely not the most efficient way, but it is one of the easiest ways to implement working collision detection. It works fine for small levels, not so much for huge open world games (although I'll explain how to optimize this method enough for bigger worlds and more entities).

For entity to static tile collisions, you don't have to check constantly because you know the tile boundary always lines up every X pixels (or whatever units you're measuring the world in). If my tile size is 32x32, I only have to check every 32 pixels. The way to check that is position % tile_size == 0. If I'm lined up on one of the axes, I have to iterate through the tiles that I may be colliding with on one face. If any one of the tiles is solid on that face, I must stop my velocity in that direction. Unfortunately this is the crappy part about this method. Instead of moving your position by the velocity and then checking for a collision, you have to step your position every pixel (I am so sorry) and constantly check for a collision. The collision only checks every tile width so it's still pretty bad. However this method has extremely high accuracy when moving at extremely fast velocities (in my previous game this was an absolute must). Another upside is that your tiles can have faces in which they are solid or not. This way you could have a platform that's only solid on its top face so you could jump "under" it to land on top of it.

Entity to entity collisions are similar. Unfortunately this means checking against every single entity each time. This gets really slow really quickly(O(n^2) I think) so this is only good for small games, not huge open world games.

Optimizations for reducing the frequency of checks can involve checking less often and visually interpolating the position to make it appear smooth.

Optimizations for the entity-entity collision involve reducing the number of entities it must check against. To do this you can use a quad tree. Quad trees divide the world into 4 quadrants. Entities can fit in that quadrant (or not but that's a different case). Entities in a quadrant only have to check against the other entities in its same quadrant. This reduces the number of entities to check against. If there are too many entities in a quadrant, the quadrant itself splits into 4 more littler quadrants. The number of entities to check reduces again. This is an absolute must for open world games because the high number of entities will cripple performance rapidly if you're checking some monster on the opposite side of the world with the player.

I hope that helps. This is definitely not an efficient way to handle collision but it's easy to implement and understand and has high accuracy. This should be enough for a small platforming game.
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-23 23:32:16
I built a health bar that has liquid in it that jiggles every time you take damage.

gifv here
26  Game Development / Newbie & Debugging Questions / Re: How to optimize light engine? on: 2015-07-22 01:19:14
For every torch you place you can re-calculate the nearby light sources. Doing the entire map is pretty unnecessary.

Calculating the lighting at the start for a dynamic world is pretty useless Roll Eyes

What I did was made a method called scheduleLightingUpdate which would set an internal flag to true. Every render, I would check if the flag is true. If it is I would re-calculate the nearby lighting. If not I only rendered the lights without calculating.
27  Game Development / Newbie & Debugging Questions / Re: How to optimize light engine? on: 2015-07-21 18:30:22
When I meant testing data I meant some benchmarks of how long it takes to render a frame or lighting update. I was too vague; sorry.

You said it's mainly on Android it has some framerate issues. I can see that every time you render a tile for lighting, you're doing a distance check (which involves a slow square root), not to mention you're iterating through every lighting per tile and doing said distance check.

I would suggest you have some sort of lighting update where it would calculate all the tiles' brightnesses so that you don't have to do it on-the-fly per frame.
28  Game Development / Newbie & Debugging Questions / Re: How to optimize light engine? on: 2015-07-21 16:06:46
You haven't even stated what's required to optimize the engine. Is it too slow as you add more lights, does rendering the lights lag, etc...

It'd be helpful if you had some testing data.
29  Game Development / Game Mechanics / Re: Getting AABB to Voxel Terrain collisionworking correctly on: 2015-07-21 01:28:14
It seems like the difference between >= and >. If you're using the greater/lesser or equals condition the equals may "overlap" into another side. If you could post some of your code that would help us look through and see what exactly is wrong.
30  Discussions / Miscellaneous Topics / Re: Looking for early testers for We Shall Wake Demo 7 on: 2015-07-20 05:00:43
The practice mode and tutorial mode don't have any glaring bugs, but a thing I did find a bit annoying was in the tutorial, it would tell you to press X key to do something. I tend to just start pressing that key as fast as I can to see if it'll work. When it does, the next time I press that key (which is very shortly after) the messages would disappear without me being able to read them. Another thing was the grab/interact was a bit finicky at first but it was easier to use later on.

The game looks really really good. I love the detail that's put into this and how the dashy thing has the air effects (I'm a sucker for those). Like I said no glaring bugs, merely my opinion. This is great!
Pages: [1] 2 3 ... 8
afikri (9 views)
2015-08-31 09:30:22

afikri (17 views)
2015-08-31 09:30:07

afikri (7 views)
2015-08-31 09:27:24

afikri (11 views)
2015-08-31 09:26:40

Roquen (16 views)
2015-08-29 11:30:54

GamerC4 (28 views)
2015-08-22 20:38:50

GamerC4 (24 views)
2015-08-22 20:37:18

GamerC4 (29 views)
2015-08-22 20:37:01

Kefwar (34 views)
2015-08-22 18:07:24

GamerC4 (26 views)
2015-08-22 01:00:24
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 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!