Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 291 292 [293] 294 295 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 882329 times)

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4380 on: April 25, 2013, 07:21:31 pm »

Minor rantage ahead.

Spoiler (click to show/hide)

I love problem-solving as much as the next guy. I'm a programmer - I wouldn't be doing this if I didn't. But open-source docs are sometimes often nearly always horrid and no one cares enough to fix them. The Django docs, for instance, are only slightly better.
Logged

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4381 on: April 25, 2013, 07:52:05 pm »

I know that feel bro; I was trying to modify libpcap at work today.   :'(

Seriously I spent an hour going through it asking myself "Why the fuck are they using bison-yacc?"

Bleh.
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4382 on: April 25, 2013, 08:26:27 pm »

Working on it now.  Figured out how to make them not be so stupid (Pathing was interfering with the swarming, I figured out an awesome solution; when they collide, share pathing information and choose the more pertinent one).

Once I have something I am proud of I'll share it.
Wait, why do your boids even need pathing?

Getting the boids working was easy.  But I want them to path through an area as a group.  Like a swarm of bees.  That way I can actually use them in a game type thing.  I am going to set it up so they automatically avoid areas that they died previously, and with the swarming and pathfinding should make it interesting to fight against.  Sorry I wasn't clearer.

Think of the idea like a zombie game, but the zombies are smarter and they work in groups better.  That's what I am aiming for.
That sounds like something I saw called flow field pathfinding. Each item doesn't explicitly do calculations and follows a sort of field to move towards a destination. Maybe something like that could be better?
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #4383 on: April 25, 2013, 08:30:05 pm »

Complex pathfinding shouldn't be necessary for boids. The nature of the swarm will flow over/around most barriers. You would only need pathfinding if they ended up in a dead end that was large enough to contain the entire swarm.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4384 on: April 25, 2013, 08:52:00 pm »

Complex pathfinding shouldn't be necessary for boids. The nature of the swarm will flow over/around most barriers. You would only need pathfinding if they ended up in a dead end that was large enough to contain the entire swarm.

Yes, but if you have complicated geometry and multiple swarms it could be.  I was thinking about having a "Master Pather" for each swarm.  I also want them to be able to dynamically split up and reform, so I am having each boid handling it's own pathing, sort of.  If they bump into another boid with a better goal they use their path instead, if that makes sense.  That way a group can dynamically split up and reform based on shared goals, and the pathing can become more like "guidelines".

I haven't quite figured out the theory, and I am still playing with what works.  Hopefully I can get an algorithm that works.

And yeah I looked at flow field pathfinding.  I may end up implementing something like that, but hopefully not, since it seems more annoying to deal with.
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

Scoops Novel

  • Bay Watcher
  • Talismanic
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4385 on: April 26, 2013, 10:18:12 am »

Can i be given a link to a reliable site based on teaching coding to beginner's?
Logged
Reading a thinner book

Arcjolt (useful) Chilly The Endoplasm Jiggles

Hums with potential    a flying minotaur

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #4386 on: April 26, 2013, 10:31:33 am »

Complex pathfinding shouldn't be necessary for boids. The nature of the swarm will flow over/around most barriers. You would only need pathfinding if they ended up in a dead end that was large enough to contain the entire swarm.

Yes, but if you have complicated geometry and multiple swarms it could be.  I was thinking about having a "Master Pather" for each swarm.  I also want them to be able to dynamically split up and reform, so I am having each boid handling it's own pathing, sort of.  If they bump into another boid with a better goal they use their path instead, if that makes sense.  That way a group can dynamically split up and reform based on shared goals, and the pathing can become more like "guidelines".

I haven't quite figured out the theory, and I am still playing with what works.  Hopefully I can get an algorithm that works.

And yeah I looked at flow field pathfinding.  I may end up implementing something like that, but hopefully not, since it seems more annoying to deal with.

I think you might be underestimating the emergent properties of the swarm. They will naturally split and merge depending on the weight and range properties that you give to the center seeking vector compared to the average motion vector and the distance keeping vector.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4387 on: April 26, 2013, 10:35:42 am »

Then they never mention any format besides JSON, because, you know, there's no reason you would want to use JSONP for cross-site requests or anything.
Is there, really? I'm struggling to find a use case. In fact, I've never actually understood the value of JSONP, other than opening yourself up to a host of vulnerabilities. Can you describe the actual problem, here? Do you really want to arbitrarily inject code from a server you have no control over? If you DO have control over both servers, why not just set their document.domain value to be the same and ignore the whole cross site problems thing completely?
Logged

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4388 on: April 26, 2013, 12:55:02 pm »

Then they never mention any format besides JSON, because, you know, there's no reason you would want to use JSONP for cross-site requests or anything.
Is there, really? I'm struggling to find a use case. In fact, I've never actually understood the value of JSONP, other than opening yourself up to a host of vulnerabilities. Can you describe the actual problem, here? Do you really want to arbitrarily inject code from a server you have no control over? If you DO have control over both servers, why not just set their document.domain value to be the same and ignore the whole cross site problems thing completely?

I'm just a code monkey. They want JSONP, I give them JSONP.
Logged

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4389 on: April 26, 2013, 02:55:10 pm »

Complex pathfinding shouldn't be necessary for boids. The nature of the swarm will flow over/around most barriers. You would only need pathfinding if they ended up in a dead end that was large enough to contain the entire swarm.

Yes, but if you have complicated geometry and multiple swarms it could be.  I was thinking about having a "Master Pather" for each swarm.  I also want them to be able to dynamically split up and reform, so I am having each boid handling it's own pathing, sort of.  If they bump into another boid with a better goal they use their path instead, if that makes sense.  That way a group can dynamically split up and reform based on shared goals, and the pathing can become more like "guidelines".

I haven't quite figured out the theory, and I am still playing with what works.  Hopefully I can get an algorithm that works.

And yeah I looked at flow field pathfinding.  I may end up implementing something like that, but hopefully not, since it seems more annoying to deal with.

I think you might be underestimating the emergent properties of the swarm. They will naturally split and merge depending on the weight and range properties that you give to the center seeking vector compared to the average motion vector and the distance keeping vector.

Yes, I have noticed that, but they don't actually have any goals, they would just kinda wonder aimlessly.  Playing with the weights is fun though, you can see all sorts of behavior.  Unless I don't understand what you are saying.  I am trying to add pathfinding and goal-seeking behavior in without breaking the natural swarming functionality, which is proving kind of annoying.

--

Can i be given a link to a reliable site based on teaching coding to beginner's?

There are literally hundreds of sites out there that do this.  What exactly did you want to learn?  You have to be a little more specific...
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #4390 on: April 26, 2013, 03:07:57 pm »

To add a simple "goal" add a weak motion vector that simply points towards that goal, the rest of swarming behavior will allow it to find a path around simple barriers between it and its goal, but in most cases the swarm or at least part of it will get there eventually.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4391 on: April 26, 2013, 04:12:55 pm »

To add a simple "goal" add a weak motion vector that simply points towards that goal, the rest of swarming behavior will allow it to find a path around simple barriers between it and its goal, but in most cases the swarm or at least part of it will get there eventually.

Which is sort of what I am doing.  Instead of pointing at the eventual goal however I am pointing ahead at some point of the patch, which would allow them to move around more complicated geometry.  Balancing the weights to get it all to work out is proving annoying though.  I need to change it so they use acceleration instead of just the calculated vectors each time so jitter and silliness is reduced.
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #4392 on: April 26, 2013, 04:31:44 pm »

How complex a geometry are they attempting to navigate? Flocks of birds do not typically live deep inside enclosed labyrinths they can't fly over.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4393 on: April 26, 2013, 04:35:40 pm »

How complex a geometry are they attempting to navigate? Flocks of birds do not typically live deep inside enclosed labyrinths they can't fly over.

Yeah, but I am just using the boid theory, it's actually being done on a 2d plane right now.  Think FPS with flocking enemies, is the general idea.
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4394 on: April 26, 2013, 05:27:15 pm »

How complex a geometry are they attempting to navigate? Flocks of birds do not typically live deep inside enclosed labyrinths they can't fly over.

Yeah, but I am just using the boid theory, it's actually being done on a 2d plane right now.  Think FPS with flocking enemies, is the general idea.
Zombie style enemies? You can make a graph of "scent nodes" across the map, populate them with the amount of protagonist's scent using diffusion along non-obstructed graph edges, and just nudge your boids to move in directions with positive scent gradients. That should give your boids enough info to always find you (this also works on non-discrete maps), all while completely avoiding any sort of precalculated pathfinding.
Logged
Pages: 1 ... 291 292 [293] 294 295 ... 796