Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
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 ... 32
1  Discussions / General Discussions / Re: How does JGO use long polling? on: 2015-08-02 22:24:55
That's interesting, thanks for the reply.

That's a little lower level than I assumed, but I guess the question is the same: won't you end up with a big list of sockets? Wouldn't it be possible (or even easy) for bad guys to overload that list until something breaks? And aren't you keeping around references to a bunch of sockets that have been disconnected, since users make a request every time they load a page? Am I missing something, or are those references so tiny that it's not a real concern?

Apologies for the dumb questions, I've just been trying to wrap my head around this stuff for a few days now. It's been an unproductive weekend!
2  Discussions / General Discussions / How does JGO use long polling? on: 2015-08-02 21:56:30
I'm wondering exactly how the "there are X new posts" notification at the top of this very site works.

I know the basics: it uses ajax to request the number of new posts, and then I think it uses asynchronous long polling on the server side to only return the number when it changes.

But on the server side, doesn't that mean there are a bunch of threads (or maybe a thread pool) waiting on that update? More to the point: if I refresh the page 500 times (sorry Riven), doesn't that mean there are 500 threads (or thread pool tasks) waiting around- 499 of which are now pointless, since I'll only ever receive the last one? Isn't that a potential memory leak- if I get a bot to constantly refresh the page and create more of those waiting objects, won't it eventually break?

I'm asking about this site, but what I'm actually trying to figure out is the correct way to do this in Spring. I'm not sure how different JGO's php server is from a Java server, but I'm hoping the above questions are general enough to apply to my situation as well.
3  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-08-01 14:41:43
If you're afraid of JavaScript, you might want to check out Processing. Its syntax is based on Java, and in fact by default it is Java. But it makes it much easier to get something visual and interactive up and running without all the boilerplate of Java.

You can also deploy Processing as JavaScript using Processing.js. This might be an easier gateway into the JavaScript world, especially if you have a background in Java.

Also note that you can deploy libGDX as JavaScript.
4  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-07-31 18:30:30
Like has already been said: start smaller. Work on prototypes instead of games. Try to always have something that works versus constantly working towards an elaborate end goal. Your scope should be a weekend or a week instead of months. Not finished after that? Too bad, publish it (remember, always have something that works) and move on to the next thing. If one of your prototypes captures the crowd's attention, then maybe start thinking about putting more work into it.

Ludum Dare is in 3 weeks, and it's a great way to force yourself to work on smaller games. But smaller game jams are happening all the time: try http://jams.gamejolt.com/browse/active or http://jams.gamejolt.com/browse/active for a start. Also check out One Game a Month.
5  Game Development / Newbie & Debugging Questions / Re: I want to work in 3D? on: 2015-07-30 12:24:00
3D math is not trivial. It's a pretty huge subject by itself. What type of math are you learning about right now?

For starters, you might look up a basic linear algebra tutorial or online course. But learning this stuff will take months or years, not days or weeks, so you're going to have trouble finding an all-in-one tutorial.
6  Game Development / Newbie & Debugging Questions / Re: Ball loses speed when it bounces straight up on: 2015-07-30 12:07:21
Can you post your code, preferably in the form of an MCVE?
7  Game Development / Newbie & Debugging Questions / Re: I want to work in 3D? on: 2015-07-30 12:03:58
You have to be a little more specific. It's hard to answer general "how do I do this" type questions other than by pointing you to google and the basic tutorials. You "do this" by learning more about the libraries already mentioned.

What *exactly* are you having trouble implementing? Split your problem up into much smaller problems, and tackle them one at a time. What have you tried? What has google told you?

Think about it this way: if I show you Mario, and then ask "how do I do this?", what should the answer be? Am I talking about creating the art? Or the specific mechanic of going down pipes? Or maybe I'm specifically talking about collision detection? Or the "physics" of jumping? Enemy AI? Something else entirely? The answer to "how do I create Mario" could be a thousand different things, but they all start with learning more about a game library or programming language.

To get a more specific answer, I'd have to be much more specific about which **part** of Mario I'm trying to recreate. Even if my end goal is to recreate the entire thing, I still have to approach each part of it individually. If I get stuck on a particular problem, then I can post the code I've written for that specific problem, and it'll be much easier to help me.

And that's just for Mario. The stuff you're posting is more involved than that, so there are even more possible answers. What "effect" exactly are you going for? Can you describe it in English instead of showing a video? Can you break it down into smaller pieces?
8  Game Development / Newbie & Debugging Questions / Re: I want to work in 3D? on: 2015-07-29 14:33:41
You start by learning about JOGL or LWJGL or libGDX or JMonkeyEngine.

Look for basic tutorials on google, and try out a basic "Hello World" in each to see which one you like the best. Then go from there. Good luck!
9  Discussions / Business and Project Management Discussions / Re: Do you team up with marketing experts or use their services? Does Steam h_elp? on: 2015-07-28 12:05:15
BTW Twitter and Facebook are quite expensive for their supposed effectiveness... but then we've also concluded that advertising takes a very long time to mature. As in, using very clever tracking techniques, we can trace sales coming in occurring over a year after advertising exposure. It's a very, very long game.

This is super interesting to me. I'd love to read a more detailed article or blog post about this!
10  Game Development / Newbie & Debugging Questions / Re: Handling curves in a platformer? on: 2015-07-22 14:41:21
Yep! After going through some old bookmarks, I came across this, which is just the parent category of the article you posted.

I also came across Open Sonic, which sadly seems to be shut down. I don't really remember what that was, but it sounds interesting.

Can you tell that I went through an optimistic phase where I thought about creating my own Sonic game? :p
11  Game Development / Newbie & Debugging Questions / Re: Handling curves in a platformer? on: 2015-07-22 12:34:40
How in the dun diddly would you handle curved/diagonal tiles in a platformer?

I'm not trying to be sarcastic, but it depends on how exactly you want to handle them. I assume you're talking about a 2D grid of blocks, some of which can have curved tops?

Surely there is a mathematical equation that I can't seem to find right?

Yeah, the equation is simply the equation of the curve. Let's say you have triangular block with a top that goes from the lower-left of its cell to the upper-right of its cell. If you land on that block, your y (bottom) position is just the y (bottom) of the block, plus the y value of the top of the block at the x (right?) position of your character.

Something like this:

1  
player.y = block.y + block.heightAt(player.x);


What I want is for the character to run smoothly up these tiles.

Personally, I would just use a physics engine.

If you want something fancier than the simple case I described above, I remember a series of tutorials on Sonic the Hedgehog game physics that I thought was pretty good. I can't google for them now, but if you can find them that might be a good place to start.
12  Game Development / Newbie & Debugging Questions / Re: Best Practices for Creating New Objects on: 2015-07-21 13:08:51
The short answer: Don't worry about premature optimization. If you aren't noticing any performance hits, don't go looking to fix stuff that ain't broke. (What princec said.)

The longer answer:

If this is happening 60 times per second, am I generating 60 obsolete objects which will require garbage collection at some stage?

Yup.

And although you shouldn't worry about premature optimization, this is indeed one obvious area for improvement. Garbage collection doesn't really matter on a modern PC- you'd be shocked to see how many Objects are being created behind the scenes by whatever library you're using and Java itself. But it **can** matter in places like Android development.


If this is the case, should I be getting into the habit of assigning the new position as shown below?

1  
2  
3  
4  
public void setPosition(Vector2f pos) {
    this.position.x = pos.x;
    this.position.y = pos.y;
}


That's certainly one approach. Another approach would be to make your Vector2f class immutable so you don't have to worry about copying them (but that might end up creating even more Objects, if you have a bunch of mutator functions).

I doubt this will effect performance in any noticeable way but I would like to make sure that I am developing good habits as I go with programming.

Do some profiling. Find out how many Objects are being created behind the scenes, and what percentage of those are yours. Find out how much time your code is spending on creating and garbage collecting those objects. That's the only way to actually answer this question.
13  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Test if the button were pushed in joystick on: 2015-07-20 18:28:42
What exactly do you mean when you say this code "did not work"? Have you tried debugging, or at least adding some print statements, to figure out when the program's execution differs from your expectations?

Does it enter that function? Does it enter that while loop? Does it enter that for loop? Does it enter that if statement? What about that last if statement? What are the values of every variable when the code does something you don't expect?
14  Game Development / Newbie & Debugging Questions / Re: [Solved] Custom Key for HashMap on: 2015-07-20 17:25:24
Gotcha.

You could also have a nested Map, something like this:

1  
Map<String, Map<Integer, InputOperation>> yourMagicMap;


This is not much different from what you already have, but might be worth considering.
15  Game Development / Newbie & Debugging Questions / Re: [Solved] Custom Key for HashMap on: 2015-07-20 16:44:40
Can a particular String map to more than one InputOperation?
16  Game Development / Newbie & Debugging Questions / Re: How to find memory leaks? on: 2015-07-14 18:52:42
You need to profile your application. You're jumping to the conclusion that your problem is caused by a "memory leak", but you don't really have a reason to believe that. That's like choosing a random disease to blame your headache on.

There are a ton of ways to profile an application, and google is your friend. Like others have said, you can monitor how much memory your application uses over time. You could also monitor how much time various parts of your code are taking. You might even step through your code and look for problems.

If you can't narrow it down by profiling, then try to boil your problem down to the absolute smallest example you can create that still exhibits the behavior. Start with a completely blank application, then only add one tiny thing at a time. That'll make it much easier to figure out what's going on.
17  Game Development / Newbie & Debugging Questions / Re: Custom Key for HashMap on: 2015-07-14 13:15:28
The approach doesn't really make sense. What if I have these keys?

1  
2  
3  
4  
5  
6  
7  
8  
9  
Key key1 = new Key("one", 1);
Key key2 = new Key("one", 2);
Key key3 = new Key("two", 1);
Key key4 = new Key("two", 2);

yourMagicMap.put(key1, "ABC");
yourMagicMap.put(key2, "XYZ");
yourMagicMap.put(key3, "123");
yourMagicMap.put(key4, "456");


You say you want to base your keys off the String or the int. That won't work. What should happen when I do this?

1  
2  
String x = yourMagicMap.get("one");
String y = yourMagicMap.get(2);


You can have your key based off your String and your int, but not or. If you want it to be or, then you need to maintain two Maps and insert whatever logic you want to handle cases like the above.
18  Game Development / Newbie & Debugging Questions / Re: Custom Key for HashMap on: 2015-07-13 17:02:43
The contract for the hashcode() function requires that if two objects are equal, then their two hashcodes must be the same.

The problem is that you're violating that contract.

For example, you might have this code:

1  
2  
3  
4  
String name = "name";
Key key = new Key(1, name);
System.out.println(key.equals(name)); //true
System.out.println(key.hashCode() == name.hashCode()); //false!


You would have to change your code so that that the contract was always obeyed. Since you want this to be based off of two values, this is going to be pretty annoying.

In fact, you're already violating the contract for the equals() function, which requires that equality be reflexive. In other words, if a.equals(b), then b.equals(a). Your code doesn't obey that either.

In the end, this approach probably isn't going to work. Instead, I'd recommend building two Maps, one that uses Integers as keys, and one that uses Strings as keys.
19  Game Development / Newbie & Debugging Questions / Re: Custom Key for HashMap on: 2015-07-13 16:18:33
Can you show us an example of how you're trying to use this class?
20  Game Development / Newbie & Debugging Questions / Re: What technologies should I choose as a newbie java game programmer ? on: 2015-07-13 12:48:36
Processing is cool, but is it really suitable for game making? OP sounds ready to go. I thought Processing was mostly for making interesting animations. Happy to be corrected.

Processing is not a game engine or framework. But it is designed to make it easy to get something visual and interactive up and running and deployed in just a few minutes, which makes it a great option for beginner game developers.

It also makes it a great option for people just getting into game jams. There are usually a bunch of Processing entries every Ludum Dare- Recluse comes to mind.

Sure, you have to handle collision and gravity and whatnot yourself, but you also don't have to worry about all the boilerplate that comes with core Java or more complicated game frameworks. And you can get libraries for it that do a ton of great stuff.

With stuff like Processing.js and p5.play, I think Processing is a great option for beginner (and not-so-beginner) game developers.

Shameless self-promotion: In fact, I believe all of the above so much that I've been writing tutorials that take you from Processing and into Java, available here!
21  Game Development / Newbie & Debugging Questions / Re: What technologies should I choose as a newbie java game programmer ? on: 2015-07-08 17:57:31
Also keep in mind that no one knows everything, and everyone took the path that he/she chose coincidentally, and we all therefore naturally suggest to you what each of us knows best or has most experience with, in order to help you best with learning it.

This is a really important idea that people who ask "what's the best way to do XYZ" should definitely keep in mind.

What's the best way for your? We don't know, you tell us!
22  Game Development / Newbie & Debugging Questions / Re: What technologies should I choose as a newbie java game programmer ? on: 2015-07-08 17:21:10
If you're an absolute beginner, check out Processing.

If you're not, check out libGDX.

Anything other than that is really up to you. There is no single correct way to approach it.
23  Game Development / Newbie & Debugging Questions / Re: GWT Error with just 3 classes on: 2015-07-08 15:05:09
I don't know how exactly libGDX handles GWT, but if this was a standalone GWT project I would expect this line in your module xml:

1  
<inherits name='com.google.gwt.user.User'/>
24  Game Development / Newbie & Debugging Questions / Re: GWT Error with just 3 classes on: 2015-07-08 14:51:39
What is the exact error?

Are you using any Java classes on the client side? Have you inherited their modules or specified their source paths if they're translatable?
25  Discussions / Business and Project Management Discussions / Re: Am curious how to budget a team project on: 2015-07-08 11:56:31
You're still asking the wrong question, as throwing people at the problem (game) doesn't always solve it faster or better it can just make the process more complicated.

Exactly. The answer to this question depends entirely on the game, and entirely on the team.

You could be an amazing programmer with amazing design skills, and a single artist might understand exactly the "vision" you're going for. Boom, you've got yourself a two-person team. On the other hand, maybe you're an "okay" programmer, haven't ever really designed anything (it's harder than you might think), and an entire team of ten artists just aren't really getting your vision. Fewer people aren't always enough, more people aren't always better. It depends entirely on the **people** in that team.

This is why I think that people who start thinking about "putting together a team" before they've built a prototype are looking at it backwards. Trying to form a team first is approaching it from the wrong angle. Build your prototype first. That'll give you a better idea of where you need to focus your energy. From there you can *maybe* start thinking about adding people to the project.
26  Discussions / General Discussions / Re: Reporting inappropriate ads on JGO on: 2015-07-07 12:05:07
This is just a minor note, but right now the "Plugged Project" ad is for "Lose Weight Fast", whatever that is.

Not really a huge deal- but I sorta assumed that the "Plugged Project" space was for, well, projects of members? Unless princec is expanding his empire to include weight loss products, I doubt "Lose Weight Fast" is the next big Java game, haha.

I suppose I could solve the "problem" by just buying out the slot. Actually...

(Feel free to move this to the chit chat monster, since it's mostly off-topic and not a big deal, just thought I'd mention it)
27  Discussions / Business and Project Management Discussions / Re: Am curious how to budget a team project on: 2015-07-07 11:57:57
How many people does it take to make an RPG?

One.

But that's not really what you're asking. You're really asking: How many people does it take to make a good RPG? You might also be asking: How many people does it take to make an RPG with great graphics? How many people does it take to make a multiplayer RPG? How many people does it take to make an RPG in a reasonable amount of time? How many people does it take to make an RPG that doesn't have any bugs?

And the answer to those questions is: more than one.

From there, there really isn't a single "this is how many people you need" answer. Every game is different, and every team is different. Maybe one person could pull off a hit (look at Notch or Orange Pixel), or maybe a team of two would be enough (look at Puppy Games).

The scale of everything (your team size, your budget, the time investment, etc) goes up along with your goals. So if you're thinking about creating a simple one-player Pokemon-esque prototype, then sure, one person can probably pull that off- and in fact, adding more people would probably only complicate the process. But if you're thinking of creating the next big MMORPG... that's going to require a much larger team, budget, and time investment.
28  Discussions / Business and Project Management Discussions / Re: Ten years of Indieexperience, revenue stats, business decisions, and tips+tricks on: 2015-07-06 11:38:49
This was a really interesting read, thanks for that. Posting about money can be difficult, but it's something that a lot of people are curious about.

If you feel like it, can you talk a little more about what exactly you mean by "learning the business side of things"? I think most of us here know how to learn the technical side- you google "how to do XYZ", you find a tutorial, etc. What, specifically, is the equivalent for the business side?
29  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 13:06:49
Off the topic of this thread...but that's exactly what they didn't do.  They cut corners and actually did violate copyrights.  This was demonstrated by the internal memos.  An important part of US law is intent and they stepped over the line and the completed system was not clean-room.

Maybe I don't understand the details of the argument, so can you provide any sources that explain how Android "cut corners"?

Most of my information is coming from this wikipedia article and this EFF article, and neither one mentions anything other than reimplementing the API.
30  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-06-30 18:30:02
Wait a minute... I implemented java.util.List yesterday.... Do I need to call my lawyer?

That's the scary part: if Oracle wins, where do we draw the line? What's the difference between implementing a bunch of interfaces and implementing an entire API?

We could come up with some arbitrary limit, but keep in mind that Android didn't implement nearly 100% of the API, so... where is the line?

No matter where you draw the line, it seems a bit arbitrary and draconian in a way that limits stuff that's at the core of software development and Java itself.
Pages: [1] 2 3 ... 32
 
SHC (28 views)
2015-08-01 03:58:20

Jesse (20 views)
2015-07-29 04:35:27

Riven (40 views)
2015-07-27 16:38:00

Riven (22 views)
2015-07-27 15:35:20

Riven (25 views)
2015-07-27 12:26:13

Riven (15 views)
2015-07-27 12:23:39

BurntPizza (36 views)
2015-07-25 00:14:37

BurntPizza (46 views)
2015-07-24 22:06:39

BurntPizza (31 views)
2015-07-24 06:06:53

NoxInc (37 views)
2015-07-22 22:16:53
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

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!