Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (581)
Games in Android Showcase (163)
games submitted by our members
Games in WIP (632)
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 ... 39
1  Games Center / Showcase / Re: Heroes of Loot's Steam release on: 2015-05-27 12:56:07
Nice looking game, also very reasonable price point as well. Good job.
2  Discussions / General Discussions / Re: Rayvolution's JGO Appreciation Thread (AKA: Free copies of Retro-Pixel Castles!) on: 2015-05-27 10:47:53
I would love to give the game a try.
3  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-26 18:42:39
So take these into account before doing it the cheat way lol.

So is your way the standard way of doing this type of item placement? I mainly plan on only using the assets for the player but it would be cool is something like a skeleton used the same weapons.

Would you not have to redesign the assets for bigger mobs anyway Huh

Parenting transforms is a pretty standard way of positioning things relative to other things, regardless of what it is. If say a skeleton was to pick up a bow on the ground, the skeleton would know where about it should hold that particular item.

You would not have to redesign the assets for a bigger mob. Why should a dagger be bigger for a 10ft orc type mob as opposed to a 6ft hero? A dagger is a dagger, if the orcs have their own weapons then of course, you would have to make more assets, as opposed to redesigning existing ones.

If you are making a game, where anybody can pick up anything, then yes; this is a pretty standard way.
4  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-26 12:17:41
Gibbo's solution does seem neat Smiley

Cheers  Wink.

Jacobs solution is also viable as long as the art is not to be used by things off varying sizes. If you want to allow say a large orc to use the same dagger as the player, and the player happens to be half the size...well, you just doubled your asset count. Say you wanted to use the same sprite for the UI and pickups , it's now triple the amount of assets.

So take these into account before doing it the cheat way lol.
5  Discussions / General Discussions / Re: Teaching Kids to be Independent on: 2015-05-22 05:58:02
It's the harsh reality that kids are "stupid", but what age group are you talking about in particular?

I tried (note tried) to teach basic java to a group of around  15 youths, these particular youths were early school leavers that claimed they wanted to do something computer related, quite a lot of them had an interest in programming, some hardware and the odd one or two that wanted to go to college and do games development.

What a waste of time for me and the organisation. We made a few little games (rock paper scissors, tic tac toe etc), as well as basic programs that simulate bank accounts.

Half of them left because they could not be bothered to show up, the others, whenever they got stuck they would go on Facebook or some random reddit page until I noticed, then asked for help.

Turned out this was pretty common, happened with every group and I was not the first person to try.

However, there was one girl in particular that loved to be creative, she wanted to do games design and possibly programming. I put most of my attention into her, helped her as much as possible.

I gave her a road map that could get her from where she is, and onto a course that is meaningful. Told her what she needed to learn and what to expect.

She is now doing the course I did 2 years ago.

All the other kids wanted to do was go home and play games on the xbox, their parents literally just let then do f**k all with their lives.

Quite the opposite end of the spectrum, on my end the parents did not care and unfortunately, the kids will never excel in anything. In your end, the parents are pushy and controlling, so the kids will succeed but still never excel in anything.

So yeah, tldr kids are shit, just do your best and try to find the ones among the idiots and focus on them. Diamond in the rough and what not.
6  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-20 21:25:51
Yeah this is the exact same, as long as you have your sprite origin set to the middle, it should be fine.

If it is offset in anyway, it will pivot weird.

Position before rotation as well (if you are doing some sort of get order).
7  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-20 20:32:34
That's what I was looking for! Thank you. Do you have any advice for what to do then when I rotate the sprites?

Pretty much the exact same, just replace position with angle/rotation  Wink.
8  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-20 11:08:39
Use a parent child setup.

So the position of the character is say, 5x5. And the item should be placed in their right hand. So lets say the sprite is facing directly right (zero degrees).

The item should be positioned 1 unit offset on the y axis. So if you were to write both positions separate, it would be 5x5 for the player and 5x6 for the item.

Now if you were to parent them (or their transforms), then you would have it be 5x5 for player and 0x1 for the item.

Here is some pseudo:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
// New character at position 5, 5
Character c = new Character(5, 5);

// Give the character an item, at position 0, 1
Item i = new Item(0, 1);

// Now parent them
i.setParent(c);

// Now the get position method would look something like this
public Vector2 getPosition(){
    return parent == null ? position : position.add(parent.getPosition());
}

// Draw each of them
// This will draw the item at the position of the parent, then at it's own position
batch.draw(i.sprite, i.getPosition());
// This will just draw the character, if it had a parent it would draw it at its parents position + its own position
batch.draw(c.sprite, i.getPosition());


This would be best split up into transforms of course, as you don't want to tie objects together like this.

9  Games Center / WIP games, tools & toy projects / Re: Flying Cavemen - Inifinite Scroller [LibGDX] on: 2015-05-17 14:55:56
This is by no means a bad game, but the performance is pretty terrible.

It is fun though, attention to detail is striking as well.
10  Discussions / General Discussions / Re: What's your day job? on: 2015-05-11 08:54:55
Just started a new job few weeks ago, in a local bike shop.

Learning a lot, great fun and most important, cheap components! Cheesy.
11  Game Development / Newbie & Debugging Questions / Re: How to order the way in which objects are rendered? on: 2015-05-06 11:31:21
Just to build on what Riven and Cero said.

You sort by layer, which means sorting each frame will take literally no time at all.

You may have a list of layers that contain a list of items, spanning many thousands. The internal array is never sorted, only the layer list is sorted.

So think of a layer as a data structure for render able objects, so to say.
12  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX] Where to start? on: 2015-05-06 11:19:57
If you have been working with Slick for 3 years then have no fear, the LibGDX documentation is HERE.

You should have no issue at all getting to know the API.
13  Game Development / Newbie & Debugging Questions / Re: [LibGdx] Best way to handle textures for hundreds of objects? on: 2015-04-28 15:54:00
Use the AssetManager supplied with the LibGDX library. Load textures once, use Sprites with them for multiple draw transforms.

Do not put the textures into a class and declare them all static, this is a bad habit and you will suffer from OpenGL context lost on the Android platform.

Here is the wiki for it.
14  Discussions / Miscellaneous Topics / Re: Can Word Lists be Copyrighted on: 2015-04-22 11:48:53
You can not copyright words or numbers.

Oh, but you can copyright numbers. And people do all the time. Every time a bit of code is copyrighted, they are essentially just copyrighting a very large number, as it's essentily nothing but a string of 0s and 1s. You can also trademark numbers for specific uses, such as Boeing and their 737.

I was meaning that you can't directly copyright a single number or word lol.
15  Game Development / Newbie & Debugging Questions / Re: how to fit a body to a sprite avoiding transparent space? on: 2015-04-18 20:10:45
i destroy the fixture to create a new one every frame with the new size

Don't do that, if your character changes size dynamically, simply attach fixtures to represent the larger sizes and set them as sensors.

Say the player can shrink to half his size, have 2 fixtures. 1 for normal size and 1 for half size that is a sensor but default, whenever the player shrinks, set the full size one to sensor and the half size one to not sensor.

Creating a new fixture every frame is a waste of power, especially if you are doing it for more than 1 entity.
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-11 21:43:11
Started my new job at a local bike shop called the bike smith, woot.

Good bunch of guys, good laugh, trade prices on stuff :p.
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-07 18:25:48
Bit the bullet, bought one of these. 8 weeks and the red one will be in stock and in my garage next day Cheesy.

Yay



I regret nothing.
18  Game Development / Newbie & Debugging Questions / Re: [libGDX] Make Tiled cell/tile transparent with code on: 2015-04-04 07:18:49
I guess the cell is a texture. Any way i can change the alpha of a texture?

You could use a simple shader, as that is basically what the sprite alpha and color altering methods are doing.

It would not take long to switch over to Sprite as opposed to texture, it's going to be easier and faster than doing it yourself.
19  Game Development / Newbie & Debugging Questions / Re: [libGDX] Make Tiled cell/tile transparent with code on: 2015-04-03 20:43:07
The Sprite class allows you to directly change the alpha amount.

I believe it is :

1  
2  
Sprite sprite = new Sprite() ;
sprite.setAlpha(someValue) ;
20  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-03 11:43:36
I've been working on a project that was shelved back in November, I am doing a refactor and update on it and I was quite curious to just how flexible the Entity and Component code was.

So I made a new playable character that was literally a cloud, I was entertained for a whole 30 minutes just building playable objects.
21  Discussions / General Discussions / Re: Looking for a developer on: 2015-04-03 06:37:19
I appreciate the op. Kev, as per usual had dimmed in on this with the exact same (good) advice he gives every other thread like this.

The difference? The op didn't go full asshole and throw it back in his face.
22  Discussions / General Discussions / Re: Looking for a developer on: 2015-04-02 07:52:56
Lol also that is a neat idea, don't give it away for free like you just did :p.
23  Discussions / Miscellaneous Topics / LuaJ and LibGDX - Class not found on: 2015-03-31 13:53:16
So I decided to have a little look at lua scripting for fun, decided on LuaJ after some googling.

I am just using an existing code base for this, as you might have read in this thread here, I was looking for a way to handle component data outside of the java code. Like loading from JSON (this is my method at the moment) or XML.

So yeah, here is the problem.

This an Android game, that is where the problem lies as it works fine on desktop. It can find, load and run the script just fine.

Here is the script:

1  
2  
3  
4  
5  
6  
7  
function init(entity)   
   local package = "com.gibbo.components";
   local size = luajava.newInstance(package..".SizeComponent");
   size:setWidth(1.5f);
   size:setHeight(1.5f);
   entity:add(size);
end


The obvious problematic line is
local size = luajava.newInstance(package..".SizeComponent");
, which can not be found on Android. I am not sure what else I can say, besides that I have the error:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
03-31 14:51:16.038: I/ERROR(26785): Lua error 
03-31 14:51:16.038: I/ERROR(26785): function init(entity, position)  
03-31 14:51:16.038: I/ERROR(26785):    local package = "com.gibbo.components";
03-31 14:51:16.038: I/ERROR(26785):    local size = luajava.newInstance(package..".SizeComponent");
03-31 14:51:16.038: I/ERROR(26785):    size:setWidth(1.5f);
03-31 14:51:16.038: I/ERROR(26785):    size:setHeight(1.5f);
03-31 14:51:16.038: I/ERROR(26785):    entity:add(size);
03-31 14:51:16.038: I/ERROR(26785): end
03-31 14:51:16.038: I/ERROR(26785):
03-31 14:51:16.038: I/ERROR(26785): :4 vm error: java.lang.ClassNotFoundException: com.gibbo.components.SizeComponent


There is obviously some sort of difference about how android is compiled compared to desktop, but yeah, not sure what to do from here.

UPDATE:

I found this on stack overflow that states I can either downgrade to fix the problem, however I can not find any documentation for anything prior to LuaJ 3.0. So I decided to instead go with the second second suggestions, I downloaded the source and found the missing libaries and changed the source. But nada, still same problem.
24  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX] How to check if Object is in certain part of camera? on: 2015-03-30 20:38:31
Op, of you're new to vectors and dot product,  this article describes how the dot product can be used for your EXACT requirements. Which is convenient lol.

Enjoy, I suggest you read the rest as well. Nice read imo.
25  Game Development / Newbie & Debugging Questions / Re: How to calculate new position based on angle? on: 2015-03-30 20:29:50
A little note info would help, as you have not stated what you are using, what you have tried etc.

There is many ways to do this, you are wanting to rotate an object around a local coordinate right?
26  Game Development / Newbie & Debugging Questions / Re: [Unsolved] Bullet not shooting in correct direction! on: 2015-03-30 15:55:39
Weird, all my code like this, I Negate it lol. If I don't it shoots opposite.

That probably means you have the source/goal mixed up in your subtraction. It's not the end of the world, just one extra step you don't really need.

Omg thank you, I had it mixed up in all my projects. How the hell did I miss that! Fail Sad.
27  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Entity Components - Should I read from file? on: 2015-03-30 15:52:11
Very nice information here.

Do you recommend serializing components using json, then add them to the entity rather than serializing the entire entity with the components?

The first one seems cleaner, as a serialized character at the moment has literally over 1000 lines in the json file.

However, I don't want to have to read the data in every time I spawn a new character or object, as this will make it slow.

For reference, this is what a basic character looks like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
   private static Entity createHaldor(Vector2 position) {
      Entity e = new Entity();
      PhysicsComponent physicsComponent = new PhysicsComponent(
            BodyType.DynamicBody, true, 2);
      DrawableComponent drawableComponent = new DrawableComponent(new Sprite(
            VRD.ASSETS.get("sprites/01/jump.png",
                  Texture.class)), DepthBuffers.VD);
      SizeComponent sizeComponent = new SizeComponent(1.5f,
            MathHelper.getRatioY(1.5f, drawableComponent.getSprite()
                  .getWidth(), drawableComponent.getSprite().getHeight()));
      MotorComponent motorComponent = new MotorComponent();
      AnimationComponent a = new AnimationComponent();
      LabelComponent labelComponent = new LabelComponent();
      ContactComponent contactComponent = new ContactComponent();
      GroundColliderComponent groundColliderComponent = new GroundColliderComponent();
      DirectionComponent directionComponent = new DirectionComponent();
      AirborneStateComponent airborneComponent = new AirborneStateComponent();

      groundColliderComponent.transform.setPosition(new Vector2(0, -.6f));
      groundColliderComponent.transform.setParent(physicsComponent.transform);
      groundColliderComponent.width = 0.35f;
      groundColliderComponent.height = 0.25f;

      labelComponent.name = "Haldor";
      labelComponent.internalName = "haldor";
      a.current = AnimationCache.getAnimation(labelComponent.internalName,
            "jump");
      motorComponent.maxSpeed = 4f;
      motorComponent.accelerationRateX = 25f;
      PolygonShape poly = new PolygonShape();
      poly.setAsBox(0.75f / 2, 1.5f / 2);
      CircleShape circle = new CircleShape();
      circle.setRadius(0.375f);
      circle.setPosition(new Vector2(0, -.375f));
      physicsComponent.addNewFixtureDef(FixtureData.BUILDER.name("foot")
            .density(0.25f).restitution(0f).friction(0f).shape(circle)
            .dataToSet(contactComponent).build());
      circle = new CircleShape();
      circle.setRadius(0.365f);
      circle.setPosition(new Vector2(0, .375f));
      physicsComponent.addNewFixtureDef(FixtureData.BUILDER.name("head")
            .density(0.25f).restitution(0f).friction(0f).shape(circle)
            .dataToSet(contactComponent).build());
      physicsComponent.transform.setPosition(position);
      drawableComponent.transform.setParent(physicsComponent.transform);
      drawableComponent.transform.setPosition(new Vector2(-sizeComponent
            .getWidth() / 2, -sizeComponent.getHeight() / 2));
      drawableComponent.transform.setAngleAxis(0, 0, 1, 0);
     
      e.add(sizeComponent).add(physicsComponent)
      .add(drawableComponent).add(motorComponent)
      .add(contactComponent).add(a).add(labelComponent)
      .add(directionComponent).add(groundColliderComponent).add(airborneComponent);
     
      return e;
   }


You can probably see why it might be beneficial to read the parameters from a file lol.

EDIT: I was considering using Lua, as this will allow me to have components configured in a script outside of the code base. I thought about this approach given the fact I won't be maintaining this project (or won't be the only one) in the long run.
28  Game Development / Newbie & Debugging Questions / [LibGDX] Entity Components - Should I read from file? on: 2015-03-30 13:12:57
I am a little stumped on the best approach for this, I want to clean up my code a bit and move my entity components to an external file that is loaded in at runtime.

However I am a little unsure how to go about this, as I have never done any extensive I/O coding, I usually just write the code once and when I am happy with it, dump the entire thing to disk using Protobuf or Json and then read it in later.

I would like it to be somewhat readable though, so that if I want to make small changes (like balancing) down the road, I don't have to re-write it and redump it.

I am using the Ashley Entity Framework which is fairly lightweight, along with LibGDX and Box2D. I have it setup so that entities bodies and fixtures are not created until they are added to the Ashley engine, so there is no serializing of actual Box2D bodies; which is nice.

Serializing sprites is bad though, correct? So my option there would be to store the file path and instead grab it from the AssetManager after the entity has been loaded from disk.

Any ideas? Suggestions?, for the record, playable characters (of which there are currently 5) have between 15 and 20 different component combinations that make them unique.

The main idea here is to remove a lot of horrible code into a nice file that is readable and can be altered.
29  Game Development / Networking & Multiplayer / Re: KryoNet Performance on: 2015-03-29 18:43:33
You can have as many as the machine that the server is running on can handle.

This, however you also have to take into consideration if the client can handle what you require as well, as clients will be receiving data from the server about the current state of other clients.

Yes the server might be able to receive 100 and process 100 packets every 33ms, but the clients and their net might not be able to. So it is a case of finding a nice balance, don't think just because the server is running sweet and handling a few clients just fine, make virtual clients and test it. Put your network under stress as well and test it with a moderate connection.

Just my two cents  Cheesy.
30  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Animated graphics formats in OpenGL Java on: 2015-03-29 16:34:57
Not sure on the licensing but I can confirm that animated PNGs are ridiculously large in size, hence why you don't see many.

Pages: [1] 2 3 ... 39
 
theagentd (20 views)
2015-05-27 22:21:17

theagentd (26 views)
2015-05-27 22:21:08

CopyableCougar4 (20 views)
2015-05-27 19:24:50

MrMapcom (24 views)
2015-05-23 20:26:16

MrMapcom (32 views)
2015-05-23 20:23:34

Waterwolf (37 views)
2015-05-20 15:01:45

chrislo27 (44 views)
2015-05-20 03:42:21

BurntPizza (79 views)
2015-05-10 15:53:18

FrozenShade (64 views)
2015-05-07 09:11:21

TheLopais (227 views)
2015-05-06 13:36:48
List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

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