Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-26 03:30:15
Not today, but in the recent past I've been working on a project that I actually find interesting for once. Going for an expandable economy based game. Starting off with stocks and chat and moving up to gambling, jobs, construction, companies, and services. Where it goes from there I'm not sure, but getting stocks and chat going with a database and everything has gone really smoothly. Networking works, logins work, server keeps track of anything sensitive in terms of gameplay. I thought about moving away from LibGdx to just do all the rendering myself now that I understand OpenGL better, but I decided against it since it's not really a graphically demanding sort of game, and LibGdx has a lot of nice built in features like text rendering already.
2  Game Development / Networking & Multiplayer / Re: Best conventions for using kryonet on: 2015-09-20 13:47:31
You'll probably not be able to accommodate for a large volume regardless of what you do with your server structure anyway, unless you're sitting on piles of money. I'm not saying design to fail, I'm saying design within constraints that are workable, don't aim for the best implementation at launch, because you won't know where you need to pour resource until later, and you might find that something works better for your specific demands down the road.

As a sort of related example, this is the server structure for a game called Osu!:

They have all that working behind the scenes for a rhythm game with ~20k peak players at best probably.
3  Game Development / Networking & Multiplayer / Re: Best conventions for using kryonet on: 2015-09-20 05:41:10
That should really be your concern until you start running into problems. Once you get down to more specific cases you can test a few things and see where it gets you.
4  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-09-16 08:41:28
I actually coded part of my current project for the first time in awhile. Just putting together things is soul crushing sometimes, since it can be completely mindless inputs. I'm to the point where I'm just refactoring code and adding a feature or two at a time because the project is interesting in concept, boring as all hell in terms of coding. Added a lot of client-server based checks and fixes, and worked on security a tiny bit. Might swap to bcrypt if I decide I'm not happy with security.
5  Game Development / Newbie & Debugging Questions / Re: Kryonet registering and serializing methods isn't efficient? on: 2015-09-07 15:36:00
Methods are a part of classes, not objects. They aren't data, so they aren't serialized.
To add onto this, this is why you have to register your objects in your network class (or whatever you use to register things for both your client and server implementations) with what they need. The methods are kept client side for both, so you can run methods on them, but the variables get passed around.
6  Game Development / Newbie & Debugging Questions / Re: Grid-based entity collision issues on: 2015-09-03 21:43:39
Make sure you do all of your rendering last so that your render matches what the game state is, otherwise you'll be 1 frame behind.
Beyond this, make sure you're checking that the object has ACTUALLY collided, not if it's GOING to collide, otherwise that'll be 1 more frame.
7  Game Development / Newbie & Debugging Questions / Re: Grid-based entity collision issues on: 2015-09-03 09:05:07
You shouldn't be assigning a velocity to reach the next entity, you should be snapping to the next entity when you've collided. So if you're going to collide on the next collision pass, let yourself collide, then rebound so that entity1.x = entity2.x - entity1.width if you're moving right or vice versa if you're travelling left. This will make sure you're not adjusting one entity's velocity and then the other, only to be giving them twice as much velocity total and forcing themselves into each other. I'd say you should change velocity in as few places as possible, from friction (so you'll be doing this ALWAYS), and then from acceleration (when a key is pressed). If you're going to collide, make the entities not inside of each other and set v = 0. It'll save you a lot of headaches, as it'll mean adding explosion movements and things like that won't suddenly be based on your collisions in the same frame and things of the sort.

Also, you should really use more descriptive variable names. I know that they're collidedDirection and DistanceDirection, but it's not very intuitive to everyone.
8  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.
9  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.
10  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.
11  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.
12  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.
13  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:
14  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.
15  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.
16  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.
17  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.
18  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-15 15:07:12
The mixed sizes though. Looks really good.
19  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.
20  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.)
21  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.
22  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.
23  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.
24  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.
25  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.
26  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:
27  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.
28  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.
29  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)
30  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.
Pages: [1] 2 3 4
ivj94 (583 views)
2018-03-24 14:47:39

ivj94 (48 views)
2018-03-24 14:46:31

ivj94 (374 views)
2018-03-24 14:43:53

Solater (61 views)
2018-03-17 05:04:08

nelsongames (109 views)
2018-03-05 17:56:34

Gornova (151 views)
2018-03-02 22:15:33

buddyBro (693 views)
2018-02-28 16:59:18

buddyBro (91 views)
2018-02-28 16:45:17

xxMrPHDxx (493 views)
2017-12-31 17:17:51

xxMrPHDxx (733 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!