Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (564)
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 ... 66
1  Discussions / Miscellaneous Topics / Re: Python Load Balancing. on: 2015-03-27 20:35:13
Even just [perhaps momentarily] popular websites. Pretty much whenever a small site is linked on the front page of reddit its server gets melted by the traffic.
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Lost System.out.println, Being bombarded with text. on: 2015-03-27 04:12:33
Ctrl-F "println"
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-26 21:24:21
Every non-primitive in Java is a pointer. What is the type of last_position?
And why this thread?
Those are rhetorical questions.
4  Game Development / Newbie & Debugging Questions / Re: [Unsolved] Bullet not shooting in correct direction! on: 2015-03-26 21:05:26
There is one reason to use angles: if he wants the ships to "flow" by changing their heading.

That's why I predicated: "outside of the controls"

Everything else should just be straight (ha) vectors. Implicit conversion to and from vector and scalar cartesian and polar spaces everywhere gets you this guessing game complete with shotgun debugging.
5  Game Development / Newbie & Debugging Questions / Re: [Unsolved] Bullet not shooting in correct direction! on: 2015-03-26 20:56:08
This is what I said in reply number 4...

And yet they're still trying to use angles...
6  Game Development / Newbie & Debugging Questions / Re: [Unsolved] Bullet not shooting in correct direction! on: 2015-03-26 20:09:34
No: http://www.java-gaming.org/topics/bullet-shooting-in-mouse-direction/34029/msg/320951/view.html#msg320951
Up towards the top of that thread is more info.

In short, a direction vector is simply the position of one thing minus the position of the second thing, normalized.
Use that instead of finding angles between things.
7  Game Development / Newbie & Debugging Questions / Re: [Unsolved] Bullet not shooting in correct direction! on: 2015-03-26 20:05:02
Gah, why use angles at all outside of the controls? This is what happens.
8  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Coroutines - A new coroutine library on: 2015-03-26 03:49:18
Whenever you would like to be able to do sleeps() in your AI behavior logic is when they become really useful, because you can! (well, simulate it)
Example:
http://stackoverflow.com/a/7224671/3517265
9  Games Center / Showcase / Re: Paper Pacman on: 2015-03-22 23:41:07
For easy programmatic emulation of hand-drawn lines, there is the technique I [re]started the What I did Today thread with:
http://www.java-gaming.org/topics/what-i-did-today/33622/msg/315998/view.html#msg315998

With some tuning it could look good.
10  Game Development / Newbie & Debugging Questions / Re: Randomly Generated Objects that do not Overlap? on: 2015-03-22 22:07:22
Remembered another way: plot points on a grid and randomly jitter them a little bit. Square grid is easiest, but a hex grid often looks closer to what you get with poisson:
http://www.java-gaming.org/topics/what-i-did-today/33622/msg/330685/view.html#msg330685

This is equivalent to the blue noise approach in the video, in the case of a square grid.
11  Game Development / Newbie & Debugging Questions / Re: Randomly Generated Objects that do not Overlap? on: 2015-03-22 21:52:06
The trial-and-error approach can work, but may not be fast or yield a good looking result.

The 'best' way to get evenly-spread minimum-distance sampling is poission disc sampling:
https://www.jasondavies.com/poisson-disc/
http://devmag.org.za/2009/05/03/poisson-disk-sampling/

The easier way is 'blue noise' sampling:
https://www.youtube.com/watch?v=lRfdN4L2SUg
12  Game Development / Shared Code / Re: Super Simple Name Generator! on: 2015-03-22 04:11:14
Another thing is, if it suits, you could make all of it not static and have an optional seed argument for the NameGenerator, passed to the rng, allowing for reproducible sequences of names.
13  Game Development / Shared Code / Re: Super Simple Name Generator! on: 2015-03-22 03:52:31
I also frown upon printing to the output because now what if I want a generated name, but don't want to clutter program output with context-less pseudologging output? I can't. Tend towards not performing such side effects and letting the caller decide what they want to do.

The whole generate function reduces to such:

1  
2  
3  
4  
5  
public static String generateName() {
    return Beginning[rand.nextInt(Beginning.length)]
         + Middle[rand.nextInt(Middle.length)]
         + End[rand.nextInt(End.length)];
}


Another thought provoker: hmm, those array lookups are almost like function calls themselves...
14  Game Development / Shared Code / Re: Super Simple Name Generator! on: 2015-03-22 03:42:11
There's also no point to the i variable. Just inline it.
15  Discussions / Miscellaneous Topics / Re: What Anti-Virus are you using? on: 2015-03-22 02:41:48
Defender. Although in all the years I've been using computers, I personally have not yet needed it.
If there wasn't an option as lightweight as defender I probably wouldn't run one at all. It's just insurance at this point.
16  Game Development / Newbie & Debugging Questions / Re: Libgdx font blurring on: 2015-03-22 01:23:25
There is always a filter, they're not optional. Tongue
(Unless scaling is simply disallowed)
17  Game Development / Newbie & Debugging Questions / Re: [LibGDX] [Solved] How to rotate a single texture in a spritebatch? on: 2015-03-22 00:08:55
When exploring the library, read as much of the docs as you can, so that you discover what has already been done for you, is possible, etc. Good practice for anything really.

Could you perhaps explain to me WHY it is that works? I don't understand how such a simple change fixed everything.

Quote
The origin is given relative to the bottom left corner of the Sprite, its position.

The point about which the batcher rotates stuff is not defined by you as an absolute position, you are to define it as a position relative to the Position value of the sprite (region).
RotationPoint = Position + X, where you provide the x. You were adding in position as if the origin is absolutely defined, so it was being counted twice, and was thus wrong.
18  Game Development / Newbie & Debugging Questions / Re: [LibGDX] How to rotate a single texture in a spritebatch? on: 2015-03-22 00:00:02
From Sprite.java: (emphasis mine)
Quote from: Javadocs
A Sprite also has an origin around which rotations and scaling are performed (that is, the origin is not modified by rotation and scaling). The origin is given relative to the bottom left corner of the Sprite, its position.

Try:

1  
2  
3  
4  
5  
6  
Width = PlanetWhite.getWidth();
Height = PlanetWhite.getHeight();
-OriginX = (x + Width)/2;
-OriginY = (y + Height)/2;
+OriginX = Width / 2;
+OriginY = Height / 2;


(All of those fields should really be floats.)

Again, all of this behavior has already been encapsulated by Sprite.
19  Game Development / Newbie & Debugging Questions / Re: [LibGDX] How to rotate a single texture in a spritebatch? on: 2015-03-21 23:32:49
Maybe what you actually want is a Sprite? (which is a texture region)
It inverts the control, you call sprite.draw(batch) instead of doing it all yourself. (and possibly writing broken code)
20  Game Development / Newbie & Debugging Questions / Re: Basic enemy movement where A* isn't really needed? on: 2015-03-21 23:22:07
I re-read the GPP chapter, all of the problems were either: (and none of them are specific to FSMs)
- changing problem requirements, which will ruin your day regardless
- boilerplate and complexity explosion caused by trying to stuff things into an object-oriented model
- not understanding the definition and consequent limitations of an FSM

But wait, at the bottom:

Quote
This doesn’t mean finite state machines, pushdown automata, and other simple systems aren’t useful.
They’re a good modeling tool for certain kinds of problems. Finite state machines are useful when:

You have an entity whose behavior changes based on some internal state.
That state can be rigidly divided into one of a relatively small number of distinct options.
The entity responds to a series of inputs or events over time.

Does it match Sauron's problem? Check, check, and triple check.
21  Game Development / Newbie & Debugging Questions / Re: [LibGDX] How to rotate a single texture in a spritebatch? on: 2015-03-21 23:07:41
Wrap the texture in a region encompassing the whole thing and pass it that?
22  Game Development / Newbie & Debugging Questions / Re: Basic enemy movement where A* isn't really needed? on: 2015-03-21 21:19:51
If line of sight matters, use raycasting. Cast a ray to the player, if it's unbroken by tiles [first assuming the distance is under some threshold], then the enemy can see the player, and it should begin attacking.
23  Game Development / Newbie & Debugging Questions / Re: Basic enemy movement where A* isn't really needed? on: 2015-03-21 19:48:42
Please don't use state machines for AI.

http://gameprogrammingpatterns.com/contents.html

Read this book about programming patterns.

Why not? They're perfectly suited to this particular problem. Don't over-complicate. Also don't throw out classes of solutions on opinion.
I posted that book here. I've read it.
24  Game Development / Newbie & Debugging Questions / Re: Basic enemy movement where A* isn't really needed? on: 2015-03-21 19:36:09
This can be modeled as a state machine, as can many simple AI behaviors like this.

You don't have to actually encode the problem as such, this is just pseudocode:
Obviously you could do things like parametrize Walking to both left and right with the same code, etc.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
State WalkLeft
    if(isNear(PLAYER))
        state = Attacking
        break           // break out to different state
    if (walkable(LEFT)) // there is a block to the left, but not i.e. a wall
        walk(LEFT)      // go 1 step left
        // no state change, repeat this
    else
        state = WalkRight
        break

State WalkRight
    if(isNear(PLAYER))
        state = Attacking
        break
    if (walkable(RIGHT)) // there is a block to the right
        walk(RIGHT)      // go 1 step right
    else
        state = WalkLeft
        break

State Attacking
    // whatever
    // resume to WalkingXX state when player is dead or out of sight, etc.
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-21 18:21:42
I've started actively seeking out smart people to listen to, and I've found Rich Hickey, author of one of my new favorite programming languages, to be a great source of programming wisdom and can recommend watching/listening to pretty much anything he says: http://www.infoq.com/presentations/Simple-Made-Easy   https://www.youtube.com/watch?v=f84n5oFoZBc
26  Games Center / WIP games, tools & toy projects / Re: PAAI - Pattern Aware Artificial Intelligence on: 2015-03-20 23:23:43
i was thinking about mutation of neurons for which GAs are prefect Smiley .. somehow a NN need to evolve, how would you go about it otherwise ?


(I hope we're not derailing your thread Ecumene)

NNs have dedicated algos for training that are specialized to exploit NNs' nature, one of the better known is backpropagation, but GA can work as well, as seen in the link I provided. However I don't think they are optimal, as they assume nothing about the problem they are optimizing (the NN).

A guy I watch on twitch has been experimenting with GA-on top of-NN for learning to play super mario: http://www.twitch.tv/sethbling/profile/past_broadcasts (the last few broadcasts)
The NN is what plays the game (a function of tile data around mario -> controller inputs)
The GA optimizes this function towards the goal (getting as far right in the level as possible)

GA = known result, unknown data
NN = known result, unknown function

Specifically, the 'data' is the argument to a function, the return value of which you are trying to optimize, whereas the NN's 'function' is anything.
NNs approximate functions, but themselves do not preform optimization, that is the job of the training algo, which then of course can be any optimization algorithm, including GAs.
In this sense I say they are orthogonal.
27  Games Center / WIP games, tools & toy projects / Re: PAAI - Pattern Aware Artificial Intelligence on: 2015-03-20 22:12:03
before you start with neural networks - read up on genetic-algorithm. its a major part in NN.

with a genetic approach you can already achieve interesting things.

Aren't they orthogonal? Obviously they can be combined, but I don't think they're a major part of NNs.

GAs are optimization, NNs are function approximation.
28  Games Center / WIP games, tools & toy projects / Re: PAAI - Pattern Aware Artificial Intelligence on: 2015-03-20 20:20:59
Sounds cool, if ambitious. I advise splitting "arbitrary data" into at least a few categories and tackling them one at a time, unless you have some specific idea of "generalized pattern."

Are you familiar with neural networks? "Arbitrary pattern matching" is basically their job description.
29  Game Development / Game Mechanics / Re: Push objects when walking into them on: 2015-03-20 02:25:37
Mouse coords transform is Camera.unproject()
30  Game Development / Newbie & Debugging Questions / Re: Mouse Position in Zoomed Tile Map on: 2015-03-19 22:51:57
Your first mistake is using orthographiccamera directly. Try Viewports.
Pages: [1] 2 3 ... 66
 
theagentd (8 views)
2015-03-27 23:08:20

wxwsk8er (52 views)
2015-03-20 15:39:46

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

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

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

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

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

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

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

Pippogeek (46 views)
2015-03-05 14:36:23
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!