Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
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  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.
2  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
3  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.
4  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!
5  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
6  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.
7  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.
8  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?
9  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.
10  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.?
11  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.
12  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.
13  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.
14  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!
15  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.
16  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.
17  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.
18  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.
19  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-09-07 23:24:47
Dad and I went to downtown using the SkyTrain (we live nowhere near it so we had to drive around half an hour to a station) to buy him the new Compass card. It's basically a tap-and-go system that they're finally getting around to implementing (we've been using the honesty system since 1986). Turns out, there is no machine that dispenses it like my friend told me (rolling out in November) and the office is closed.

At least I got to try my own card. Grin The faregates don't suffer from "Japan syndrome" as I like to call it where if you enter you cannot exit through the same station where I first experienced in Japan.
20  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.
21  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-09-02 19:10:00
We had a power outage in the middle of winter. It was -10 degrees outside and the indoor temperature dropped fast. Had no charged phone, no charged laptop. Entire family cuddled up in the sofa around some candles and listened to radio news on a massive radio that was older than me. I had so many "Oh, wait" moments trying to decide what to do... No hot food (induction stove), no computers, no phone, no light for reading. Did I mention it was cold as balls?Jesus, the horror.

Ouch, now I'm glad it was still somewhat warm here when the outage occurred. Luckily we had a butane gas stove to use so we could heat up some water and food. Other than that it was okay, worst part was the power company scheduled the estimated time of restoration at noon yesterday, then ten minutes to noon they changed it to 6pm. When 6pm rolled around it was changed to 10pm. Finally got it back at 3am. It was still windy and rainy in other parts of the mainland so it's understandable that it took awhile. The neighbours behind us had power for the first day, then they lost it on the next day. Is it bad that I was slightly happy, in that evil-genius twiddle-your-fingers hehehe way? Tongue
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-09-02 16:43:05
Left without power for 66 hours after a windstorm battered the BC Lower Mainland. Power got restored around 7 hours ago. You really take electricity for granted when you're so used to it all the time.

At least I'm back now and can work on things.
23  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-29 18:24:22
Finally decided to separate the big chunk of code that's always in my games for screens, registries, transitions, utilities, and the like into its own mini-engine/library. I can just access it using git submodules in my actual games. Hopefully this'll make it much easier to make a bunch of little games instead of tediously copying alllll the old files and refactoring it to death.
24  Game Development / Networking & Multiplayer / Re: Handling monsters on serverside on: 2015-08-29 16:46:39
Kryonet is not a game engine with its own update methods for you to run your logic. It is merely a networking library for general purposes.

As Drenius said, KN has its own internal update thread that can be started with start() where it continually updates itself, checking for incoming packets and processing them with the received method. It doesn't do any game related things, only networking.

For your server logic instance, you'll have to set up some loop that gets updated X times per second where it updates all your logic. After you compute the new positions, create/re-use a packet instance with the correct information and send it via the Kryonet Server instance using sendToAllTCP/UDP().
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-03 03:59:27
This is one of many apple cider vinegar traps I laid out.[/img]

Out of sheer curiosity, is it just apple cider vinegar inside that cup? Do they drown in vinegar or is there something else?
26  Game Development / Newbie & Debugging Questions / Re: World architecture and internal construction? on: 2015-08-03 03:03:10
Your WorldMap would have a list of Regions. Each Region has a list of Rooms and Connections between rooms. This is your current design, and it should work pretty well for what you want.

Think of each Region as a universe. The WorldMap has a lot of universes. The universes don't interact with each other, but they're all in an area where they're contained.

The Regions are universes. Each one has Rooms and Connections. Think of Rooms as galaxies and Connections as a wormhole found in the centre of each galaxy. Each wormhole can only go to one galaxy, but they you can potentially have multiple wormholes to multiple galaxies.

I don't know if that space analogy helped. I hope it did Grin

EDIT: more detail below

Rooms could be generic. They get rendering data from its region (so a brick wall theme for castles, etc.). Connections would do the same. You could also make rooms unique and have subclasses of Room for each rendering type that implement an abstract rendering method for different designs. You can also customize each room (different traps, loot) and make it more immersive that way.

27  Games Center / Showcase / Re: Block-Warefare (new original concept showcase) on: 2015-08-02 05:00:43
The concept is good. However I came across a few bugs:

Clicking and dragging the squares seems really awkward. What I mean is most of the time it doesn't actually get grabbed, or after moving it I am not able to move it again. Also, if I move it and leave it in the "tray" where the blocks start it will get stuck in there. The ball will never hit the blocks and I can "win" this infinite game.

For a 14 year old with just under a year of Java experience, this is a good learning tool. It's a simple game but in the future you can learn from it and create even better games. I'm a 14 year old developer too. My first game was pretty crappy but even if I didn't finish any of my games (still haven't for the last 4 years Tongue) each one gets better and better as I learn.

Good luck on your Java adventure! Grin
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-31 23:57:51
Decided since my new project will have a train theme to it, I should add a fitting scene transition that I stole from Mind the Gap.

GIF (warning: somewhat large!)
Click to Play

faster smaller gifv here
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-31 20:23:15
Thanks to all your kind feedback on my post about what to do when you feel like quitting making a game, I've decided to start a smaller game. I had to refactor many things and the first thing on my list was converting the UI from acting in 720p to a ratio-based system. It looks like a mobile game right now but everything looks so much better in 1080p.

Perhaps you can infer what the game will be about from the name? Tongue
30  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-07-31 16:20:02
Thank you all for the support. I think I need to stop making huge games and just try little things for once. I'll halt PMP progress for now since as a framework it's as complete as I want it to be and use it for the next small game.

4. Don't work on or think about the project full time - code on it every day for only 5-15 minutes. Do a little change, fix a thing, add a comment, debug a thing - baby steps
This so far has gotten me the farthest on Project MP (gotta get that github streak Pointing).

Again, thanks for all the feedback. Now I just have to find an idea for said small game... Tongue
Pages: [1] 2 3 ... 9
BurntPizza (22 views)
2015-10-08 03:11:46

BurntPizza (15 views)
2015-10-08 00:30:40

BurntPizza (16 views)
2015-10-07 17:15:53

BurntPizza (31 views)
2015-10-07 02:11:23

KaiHH (37 views)
2015-10-06 20:22:20

KaiHH (16 views)
2015-10-06 19:41:59

BurntPizza (31 views)
2015-10-06 19:04:48

basil_ (46 views)
2015-09-30 17:04:40

shadowstryker (24 views)
2015-09-29 15:55:06

TheSpaceHedgehog (30 views)
2015-09-29 01:58: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

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!