Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (686)
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  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-11-21 04:16:01
I spent a few hours trying to figure out why Gradle in Eclipse was being odd and utterly destroying my projects by making them unable to do anything Gradle-related. Turns out the Buildship plugin tends to clash with an already existing (and better) plugin by overwriting properties and the .project file to suit its own liking, so all I need to do is uninstall it, right?

Uninstall doesn't work in the Install New Software window, and for some odd reason there was no plugins nor features folder in my eclipse installation.

Three reinstalls later: I find out that the installer uses pools to avoid downloading the same program over and over again, essentially copying my problem. Turned that off, my folders are back. I delete Buildship, all is well now except for the fact that running the Refresh All on gradle causes the project to fail to compile [the script]. Some more googling later turns up that the old syntax for Gradle 2.4 for multiple source directories doesn't work, and 2.9 requires a new syntax. Fixed that, everything is finally fine.

That took way too long.
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-11-15 03:52:39
This is the third project in a row to lose inspiration in. I keep doing this because I have no real goal to achieve. I wish I could find a better project to have fun on.

All I got done was some backend collision and rendering. I also decided to (finally) animate a robot I used as my main player sprite ever since I started with LibGDX just over a year ago.

3  Discussions / Miscellaneous Topics / Re: Bought the Humble Bundle so I could play Insurgency; here's the rest of it. on: 2015-11-01 23:43:25
Could I have a copy of RFLEX as well?
4  Game Development / Newbie & Debugging Questions / Re: Yet another stuttering problem on: 2015-10-26 15:07:31
This problem is fairly common, especially in multiplayer games where the tickrate is much slower than the framerate (take Team Fortress 2, for instance where the default tickrate is 20, and the normal framerate 30-60).

The solution to this is interpolating your visual position between frames. When you update your positions, you can update the actual ones, but interpolate a "visual" position which only exists for where the sprite should be drawn.

If your tickrate is 20 ticks per second, and you're assuming the framerate will be at around 60, you'll have to interpolate between the old and the new position in thirds (because there are 3 frames until the next update is executed).
5  Game Development / Newbie & Debugging Questions / Re: Terrain Saving and Loading on: 2015-10-19 00:43:43
A chunk-based system works well for on-the-fly saving-and-loading from a file (Minecraft does it). You're dividing the world into X by X sections of tiles.

You also mentioned that you're saving your tiles in an ArrayList. You could use a 2-dimensional array instead.

Tile[][] tiles = new Tile[world_width][world_height];
6  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Manual Libgdx Project Creation on: 2015-10-15 23:26:38
The build tool lets you only select the desktop project if you need just it. It would be much more difficult to set up a project manually.

You only need the three Gradle projects: the encapsulating one that does dependencies, the core project, and the desktop project). Yes, it's not one but if you decide to get deeper into Gradle the setup is very handy.
7  Discussions / General Discussions / Re: On-site IRC error on: 2015-10-12 17:16:44
A few people noticed it but it was not publicly mentioned yet AFAIK (since, you know, IRC public log is down).
Also, is it normal that the main page's content block is stuck to the left?

I think the content used to span most of the width of the page (or maybe I'm wrong).
8  Discussions / General Discussions / On-site IRC error on: 2015-10-12 16:33:23
I've no idea if this was mentioned already and I'm just blind, but here we go.

The IRC chat thingy on the front page of the site has an error.

No featured games/shameless plugs are appearing on the right-hand side, but if they were never there to begin with, my bad.

I should also mention that if a new post is posted, the update top thingy doesn't appear only on the front page, but appears on the others.
9  Game Development / Networking & Multiplayer / Re: Kryonet - how to recognize a packet type? on: 2015-10-11 16:43:26
I would highly recommend just having a common method that accepts the Kryo instance as a parameter, and in that method registering all your classes. Then from your server, call that method, client as well.
10  Game Development / Networking & Multiplayer / Re: Kryonet - how to recognize a packet type? on: 2015-10-11 16:24:01
The only reason I could think that the server would be reading a packet incorrectly would be because you didn't register your classes on both ends in the same order. Kryonet uses indices to indicate which class is what and how to deserialize it, so registering packets in the wrong order would result in the wrong index being serialized from client to server..
11  Game Development / Networking & Multiplayer / Re: Kryonet - only one instance of a Client in the whole app on: 2015-10-11 00:06:37
if(null == client){
Client client = new Client();

That will set a local variable client and start it, not the one you're checking that's null. Just drop the Client type declaration.

if(client == null){
   client = new Client();
12  Games Center / WIP games, tools & toy projects / Re: (Another) Terraria-Clone on: 2015-09-28 23:47:38
My recursive method was actually quite efficient like you said (it acted just like yours, spreading out from a source), but as the number of light sources grew, the amount of method calls grew a lot as well. Method calls are much slower than iterating.

Recursion is great when the language has tail-recursion optimization. However, Java does not.

Regardless of our lighting methods, both recursion and raycasting work quickly. I also mainly chose raycasting after recursion because I disliked my diamond-shaped lights that recursion had, not because recursion was slow.
13  Games Center / WIP games, tools & toy projects / Re: (Another) Terraria-Clone on: 2015-09-28 22:57:39

Haha I guess that depends on your definition of huge. My world currently has 1,620,000 tiles in it which I would personally say is pretty huge. Why would work size depend on whether to use the raycasting method or not?

I think I must've made an error. World size doesn't matter, but it's how many tiles on-screen at once that matters for updating. My raycasting technique is more-so a Bresenham line algorithm except counting down a light value for brightness. It works a lot faster (and prettier) than the recursive way because it's not constantly calling functions. My bad! Tongue
14  Games Center / WIP games, tools & toy projects / Re: (Another) Terraria-Clone on: 2015-09-28 21:14:32
My philosophy right now is to ignore the cosmetics of the game and focus strictly on the fundamentals and background services of it. I'll worry about the cosmetics when the game is fundamentally sound.

Yup, sounds just like the opposite of how I normally do things Roll Eyes

Recursion can either be pretty efficient or not so much depending on your method of execution. If you're doing repeated method calls for recursion, it works but it's not the fastest. A faster way would be to iterate through a queue, but seeing as your game doesn't have as huge of a world as I did it's not a big deal right now.
15  Games Center / WIP games, tools & toy projects / Re: (Another) Terraria-Clone on: 2015-09-28 20:38:38
Just finished the algorithm that removes the lighting generated by a light source. The important thing with my lighting system is that, unlike most other light systems, my system doesn't have light sources generate a dynamic light value each frame. We can assume that light sources only change when they are modified (broken, placed, or moved) so there is no need for a light source to generate light values every frame. My system generates a dynamic light value once after the light source is placed. It removes the generated light once the light source is removed (broken). It cuts down on resource-usage and makes the game run a lot faster. It also works very well with multiple lights placed next to eachother. Here are images of the lighting system in action, starting from one light source, adding more, breaking some surround blocks, and then removing them. Let me know what you guys think!


We can't see your images. You'll have to paste the actual image link (which actually is hosted on imgur).

Good on you for optimizing the lighting engine! I don't think Terraria dynamically updates per frame, most engines actually update when needed rather than per frame.

Have you considered putting colours for lights? The colours can mix together with different light sources. Here's a screenshot of my game way back when I was using recursive flood-filling (it uses raycasting which is faster).

It looks smooth but it's just gradients to interpolate between tiles. Try it!
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-09-28 03:01:20
It was my birthday today. I turned one year older than I used to be.

Hey hey, it's my birthday too! Grin

Edit: oh you're in a further ahead timezone so we don't actually share the same date Sad
17  Game Development / Newbie & Debugging Questions / Re: My Game keeps crashing on: 2015-09-24 22:41:49
When an event is triggered (like in your key input methods, for example) it's dispatched on a different thread than the one with your handler class. That means if you're adding/removing objects in the event methods on the event dispatch thread, the contents may differ from the one on the logic thread, for example. You need to stick to one thread, preferably the logic thread.

As for your pastebin issue, just put it on the pastebin and put the pastebin link here so we can view it.
18  Game Development / Newbie & Debugging Questions / Re: My Game keeps crashing on: 2015-09-24 22:22:42
First: we can't see your code. All I can see is a one-line empty code box.

Second: giving you a step-by-step explanation isn't our duty. We're here to help you solve issues and to help you learn. Holding your hand all the way through doesn't make you a better programmer, learning the why of what something does this is what does.

As BurntPizza and I stated, you're modifying the array concurrently. You need to find where you're doing that in the event handlers (they're on a separate thread) and move it to your main/work thread.
19  Game Development / Newbie & Debugging Questions / Re: My Game keeps crashing on: 2015-09-23 22:56:21
As DarkCart said, 1400+ lines of code is excessive. There's even an message that says

at the bottom of the text box.

I would shove it all into a pastebin now. It's fairly repulsive to just see a wall of text at the start of the message, and it might turn some people away if they were going to help you.

The stack trace shows at line 25 in your Handler class, you're attempting to get an index that doesn't exist/is too large. Is it possible something may be changing the list concurrently?
20  Game Development / Newbie & Debugging Questions / Re: LibGDX Saving Chunks To Files? on: 2015-09-23 18:44:29
You should write down what steps are required. Think about each step along the way. Doing things like this is part of problem solving as a programmer. Think about writing the chunks to a file, then reading it back. Once you can do that, you can write/read on the fly depending on your situation.
21  Game Development / Newbie & Debugging Questions / Re: LibGDX Saving Chunks To Files? on: 2015-09-23 14:35:19
So what is your question? Are you having difficulty doing the actual file IO or serialization, etc.?
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-09-22 23:19:48
I talked for an hour with my programming teacher with my best friend after school. He's a really great guy!

He has over 12 years of Java experience, then we argued over strong- (Java) vs. weak- (Swift) typing.

We won.
23  Game Development / Newbie & Debugging Questions / Re: libGDX get pixels out off TextureRegion on: 2015-09-20 19:06:07
A TextureRegion is merely just a region of a texture. It doesn't make a new texture, it just has numbers telling what part of the texture it occupies. You can use the TextureRegion's bounds to get the desired pixel on the original Texture object.

Say your region is using pixels from 8, 8 to 16, 16. If you want to get the pixel at 1, 1 in your region, you would start at where the texture region starts ( 8, 8 ) and add your desired coordinates that are in your region (1, 1). That ends up to the pixel at 9, 9 on your texture.
24  Game Development / Newbie & Debugging Questions / Re: What are Scripting languages used for in games? on: 2015-09-14 03:31:06
Scripting languages can be used for a variety of things. For example, let's say you're making an RPG and need this character in a certain cutscene to move around this house, stop, and talk to you. Instead of hardcoding it in, you can run a script file that does the same thing. What I use them for is for the content part of the game, ie: this one part of the story but not the internal code that renders text.

A good scripting language to learn is Lua. A simple wrapper found with a quick google search brings up LuaJ.
25  Game Development / Newbie & Debugging Questions / Re: Best way to manage entities in a client-server model on: 2015-09-12 04:32:30
In my multiplayer sandbox game, I send entire entities only when creating. Each entity has a UUID (normally supposed to be 128 bits but I used 64 because it's just a long and easier to work with). When removing it'll send the UUID of the to-be-removed entity (if the entity with the UUID doesn't exist for some reason the client will ignore the packet). Updating entities' positions is merely an array of UUIDs and another array of floats that correspond for each entity's position.

If you are using Kryonet, the below will be a breeze because Kryonet can serialize and deserialize object graphs over the network extremely efficiently. If not, I suggest you do try it and see how you like it.

As for render data, that's client-side only. I can mark fields as not-needed to be sent over the network by using the transient keyword. Of course, in order for Kryonet to create objects they will need an empty constructor where it can be instantiated and then the rest of the information can be filled in.

You won't need to assign IDs for each entity. IDs for that are really a pain because if you remove a type then you have an annoying gap in your sequence of numbers. With Kryonet you can merely register the entity's class and it'll tell the serializers how to work with that type of object.

Kryonet was designed to be really fast and efficient, so it's perfect for games. The only time you're sending an entire entity's worth of data is when it's being created. Anything else merely uses the UUID to look up the entity.

I hope that helps!
26  Games Center / WIP games, tools & toy projects / Re: TritonForge || 2D RPG Sandbox (DOWNLOAD V1.1 NOW) on: 2015-09-11 22:25:07
Are you still looking for anyone to help with programming? I don't have a project to work on right now after I halted Project MP. Your game seems quite similar to what Project MP was supposed to be and I (probably) wouldn't mind working on something new yet familiar.
27  Game Development / Newbie & Debugging Questions / Re: [Kryonet] Problems with sending ArrayList over network on: 2015-09-09 03:22:02
Glad to hear! I was just about to go look up the pluggable serialization for you but I'm happy to hear it's resolved.

It's a bit annoying to have the empty constructor especially for entities (sometimes I'll accidentally use it instead of the actual "real" constructor) but I suppose it's much easier than writing a serializer for each entity type.
28  Game Development / Newbie & Debugging Questions / Re: [Kryonet] Problems with sending ArrayList over network on: 2015-09-09 03:06:21
I've noticed you don't have an empty constructor in your Bullet class. When using the default serializer, Kryo requires an empty constructor so it can instantiate the class after deserialization.

Try using the default serializer (proceed as normal) but put an empty constructor in the Bullet class.

It's also possible you're not getting any errors shown because your Kryonet logger level isn't detailed enough.
29  Game Development / Newbie & Debugging Questions / Re: [Kryonet] Problems with sending ArrayList over network on: 2015-09-08 03:41:25
Can we have a look at your registration code (registering classes on the server and client for serialization)? Perhaps you may be missing a class that is vital for sending the entire ArrayList over.
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-09-04 16:01:34
Working on an art style for my asteroids, came up with a couple of different iterations.

Going from most recent to first.

I still think it's too round. It looks like a moon.
Pages: [1] 2 3 ... 9
Dwinin (70 views)
2015-11-07 13:29:08

Rems19 (78 views)
2015-10-31 01:36:56

Rems19 (71 views)
2015-10-31 01:32:37

williamwoles (105 views)
2015-10-23 10:42:59

williamwoles (92 views)
2015-10-23 10:42:45

Jervac_ (106 views)
2015-10-18 23:29:12

DarkCart (134 views)
2015-10-16 00:58:11

KaiHH (116 views)
2015-10-11 14:10:14

KaiHH (155 views)
2015-10-11 13:26:18

BurntPizza (168 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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!