Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (748)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (834)
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
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Rigging/Animation tool for FK Forward Kinematics and IK Inverse Kinematics on: 2018-02-13 16:19:32
I like you're idea of exporting the data so it's usable in any language/engine, which means it can have use regardless of, as you noted, java's popularity in game dev. I'm not sure JSON would be best though; maybe just plain space/new-line/comma delineated text, as this would avoid requiring a JSON parser, and would be more in tune with how .obj files are structured.

Quote
I want to know if it is worth it for me to continue working on the tool even when java isn't really used for games.
...
Please note that this tool was made simply for personal use and as a personal challenge. I am aware of the fact that there are similar tools out there.

You seem to already have an answer to your question (with which I agree). Your tool may never be used in an actual game. Might not even be used by yourself. But that goes for most games and experiments, both on this site and elsewhere; most will be played by / seen by few people. If your doing it as a challenge or learning experience, then continue as long as it remains interesting, challenging, and educational.

Nice job btw Smiley
2  Game Development / Newbie & Debugging Questions / Re: Libgdx, Box2D, Box2dLight on: 2018-02-06 17:10:54
My hypothesis of the issue, you're doing
arm.setTransform(new Vector2(arm.getPosition().x, arm.getPosition().y), newAngle);
and you're ALSO doing
light.setDirection(newAngle);
My interpretation of Orange451's suggestion, and assumptions of the box2d api, would suggest you shouldn't be flipping (adding PI) to both the arm and the light, as that would just put the light back where it started. Try flipping only the light, not the arm. That is, revert line 9 to use angle
arm.setTransform(new Vector2(arm.getPosition().x, arm.getPosition().y), newAngle);

Other notes,

does vec2.set(vec2.x, vec2.y); do anything? I'm not familiar with box2d, but assuming I understand correctly, that code seems redundant.

float angle = (float) Math.atan2(arm.getWorldCenter().y - worldCoords.y, arm.getWorldCenter().x - worldCoords.x);
can be replaced by
float angle = (float) Math.atan2(vec2.y, vec2.x);
in order to make it both more efficient, and more importantly, easier to read.

You have some formatting issues. It's a good idea to format your spacing and such before posting online. After all, you're asking other people to offer their time and experience, the least you could do is make it easier for them to understand your problem. Most IDE's have a keyboard shortcut to auto-format.
3  Games Center / WIP games, tools & toy projects / Re: exploration rpg on: 2018-02-03 18:11:54
Given there are no textures, and cubes have a bunch of sharp 90deg edges, I've implemented a simple antialiasing solution
Anti-alias off:

Anti-alias on:
4  Games Center / WIP games, tools & toy projects / exploration rpg on: 2018-02-02 21:18:14
Here's a gif of an early wip project.

Click to Play


project emphasis on:
1) fast-paced mobility,
2) using crafted rather than random-drop item & gear,
3) crafting involves choices, rather than a linear progression of X is better than Y in all aspects,

All feedback greatly appreciated
5  Game Development / Newbie & Debugging Questions / Re: Comments & feedback on this health-bars? on: 2018-02-01 16:29:12
Here I don't change the distance between bars, but instead making the border consume space inwards rather than outwards.


Here I just put greater distance between the bars
6  Game Development / Newbie & Debugging Questions / Re: [Libgdx] Particle Effect Pool on: 2018-01-27 17:28:50
Everyone makes coding mistakes, regardless of experience.
Sometimes, it's faster to fix with someone else looking at it with fresh pair of eyes. Sometimes, it's faster to fix with someone else with more experience in that area.
But given your'e saying this is the entirety of your program minus some input trigger, then it may very well be in your best interest to struggle and take these obstacles as an opportunity to challenge and improve your debugging and problem-thinking skills.
It's one thing to ask for help on a piece of code you've been unable to figure out after hours of struggling, it's another to default to asking for help the minute you encounter behavior you can't explain immediately.

Take a look at this very relevant post, https://softwareengineering.stackexchange.com/a/10751
Quote
The mindset and attitude to debugging is perhaps the most important part, because it determines how effectively you'll fix the error, and what you'll learn from it — if anything.

Classics on software development like The Pragmatic Programmer and Code Complete basically argue for the same approach: every error is an opportunity to learn, almost always about yourself (because only beginners blame the compiler/computer first).

So treat it as a mystery which will be interesting to crack. And cracking that mystery should be done systematically, by expressing our assumptions (to ourselves, or to others) and then testing our assumptions, one-by-one if need be — using every tool at our disposal, especially debuggers and automated test frameworks. Then after the mystery is solved, you can do even better by looking through all your code for similar errors you may have made; and write an automated test to ensure the error will not happen unknowingly again.
7  Game Development / Newbie & Debugging Questions / Re: Comments & feedback on this health-bars? on: 2018-01-26 15:58:10
Oh my bad, i read ur first post as referring to the divider lines rather than the surrounding border  Smiley

black
Click to Play


thick external border
Click to Play


thick internal and external border
Click to Play
8  Game Development / Newbie & Debugging Questions / Re: Comments & feedback on this health-bars? on: 2018-01-26 15:22:41
This one's black with 50% alpha. pixel width, i'm not sure, as i'm providing coordinates in the [-1,1] space so that they scale with window size. Each line is 0.2% width of the screen
Click to Play
9  Game Development / Newbie & Debugging Questions / Re: Comments & feedback on this health-bars? on: 2018-01-25 15:47:02
Yes that sounds like a good idea. Though I'm not sure if my implementation turned out that nicely.

White

Click to Play


Same color as background of each bar (i think this is my favorite?)

Click to Play


Black

Click to Play


Halfway between white and bar's fill color

Click to Play
10  Game Development / Newbie & Debugging Questions / Re: Comments & feedback on this health-bars? on: 2018-01-24 18:22:07
i've never thought of it like that, that's very helpful. Currently, there's no special change at any boundary. Even when shield reaches 0, there's no change in mechanics; shield and life just regenerate differently (e.g. life regens slower, shield regens faster but only if you haven't taken recent damage), and scale differently from stats / gear.
11  Game Development / Newbie & Debugging Questions / Re: Comments & feedback on this health-bars? on: 2018-01-24 16:56:48
This is maybe my favorite? idk, is it? no one knows the truth Shocked

the rectangle chunks individually set color, the rightmost one becomes blacker and blacker as you take damage, until u've taken 1/num-rects of your health as damage, then the next one begins to darken. This seems kind of digital like?

Click to Play


side note, it seems the size tags don't work: [size=5pt]why isn't this font size 5?[/size]
12  Game Development / Newbie & Debugging Questions / Re: Comments & feedback on this health-bars? on: 2018-01-24 16:19:07
Yes, the left is health & shield, the right are stamina and secondary stamina.
Yes, in the gifs, the range of values doesn't change, just the percent changes. But in the game, as your character progresses, you could increase maximum health and such and then the rectangle chunks would change size. (in the below gifs, i've included a preview with 3 rects and a preview with 5 rects to show what i mean)

I've stuck with both ur advices and kept the white border. Here are 2 more attempts.

For this one, I had the life bar chunks stick to the right edge, rather than the left as previously.

Click to Play


And for this one, i've put the darker rects to the right and the lighter rects to the left.

Click to Play


To be honest, i don't like any of the one's i've tried out so far Smiley

I want to avoid adding 3d affect to the bars. The short gifys don't show it, but the game is meant to be set in wild planets, like James Cameron's Avatar kind of planet, but maybe more barren. So your character is in some sort of suit, and the ui should feel "digital / electric / battery-like"?
13  Game Development / Newbie & Debugging Questions / Re: Comments & feedback on this health-bars? on: 2018-01-23 16:48:33
The background color changes. I made everything else black for those gify & screenshot to make it obvious what I was asking about, but in reality, the bars will be overlaid on top of the 3d rendered scene. Still though, I think ur right, the left-most points are "too" black.
Good idea. I avoided a border at first because I feared making the UI too obnoxious, but i definitely should try before deciding.

Here is what the background actually might look like

Click to Play


Here i adjust the darkest shade to be ~.25f rather than ~.02

Click to Play


Here it has a white border



And here it has a black border



Overall, the bordered one's "pop out" too much, but would like others' opinions.
14  Game Development / Newbie & Debugging Questions / Comments & feedback on this health-bars? on: 2018-01-23 16:11:26
I'm working on a sandbox rpg kind of game. Still very early in development process to show much, I'll create a post under WIP once it's a bit more developed.

At the moment, I am working on the health bar (and other ui-bar-components). I don't want a plane 1-color bar that shrinks as health decreases, because that wouldn't visually indicate total health, just % health of maximum health. I know other games have vertical lines divide the health bar; as maximum health increases, the number of these lines increases, and the distance between them decreases. For example, Dota does this (

I wanted to try out something similar, and ended up with the below example. I'm not sure if it's any good or just hard to read, and need some feedback Smiley

Click to Play


15  Game Development / Newbie & Debugging Questions / Re: [Libgdx] Using progress bar as health bar on: 2018-01-12 16:17:00
I assume you have a colors vbo for your health bar. Then all you have to do is:

1) Give progressBar a private method field float[] color and a setter for that color field.

2) Call the setter when human health changes.

3) When you call healthBar.draw or whatever u call each frame to get it on screen, copy the float array to a float buffer (don't create a new buffer each time, reuse the same one), and then do what you usually do when drawing updated vertex information
e.g.
glBindBuffer(GL_ARRAY_BUFFER, colorsVboId);
glBufferData(GL_ARRAY_BUFFER, colorsBuffer, GL_STATIC_DRAW);

Side note, if the health color is something that doesn't change often, and was something that you used a lot (say on enemy's as well), then it may be worth having a dirty flag, set to true every time color changes, and then you'd only need to update the VBO if the flag were true.

Alternatively, you could do the vbo update in step 2, rather than on frame refresh. I personally wouldn't like mixing "game logic" and "draw logic" into the same method though, especially if u were to later attempt to have separate threads for them.

Another side note, maybe just me, but I wouldn't name the healthBar class ProgressBar, as health doesn't "progress" (it moves in both directions usually). Maybe Bar?
16  Java Game APIs & Engines / OpenGL Development / Re: UI-Overlay on 3D scene on: 2018-01-03 18:28:57
Thank you all. For now, I'll go with swapping shader programs for simplicity. If this becomes the bottle neck or gains a significant impact on performance, I'll try out the other options. Though based of eject's reply, it seems this shouldn't ever really be the bottleneck.
17  Java Game APIs & Engines / OpenGL Development / Re: GLSL error in fragment shader on: 2018-01-02 20:15:20
line 16: toLightVector is a vec4, so normalize(toLightVector) is also going to return vec4, but you're assigning it a vec3.
18  Java Game APIs & Engines / OpenGL Development / UI-Overlay on 3D scene on: 2018-01-01 22:00:34
I'm wondering what would be the preferred way to draw a 2d ui overlay on top of a 3d game. Some ideas I've seen online or am considering are:
1) draw the 3d frame, set projection/view uniform matrices to Identity, draw UI
2) draw 3d frame, set some uniform boolean value that tell shaders to skip the matrix transformations, draw ui, reset the boolean
3) draw 3d frame, switch to another shaderProgram, draw UI, switch back to 3d shaderProgram.

I'm not sure how expensive switching shader programs (3), but https://www.opengl.org/discussion_boards/showthread.php/173818-Best-way-to-handle-multiple-shaders suggests it shouldn't be a problem. Likewise, not sure how expensive checking a uniform boolean value for every single vertex (2) would be?
19  Game Development / Performance Tuning / Re: What is the fastest way of setting screen pixels? on: 2017-12-30 18:05:24
Quote
OpenGL, it's basically doing exactly the same thing as what I'd like to build myself

OpenGL can do what you're trying to do; e.g., given some world representation, convert them to screen pixels. But it's really up to u how u decide to use openGl. You could totally give openGl a 1d or 2d array of pixel colors, and have openGl draw them on screen.

I've built some projects that did the conversion from 3D world representation to 2D screen uniform-color quads/triangles, and then let openGl take care of those (because it's faster than Java2D). So it's really up to u how much of you're logic you want to do "reinvent" and how much you want to use openGl to do.

Side note, openGl doesn't really "do things for you", it's a library/framework that provides you with the tools that make it easier and simpler to do yourself. You're still multiplying model matrices with your vertexes and such. I wouldn't call it an "engine."
20  Java Game APIs & Engines / OpenGL Development / parenthesis in shaders for multiplication order & 1 giant draw call optimal? on: 2017-12-28 20:38:00
I'm trying to understand opengl a little better, and have come across 2 short questions. I'm using lwjgl, if it's relevant.

1. When writing glsl shaders, should I put parenthesis? I've read matrix*matrix multiplication is slower than matrix*vector multiplication, e.g.
1  
(matrix1 * matrix2) * vector1

is slower than
1  
matrix1 * (matrix2 * vector1)

Specifically, my vertex shader has this line, where projection, view, and model are mat4's, and position is a vec3:
1  
gl_Position = projection * view * model * vec4(position, 1.0);

and I'm not sure if I should let glsl decide how it wants to do this, or if I should put parenthesis to ensure optimization of multiplication order.

2. I'm using glDrawElementsInstanced to draw a bunch of cubes (~3,000,000). I've divided a world into chunks, with the cubes evenly distributed between the chunks. Each chunk has it's own VAO and does a draw call. For optimization, I thought if I were to aggregate the cubes from all chunks into 1 VAO and reduce to 1 draw call, then maybe I would have performance increase.
I setup an example with 4 chunks and cubes evenly distributed between the chunks (so ~750,000 cubes per chunk). But performance either decreased by ~1fps or didn't change when I use an aggregated VAO and 1 draw call as opposed to 4. I'm assuming 4 draw calls and VAO's simply don't have enough overhead to be measurable, and I'll try with more.
- update: I've tried with more chunks. For this setup, I had ~2,100,000 cubes evenly distributed over 1024 chunks. Having 1024 VAO's and draw calls, gave ~30 fps. Having 1 aggregate VAO and 1 draw call gave ~29 fps.
Similarly, ~4,100,000 cubes distributed over 2000 chunks gave 15fps with and without the aggregated VAO.
Are there downsides with draw calls of too many instances?
Are there any downside with a couple thousand draw calls per frame?
All these tests were done with static cubes. Are there any downsides that would become more apparent with dynamic cubes?
21  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-23 19:53:30
Another update
http://www.java-gaming.org/user-generated-content/members/244457/monster-12-23-17-3.jar (see top post for most up to date jar)

I've redone the movement collision algorithm. It no longer makes you slow down if you're sliding against a wall. Turning tight corners while being chased by the monster will be a little bit less scary.
Plus improved the house generator to require a minimum number of connected rooms (set to 70). We should no longer experience the bug with just 1 or a small number of rooms being generated, and the monster, human, and exit are spawned very close by. So if anyone still experiences this bug, let me know.

All feedback greatly appreciated. Smiley
That being said, I feel like this project is coming to an end soonish; as other than making it prettier (I'm not much of an artist), and doing small fixes & improvements I don't really know where to take it. Thank you all for your feedback and helpful comments, I had fun building the project, if there are any features or ideas you would like to see before I move to my next project, let me know Smiley.
22  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-22 17:18:53
Another update Smiley

http://www.java-gaming.org/user-generated-content/members/244457/monster-12-22-17-2.jar (most up to date jar in top post)

1. Added hints; these are purple floor tiles that protrude from the exit horizontally, vertically, and diagonally every 3 tiles. They help the human find the exit more deterministically.
2. added particle system and monster "footprint" trail indicating where the monster has been recently.
3. monster speed decreased from 50% to 20% faster than human
4. camera is more zoomed out by default (z increased from 20 to 25), allowing you to see more of the map. Feel free to try adjusting this ("-" and "=" zoom out and in) and let me know what feels optimal
5. fixed bug where corridors with dead ends were being generated
6. Adjusted monster sniff error. Monster is less inaccurate at determining human's location at farther distances. It's a linear scale, with a minimum error of 5 units that increases at about .3 units of error per 1 unit of distance.
7. Stamina and Running. Stuck in a hallway with the monster right behind you? Have no fear, just press "." for a short burst of movement speed (100% increased movement speed) to get away!

Click to Play
23  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-20 21:43:01
Updated, http://www.java-gaming.org/user-generated-content/members/244457/monster-12-20-17.jar (see top post for most updated jar).

In this update,
I've changed monster behavior. It no longer can determine the human's exact location when nearby unless it has line of sight. 1) if it has line of sight of the human, it directly chases the human. 2) else, if it's "sniff" cooldown is ready, it sniffs which gives it an approximate location of the human (accuracy vary's depending on distance) and updates it's movement to go to that approximate location
And the human now get's a blinking direction indicator when the monster is nearby. Blink frequency is relative to distance, and direction points towards monster. Lastly, human detection distance has been increased.

Hopefully these set of changes help address the almost-guaranteed "game over" on encountering the monster, as well as make encounters with the monster more frequent.

All feedback greatly appreciated Smiley
24  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-19 16:22:36
So i've updated the project to address some of the simpler / easier-to-fix concerns brought up. (http://www.java-gaming.org/user-generated-content/members/244457/monster-12-19-17.jar - see top post for updated jar)
specifically,
1) distance required between monster / exit and human to trigger game over has been decreased (from 2 to .5 units);
2) Pressing "enter" key restarts the game. At game over, text is displayed to remind the player they can press Enter.
3) Map generation can no longer generate isolated room-groups. Only group of connected rooms will be kept. This should fix unreachable exits / monsters.

The fix for slower speed when "sliding" on a wall, isn't as straightforward as I thought it would be, since the intersection finding logic solves for x movement, then y movement separately. It has no way to come back to the x-logic after it realized it's sliding on a wall in the y-direction in order to increase the x-movement. So the solution would require rewriting the movement intersection logic, which I will do, but just not in this update.

Next i will address the bigger game-design concerns, e.g., fix "repetitive & mindless wandering and hope u encounter exit before u encounter monster and feel like you're helpless in determining whether u win or lose." I've got some ideas on how i'll try to improve this, but before i'll list them below to get some opinions:

Encountering the monster shouldn't be a rare occurrence that ends in losing; it should be a probable, experience that repeatedly breaks up the monotone of searching for the room, and must therefore also be "resolvable" without defeat. First, to make it more likely to happen, the monster will not wander aimlessly when it is far from the human, but instead "sniff" the general direction of the human and move towards the general vicinity. Second, to make the encounter resolvable/conquerable, the monster will be only slightly faster than the human. In addition, the monster will not be able to chase the human's exact location even without line of sight. Instead, the monster takes "sniffs" on a ~5 or ~10 second cool-down, which provide it with the approximate location of the human (more accurate with smaller distances), and follows the last sniff location. Only when the monster has line of sight of the human (or his light), will the monster chase the exact location of the human. This gives control to the human on escaping the encounter by juking and such. In addition, the human's light can be toggled off, making it harder to navigate, but also less likely for the monster to gain line of sight of the human's light. Lastly, the monster leaves a fading "footprint" trail, to allow the human to have control on avoiding encounters.

These are just initial thoughts. In essence, I'm just trying to avoid the "inevitably" of defeat following the monster/human encounter, as well as make escaping and avoiding an active task rather than luck-based.
25  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-18 17:44:43
@VaTTeRGeR Thank you so much, that was a very helpful Smiley. I agree completely with your feedback, and will be sure to improve the project.

Regarding the movement, I thought this feels more naturally, as your running into the wall it makes to lose speed. But I wasn't sure since the tight corridors makes it easy to slide into walls as your'e trying to turn a corner. Your comment convinced me Smiley, I'll fix it soon.

Regarding game over before monster touches you, you are right, i set the victory condition distance arbitrarily as 2 units, but I'll change it to something more reasonable, like 0.5 or such, after I test it out.

Regarding the monster speed, it's 50% faster than the human currently. I'll try speeding up the human, slowing down the monster, increasing the light range, or  increasing the human sense distance (red bar when you get near the monster), and see what values work well. (Side note, if you press '.' you run twice as fast as the monster but you're not supposed to know about that since running isn't fully implemented Smiley).

I'm aware of the bug with the map generator, but just haven't gotten to it yet. It basically removes all rooms that are totally unconnected to other rooms, but doesn't do the required search to determine if all the rooms remaining are connected.

I'll definitely add a restart button or maybe text "Press Enter to Try Again" or such. It's even annoying for me when debugging to have to restart Smiley.

All that being said, you pointed out two of the most significant issues I'm having, 1) better map generation to avoid the "tight and wrinkly" repetitive maps, and 2) some kind of clues as to where the exit is or some way of figuring it out without relying on pure random luck and walking "my experience was running around aimlessly"
26  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-18 16:19:44
Awesome idea, would be nice ambiance setting the mood. Especially if they flickered or turned off as u approached them or such. Art and visual polish have always been my weakness in my projects, not sure if i'll pull it off as nicely as u described, but will give it a shot.

In the meantime, i've worked on the victory conditions (human wins if he encounters the exit, and loses if he encounters the monster) and the sensory information. The sensory information might require adjusting, but for now, the human has a red bar indicate his distance from the monster if they're 12 units or closer. The monster senses and chases the human if they're 9 units or closer.

Feel free to give it a try and let me know how it feels Smiley

JAR: http://www.java-gaming.org/user-generated-content/members/244457/monster-12-18-17.jar (see top post for most up to date jar)

(stupid question maybe, but does anyone have experience with "java web start"? Would it allow me to host my project on a website for u guys to demo without requiring downloading the jar?)

Click to Play
27  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-18 15:13:41
You're totally right, I'd never heard of gamma correction prior to ur comment, and was not accounting for it. Quick wiki + stackoverflow search suggest something like `[r*|g*|b*] = 255 * ([r|g|b] / 255) ^ (1 / 2.2)` might be all i need, I'll try it out sometime and see what happens.

In the meantime, I implemented multiple light sources. To be honest, I don't like it. Below is a gify if anyone wants to share their opinion, but I felt like it didn't fit with the top down view. It provides the the human with sight of rooms that he doesn't have line of sight of and therefore killing the "spooky" feel. if I were restrain it to only being visible when the human has line of sight of the lighted areas, then it's pretty pointless as the human's light source would've lighted the area anyways.

Click to Play
28  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-16 17:31:44
I decided to go with the `1 - distance / maxDistance` lighting function. It seemed to look the nicest plus it's easy to set it to the required max distance.

Next steps:
1. multiple light sources randomly spread throughout the house. They will flicker or turn off as the monster approaches to add a sense of gloom and provide the human a way to know he's really close to danger and in what direction the monster is.
2. win conditions. If the human reaches the exit, he wins, but if the monster reaches the human first, the human loses.
3. sensory information. The human should be able to hear (probably some visual indicator as well) when the monster is close. The monster should be able to hear/smell the human. Probably, the human will sense farther than the monster so that it can avoid the monster, but the monster will be able to determine the human's exact location, whereas the human only knows how close he is to the monster. Running should make the human/monster move faster but also audible from farther away. Maybe the human has some kind of re-chargeable / cooldown-limited pulse equipment that will tell him the monsters' (approximate?) location.

Click to Play

29  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-15 22:28:21
Hmm.. precomputed flow maps seem like they would only work with static endpoints, as they would be function of the destination/exit endpoint. I wonder what your use case was, why would a map have multiple static entrances / exits,  but not a precomputed path to follow?

As for lighting, my next problem to solve is how to compute color based on lighting.
Currently, I'm using some function of distance between light source and light destination to compute light intensity for that destination. Then I use that light intensity to multiply the destinations color. I.e., given distance d (d>0), I compute light intensity L (0<L<1). Then, assuming, under 'pure' light, color(r,g,b), I paint the area color(r*L,g*L,b*L).

The question is what function to use for determining light intensity based on distance. According to wiki, light intensity is inversely proportional to square distance, but 1) this becomes too dark too quick, and 2) the technical light intensity wiki and physics refer to probably isn't the same as what I'm referring to L.
I've tried stuff like `1 - constant * distance`, as well as `1 - sqrt(distance)`, both seem to be 'ok,' but I'm wondering if anyone has experience what function seems to work best.

Click to Play


If anyone wants to try out different lighting functions and see which one they like, please feel free

Lighting Demo
30  Games Center / WIP games, tools & toy projects / Re: Generated Graph optimized A* Pathfinding on: 2017-12-15 18:12:40
Got a simple lighting demo up and running, now need to integrate with the main java app.

Click to Play


Click to Play
Pages: [1] 2 3
 
xxMrPHDxx (345 views)
2017-12-31 17:17:51

xxMrPHDxx (111 views)
2017-12-31 17:15:51

xxMrPHDxx (160 views)
2017-12-28 18:11:33

Ecumene (362 views)
2017-09-30 02:57:34

theagentd (505 views)
2017-09-26 18:23:31

cybrmynd (557 views)
2017-08-02 12:28:51

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

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

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

Archive (1347 views)
2017-04-27 17:45:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

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
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!