Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (734)
Games in Android Showcase (222)
games submitted by our members
Games in WIP (811)
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 ... 38
1  Game Development / Newbie & Debugging Questions / Re: 2 questions, coding MMORPG in Java on: 2017-08-19 16:19:18
Think about it this way: Notch spent years making the first versions of minecraft, which are nothing compared to the game that exist today.

Not just that. He also spent years before that, developing much smaller games. He didn't start with Minecraft. He started with something much smaller, and worked his way up from there.
2  Game Development / Newbie & Debugging Questions / Re: Using bytes to save space. Does that really optimise perfomance or not? on: 2017-08-18 12:48:47
I mean using primitive type for number (byte) instead of int/short/long.

If I would make an application with byte only, would that save any perfomance or space? Or its really NOT important? I thought I can make app just on bytes and it will be super optimized but maybe not? PS I know byte hold value just to 127(or128) but in certain applications thats enough

You can, and should, do the math yourself.

An int requires 32 bits. A byte requires 8 bits. So you're saving 24 bits of memory by using a byte instead of an int.

Now, how many substitutions are we talking about here? If it's 1000 substitutions (1 substitution in 1000 instances, 2 substitutions in 500, whatever), that's 24 bits * 1000 = 24 kilobits, and we divide by 8 to get 3 kilobytes.

If you have a million substitutions in memory at once, then you're saving 3 MB.

To put that in perspective, by default Java programs run with 256 MB of memory. So a million substitutions will save you about 1% of the allocated memory. (And you can increase this default memory allocation.)

This sounds like premature optimization: you're thinking about making optimizations before you understand the numbers or see an actual problem. This is almost always a waste of time.

That being said, this kind of optimization does come in handy, if you have more than millions of int values that can be represented by smaller types.

But you shouldn't just look for random "optimizations" before you understand the problem.

Edit: Another reason to consider which data type you should use is code readability. If a value will never go outside the bounds of a byte, then using a byte makes your code easier to understand. Of course, it can be very difficult to know that something will never happen. But code readability is more important than micro-optimizing your code.
3  Game Development / Newbie & Debugging Questions / Re: 2 questions, coding MMORPG in Java on: 2017-08-16 14:55:18
MMORPG

Recommended reading: http://yourgameideaistoobig.com/

Start small. Start with Pong. Get that working before moving onto the next thing.
4  Game Development / Newbie & Debugging Questions / Re: Javafx vs libgdx vs LWJGL on: 2017-08-16 14:52:43
The answer to this question depends more on you and your context than it does us and our preferences. Why don't you create a few simple applications in each and see which one works best for you?
5  Game Development / Newbie & Debugging Questions / Re: looking for good way to make colisions with slopes and gravity on: 2017-08-14 03:57:39
Have you considered using a physics engine like Box2D?
6  Discussions / General Discussions / Re: Neat code or a early finish product on: 2017-08-12 17:31:21
Neat code or a early finish product?

Ship it.

Get the product (even if that product is just a small game) out the door. Put a link to it on your portfolio website, and move on to the next project. Take the lessons you learned from the previous project and use them to improve the code quality in your next project.

Any code you write now will look like garbage to you in a year anyway, so there isn't a huge benefit to spending time polishing it. Publish it and move on to the next thing. Hopefully we all get a little less terrible every time we start a new thing.
7  Game Development / Newbie & Debugging Questions / Re: using music of a band on a free game on: 2017-08-11 02:52:41
what happen if I put music in a game I made but im not selling it, can they proceed legaly with me even if im not getting profit with the game?

Whether you're profiting from your game has nothing to do with copyright. Copyright gives you the right to copy something. You don't magically get the right to copy anything you want, even if you aren't profiting from it.

If that were the case, why would anyone ever buy anything? I'm not profiting from watching movies in my own home, so I should just be able to download it, right? That's not how it works.

Yes, they could take legal action against you.

should I call them, and ask them if they are ok if I use their music in my game, what to consider on that scenario?

It's potentially much more complicated than that. The band itself might not even own the copyright. It might be their label, or the songwriter, or some other company or person.

Please read this: What do I need to legally use copyrighted music in my game? More info here.

I would second the suggestion of using FreeSound.org. You can search for sounds and music that are released under creative commons, but please make sure to give attribution unless they specifically release it with a "zero attribution" clause.

How does it work with a channel like WatchMojo, where they play clips of movies all the time?  Do they pay a fee to Universal or MGM or whoever put the movies out?  Considering they have played clips of just about every movie ever made, that seems like it would be a pretty hefty sum.

I don't know what WatchMojo is, but they either purchased a license to the stuff they stream or they're hoping that nobody sues them or shuts them down.

YouTube also has a feature where you can use copyrighted music in your video, which then shows a purchase link to that song. That's a pretty special case though, and is probably a result of Google making some deal with major recording labels. (That's just a guess though, I don't know the internal workings of the YouTube copyright system.)

But this stuff is complicated. If WatchMojo is a company, then they probably have a team of lawyers whose entire job it is to sort out copyright issues.
8  Discussions / General Discussions / Re: Getting ready to release...any suggestions? on: 2017-08-08 04:06:36
looks like I was trying to be an asshole which I wasn't.

Pretty sure that sentence is going on my tombstone.  Tongue No worries man.
9  Game Development / Game Mechanics / Re: Using a Map with Duplicate keys vs using instanceof on: 2017-08-07 04:30:21
That's not what I meant.  As I said in my original post, I was planning on using an int as an index for the types and would, therefore, be using the index numbers more than once - which isn't how an array works.

If you're going to have a small number of sequential indexes, then that's what an array is designed for. You could use a 2D array, or an array of Lists.

I think there's a difference between premature optimisation and trying to build software properly and thinking about design as you build.  For example, it makes sense to me to use the libGDX Array class as it's been optimised for use in a render loop - why would you not use that just because you don't want to prematurely optimise.  I agree that is to be avoided, but avoiding performance efficiency for the sake of it is obviously counter productive.

I'm not telling you to avoid efficiency. I'm suggesting that you need to define exactly what you're optimizing for before you can talk about efficiency.

Honestly - why is considering a multimap over-complicating things? It's a simple enough concept and, I must admit, I was surprised when I looked at the docs and discovered that there isn't already an implementation in either java or libGDX.  I'm really not trying to over complicate and I don't think that is what I'm doing - I'm just trying to think about design as I build instead of writing poor code and having to refactor or simply not be able to maintain my own code!

I'm not saying that a multimap is overly complicated, and in fact I've given you a few suggestions on how to implement one. I'm suggesting that worrying about the "efficiency" or "overhead" of a library is missing the point a bit, because honestly there won't be a noticeable difference either way. Go with whatever makes the most sense to you. Stop worrying about "efficiency" before you actually have any problems.

Just because it makes more sense for me to loop through one collection rather than multiple collections.  All the objects will need rendering regardless of subtype.

Like I said, you should go with whatever fits into your brain. But if you want to avoid the kinds of checks you're talking about, a common approach is to split it up into multiple Lists. Note that you could still have your mega-list if you really needed it.
10  Discussions / General Discussions / Re: Getting ready to release...any suggestions? on: 2017-08-07 03:34:10
Why is that if I'm not making money?

Because that's not at all how copyrights work.

Not really, it's like saying I've painted a picture and put it up in a gallery, so what's the best way to get people to see it.

That's still a huge topic without any definitive answers.
11  Discussions / General Discussions / Re: Looking to hire artist on: 2017-08-06 17:05:36
That's still extremely broad. You've said that the sprites are all going to be replaced, so that doesn't really tell us what you're trying to replace it with. And you still haven't told us how many sprites you need or what size they need to be. Are we talking 10 sprites? 100? Are they animated? What about logos and backgrounds?

Think about the reverse situation: if an artist posted saying that they have art, but just need you to program the game, that wouldn't be enough information. You'd need to know what kind of game it was, what platforms it was releasing on, whether it was multiplayer, etc. An artist needs to know more information than you've given.
12  Game Development / Game Mechanics / Re: Using a Map with Duplicate keys vs using instanceof on: 2017-08-06 17:01:15
I could possibly use a map with Integer keys and Array values

Why not just use a good old-fashioned array then?

I just assume that an existing implementation of a Multimap would already be somewhat optimised, but it's looking like it would also require importing a library just for one class - which may offset the advantage.

Optimized for what? Have you tried implementing any of the above solutions and run into trouble? Or are you just assuming you're going to have a problem? Premature optimization is the root of all evil, and all that.

What advantage is offset by using a library? How does using a libary offset that?

Honestly you seem to be complicating things a little too much, worrying about "efficiency" without actually defining what that means in your context.

There is at least one context (rendering) where it'll be easier if I can have everything in one collection, so it seems better  to me to have a collection of everything where individual collections are easily accessible - hence the multimap idea.

Why is it better for rendering if everything is in one collection?
13  Discussions / General Discussions / Re: Looking to hire artist on: 2017-08-06 05:53:39
Honestly a hundred bucks doesn't get you very far: I've paid that much just for a few sprites. But you'll have better luck if you post your exact requirements: how many sprites do you need? What size and style are you going for?

Also note that this forum is mostly for programmers, so I'm not sure how many artists you're going to find.
14  Game Development / Newbie & Debugging Questions / Re: print game screen like vr games on: 2017-08-05 18:13:58
when i googled, there is how to create VR but for android, not for Java SE

You need to break your problem down into smaller steps and then approach those steps one at a time. Something like "vr Java" is way too broad, so you aren't going to find anything very useful with that.

You've already narrowed it down to a step of drawing the same scene twice (with the caveat that that's not how VR works). And you've been given a couple of approaches for how to tackle that. Have you tried googling that? Something like "java swing buffer" will return a bunch of results, and you can use those results to refine your approach. Then if you get stuck, you can come back here with a specific question and a small example program that shows us exactly what you're trying to do. Good luck.
15  Game Development / Game Mechanics / Re: Using a Map with Duplicate keys vs using instanceof on: 2017-08-05 18:00:46
Do you agree with my assessment regarding efficiency?  If not, what would you suggest?

What is the Array class? Do you mean ArrayList here?

What exactly do you mean be efficiency? How many objects will this data structure contain in real life? What are your memory constraints? "Efficiency" is not just a single number. It's a bunch of tradeoffs.

Are you aware of a good Map implementation that allows duplicate keys?

Can't you just use a Map of Lists?

Or just use a different Map for each subtype. Don't try to come up with a "clever" solution if something simple will work.
16  Discussions / General Discussions / Re: Getting ready to release...any suggestions? on: 2017-08-05 17:53:14
Is the trailer music also the game music ?
If yes, change it.

Interesting. Can I ask why?

The trailer uses a Good Charlotte song... I feel like that might be copyright infringement...

It sure is.

Besides the usual stuff like a video and screen shots, does anyone have any advice as to how to get the game to be seen by people and played?  Is there any promotional tools I should use or any incentives I could give the players on Itch to play it besides it being free?

This is a huge topic, and nobody has figured out a fool-proof method of getting people to play your game. It's not an exact science. It's a little bit like an artist asking "I've painted a picture. Does anybody have any advice for getting people to look at it?"

The best advice I can give you is to not expect much. If this is your first game, chances are it's not going to be the one that makes you famous. Every game developer you can think of created dozens of games before the game that made them big, and that was because they slowly built up a following from the games that came before it. Build up a portfolio. Get 10 people to like this first game. Get 20 people to play your second game. Slowly build on that instead of hoping that one game is going to put you on the map, because that's not really how it works.
17  Game Development / Newbie & Debugging Questions / Re: preven title bar to show in the part of your rendering screen on: 2017-08-04 01:40:41
Yep, the pack() function is the way to go. Also note that this will require you to set the sizes of your components in your window, and use appropriate layout managers.
18  Game Development / Newbie & Debugging Questions / Re: print game screen like vr games on: 2017-08-03 02:56:32
Like most things in programming, there are about a hundred different ways to do this, and which way is right for you depends more on you than anything. So the best thing you can do is researching and trying things out.

Two approaches occur to me:

Approach one: just draw stuff twice.
Approach two: draw to a buffer, and then draw that buffer twice.

There are probably other ways to do this, and Google should really be your first stop for questions like this. Also note that VR games aren't just drawing the same thing twice; they're drawing the same scene from slightly different angles.
19  Discussions / Miscellaneous Topics / Re: Can't log In on: 2017-08-03 02:53:40
Related: http://www.java-gaming.org/topics/no-email-confirmation/38306/msg/365796/view
20  Game Development / Newbie & Debugging Questions / Re: About making game tools on: 2017-08-01 01:17:03
What is a good API to write tools with. Such as a paint application?

You're going to have to be much more specific than this. There is no catch-all API for writing tools.

You have to break your problem down into smaller steps and then focus on only one of those steps at a time. Which part are you working on? Is it the core painting part? The GUI around the painting part? Data storage? If you haven't broken down your problem into smaller steps like this, then that's your first step.

Like gouessej said, you can probably just use core Java and Swing or JavaFX, without any external libraries.

I'll also mention a library / language called Processing, which makes it easy to create visual and animated programs without a ton of boilerplate code. If you're just starting out, it's a great language to use for learning the basics.
21  Game Development / Newbie & Debugging Questions / Re: Synchronized Drag and Drop?!? on: 2017-07-29 04:27:06
You are not supposed to stall the EDT.

None of the things I mentioned require stalling the EDT.
22  Discussions / Miscellaneous Topics / Re: Cheerpj: convert any Java application and library to a browser-based Web app on: 2017-07-28 01:02:15
People are asking if they can take their Java code and compile it to JavaScript in order to run it on the server. When Java is already on the server with better stability and performance than JS.

We must go deeper. Can we have a JavaScript engine inside the Java that's executing as JavaScript?
23  Discussions / Miscellaneous Topics / Re: Cheerpj: convert any Java application and library to a browser-based Web app on: 2017-07-28 01:01:22
Have you looked at this?
https://javafiddle.leaningtech.com/

Yeah, that's what got me excited about the idea of embedding a Java editor directly in a website. I've seen a few other online editors, but they can't handle Swing and UI stuff.

I happily pay for a CodePen account so I can do this. I'd happily pay for the ability to do this with Java.
24  Game Development / Newbie & Debugging Questions / Re: javafx canvas like swing on: 2017-07-28 00:52:45
can I extends JavaFx canvas and add a thread inside and just add to stage?

What happened when you tried doing exactly that?
25  Discussions / Miscellaneous Topics / Re: Cheerpj: convert any Java application and library to a browser-based Web app on: 2017-07-27 04:06:45
This seems to work pretty well. This could be pretty exciting. I'd pay money if they supported embedding something like the fiddle in websites, similar to CodePen. Where'd you find out about this?
26  Game Development / Newbie & Debugging Questions / Re: Synchronized Drag and Drop?!? on: 2017-07-27 03:58:53
Since I am offloading the actual import code to the game loop, there is no way for me to know if I am still importing data.

Huh? How is there no way? You could poll from one thread to the other, or better yet just notify the other thread when it's done. There are a ton of ways for you to know when you're done importing the data. Have you read any concurrency tutorials?
27  Discussions / General Discussions / Re: Security in server-based multiplayer games on: 2017-07-23 02:10:22
No I know that someone with the client can reverse engineer it.

My point is that all of the "security" you mentioned (hashing variables, sending packets) can be reverse-engineered, so they aren't really providing much security.
28  Discussions / General Discussions / Re: Security in server-based multiplayer games on: 2017-07-23 00:45:03
I don't see anything that a determined hacker couldn't reverse engineer by simply looking at your code (which they can get, even if you're doing things like obfuscating) and what's sent over their network.

Can I take a step back and ask why you want to prevent clients from connecting to your server? You should be validating inputs on the server anyway, to prevent clients from doing anything they're not allowed to do.

Anything done on the client side is exploitable by the user. There is no 100% fool-proof way to prevent clients from doing whatever they want. If you really want something to be secure, you have to do it on the server.
29  Game Development / Newbie & Debugging Questions / Re: Is there an OOP way of doing this? on: 2017-07-22 01:39:43
It seems like you didn't really want any advice, as you've shot down every idea that's been presented pretty abruptly. It's completely fine to do things your own way (in fact I think you should do whatever makes the most sense to you), but if what you really want to do is explain your approach to us instead of take suggestions, then maybe next time just make a post outlining your approach instead of asking for input. Tongue

Judging from your other replies, you probably don't want to hear any feedback, but I'll just quickly note that you shouldn't get too hung up on "the OOP way" or "design patterns" before you really understand what they mean. Write code that works and makes sense to you.

Anyway, it sounds like you're having fun working on your code, and that's what matters. Good luck, and happy coding.
30  Game Development / Newbie & Debugging Questions / Re: Is there an OOP way of doing this? on: 2017-07-20 01:51:02
How exactly is
1  
rigidBody.getCollisions()
calculated? What exactly does it contain?

If you need to know which characters are colliding with
1  
rigidBody
, why don't you have something like this:

1  
2  
3  
4  
for(CharacterCollision collision : rigidBody.getCharacterCollisions())
{
  collision.getCharacter().getEffects().applyAll(effects);
}


I'm also a little suspicious of why you need to keep around a collection of what's colliding instead of doing applying the effects whenever you detect the collision, but in any case I think you should just go with whatever makes the most sense to you.
Pages: [1] 2 3 ... 38
 
cybrmynd (32 views)
2017-08-02 12:28:51

cybrmynd (46 views)
2017-08-02 12:19:43

cybrmynd (57 views)
2017-08-02 12:18:09

Sralse (67 views)
2017-07-25 17:13:48

Archive (496 views)
2017-04-27 17:45:51

buddyBro (644 views)
2017-04-05 03:38:00

CopyableCougar4 (1128 views)
2017-03-24 15:39:42

theagentd (1133 views)
2017-03-24 15:32:08

Rule (1108 views)
2017-03-19 12:43:22

Rule (1086 views)
2017-03-19 12:42:17
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

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!