Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (723)
Games in Android Showcase (216)
games submitted by our members
Games in WIP (790)
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 ... 9
1  Game Development / Networking & Multiplayer / Re: hosting java socket based server on: 2013-11-20 06:20:00
Well, yes you should do it this way, but it would cost you a decent amount of money for a dedicated server. Honestly, unless your game goes big, just host your own server and port forward it. Paying for a server is a bit of a waste if you only have a few people playing!

I tried this, this isn't a great idea. Just because it requires you to have your home computer on all the time, always connected to the network. Also you'd be violating (for most people I'd think) your ISP's ToS. You'll want some server space for an HTTP server as well eventually so you mid as well rent a server.

I've set myself up with DigitalOceans - while I haven't actually done anything with it yet (I've put JevaEngine on a hold till sometime in the next two weeks just because I am training for work etc...) it seems pretty decent.

The costs for the basic plan are cheaper than most monthly subscriptions.

If you host your server with your home computer you'll need to really double check the security since it's your personal life at stake rather than just whatever you have floating on a cloud.
2  Game Development / Newbie & Debugging Questions / Re: Debugging, i'm doing it wrong? on: 2013-11-20 06:10:42
If an exception is thrown just look at the call-stack.

If you get unexpected results, you should know the method that causes those results to be formed (at some level in the call hierarchy). Put a break-point there and step through them line by line. Whenever you're about to enter a method, check that it performs its task correctly by examining the arguments and the return value (you don't need to step into it.)

The best system is to individually push all your changes that are testable (when your project gets large) to a repository. Then you can easily apply a diff on the code to see where you went wrong. I don't follow this advice often and just push large chunks of tested changes at a time just because I am lazy but it could save you a lot of head-aches in the future. If I were working for an employer it is definitely something I would try to do.
3  Game Development / Networking & Multiplayer / Re: Looking for cheap server space on: 2013-11-09 06:15:26
Digital Ocean or Linode would be good options for virtual servers. I've used Linode in the past and love them. Their support is top notch, plus they have a plethora of resources on the site that can help you with maintenance. DO is rather new and has some cheaper plans. I've heard good things about them, though.

Digital Ocean's $5/month or $10/month plans seems like a perfectly sufficient model for right now. That would be more than enough and it's incredibly cheap.

I can definitely have a servlet and my game server running on there. I might be able to get MongoDB on there as well, I'll have to ask the dev. team for some tips running it on a smaller server.

Linode looks a little excessive in terms of power (at least for now).

I did some rough calculations and I believe 1TB traffic limit would give me tons of slack.

Thanks for the suggestions.
4  Game Development / Networking & Multiplayer / Looking for cheap server space on: 2013-11-09 03:48:48

Some of you might know I am working on an isometric game engine (currently hosted on github ( [I'm currently in the middle of code refactor that changes some of the api so I advice against doing anything with it right now]).) I am looking for a server to host ~20 users and preferably quite cheap on hosting. You can get a listing of the basic networking benchmarks I've performed here:

That is essentially the average load per user on a server with ~150 complex server-side entities (like NPC Characters etc) The overhead of these characters being user controlled is very small, its just that for every client, the more data has to be sent out. Very little data is actually received relative to the amount sent on the server-side.

I will also be hosting a back-end MongoDB (not required, but it would definitely be a plus to get it in there.) I know MongoDB is optimized to consume many system resources so I'm not sure if that would cause complications. Obviously if I could get an HTTP servlet in there that would be great, but again, not required.

The server would be deployed as an executable JAR. The idea is to periodically push the latest server component of the game to the server. Any suggestions?

5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Is there a small geometry library for java out there? on: 2013-11-03 22:47:55
I said 'small' and 'simple' 'geometry library,' not a physics library!

I haven't used it personally, but it is quite robust, mature and it works in pure Java which is also a plus.
6  Games Center / WIP games, tools & toy projects / Re: Renoria - Java MMORPG on: 2013-10-24 23:30:23
Java2D is kind of a "fall-back" for systems that fail to load LWJGL Tongue

Java2D first tries to use DirectX, then OpenGL, and then if all fails it doesn't hardware accelerate. Unless you are doing something really fancy with shaders (and java2D should be fine for the kind of game you're making) what you've done seems like a pretty pointless abstraction layer. If you have performance issues with Java2D you should trying playing around with the VM switches for java2d.

Anyway, nsigma and I argued about this for a while and it turns out I was referencing some pretty old material that was inaccurate for the time. Java2D does accelerate BufferedImages. A couple years ago, what you're doing might've improved performance but it doesn't any more.

I bench-marked my particle engine without (and with) creating compatible images and the difference in performance was (as far as I can see) zero.

*edit* Sorry, I've just hijacked the thread :X
7  Discussions / General Discussions / Re: Sync project via FTP on: 2013-10-24 10:16:12
An alternative to git is mercurial. It is designed to be simpler and easier to use than git, most probably while sacrificing some of the flexibility and functionality that git offers.
I, personally, don't like git, but I was using mercurial daily. Now that I had to switch back to SVN,  I miss it.

Yeah, mercurial is great too. I would suggest that Yemto just pick up any version control and familiarize himself with it, it is definitely a powerful tool.
8  Discussions / General Discussions / Re: Sync project via FTP on: 2013-10-24 08:32:09
Looks like I going to stick with messing around with USB, since git is the worst thing I have ever tried. It's no information about it that's up to date.

EDIT: and not it have messed up my computer, I can't open any files or folders...

Git is a very powerful version control system that was designed to do what you want to do right now. It is very well documented but there is a bit of a learning curve. I would check a book out on git in the library.

You will without a doubt encounter git (or some other version control system) sometime in your programming career, and it is a huge plus on your resume if you know how to use it. I highly advice you take the time to learn it now.
9  Game Development / Newbie & Debugging Questions / Re: Load Images with alpha on: 2013-10-24 01:42:13
I imagine that not having an alpha channel can reduce the size of the texture on disk and in your memory cache (if you cache textures) and I can see that having some significance for very large games or games being run on limited hardware.

You can do the transparency (with for example, a colour Magenta) at the shader level with virtually zero performance hit. Preprocessing them and giving them an alpha channel defeats the purpose.

I wouldn't worry about it and would just use your png with an alpha channel.
10  Discussions / General Discussions / Re: Sync project via FTP on: 2013-10-23 23:01:48
I find if you are using Eclipse Keplar and your workspace is placed inside of a directory with a .git directory, Eclipse will detect that and allow you commit to the repository through it. I find that you also have to commit the project files as well (github will filter them out by default) maybe this was a faulty observation though.

Maybe I have a plugin installed, but if I do I don't recall installing it.

Also, yeah, you definitely want to use git. If you can't find an appropriate host, you can setup a git server on your home pc.

It'll be somewhere under the 'team' submenu.
11  Game Development / Newbie & Debugging Questions / Re: Using ArrayList<> adding and removing objects on: 2013-10-22 20:05:49
Yeah but its the library im most comfortable with, also gives me a market.

Here would this "list" help me at all?

 I think it might, if i can create a way to clone it then i could possibly clone the arraylist to another arraylist, remove the object from the temporary arraylist and then at the end set the permanent one the same as the tmp one?

Yeah, cloning should work fine. Just make sure you only do a shallow clone. The only problem with this approach (and if it isn't a problem for you - and it probably isn't) is that you end up creating a lot of shallow clones. Just be clever about when you clone and it shouldn't be a problem.
12  Game Development / Newbie & Debugging Questions / Re: Using ArrayList<> adding and removing objects on: 2013-10-22 19:59:54
Yeah, they've left out some classes that make things easier. I'll use the unsortedreadablelist. Does sorting matter? and I'll also check the enumeration for the for each, can i not simply use a basic for loop for this?

Scratch my solution. You need a sorted list to store the mutations (they need to be applied in the proper order.)

Sorry for wasting your time.

That BB JDE seems terribad. Last I checked, BlackBerry (canadian company) was doing terribly and is thinking of selling to an Chinese organization.

The simplest solution for this (psuedo code)

ArrayList garbage;

for(item i : myList)


But it isn't very memory efficient. You could reuse your garbage arraylist which would help a lot. Ofcourse, you might run into the problem I've stated above (in my first post in this thread)
13  Game Development / Newbie & Debugging Questions / Re: Using ArrayList<> adding and removing objects on: 2013-10-22 19:52:13
Jeremy in your you use ArrayList and Iterator. Neither of these are available to me whereas the NoSuchElement is.
Could I possibly use my own ArrayList as a substitute for the ArrayList<>. However the iterator part i@m not too sure on.

Replace ArrayList with UnsortedReadableList (of course, now they won't be sorted.)

How are for-each loops implemented without iterators D: ? Man that is really awkward... Maybe try Enumeration:
14  Game Development / Newbie & Debugging Questions / Re: Using ArrayList<> adding and removing objects on: 2013-10-22 19:29:50
I've created my own ArrayList class. With the JDK I'm now allowed to use type so it's specific for my PlayerRocket:
package {...}data;

import {...}PlayerRocket;

And if i removed whilst iterating, i get an ArrayOutOdBoundsException.

Also I cannot use the LinkedList. It isnt available to me

Have you looked at my solution? It isn't perfect, but I think it'll work fine or at least inspire some ideas for you:

I get where you're going with your solution but I don't think it's a very good general solution.
15  Game Development / Newbie & Debugging Questions / Re: Using ArrayList<> adding and removing objects on: 2013-10-22 19:17:05
I wrote a really hacky solution for this, the reason is because when you get more complex iterations you cannot use an iterator and predict which elements to remove via it.

Like for example, the UI  subsystem receives a mouse-press, the UI subsystem iterates through it's list of buttons and execute the appropriate button's handler. In the button's handler you remove the button from the UI subsytem, thus throwing a concurrent modification exception.

You can create a shallow clone your set as you iterate (not very memory efficient), or you can use CopyOnWriteArrayList . I wrote a solution for this (I am not very familiar with the JDK so it may be a redundant implementation) but you can see it here. It essentially stores all mutations to the list and only applies them when data is required to be retrieved about the arraylist. I.e, inserting an element or removing an element doesn't do anything immediately to the list. Creating an iterator into the list applies the mutations, getting an element from the list applies the mutations, getting the size of the list applies the mutations etc.
16  Discussions / Miscellaneous Topics / Re: Java in GTA5 on: 2013-10-22 05:25:47
I think there is some really clever joke we're all missing in the code. Not sure what it is and I'm too lazy to try and work it out. It might've been some artist's terrible attempt at making a programming joke.

Maybe some developer didn't get their meal or something.

Then again, it might just be there for the fun of it.
17  Discussions / Miscellaneous Topics / Re: How to cheapen the Java brand! on: 2013-10-21 15:03:43
Man... I know.

I cringed when I installed the java runtime (after a long break) and saw that...
18  Game Development / Game Play & Game Design / Re: 2D vs 3D World Immersion on: 2013-10-21 14:52:43
Have you considered using an isometric perspective? It's a nice compromise between 2d and 3d since it allows for depth and immersion, but doesn't require an unreasonable amount of artwork and engine work.


One of the main reasons I target isometric is because it looks great and it doesn't take an insane amount of work to make it look great.

Full 3D games take _A LOT_ of work to make look even decent.
19  Game Development / Newbie & Debugging Questions / Re: How should i Use Logger, Or Save Error Game Files with Libgdx? on: 2013-10-21 01:49:02
Use a proper logging framework. You can plug in different SPIs\bindings into the framework that will handle the logs differently.

JevaEngine uses this one:

Logs are obviously important, even if you just spit them back to the user. I have had users who experience problems with my applications provide me a log that I would've been left guessing without.

When you want to distribute your software, you can easily No-Operation your logs if you use slf4j with little performance impact by plugging in the No-Operation binding without making any mutations to the code, and just plugging in a different binding.

Will i have any problems if i just use a .txt File to record bad things?
I plan to run in HTML,desktop and Android

Nope, but keep in mind:

- Logging frameworks (like slf4j) batch I/O operations to logging repositories (i.e, a text file) rather than write per function call. This prevents them from consuming a lot of CPU time when you're in the middle of a time-sensitive task (like rendering\updating)
- If you use slf4j, you can very easily change your binding, so if you want to (for example) print the logs to a console, save them to a file, dispatch them to a server or ignore them, you can do that without altering any of your existing code (and just swapping bindings).
20  Game Development / Newbie & Debugging Questions / Re: How should i Use Logger, Or Save Error Game Files with Libgdx? on: 2013-10-20 09:58:00
Use a proper logging framework. You can plug in different SPIs\bindings into the framework that will handle the logs differently.

JevaEngine uses this one:

Logs are obviously important, even if you just spit them back to the user. I have had users who experience problems with my applications provide me a log that I would've been left guessing without.

When you want to distribute your software, you can easily No-Operation your logs if you use slf4j with little performance impact by plugging in the No-Operation binding without making any mutations to the code, and just plugging in a different binding.
21  Game Development / Newbie & Debugging Questions / Re: How many tiles should cause lag? [libGDX] on: 2013-10-19 22:29:36
This is an absolutely terrible way to optimize anything.

All the CPU time will be spent on the draw calls themselves (since they can be relatively expensive sometimes) You should make sure all you operations are hardware accelerated in Java2D if you are experiencing performance issues.

X draw calls at Y FPS is an absolute crap benchmark. So is drawing any conclusion like "all your draw code is bad." Use a profiler, it is probably less than 5% of the code that is inducing that bottle-neck. Find it and it is probably an easy fix.
22  Games Center / 4K Game Competition - 2013 / Re: random seed sequences as a form of data compression on: 2013-10-19 02:16:15
I really don't think it is a great method to take a set of data and then look for a seed that will generate that data.

A better idea is to look for seeds that will generate the appropriate data. For example, say you have a map generation algorithm. You can plugin various seeds for that map generation (along with maybe other parameters like 'snowy', 'cold' etc...) and it will generate a map. Look for seeds that will produce a desirable map, then save your 'map' as a seed.

Then add features (such as quests etc) to that map that will be generated with that seed.

TLDR: Going from seed to desirable data I think is practical. But trying to find a seed for a set of predefined data is almost impossible (practically speaking.)

Depending on how intelligent the generation algorithm is, it may be practical to search for desirable sets of data generated with seeds, rather than going in the reverse direction.
23  Game Development / Newbie & Debugging Questions / Re: Custom resource caching? on: 2013-10-18 02:58:32
Yes, .jar files.
What are You trying to do? Image atlas ?  Or something else ?
I mainly don't want my resources 'bluntly' out in the open Cheesy
Now I know I can't fully stop people from grabbing/editing the resources but I'd like to remove the 'bluntly' part and possibly store everything in "Cache files" ^_^ (.dat etc)

You can use the built-in zip file api in the standard java api and rename the .zip file to .dat Smiley
Never thought of that Tongue
Wouldn't they just need to rename the .dat to .zip though? XD

I'll fiddle around with some ideas tonight in my IDE ^_^

How would I 'casually' go about storing a .png in a .dat file (Encoded, see below)
Beautiful charset output: 3cÿrBR·ÒçÓW~ò$ãÔ€ä5Al½ô

Feedback's still welcome guys =D

I really advice against doing this because it is much more trouble than it is worth, but you can do something _really_ simple, like this:

1. Compress your resources (loosely) into a ZIP archive
2. Apply a simple encryption algorithm (really simple, since the purpose here isn't to 'keep them out' so much as it is to making it not so blunt to acquire access to the resources. Also, the encryption algorithm is entirely local so there isn't much in the way of someone tearing apart your usage of the Java encryption API and grabbing the key if they really wanted it anyway...) So (in this example) XOR encryption.
3. Decorate a FileInputStream (to the Zip Archive containing your resources) with an XorDecryptionInputStream (basically just applies an XOR to every byte you read from the stream to decrypt it. A simple one byte key is entirely sufficient for these purposes) and pass that to the ZipInputStream
5. Use the ZipInputStream as you would.

XOR encryption isn't that great, and there are flaws (you have to avoid NULL bytes etc) but assuming you just want to make the archive unreadable\unrepairable, it should work fine for your purposes.

Also, with XOR Encryption

Original XOR Key  = Encrypted


Original XOR Encrypted = Key.

So if they know what the data is supposed to be, your key is exposed. And they can figure out some signature in a Zip Archives Filesystem.

But all that is besides the fact, since security isn't an issue here.
24  Discussions / General Discussions / Re: Running Jar with Unknown Publisher Blocked in Future Java Release on: 2013-10-17 22:06:40
The reason we need things like file access and JNI in the first place is for game development- game saves, hardware acceleration, openGL, etc. I get that these can be exploited, but so can any "real" programming language. It's just frustrating that legitimate users (especially novices who will help carry the language on) are the ones being inconvenienced.

A lot of people can get away without using JNI and if you're working with an applet, you do not need native filesystem IO. The users game should be saved on a server etc... Flash captured what Java Applets should have been perfectly (minus the terrible framework, actionscript, the expensive SDK, etc...)

If you used Java as it was intended to be used (when you can, I know that sometimes you absolutely have to use native dependencies) There is no reason [technically] that we can't sandbox our apps in an environment that is safe.

I see a lot of people using native dependencies where they most certainty do not need them. You can get away with making some great games without OpenGL, and with (at least for most games I see here) it is entirely possible. You can get hardware acceleration out of Java2D if you use it properly.

Applets aren't meant to be "Run Everything on the internet in a sandboxed environment" it is more "These sets of applications can endure this set of restrictions and still function properly, so they can be trusted to run in the browser)

The problem with Java right now is that:
1 ) The warning message that is displayed when an application is using native dependencies looks exactly the same as the message that appears when none at all are being used. Most users are too ignorant to discriminate, and thus label all applets as unsafe as the worst possible case.
2 ) Even sandboxed applets have an incredibly long history of breaking out of the sandbox, making us question if it will ever be safe.
25  Game Development / Performance Tuning / Re: Concurency in 3d engine. on: 2013-10-17 22:01:38
I'm not sure if this is what you're looking for, but it stumbled across this article a couple months ago, it doesn't seem too difficult to implement:
26  Game Development / Shared Code / Re: JevaEngine Open Sourced on GitHub on: 2013-10-17 20:30:40
What is it, a game or a general purpose game engine ?

It is an isometric game engine. There is a ORPG game and server built over it. The game is in ClientRpgGame, the server is ServerRpgGame, they use the JevaCore and JevaRpg (the engine & Rpg Extension to the engine) common libraries.

It is a general purpose isometric game engine, plus a ORPG game built over it that is also in the repository. Each module is separated into its own project.
27  Game Development / Shared Code / JevaEngine Open Sourced on GitHub on: 2013-10-17 05:19:46
I've been trying for some time to condition JevaEngine for open-sourced, I haven't completely gotten around to adding the JavaDoc etc, but I'd figure it's about time I got it onto a repository.

You can take a look at it here:

A lot of the code is not documented (sorry, I intend on getting around to it...) Here is a list of where you want to go if you're interested in what:

JevaCommunications : JevaEngine's Networking library
JevaCore : The Core\Infrastructure to the engine. Most of the interesting code is under the 'world' package.
JevaRpg : Rpg Extention to the core. Implements a lot of the RPG Elements to the engine.
JevaRpgClient : An example RPG Game's client-side code.
JevaRpgServer : An example RPG Game's server-side code.

A lot of the code has not thoroughly been reviewed so if you see me doing anything stupid anywhere, just bring it to my attention\submit an issue.
28  Discussions / General Discussions / Re: Running Jar with Unknown Publisher Blocked in Future Java Release on: 2013-10-17 03:42:58
Applet signing was entirely pointless in the first place.

It would be nice if Java provided us with some default access to most of the JRE without scaring users away from Java - leaving out the bits that could cause harm to the executing PC like JNI and Filesystem IO etc...

I have a feeling though it'd only be a matter of days hours before someone broke out of the sandbox again though...
29  Game Development / Newbie & Debugging Questions / Re: Packaging files inside jars on: 2013-10-13 10:45:58
Whatever you do with your graphics resources you should be able to do with your plain-text resources.
30  Game Development / Newbie & Debugging Questions / Re: Packaging files inside jars on: 2013-10-13 08:32:02
You can acquire a stream to any resource in the JAR, it doesn't matter what kind of data is contained in that resource. You will need to decorate\adapt the stream appropriately though if you're going to read text from it.
Pages: [1] 2 3 ... 9
buddyBro (182 views)
2017-04-05 03:38:00

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

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

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

Rule (632 views)
2017-03-19 12:42:17

Rule (637 views)
2017-03-19 12:36:21

theagentd (647 views)
2017-03-16 05:07:07

theagentd (582 views)
2017-03-15 22:37:06

theagentd (422 views)
2017-03-15 22:32:18

theagentd (351 views)
2017-03-15 22:31:11
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 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!