Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (563)
Games in Android Showcase (151)
games submitted by our members
Games in WIP (605)
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  Game Development / Game Play & Game Design / Re: Shooting Towards Cursor Location on: 2015-03-19 05:30:56
If you really want to fully understand it, heres some basic trygonometry Smiley
https://www.youtube.com/watch?v=8v9vwQvt6Rc

Don't poison his mind with angles just yet! Tongue

It will be useful for him in the future Smiley You can also do some nice smooth animations with them.
2  Game Development / Game Play & Game Design / Re: Shooting Towards Cursor Location on: 2015-03-19 05:26:38
If you really want to fully understand it, heres some basic trygonometry Smiley
https://www.youtube.com/watch?v=8v9vwQvt6Rc

EDIT: Theres also a way to do it using only Pithagoras and some divisions/multiplications/additions/substractions.
3  Game Development / Newbie & Debugging Questions / Re: [LibGDX]Entity Framework and Input - Best approach? on: 2015-03-18 20:08:21
This is sort of what I have at the moment.

I am using components to swap states about, what I have at the moment is you press the space key and if the entity has a GroundedComponent, it gives the entity a JumpComponent, the JumpSystem then uses data from that component to propel the entity upwards, then removes the GroundedComponent, the JumpComponent and adds an AirborneComponent.

All this is fine and dandy, but you can't really poll for input from Scene2D like I am doing now. Say you press left, change the data in the VelocityComponent, which is then handled by the MotorSystem.

However, if you know what Scene2D is like, it has every button you add to the stage take a callback. I don't want to have to make a ton of anonymous classes in a system (the button shouldn't even be in the system for a starter).

So Scene2D has no knowledge of any of the components of an entity, I think I may be missing something simple here :S.



So from what i understand, the buttons are on-screen, right?
And your problem is that you cant poll the button state from within the entity system.... right?
So maybe add some booleans/action variables to the InputManager class that hold the data for the specific action. F.ex Action moveLeftAction = new Action(Key primary, Key secondary);
Because the InputManager is a InputListener itself, you would still be able to modify the action states by keyboard (when compiling for desktop).
In the callback classes you could override that behavior by manually setting the action on/off state.
Whenever you pass the InputManager to the Entity System and GUI System in the constructor, or make the InputManager a static singleton is up to you.
4  Game Development / Newbie & Debugging Questions / Re: Entity Framework and Input - Best approach? on: 2015-03-18 19:29:25
Perhaps you should make a InputManager class, that maintains a list of registered InputListeners?
Then make a Entity System whitch implements InputListener and registers itself to the InputManager.In the update method, find the player entity by a IDComponent (empty class ex. PlayerTAGComponent extends Component), then do your calculations.
If you need any help with the actual implementation, i can help Smiley
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-16 21:18:28
Remember when i posted that i figured out bump mapping? Yeah, i was wrong. The sphere was normal mapped correctly only when the light was at a certain position.
I looked up the problem on google and struggled for 3 days to get the thing working. Basically i needed to convert the light & eye position to texture-space, then do calculations on that.
To do that i needed to calculate the TBN (tangent, binormal, normal) 3x3matrix and multiply lightPos & eyePos by it.
I had a lot of problems on the way, like having some sort of "gradient" on the faces that were rendered --->

I was trying to pull off some sick math to remove it, but then the next day, i deleted the code, so i could start over.
I looked at the code for a bit, and then spontaneously surrounded the tangent vector with a normalize() function. It worked. HALLELUJAH !
If anyone has problems with normal mapping in the future, pm me, i think i can point you in the right direction Smiley
Here is the awesome article that made everything clear : http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter08.html
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-14 09:45:27
Finally got normal mapping working  Cool thanks to this article. After ~12 hours...
I was way overcomplicating things / trying to make my shader code look exactly like the tutorial shader code.
I then looked back, reverted all changes, and tried to actually understand the code.
Then it turned out i had to add like 5 lines to the fragment shader  Pointing
1  
2  
3  
4  
5  
if(usesNormalMap > 0.5){
      vec3 nColor = texture(normal_textureSampler, pass_textureCoords).rgb;
      nColor.g = 1.0 - nColor.g;
      unitNormal = normalize(nColor * 2.0 - 1.0);
}

Click to Play
7  Game Development / Newbie & Debugging Questions / Re: Rendering a list of objects with the same mesh. on: 2015-03-14 02:00:46
Thanks Smiley i will let you know when i find the issue.
8  Game Development / Newbie & Debugging Questions / Re: Rendering a list of objects with the same mesh. on: 2015-03-13 19:40:23
Please help me :c Can you guys at least show me some way to do it? I don't need code, just some tips. All im trying to do is render a mesh multiple times, with different scale, and different "texture offset".
9  Game Development / Newbie & Debugging Questions / Rendering a list of objects with the same mesh. on: 2015-03-13 17:52:33
Hey.
Im using LibGDX + Ashley (ECS) and im trying to draw a list of tiles(entities) with one mesh (each tile has a texture offset and height - for scaling along the y axis).
The problem : nothing shows up on the screen and i have no idea why. I suppose i messed something up with OpenGL calls, as this is my first attempt at 3D.
If you have a better solution than what i have come up with, feel free to share it Smiley

TileRenderSystem.java
Test1.java (Loop Class)
tilesVertexShader.txt
tilesFragmentShader.txt
EDIT: defaultTileSet.png
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-10 22:12:56
I finished ThinMatrix's OpenGL tutorials and immediately went to convert my rouglelike game to 3d. And then everything started to fall aprat. All my code and tought i put into coming up with a way to make my game seem more 3d can now be thrown away, but without it, the whole structure doesn't make sense. Im currently considering to completley start from scratch and drop LibGDX in favor of LWJGL. It's just so overwhelming, and i want to put out some demo or next version of STS, but i keep coming up with new ideas that require me to restructure the whole code. Im sorry guys, this project wont be updated for another month i think :c But hey, when it finally does come out im sure it will look way better Smiley

EDIT: Will i be able to (in the future) change the title of my project thread?
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-09 23:21:41
You can make it weirder and do it like this:
1  
cable = electric = (sub != null);
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-08 11:15:08
Ok, this day was awesome. Got my new computer, installed Windows 7 on it, then had to install all the drivers.
Now, because my older computer (iMac 5,1) didn't support anything > OpenGL 2.1 , i had no way of learning the new OpenGL stuff (i could learn the old ways of the fixed pipeline, but its like learning C before C++ - which has completely different habits). Now i can. And i'm very happy Smiley
EDIT: I think i will convert my rpg game to 3D ....
Also, downloaded Lara Croft : tgol (thanks @NegativeZero !) , and it works like a charm Smiley (low settings unfortunately)
Here's a screen shot:


And the result of ThinMatrix's 12th OpenGL tutorial:
Click to Play
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-06 08:03:19
@SwordsMiner
Nice work! Can you tell us how you are generating those galaxies?
14  Discussions / Miscellaneous Topics / Re: Yay, free games! Zero's Game Giveaway on: 2015-02-26 15:12:56
Oooh nice! Laracroft please Smiley i love the series
15  Discussions / Miscellaneous Topics / Re: Yay, free games! Zero's Game Giveaway on: 2015-02-22 14:20:25
Id really like to take fez, but i wont be home until tomorrow Sad
Edit : nvm, doesnt work.
16  Game Development / Newbie & Debugging Questions / Re: [LibGDX] UTE not fading out? on: 2015-02-21 12:03:38
Set the delay on the secong Tween.to to 2f and see if that helps.
17  Games Center / WIP games, tools & toy projects / Re: Bit Siege - 2D Competitive Multiplayer PvP Game. (Patch v1.4.2 out now!) on: 2015-02-21 08:58:33
...

Nice!
You didn't get me with the graphics. My friends really do like retro games, but theres difference between good pixel art and a bad one. Now im not saying yours is bad, im just saying it needs more work Smiley It's just a opinion, it can vary from person to person. And that opinion is that this game is one of the best at JGO(State of Fortune FTW).
I can't wait until i can play this game.
18  Games Center / WIP games, tools & toy projects / Re: Bit Siege - 2D Competitive Multiplayer PvP Game. (Patch v1.4.2 out now!) on: 2015-02-20 22:45:54
Few things:
-Add "All" option to "Find Game". There are almost no players online most of the time, and if there are, you need to click through each mode to check if this is the one they are sitting in.
-Add a option to play against bots.
-Upgrade your graphics. It's the reason why most friends don't want to play your game (so i can't play either :c).
-Make a native launcher. My friend's first comment was "how do i run this". He can't double click it (stupid windows starts to unzip it), so i needed to guide him through the dark path of the cmd.

PS: He couldn't launch it and got angry. Ended up playing LoL :c
19  Discussions / General Discussions / Motivation on: 2015-02-20 21:51:59
What (de)motivates you guys? What do you do to keep yourself motivated?
I always get demotivated when i loose track of my thinking process / what i was doing at the moment (f.ex. go to mountains for a full week, or take a break from programming because of education).
Every time i start a new project, the class count quickly goes up to ~50 classes(each one having quite some code), so i easily forget what i was doing after some time not coding (thats also why i don't release any finished games). I recently (for my current project, which is STS, but from scratch) started leaving long todo notes for myself in the comments and some helpful hints to get me back on the track. It REALLY helps. I can basically start making new code instantly, instead of figuring out where i left and what needs to be done.
20  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-08 15:48:11
Been trying to fix my old iMac Intel iSight the whole day. Yesterday, i shut it down, unplugged it and placed it on the floor because i wanted to clean my desk. After reconnecting it wouldn't even boot. No chime no fans no lights, nothing. Checked the psu-fine , nothing fried. Blew the dust away and reassembled it. Tried again. Still no boot.
21  Game Development / Game Mechanics / Re: How to Store Tiles on: 2015-02-06 21:28:54
Object(only properties and image, pos can be calculated by mult. Tile size by x and yoposition in the array) + 2D array Smiley
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-31 23:52:20
Trying my best to make a gui for my rpg Smiley
23  Game Development / Game Mechanics / Re: "Help" with RayCasting on: 2015-01-25 21:33:46
Actually its really medium quality if it comes to actually determining if the entity is visible to the light or not. It casts a ray from the center of the light to the center of the entity, and lights the entity up if there are no bodies between them. What i will probably do is cast the ray to each 4 of the entity's corners, and one to the middle. If at least one is "clean", it will light it up.
And there needs to be some optimization (only updating entities on the screen) and cleanup done.
Performance-wise its also medium i think. Right now the amount of entities on screen is small so there are no problems, but if f.ex. there would be 20 mobs, some junk and particles, the performance will decrease. Oh, yea, filters, i will need to implement filters.

Code.
24  Game Development / Game Mechanics / Re: "Help" with RayCasting on: 2015-01-25 21:14:42
I always clean the code up after i'm sure its working as intended. I will keep fiddling with the system, but for now, i have this (moved some code from my previous game):

It even works when the tiles are in motion!

Thank you for your help, i will probably convert the code to .jar when i succeed in porting the framework and post it here for wanderers.
25  Game Development / Game Mechanics / Re: "Help" with RayCasting on: 2015-01-25 18:50:50
No, they cant rotate, and they can move around freerly.
Heres what i got so far:
Code.
26  Game Development / Game Mechanics / Re: "Help" with RayCasting on: 2015-01-25 17:18:46
Please? Im sure someone on this forum knows something about the topic.
27  Game Development / Game Mechanics / "Help" with RayCasting on: 2015-01-25 12:09:25
Hey guys,
Im using Ashley and LibGDX to make a top-down game, but i wanted to use my own "physics engine".
In my previous projects i always integrated Box2DLights for lighting, but since it uses Box2D to do the math, i had a problem.
So i downloaded the sources of Box2DLights and changed it to use Entities instead of Bodies.
Everything is working fine, except the shadows. I cant get raycasting to work.

TL;DR Teach me how 2 raycast pls (or point me in the right direction)

Additional info:
-2D Environment
-Each entity has a Position and CollisionBox component.
-CollisionBox has 2 fields : size and offset
-Engine object manages enities. You can get any entity or group you want at any given time
-The function that gets called for raycasting:
1  
2  
3  
public static void rayCast(Engine engine, RayCastCallback ray, Vector2 start, Vector2 tmpEnd){
      //TODO: Implement raycasting
}

-What it should do in the end:
1  
ray.reportRayFixture(Entity body, Vector2 point, Vector2 normal, float fraction);
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-25 10:54:54
Converting my game to ECS, which allows me to do this.
Trying to figure out lighting now -> the tiles are loose entities
Click to Play
29  Game Development / Game Play & Game Design / Re: Appropriate mobile game controls on: 2015-01-24 18:15:48
Split the screen vertically, then split the right side horizontally (or again vertically) for two "buttons" (jump and shoot)? The left side is used as a analog sitck -> user puts his finge on the area and slides in the direction he wants to go. Im probably describing some game's controls that i saw a long time ago, but im not sure.
30  Discussions / Miscellaneous Topics / Re: Minecraft - ever server saying 'Timed Out' on: 2015-01-20 08:07:16
Idk if it will help, but maybe try port forwarding?
Pages: [1] 2 3
 
wxwsk8er (49 views)
2015-03-20 15:39:46

Fairy Tailz (42 views)
2015-03-15 21:52:20

Olo (26 views)
2015-03-13 17:51:59

Olo (29 views)
2015-03-13 17:50:51

Olo (33 views)
2015-03-13 17:50:16

Olo (40 views)
2015-03-13 17:47:07

ClaasJG (29 views)
2015-03-10 11:36:42

ClaasJG (37 views)
2015-03-10 11:33:01

Pippogeek (45 views)
2015-03-05 14:36:23

Pippogeek (37 views)
2015-03-05 13:56:12
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
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!