Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
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 ... 16
1  Discussions / Miscellaneous Topics / Re: What are Anti-Virus Developers Protecting us From? on: 2014-04-18 18:47:46
Are you sure you doesn't get any viruses? I've used my USB in my friend's laptop and I've inserted into my pc. AVG detected 368 trojans ending in 'Foldername.exe' and every folder in the drive became a link to that exe file.

I hope you take no offence, your friend is the reason AV software exists.

I don't see what is so hard about watching what you install and what is too good to be true. 

Also, I find malicious emails absolutely hilarious, how can anyone fall for them.

"You won €5m in the Spanish lottery"

Seriously, I'm sure you would remember if you put a lottery ticket on in a different country, how thick can someone be.

Even better,

"A distant relative has died and left €6,352,435.68 in your name"
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Scene2D, utter tedious on: 2014-04-18 12:24:22
Yeah well in the end, Scene2D is a good library, its used by many to good effect, made by volunteers who know what they are doing. Considering that, its just not so nice to use words like "utter tedious", "tedious as hell", "that was horrible", "god annoying", "tedious and ugly library". It would be sad if a post like this would put newbies off using a good library for no good reason.

Fair enough I could have chosen my words better, I would never discourage someone to to use this library!

I never said it was ugly, I said it can make your code look ugly, especially if your just making something simple.
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Scene2D, utter tedious on: 2014-04-18 11:27:39
OP, since your problem is "fighting with a whole bunch of exceptions to get Scene2D to agree" I assume you haven't taken the effort to understand the API. Presenting your opinion so crudely (scene2d is "annoying as shit") isn't going to lead to productive discussion. Complain until you are blue in the face, but don't be surprised that I don't care about you or your problems. If your goal is solely to complain, remember that scene2d is provided to you at considerable effort for free. If you don't like it, don't use it.

Sorry I will reword, setting up a skin is annoying, I find it quite over whelming it you want something simple. I have read the documentation, I get it. I can easily setup a basic ui with it.

Just because I find it tedious does not mean I don't know how to work it.

I never complained about the functionality, nor at any point did I say I never appreciated the free use of the library.

I find your reply pretty aggressive, for no reason at all.
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Scene2D, utter tedious on: 2014-04-17 23:53:50
Personally I've never had any problems with it, obviously you are always going to sacrifice simplicity for power. A menu with two buttons is pretty trivial:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
TextButton startButton = new TextButton("Start", getSkin());
      startButton.addListener(new ClickListener(){
         @Override
         public void clicked(InputEvent event, float x, float y){
            //blah
        }
      });
TextButton quitButton = new TextButton("Start", getSkin());
      quitButton.addListener(new ClickListener(){
         @Override
         public void clicked(InputEvent event, float x, float y){
            //blah
        }
      });
table.add(startButton);
table.row();
table.add(quitButton);
right?
About the same amount of code as you have, except you don't have to manually resize each element.


Except you are missing the creation and setup of tgr stage, the table, sizing both.

Them setting up the skin so that it has a font and drawables.

I don't have to manually resize my widgets, I added in 1 line if code that sizes it to the parent if you wish.

I dunno, I just can't seem to do well with it and the thought of it puts me right off.
5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Scene2D, utter tedious on: 2014-04-17 17:58:01
The 23 lines of code in the OP is my code, not Scene2D.

If it was scene2d the lines would be doubled, to get the same thing.

Scene2D is great when it comes to a semi complex UI, but see trying to get something basic to work...annoying as shit imo.
6  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Scene2D, utter tedious on: 2014-04-17 13:59:39
Can you perhaps show the rest of the code? It usually doesn't take me more than a few lines to create a basic menu.

The rest of my code? That is pretty much it in terms of creating the menu, do you mean my actual back classes? If you mean Scene2D, I have no Scene2D code.

It is very similar to Scene2D except I don't have a skin crashing 6x before everything is put into it.
7  Java Game APIs & Engines / Engines, Libraries and Tools / Scene2D, utter tedious on: 2014-04-17 11:40:59
Is it just me or is messing with Scene2D tedious as hell.

I have been coding a Space Invaders game for the past couple of days, using LibGDX and I have the game almost complete (death animation missing) so I decided to add a menu.

Now it would have 2 buttons, play and quit. Jesus, the amount of fields/variables required to just do that was horrible.

Then the skin, god annoying.

Don't get me wrong, I have used it to good effect in the past but it just feels like a tedious and ugly library when it comes to coding with it.

Anyone feel the same or just me?

I ended up just creating a simple UIHandler, a few buttons, a list to holds the buttons and a way to navigate them with the keys.

It took around 5-6 classes but all I have to do is this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
UIHandler uiHandler = new UIHandler();

   TextButton play = new TextButton("PLAY", Gdx.graphics.getWidth() / 2,
         Gdx.graphics.getHeight() / 2, 300, 100, new ButtonCallback() {
           
            @Override
            public void onClick() {
               ((Game)Gdx.app.getApplicationListener()).setScreen(new GameScreen());
            }
         });
   
   TextButton exit = new TextButton("QUIT", Gdx.graphics.getWidth() / 2,
         Gdx.graphics.getHeight() / 2, 300, 100, new ButtonCallback() {
           
            @Override
            public void onClick() {
               Gdx.app.exit();
            }
         });

      list.addWidget(play);
      list.addWidget(exit);
      uiHandler.addWidget(list);


You can see where the similarities lie, the ui hander is like the Stage and the list is like the List in Scene2D, this was pretty fun to write, it might not look pretty but at least I am not fighting with a whole bunch of exceptions to get Scene2D to agree :p
8  Game Development / Newbie & Debugging Questions / Re: LibGDX and Getting Pixels From Sprite on: 2014-04-16 11:28:47
@grunt and gibbo

You don't seem to understand what he wants.

He doesn't want tinting. He wants to replace certain gray colors with custom colors in code.

I understand what he wants, I told him you can get the pixels of a texture but if there is a way to manipulate them with libgdx, no idea.

I then suggested an alternative, is all.
9  Game Development / Newbie & Debugging Questions / Re: LibGDX and Getting Pixels From Sprite on: 2014-04-16 11:17:48
You can get the pixels from the texture, unless I'm thinking a pixmap. You can then store them in a 2D array but like you I have no idea if you manipulate them from there.

Just have all your images shades of grey, then apply a tint.
10  Game Development / Newbie & Debugging Questions / Re: Scaling my games? Performance loss? on: 2014-04-16 06:59:53
1366x768 is the new 1024x768.

This practically every sub £1000 laptop has this resolution, a few below this price have 1920x1080 but they are usually pretty shit. With the screen being the selling point and the rest of it men.
11  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Libgdx] Problem with ImmediateModeRenderer20 on: 2014-04-15 18:04:41
That is not noise, well it kind of is. You are probably experiencing aliasing.

If your image is very detailed, say 5000x5000 and your screen is only 1920x1080. A lot of the 1 pixel thick details will be lost.

A way around it is texture filtering, using texture.setFilter();

If it is a very detailed image though, you can only do so much.
12  Game Development / Artificial Intelligence / A* NodeMap on: 2014-04-15 12:09:12
Hi,

I have a NodeMap class for my A* algorithm that holds all my nodes in an array with some methods to do things.

I am struggling to make a decision about 2 fields in specific within this NodeMap:

1  
2  
3  
4  
5  
   /** The nodes that are passable */
   private boolean[][] nodesPassable;

   /** The value of the nodes */
   private int[][] nodeValues;


These 2 fields, hopefully are self explanatory. Basically when I create my NodeMap I pass in 2 arrays that holds information about what is passable and the values of the nodes.

The array of nodes is just a 2D array like the above.

I also have a PathFinder class that has a one of these maps, well in this case they all have the same map.

Which is bad, because after I have finished moving to a path, the map needs reset. To my knowledge that means if I do this:

1  
2  
3  
4  
5  
6  
      /* Create our map and give it the array of passable nodes */
      Map map = new NodeMap(8, 8, nodesPassable, nodeValues);
     
      /* Create our apth finder and give it the map */
      PathFinder pathFinder = new PathFinder(map, new Heuristic());
      PathFinder pathFinder2 = new PathFinder(map, new Heuristic());


I pass the exact same map to both path finders, ideally every single NPC in my game will have their own path finder. No idea if that is wise or now, or if they should all use the same one.

Well now say one NPC just finished its path, I then call:

1  
pathFinder.map.reset();


I feel stupid for asking this, but is that not going to reset the map for both pathfinders since I passed them the same map? Objects are pass by reference right?

So back to the problem with those 2 fields, if I was to go into my NPC class and create a new NPC, say I don't have access to the array of passable nodes and node values, or say they have changed (The map can change), now what?

Well I was thinking I would make those 2 fields static and set them at run time, then I can adjust them for all maps with NodeMap.updateNodes() or something.

Would this be a viable work around? Or anyone got a better idea?

I would rather not have to fire those arrays around in a ton of constructors or even make them static, it seems to make more sense to make the actual fields inside the array static themself.

Means if the map changes I can simply get the position of the node within the array and change all the values from within any class.

EDIT: Might want to tell you reset actually does, it basically goes through all the nodes in the map and resets their previous node to null. As the path is built by setting the next node to check as the current node we just checked.

So the path gets build from destination to start.
13  Game Development / Newbie & Debugging Questions / Re: Space Invaders - Defense Thing on: 2014-04-15 11:45:11
Yeah of course it is Smiley

You might want to look into Destructible terrain, GameDevTuts+ always makes very, very good gamedevelopment articles ^^

Thank you!

I'll have a look over it soon as I am home Cheesy
14  Game Development / Newbie & Debugging Questions / Re: Space Invaders - Defense Thing on: 2014-04-15 11:18:45
Yeah I thought it was something like that, but that is quit a few sprites for something so trivial.

Is it not possible to generate a little bit of noise on the current sprite for every damage level and alpha the pixels? lol
15  Discussions / Miscellaneous Topics / Re: What are Anti-Virus Developers Protecting us From? on: 2014-04-15 09:06:03
I worked with IT support last years and its time for me to tell you all the truth.

The first sentence to come out of a sales mans mouth :p

Oh, Kaspersky Pure costs £34.99!

I kid lol.
16  Game Development / Newbie & Debugging Questions / Space Invaders - Defense Thing on: 2014-04-14 22:02:42
So simple question, what would be the best way to design the defense bits in space invaders?

I am curious if it should be done using individual little sprites, 6x6, then when they are hit, alter the pixels of that sprite to show the noise/damage effect.

How would you do it?

If for whatever reason you are unaware what I am even on about, have a go and shoot the defense structure:

Space Invaders
17  Game Development / Game Mechanics / Re: A* path finding on: 2014-04-14 17:35:09
You really need to rethink all your variable names, this could have been avoided if you where not messing around with variable called n, q, f and h and what not, I know what they are but it is still annoying as hell, for instance:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
Node q; > Node current;

Node[] successors = new Node[] { new Node(q, q.x, q.y + 1),
               new Node(q, q.x, q.y - 1), new Node(q, q.x + 1, q.y),
               new Node(q, q.x - 1, q.y) };

>

Node[] currentNeighbours = new Node[] { new Node(q, q.x, q.y + 1),
               new Node(q, q.x, q.y - 1), new Node(q, q.x + 1, q.y),
               new Node(q, q.x - 1, q.y) };

      for (Node neighbour: currentNeighbours ) {
            if (neighbour.equals(goal)) {
               last = node;
               break;
            }


Just a though, it will greatly help you think.

Also more comments, lots more.
18  Game Development / Game Mechanics / Re: A* path finding on: 2014-04-14 16:51:32
Just to let you know I am trying to find the problem lol.
19  Game Development / Game Mechanics / Re: A* path finding on: 2014-04-14 16:16:12
All the tutorials I've looked at have told me to add the start node to the open list. :x
The start node is removed almost immediately because it is the node with the lowest f value in the open list and that node is removed at the beginning of the loop.

Ah right I see where that is removed now, fair enough.

Regardless you are stuck in that loop, it seems your open list is never actually empty therefore your path is never actually found.

I suggest slapping a bunch of print statements in each part of the code where the search is complete, the loop should break or when a node is removed. As well as print the size of open each time one of those happens.

That should help you pinpoint, my pathfinder is quite a bit different. Hella lot easier to read, probably just because I wrote it  Tongue.

EDIT: Oops yeah, I add my start node to the open list as well! Shows the last time I looked over this code LOL.
20  Game Development / Game Mechanics / Re: A* path finding on: 2014-04-14 16:04:20
Hi all, I'm just trying to implement this algorithm that I've mentioned above, but it seems to be stuck loading endlessly.

Here's my source: http://www.java-gaming.org/?action=pastebin&id=896

At the moment I'm declaring it with the start and goal nodes set to (0, 0) and (10, 5) respectively. Can anyone spot the reason why it's loading out?

Thanks!

1  
open.add(start);


At no point do you remove start from the open list, therefore its size is always > 0. Infinite loop.

Also when you are creating your NodeMap, if you have one...are you predefining a bunch of nodes that are automatically closed?

EDIT:

Also I have no idea if my way is more efficient, but I have each node store an array of neighbours instead of doing that in the loop, my nodes are all initialized at game start so that only gets done once.

Also from what I see you have no predefined nodemap, I suggest you make one. Surely you have obstacles? If so, get a node map made.

EDIT 2:

Actually now that I think of it, why is start even on the open list? It is not an option, you are already there. It should be on the closed list.
21  Games Center / WIP games, tools & toy projects / Re: [LibGDX] GameUtils on: 2014-04-14 15:47:47
Hi guys, I do have some things in the development pipeline, I have started putting some spare time into a StateMachine that can be used for any object.

I have refactored the Stopwatch and Clock quite significantly, they now share a fair bit of base code from the GameTimer class, as they should.

Other than that I have just been changing up javadoc to reflect the refactoring and spelling mistakes!

However I have done something useful...

I started making some video tutorials on how to use the basics, because I am absolutely terrible at writing up Wikis Sad.

You can find them on the Wiki Page of the respected class, so far I have done the ActionOrthoCamera, Stopwatch, Box2DObject and Box2DFactory. They are fairly simple to use but I felt like it would help towards my goal of having a properly documented library!

Enjoy, hope my accent is understandable lol!
22  Discussions / Miscellaneous Topics / Re: What are Anti-Virus Developers Protecting us From? on: 2014-04-14 15:11:49
Good to know I am not the only one thinking it is a big con.

I do believe it is somewhat good for people who might not be computer literate, or as computer literate as us.

For example my poor 55 year old dad, he seems to get a hella lot of virus like problems that frankly I am sick of fixing. I just accuse him of watching too much porn :p

Just a few weeks ago, I was visiting and he was showing me this tv streaming program he was overly chuffed about, as we do not have sat/cable tv in that area...should have seen the amount of crap that it installed on his laptop. I was actually shocked.
23  Games Center / WIP games, tools & toy projects / Re: SCREENSHAKE: SixtyGig - Open World Retro RPG. on: 2014-04-14 12:22:42
Heh camera shake/rumble is awesome.

I use this in my game:

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  
   private final void processShake(float delta) {
      /*
       * If the current shake time is less than the desired shake time, shake
       * away
       */

      if (currentShakeTime <= shakeTime) {
         /*
          * We take the current shake power and give it the value of
          * shakepower - current shake time and divide it by a blend factor,
          * then divide by shake time
          */

         currentShakePower = shakePower
               * ((shakeTime - currentShakeTime / 1.15f) / shakeTime);

         /*
          * Randomly increase/decrease the position on x by a random factor
          * multiplied by the shakepower
          */

         shakeX = (MathUtils.random(-0.5f, 0.5f) * MathUtils.random(1.25f,
               1.5f)) * currentShakePower;
         /*
          * Randomly increase/decrease the position on y by a random factor
          * multiplied by the shakepower
          */

         shakeY = (MathUtils.random(-0.5f, 0.5f) * MathUtils.random(1.25f,
               1.5f)) * currentShakePower;

         /* Move the camera to the new values */
         translate(-shakeX, -shakeY);
         /* increase our current shake time */
         currentShakeTime += delta;
      } else {
         /*
          * The current shake time has exceeded the desired shake time, lets
          * stop the shaking process
          */

         shaking = false;
      }

   }


I am using LibGDX and and my own camera that extends from the normal ortho cam. It works pretty well, however the LibGDX Ortho cam does make it much better because it interpolates between the 2 positions and moves smoothly back into place.

Do you have something similar? Yours looks really good for arcade shoot em' ups!
24  Discussions / Miscellaneous Topics / Re: What are Anti-Virus Developers Protecting us From? on: 2014-04-14 12:01:07
Maybe I'm currently typing and someone is seeing what I'm typing, but I doubt it.

Just for good measure, you may as well insult them.

But yeah, I feel as if when I install and Anti-Virus program, I am installing a virus that brings in a whole lot of malware.

The only time it ever flags something is a crack for a game, which is a false positive.
25  Discussions / Miscellaneous Topics / What are Anti-Virus Developers Protecting us From? on: 2014-04-14 11:11:21
I have been a Windows user since Windows 98. I have used pretty much every single anti-virus that ever existed but what exactly are they protecting us from?

I have had this Laptop for around 7 month now, admittedly I have 100's of movies and dozens of games that I have "acquired" through various activities. I won't lie, most of us do it.

But what is my Anti-Virus doing?

f**k all, I have not had a Virus on this laptop since the day I got it.

My GF has a PC, she has had it for 3 years and she downloads stuff like there is no tomorrow, I have used Free and Paid Anti-virus, Norton/McAfee just slowed down anything they got put on, I moved over to AVG/Avast!

None of these Anti-virus have ever found a Virus, ever.

The few times in the past I have had a Virus, the Anti-Virus never even done a thing. You know one of those ones that happens to embed itself in your system tray.

So what exactly does Anti-Virus even do? Does it just bloat our PCs now? Or are they actually doing something? Are viruses as common as they were 10 years ago?

Are the people developing this software getting paid for nothing?

Your views...
26  Games Center / WIP games, tools & toy projects / Re: Element X on: 2014-04-13 11:12:16
Looks good. I couldn't spawn anything in though (got null pointer exception when run in the console). Other than that, it ran nicely. Loved the stick onionade!
Hmm. Should have mentioned before, but the names are case-sensetive with the entities.
You need to say /spawn NOTCHHEAD <x> <y> or /spawn 69 <x> <y>.
Sorry about that, it's just the method I was using.

Error trap that as soon as possible, try/catch block and print a "No Such Item Found". May as well get it out the way if that is your most common way of spawning stuff until resources collection is in.
27  Discussions / General Discussions / Re: What genre/artists do you listen to while coding? on: 2014-04-13 11:10:43
Lol Gangsta Rap, Rap, Rock... I am hella random when it comes to music.

However if I had a favorite genre/artist it would be Ice Cube.

And yes, I am white :p
28  Games Center / WIP games, tools & toy projects / Re: MERCury - 2d Game Engine on: 2014-04-12 22:10:42
*snip*

Heh, your idea is quite a bit different from mine :p

I appreciate the acknowledgement Cheesy

I tried running my Events on a separate thread, it worked 10x better in terms of timing accuracy (I could make it iterate ever 1ms, every 50 or whatever, depends on how accurate you want it/cpu usage). However due to OpenGL being bound to 1 thread, it seemed less hassle to just deal with a slight inaccuracy in the ms counter.
29  Game Development / Newbie & Debugging Questions / Re: Drawing a Sprite left,top,right or bellow of another Rotating Sprite on: 2014-04-12 18:36:21
Imo I would not use batch.draw().

It is more readable to have  block of code that positions/handles rotations and then use, well I think so anyway. It does make your code more bulky.

1  
sprite.draw(batch);


You just need to set position and angle, right before drawing. In your render loop.

Let me know how it goes.
30  Games Center / WIP games, tools & toy projects / Re: [LibGDX] GameUtils on: 2014-04-12 18:33:57
Awesome project! I'm going to try and work this into my current libgdx project as soon as i get home. Are you working on this solo or would you mind having another contributer to the project? If there are any features you want but don't have the time to add I'd be happy to donate some time, I'd keep everything I write very clean and document as I go.

I'm currently working on a level editor for box2d/libgdx right now and I could definitely benefit from using your gameUtils. I just joined java-gaming I plan on sharing my level editor with everyone once I get a littler further into it, I'll also release the small gui library I'm developing for use with it.

Good luck with the project I can't wait to try it out!

Thanks for the reply and support!

I am currently working on this solo, I am not looking for someone to contribute to it directly however you are more than welcome to create using what I got, or take what I got and edit/optimize it for yourself, then you are free to use/distribute it under the conditions I am credited.

I would not rely on it too much for your project, I am in the process of properly refactoring it, a lot of code is repeated, such as in Clock and Stopwatch, they have same fields but extend from the same class.

Small things, really.
Pages: [1] 2 3 ... 16
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (53 views)
2014-04-15 18:08:23

BurntPizza (51 views)
2014-04-15 03:46:01

UprightPath (65 views)
2014-04-14 17:39:50

UprightPath (48 views)
2014-04-14 17:35:47

Porlus (65 views)
2014-04-14 15:48:38

tom_mai78101 (89 views)
2014-04-10 04:04:31

BurntPizza (149 views)
2014-04-08 23:06:04

tom_mai78101 (245 views)
2014-04-05 13:34:39

trollwarrior1 (203 views)
2014-04-04 12:06:45

CJLetsGame (210 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!