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 4
1  Game Development / Game Play & Game Design / Re: Tiled with objects made of multiple tiles. on: 2015-08-21 19:45:27
Why not just use a dummy tile for objects? "tree_seed" or something, so when you load in your tiled map, you just swap out tree_seed with a tree of a random size? Then you can add trees with tiled, and they'll be handled in game with your entity code.
2  Game Development / Game Mechanics / Re: How to code a sword swipe? on: 2015-08-15 17:05:34
Program a hitbox, program a rotation and render the swing vfx when you're swinging. Nothing else to it. I don't really see what you mean by "what can you do with that". You can do whatever you want to happen in your own game, that's what programming games is all about.
3  Game Development / Game Mechanics / Re: How to code a sword swipe? on: 2015-08-15 11:24:55
Or just rotate the sword and have the vfx animation be a seperate graphic. There are many ways to do this, none of them are wrong unless you want them to function differently.
4  Game Development / Networking & Multiplayer / Re: Weird packet behaviour with kryonet on: 2015-08-10 06:05:00
UDP by definition is an unstable networking protocol, it's meant to be fast, but not verified. You're probably just getting left over packets that never arrived initially. I'd package a counter with each packet (a packet ID), and if a packet comes that is below your current last packet ID, just ignore it.

At least, that's what I'd first think of.
5  Game Development / Networking & Multiplayer / Re: How to deal with different packet sizes? on: 2015-08-10 06:01:29
Why don't you just fill as much data into each 1024 packet that you need and send them over one at a time until all the data is sent?

First packet says hey here comes the terrain data, the rest follows until you tell it you're done sending terrain data.
This is the correct answer. Don't send the entire thing in one go. As long as each piece makes sense alone, you can rebuild the array on the user's side.
6  Games Center / Showcase / Re: We Shall Wake Demo 7 is out! on: 2015-08-05 18:45:47
New site looks good.
I crashed the game: I pressed H at the very beginning of lambaste mode while clicking on the screen. No idea why that happened, but it happens every time if you try it Smiley
(Happens everytime I press H in fact.)
Paste to log:
7  Game Development / Newbie & Debugging Questions / Re: [LibGdx/LWJGL] What does this do? on: 2015-08-05 00:18:11
Then I'm missing something entirely. It's definitely handled by libgdx, and I'm not doing anything particularly strange with the graphics. (So far as I can see)

I looked into it and it's just how the shaperenderer works. Luckily, I don't actually use the shaperenderer for anything except drawing in the stuff that has no textures, so I can just texture everything and get rid of literally all of the gl15 calls.
8  Game Development / Newbie & Debugging Questions / Re: [LibGdx/LWJGL] What does this do? on: 2015-08-04 14:15:04
There are no clear invocations of the method, which is why I don't know exactly what's going on. I could do a lot of digging and find out where the issue is coming from, but I figured it'd be quicker to ask around the forum. I'll run another test and check the time scale of the invocations though.

So, looking at it, it looks like it's being called once per frame, which makes sense, since the data is changing on a frame by frame basis.

As is, I can get ~18000 individually drawn and collision checked bullets without dropping any frames anyway.
I think if anything, the slowdown past that point comes from poor handling of new objects.

Mostly I was just curious as to what was happening there. I figured based on the information I did have that it was just buffer allocation, but I haven't used opengl in a very long time.

As for the amount of invocations to glbufferdata, that 2000~ was nothing compared to the ~1 million calls to a few other functions, luckily they're incredibly cheap functions. (which I initially wanted to clean up for further optimization, but after profiling, clearly they aren't an issue)

Basically, what I learned today is that buffers are expensive (no shit), what I'm doing is fine as long as I'm not throwing 20K+ bullets around, and collision is super cheap.
9  Game Development / Newbie & Debugging Questions / [LibGdx/LWJGL] What does this do? on: 2015-08-04 11:04:47

I'd honestly like clarification on exactly what that method does, since reading the lwjgl documentation doesn't make it very clear. It explains it initializes a buffer object's data store, but what does that really mean? Why does it eat so much cpu time? Am I doing something particularly wrong? (And if there's a better way to profile, please do share, I'm out to learn a bit at the moment)

The code in question isn't anything complex. Here's the paste of it:

It was just something I wrote up in a programming class to pass time and show my friends how simple it is to get some basic stuff going.
10  Java Game APIs & Engines / Engines, Libraries and Tools / Re: A library for 2d shapes and collisions on: 2015-07-15 17:04:23
If you need torquing and shapes, you are in the realm of a physics engine. Use box2D. This will give you the most consistent outputs and will be something actually usable.

If you just want shaped collisions, look into Separating Axis Theorem.

There is no simple in between that I know of, because anyone who puts that much work into their collisions will just opt for the library that handles what they need already and is well established.
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-15 15:07:12
The mixed sizes though. Looks really good.
12  Java Game APIs & Engines / Engines, Libraries and Tools / Re: A library for 2d shapes and collisions on: 2015-07-15 14:36:43
Use box2D. If you need 3D use bullet. These are the libraries that are the most widely used and supported.
13  Game Development / Newbie & Debugging Questions / Re: Digging tiles out on: 2015-07-15 14:32:32
Try this:
System.out.println("Down: " + bdown +" Left: " + bleft + " Right: " + bright);

Are you actually getting the results you expect? If yes, add this:
System.out.println("Player Coords: " + position.x +", " + position.y);

(assuming that's how this works)
System.out.println("Block remove at: " + x +", "+ y );

If these values check out, then it should work, or you're removing the wrong entity or not hitting one of your qualifiers. Your code is written pretty badly in terms of understandability, and you may want to just change your map to something along the lines of a multidimensional array that isn't tied to entities, since I assume tiles are not treated as entities in any other way except that they have a position and a type.

(At least, this would make more sense to me, as then you wouldn't need to do any of that round about entity work in there, just
 "Array[x][y].type = air"
or whatever.)
14  Games Center / WIP games, tools & toy projects / Re: Airships: Conquer the Skies on: 2015-02-09 01:43:33
I'm glad this project still seems to be going strong. Looks very promising still.
15  Games Center / Featured Games / Re: State of Fortune on: 2014-07-26 23:53:04
Oh lord, Mike you are my hero. I love the idea of using islands.

My banter below, feel free to ignore:
I think another interesting idea if people do run out of land is to set up a sort of public fund, to create a nearby artificial island. It's way more complex, but say, you add it close enough to see, and you set up a bridge and all that, so that people will have to wait to get out to it, and will get excited for it, and have to pay into the new land to get to it. (Using in game currency they have obtained of course)

Good way to create an artificial money sink in a game like that, and you could make it so it's "government" funded partially, and over time will get completed either way, so that it doesn't limit the actual game, just gives people something to spend on. Of course, you could always just make this sort of idea as a "building a connection to a newly discovered island" instead of an artificial one, but it's an interesting way to go about it.

You could do some crazy stuff though, like adding in a literal government system and elections, giving some players the power to pass laws which get voted on by the population of their island that they govern, etc. It is called State of Fortune after all, never a bad reason to add politics and ways to spend money. At that point, it turns less about your idea of agriculture and exchange though and more into a colonization sim.

Anyway, those are just my tidbits of ideas, I'm sure whatever you do with the actual gameplay will be good, hell it already is fun to play and you're focusing on the technical side still. Hope to see more updates from you in the future.
16  Game Development / Newbie & Debugging Questions / Re: Tile rendering FPS lag on: 2014-07-25 21:58:06
LWJGL is pretty much better than Java2D in all circumstances. It's more complicated, but faster.

I wouldn't even bother writing a game in Java2D these days, since you can use something like libGdx and get better performance for about the same amount of code as regular Java2D.

I recommend looking into a graphics library and brushing up on your basic Java skills before venturing further into game development.

Also, for tile based games, why not use a regular array? Then you know what's in the bounds of the screen for much cheaper (it's 1 if call and 1 multiplication calculation, versus at least 4 if calls per bounding box) [you can actually get this to be less by just saying for(int i = playerPositionTileX + tilesToRightEdge; i > playerPositionTileX - tilesToLeftEdge; i--) and doing another loop for the Y, and just rendering out those like, 50 objects, and never having to check anything for collision, no if statements of any sort, so it's even cheaper, since on larger maps you can save thousands of calls]

I assume geometry is static, so it's not like you need to make your map bigger suddenly. Even if this was the case, you could always bump your array up a size by recasting it, it seems like a big waste of resources to use an ArrayList for your map. Entities, surely, but geometry, no.
17  Game Development / Newbie & Debugging Questions / Re: how to do something at the end of a finger drag in libgdx/android? on: 2014-07-19 00:59:49

That doc tells you all about the handy dandy input processor.
18  Games Center / WIP games, tools & toy projects / Re: Airships, a ship design & fight game on: 2014-07-03 13:18:37
Reminds me of the land ships from the book Leviathan.

You can check out all of the land machines from the book here:
Probably really great if you're looking for other inspiration.

Also, on the topic of airships:
The ships in the edge chronicles are really cool. They fly using floating rocks!

These are just what I was immediately reminded of by your last post. Concept art looks real good, hope to see some more diversification like that in the future.
19  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Gdx.files.local doesn't seem to be finding my files. on: 2014-06-19 09:16:40
Gdx.files.local will find anything in the directory of the jar only, classpath is INSIDE the jar only. Internal turns into classpath if the file is not found, so it basically serves as both local and classpath combined. So you guys are both wrong.

Yes, what you are doing originally works fine. NORMALLY.

As for Gibbo, read the documentation before spouting nonsense:

Local files are stored relative to the application's root or working directory on desktops and relative to the internal (private) storage of the application on Android. Note that Local and internal are mostly the same on the desktop.
Except that internal turns to classpath if it can't find the file locally.

As for how folders work, those ARE the root folders when running a project in eclipse, so if he is using eclipse, anything that is at the same level as his src and bin folders WOULD be considered root, this is because things are run as if they were a jar in the project folder.

Here is the entire wiki page on filehandling:
and here is the official documentation:
20  Game Development / Newbie & Debugging Questions / Re: libgdx collision detection on moving and rotating object (rectangle enemy) on: 2014-06-17 04:24:53
You're going to need more code than that. All that tells me is you're rendering 2 rectangles, doesn't say anything about where you're doing movement or collision checking.
21  Games Center / WIP games, tools & toy projects / Re: Athanas Quest on: 2014-06-14 04:36:33
No point doing it yourself. Use Tiled.
 (Unless you want the experience creating your own editor will bring you, in which case, make your own version of tiled, don't bother making just a basic png -> text/object type converter)

I do recommend tiled over the RGB method though. It gives you a better idea of how things will look without loading them up, and it already has all the things you need in it's export format.
22  Game Development / Newbie & Debugging Questions / Re: Spears (ENEMIES) on screen like many of them. [LibGDX] on: 2014-06-08 20:17:27
The methods there need to be wherever you render.

 You have to work out the exact details yourself, if you can't get through this simple of a thing after being given this much you probably need to work more on basics of logic and the Java language before making games. Just throwing that out there. This is all the help I can give you without me literally writing parts of the game for you at this point. (Although I already gave you a bit of code, albeit not much)
23  Game Development / Newbie & Debugging Questions / Re: Spears (ENEMIES) on screen like many of them. [LibGDX] on: 2014-06-08 19:51:41
I really don't see the issue with creating a new object for this sort of thing. If it's just a static thing though, you can just make an array of objects, and reset them. Something sort of like:
Spear spearArray[] = new Spear[5];
for(int i = 0; i < 5; i++){
     spearArray[i] = new Spear(x,y,width,height);

on initializing, then on update something like this:
for(int i = 0; i < 5; i++){
     if(spearArray[i].x > 0 - spearArray[i].width){
         spearArray[i].x -= SPEAR_SPEED;
        spearArray[i].x = screenWidth;

with a spear class that looks like this:
public class Spear{
    int x, y, width, height;
    Spear(int xx, int yy, int w, int h){
    x = xx;
    y = yy;
    width = w;
    height = h;

You'll have to handle rendering and collision yourself.
24  Games Center / WIP games, tools & toy projects / Re: Athanas Quest on: 2014-06-06 19:09:24
Just going to put this out there in response to those of you who are young and trying to work together. Work alone for now. You aren't good enough at programming or cooperation to collaborate yet in most cases. I know it sounds like fun to put together a group, but it's likely you won't get anything done, or you will have issues with cohesion. Not trying to be mean, but it's unlikely to work out. If you still really want to make a team, make a plan first. Split up work properly, make contact times, set up a git repository, and continue to learn with each other. Don't flake out, put a lot of hours into it. Treat it like a job.

On Topic more:
For the scrolling background, I recommend either just making a few cloud images and making them appear in the background randomly offscreen, move in one direction, and disappear one they're offscreen, or you can make one long image that loops once it gets to the end.
25  Game Development / Newbie & Debugging Questions / Re: Collision bug in a 2D platfrom game. on: 2014-05-28 20:32:44
You can also just check the bounding volume of the intersecting bodies and say, if the player is moving toward a static body with a positive x velocity, you get the left most edge of the object it collides with, and minus the width of the player. This is pixel perfect with rectangles and doesn't require iterating per pixel, as it will just automatically push you to the left most edge of whatever you've collided with. My implementation looks like this:
public void collisionChecks() {
                //move the player's rectangle the entire velocity
      player.rect.x += player.xvel;
                //if the player leaves the boundary of the camera, load a new map segment
      if (player.rect.x < 0 && pmx > 0) {
         pmx -= 1;
         player.rect.x = 1899;
      } else if (player.rect.x < 0) {
         pmx = MX - 1;
         player.rect.x = 1899;
      if (player.rect.x > 1900 && pmx < MX - 1) {
         pmx += 1;
         player.rect.x = 1;
      } else if (player.rect.x > 1900) {
         pmx = 0;
         player.rect.x = 1;
                //do actual collision check
      for (int i = 0; i < rectList.size(); i++) {
         if (player.rect.overlaps(rectList.get(i))) {
            player.rect.x -= player.xvel;
            if (player.xvel > 0) {
               player.rect.x += rectList.get(i).x - player.rect.x - 20; //20 is the player width, I'm just too lazy to use player.rect.width()
               player.xvel = 0; //set velocity to 0 as we've collided
               touchingRight = true;
            } else if (player.xvel < 0) {
               player.rect.x += rectList.get(i).x + 32 - player.rect.x; //32 is tile width, also too lazy to use rectList.get(i).width()
               player.xvel = 0; //set velocity to 0 as we've collided
               touchingLeft = true;
                                //if we know there's a collision, leave the loop
                        //if there is no collision, reset touching booleans
         touchingRight = false;
         touchingLeft = false;

keep in mind this only will work if your velocity is less than the width of a tile, but you can test for that and iterate in velocity steps that are the size of tiles, so it's just less iterations, rather than per pixel.
26  Game Development / Newbie & Debugging Questions / Re: creating grid based ascii graphics for a rogue like on: 2014-05-28 19:54:54
Keep in mind you gain nothing from actually making it ASCII at this point. Once you go through the trouble of using arrays and any real graphics calls you've defeated the point of ASCII. If you're dead set on it, go for it, but keep in mind you're limiting the audience of your game severely for very little ease of programming/slightly less work.
27  Game Development / Newbie & Debugging Questions / Re: [Libgdx] Strange issue when scaling a sprite on: 2014-05-09 04:20:37

do this after setting the position, and remove your setOrigin line of code.
28  Discussions / General Discussions / Re: Publishing my game on: 2014-04-18 21:29:03
Pretty sure the majority of successful developers haven't made a lot of money based off per-sale profit, but rather through many sales/customer loyalty.
29  Discussions / General Discussions / Re: Publishing my game on: 2014-04-18 21:09:06
Kickstarter isn't a good place to put a finished product, or very nearly finished one. You're better off releasing to android/play and building a fanbase, then kickstarting your next project if people like your first.
30  Games Center / Showcase / Re: Groundskeeper 2 on: 2014-04-10 03:58:26
I think the trick is not recording from a mobile device, but rather your desktop/dev build.
Pages: [1] 2 3 4
afikri (8 views)
2015-08-31 09:30:22

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

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

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

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

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

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

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

Kefwar (33 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!