« first day (1344 days earlier)      last day (3973 days later) » 

Jon
Jon
13:39
Anyone know how to "Square out" a pathfinder?
@Jon I know how to cut grilled cheese into squares
square out?
Jon
Jon
like for example.. my a* implementation is too good... i'd rather have it focus more on going one direction, then the other
instead of switching back and forth from right, up like above.
so, left-left-left-left-left-up-up-up-up-up?
Jon
Jon
13:45
essentially.
not sure how this would fit in your case but:
The Bresenham line algorithm is an algorithm which determines which points in an n-dimensional raster should be plotted in order to form a close approximation to a straight line between two given points. It is commonly used to draw lines on a computer screen, as it uses only integer addition, subtraction and bit shifting, all of which are very cheap operations in standard computer architectures. It is one of the earliest algorithms developed in the field of computer graphics. A minor extension to the original algorithm also deals with drawing circles. While algorithms such as Wu's algori...
Jon
Jon
naw..
I would need some form of pathfinder, that prefers straight routes.
since you're A*-ing I guess you have obstacles
if I were to try to do what you wanted, for a first draft I would:
1) Enclose found path in a rectangle.
2) Try to go to the right/left until reached the corner of the rectangle or an obstacle.
3) Avoid the obstacle.
4) Repeat.
Jon
Jon
13:51
Yeah...
A* is probably not the solution here
There's also non A* algorithms that avoid it
i think A* will work fine
@Jon why not?
add some kind of heurestic that makes going in the same direction cheaper than changing direction
maybe lol
Jon
Jon
Well.. Yeah.. kinda defeats the purpose of A* lol
13:53
what Mick sorta makes more sense
Jon
Jon
But yeah, I would have to create a separate implementation of A* just for this
well tbh you're not really asking for the shortest path anymore
so you defeat the purpose of most pathfinding algorithms in their standard form
@KevinvanderVelden that's what he doesn't need
OOh! I found the pathfinder algorithm I was gonna recommend: aigamedev.com/open/tutorials/theta-star-any-angle-paths
@AlexM. hmm true bleh
Misread
I thought he wanted to make it smoother
Jon
Jon
14:01
ok... so maybe I don't need to use pathfinding here
its a start i guess
Wait, you're going from the center of each black thing to another black thing only?
Then just create a simple graph and A* it
Jon
Jon
at the moment yeah
i just dropped the A*
Use Manhattan distance heuristics rather then euclidean
Jon
Jon
I'm not seeing your vision
@Jon well jeah, A* over the 2D map pixel for pixel, I'm saying create a graph with vertices for each black point and edges to each other black point
Jon
Jon
@KevinvanderVelden I already did this
The issue is A* is too direct
Ends up with pathing that is too unpredictable
From the looks of it you did it over the pixel/tile map, correct?
Jon
Jon
No..its a dungeon data map
the pixels are just drawn after the fact for debugging
Then I don't understand what you're doing currently
Jon
Jon
lol.. well if I run A*, I get this
14:17
@KevinvanderVelden instead of a straight line towards the target he wants detours
@Jon and what I'm saying is you don't "just" run A*, A* is an algorithm that works on a graph, how are you constructing the graph?
Jon
Jon
Right. Instead of A* pathing, I want a more straight instead of direct path
user92578
Hey there!
Hey
Or if you don't know what the graph is then I already know the answer
14:19
path = block1pos - block2pos;
for(int x = 0; x < path.x; x++) { // horizontal line }
for(int y = 0; y < path.y; y++) { // vertical line }
like that maybe?
Jon
Jon
Dropped a*, but now the pathing doesn't care if there is a room in the way... which I guess is fine.
I'll go with this for now
and most likely refine it further as I go along
you'll end up writing your own pathfinding algorithm that way :D
and then on each dot test if it's inside another block, and if it is then take some other path (vertical line before horizontal)
@ShotgunNinja 23-2-11 cait, team got 47 kills last night. :D
user92578
@Pip I'd like to test Malware Tycoon!
14:25
I'd like to test my Malware!
Oh wait, we were talking about something different
user92578
lol
user92578
I'd actually really like to try hacking or something :)
oo evil hacking
user92578
or just write a bot that spams my friend's emails :DDDDD
why use bot, when you can use botnets
it's more efficient
user92578
14:28
But, my codes can't use networking
user92578
at all
user92578
so nothing works
user92578
firewall blocks it
user92578
and I don't have the password to allow it
user92578
maybe I need to hack the firewall first
14:28
yes, the software ones are quite easy
user92578
really? well I've heard that the Window's firewall isn't good at all...
well just bombard it with packets until it stops responding and windows kills it
the downside is that windows most likely will kill your app bombarding the firewall first
user92578
the bad thing is that I'll probably break something...
the solution to that is figuring out what causes the firewall to "think" really hard
hand craft a dirty packet that will choke it as hard as possible, then spam it with that, standard DoS attack
user92578
and bam I've killed my firewall and now all the other malware can infect my computer
user92578
14:32
lol
oh yes
but you have unrestricted access to the network!
@Tyyppi_77 do you have a router? Then you're still 99% safe
user92578
not sure at all
That's why people who know about shit uses linux
@Tyyppi_77 what's your ip address?
user92578
localhost
14:34
open cmd and type in ipconfig and you should see it
user92578
it's localhost
@Tyyppi_77 -____-
localhost isn't ip address, it's hostname
if the ip address starts with 192.168 or 10.0 or... uhh.. what was the third one? then you wil be behind a NAT box
or router
user92578
it starts with 192.168
then you are most likely safe without the software firewall, which is blocking only traffic going outside
14:38
@Almo Nice!
:)
lulu support is pretty awesome
also learning each shot to shoot at the target most likely to die
that means switching target as the enemy adc/support shift position
just keeping target on the adc often means the support sets up to kill you
well yeah
establish a line.
anyone who crosses that line gets fucked with.
:D
what you think of GA as last item
I checked a pro build, and they seem to use it
(/ .□.)\ ︵╰(゜Д゜)╯︵ /(.□. )
fyeah
user92578
to be honest, I don't know anything about networking
user92578
14:47
maybe I should learn some
user92578
code a network simulation since I can't actually network
list comprehensions in python are pretty neat
user92578
yeah
self.tiles = []
for i in range(n):
	self.tiles[i] = []
	for j in range(m):
		self.tiles[i][j] = 0
user92578
they are some awesome
14:48
becomes self.tiles = [ [0 for x in range(m)] for i in range(n) ]
thats..uhh.. unreadable
not really
yeah well might be because I don't know python
it's really just mathematical notation
v = [ x for x in range(3) ]
gets you [0, 1, 2]
it's equivalent to V = { X | X in [0, 3) }
need a free flowchart tool? yworks.com/en/products_yed_about.html
really works well
Jon
Jon
14:54
not so damn bad for an hours worth of work if i do say so myself
@Jon :o that looks sweet!
:D
only complaint: the double corridors. fucking great for one hour.
Jon
Jon
Custom pathfinder a la jon
I kinda like the double corridors, ehehe
ah! even more win then
:)
Jon
Jon
super fast generator if anyone wants it, lol
Jon
Jon
maybe i'll make a blog post about this dungeon generator, since everyone else has one
:D
@Jon Make a gif showing how it works
like that
Jon
Jon
can't see that image
blocked?
Jon
Jon
15:00
yeah hold on i'll use the other network
oh
yeah
that gif is awesome
There, that should work on both now
I fucking relied on my text editor to keep 2 version of my code in memory
Everything was going smooth, until I ran the god damn buffer out
Now I wrote what I thought was the same code, but it's got the original error that I fixed in the undo buffer ;(
sounds like you need to write a new text editor that won't fuck that up.
:D
Jon
Jon
That is a very intelligent level generator
I need spacing between rooms, so it wouldn't work for me
Jon
Jon
my algorithm is pretty simple and dumb
1. Define an area.
2. Generate random rectangles inside area.
3. Connect Rectangles
Seems to work!
Jon
Jon
Rectangles are checked for collisions, and discarded if hit
When generating rectangles, I have
if (count > RoomCount * 3)
                    break;
blank stare
Jon
Jon
Yeah.. I don't know how to stop it if there is too many rooms
and it goes in infinite loop
15:09
eeeeewww break statements D:
cap the room count to like 20 or something?
Jon
Jon
Yeah, I have a room cap. works fine
ie. RoomCount
if I loop over 3X the roomcount, I stop trying
what's wrong with break
Jon
Jon
it breaks out of the for loop
I use breaks when they are useful.
and save time
@Almo just that approaching the problem a little differently to avoid using break will (almost) always result in cleaner code and easier to follow logic.
Jon
Jon
15:11
I think the issue with people saying break; is bad, is because they were told it is bad
Jon
Jon
I posted this code because I don't think it is optimal.
though gnome is not necessarily doing that
it's bad in the same way goto statements are bad. it's just the degree is less.
@Almo I just linked to a gif.
I have no idea what they did.
15:13
I meant that you weren't "saying break; is bad, is because they were told it is bad"
I think any coding construct can be bad
necessarily
that was me, not gnome
anyway I didn't mean to derail the conversation. it was just a side comment.
NO! I must defend the honor of the break verb!
15:15
I'm joking but I do think it actually really helps readability in some situations
I for one am a great fan of break statements... especially in switch statements
Jon
Jon
ok
i was looking for an example, and found one
well yeah switch statements kind of require them, lol
Not necessarily
fall through switches is seen frequently
usually
Jon
Jon
15:16
bool validated = true;
foreach (Room room in Rooms)
{
	if (room.CollisionRectangle.Intersects(r))
	{
		validated = false;
		break;
	}
}
they are questionably reliable though
Jon
Jon
what would you do with this, code review time.
what is r ?
Indeed
Jon
Jon
a rectangle
15:17
@IcyDefiance that's kinda the joke =p
Also, validated is somewhat vague, though a lesser issue
It seems too clear and simple to be wrong :P
Shattered Planet's ready for your Android explorations! Get downloading! https://play.google.com/store/apps/details?id=com.kitfox.shatteredplanet http://t.co/STKHX85VwH
woo
Jon
Jon
I think it is a fine use of a break;
but with that said, some kind of BVH would probably be easy as hell to implement
15:19
if you REALLY wanted to, you could restructure it to eliminate a conditional check. by using a regular for loop that checks validated as its conditional, and the loop itself would use the results of the intersection test to set validated
Thats just unnecessary though
and less obvious
So you should probably not do that
@Jon it is
for (int i = 0; i < Rooms.Count && validated; i++)
    if (Rooms[i].CollisionRectangle.Intersects(r))
        validated = false;
don't do that
user4704
That's basically a break, but in a less common style.
Jon
Jon
15:20
that would also work
Dont even need to do the if check for the intersection, could just assign validated to the inverse of the intersection test
@JoshPetrie yeah you're right. I'm not entirely serious about that solution, though I have used it before when I felt lazy.
:D
user4704
Rewriting that as a while loop would read in a more expected fashion.
good idea
Jon
Jon
15:21
interesting
@IcyDefiance at least add the brackets, as jon seems to already do
no offense, but removing brackets to make the LOC smaller is what I call the idiot's refactor
nah in that case I'd remove them because I think it looks better.
int i = 0;
while (i < Rooms.Count && validated)
{
    if (Rooms[i].CollisionRectangle.Intersects(r))
    {
        validated = false;
    }

    i++;
}
I hope you at least have the decency to add them if the previous programmer added them in the module you're working with
oh yeah. consistency is good.
Jon
Jon
looks good to me
15:24
actually I still like the for loop better than the while loop here, because the scope of i is limited.
Jon
Jon
Yeah, I prefer the for loop also
easier to read in my opinion
I think breaks are fine in a lot of cases, and improve both the code's layout and its ease of understanding
Jon
Jon
Also, if you are using VBA for certain things, especially in Excel, breaks are pretty crucial (or exits)
I still think the foreach was the cleanest
I always do this
public void Update()
{
	if (condition)
	{
		return;
	}
	rest of the update logic;
}
when update needs to be stopped on a particular condition
15:27
@Jon but then, you shouldn't be using VBA for anything so that really isn't an argument either way
Jon
Jon
I do a lot of if (condition) return; in functions
not sure if that is bad, but I love doing it
it's readable to me
user4704
It's fine.
Lol oh come on it's not bad, there needs to be a reason for it to be bad
and it's readable to any programmer who wrote more than 20 lines of code
user4704
15:28
Very old-school programmers will frown upon having multiple-exits.
that embed-valid-condition-in-for and whatever
user4704
But that's largely a perspective developed from extensive years of C.
is just academic bullshit
that is pointless
Very old-school programmers are outdated and irrelevant like the betamax tape compared to the DVD
Still complaining about VHS
the first version was perfectly understandable
I don't even understand why you brought it up
15:29
Old-school programmers bring a perspective to development that new programmers lack
2
@Evan but since new programmers are just fine
I have found some of my favorite programming books are "old and busted"
it must mean the perspective isn't really all that useful?
@Evan Not always, I've actually run into the problem of the majority of them believing this is the case but then not actually delivering on the fresh perspective
15:30
yeah that I do as well, even though I'm told many times that multiple-exits is bad, because the alternative is often something like
if (!condition && !condition && !condition && !condition && !condition && !condition)
{
//logic
}

return;
Okay, well I guess your mileage may vary :P
I've never not had an old-school programmer complain about efficiency to me
My results with old-school programmers has been good.
bah damn formatting
I bet an oldschool programmer with his perspective would do wonders with HTML5
Jon
Jon
15:31
LOL, oh well... some older programmers here tell the juniors to not use newer libraries, because they don't understand them.
linq, regular expressions
There are exceptions to everything
user4704
That just means they are bad programmers.
BUT! Despite each one complaining about efficiency, my efficiency has never been below that of their on the same problem
Jon
Jon
I don't work with them, so I don't have to deal with that :)
user4704
Programmers from an older generation are not good programmers by virtue of their age, after all.
15:32
I've had these old guys so sure that they are better, that they stir up management to do a performance shootout between our implementations
@Jon both of those are incredibly useful, but also incredibly overused. like here: stackoverflow.com/questions/1732348/…
I've never, ever lost one of these, and statistically, the more sure someone is that their code is better than mine, the slower their code runs relatively
Also these old guys hated HTML5 because "Javascript is too slow and bullshit"
I guess somehow it's more efficient to have the server sort a page, and then re-load the entire page
Sorry for the rant, I just write off "old school" as retarded these days, because every time I learn the latest thing with coding, it's better than the last thing
@JoshPetrie yay, someone got it
@IcyDefiance aah good, I was gonna look for the ZALGO reply but that was this question :)
the whole discussion is aimed at the wrong target
programming is about the technology
and each substantially different technology requires a substantially different perspective
if you are not capable of grasping that perspective, you're just a bad programmer
regardless of your age
and should switch to a different tech
BUT
15:36
Well, there certainly is an interesting collection of perspectives here.
if I were to choose between an oldie and a newbie if it were about learning a new technology
I'd choose the newbie because he'd be less likely to try to do FORTRAN in JavaScript
I appreciate experience, but it usually comes with ego
Jon
Jon
and more likely to be cooler to hang around with
letting go of what we know is something we do more and more difficult the more we learn
Lots of ego flexing going on in here today :P
15:38
and to fully understand and learn new things, you have to stop trying to apply the things you know with them
Jon
Jon
^
As a 43-year-old programmer who doesn't exhibit the behaviors listed above, I resent being lumped in with bad programmers who fail to learn new things.
it's okay almo
I know you're not like that and I do love you <3
Jon
Jon
We need a @Almo appreciation day
A day for programmers over 40 that have kept with the times, to be celebrated.
And as well, a reminder to the "others" to get out of their way.
@Jon Could involve branding irons?
Old people love branding irons and cows n' shit
Jon
Jon
15:42
hmmm... that would be a tough sell
I guess, most of the things I come up with are a tough sell
there has to be a situation here on chat where this would fit
Jon
Jon
lol, a guy wondering why his 1920x21600 image won't draw in monogame spritebatch
branding irons are okay, but those electric cattle prods are much more fun
15:43
they don't need to be heated up first, so you don't have to give any advance warning
I'd personally appreciate if everyone were fitted (from birth) with government sponsored shock collars that punish you for being objectively wrong or willfully ignorant
I'd hack it to punish you daily :D
or for avoiding NSA spying or saying anything bad about the president, any republican congressmen, or god
@AlexM. I'll keep it in mind for when the next random flag comes in on the bridge :)
@IcyDefiance or for thinking of a way to escape the shock collar
15:44
right
@IcyDefiance but a nice hot branding iron can also be used as mood lighting
for a little while, but it requires recharging
I think that's part of the nostalgia
It's slow and inconvenient
nostalgia is fine and all, but not many people can appreciate nostalgia without the inconveniences removed. the best is when you can make the audience aware of the inconvenience that used to exist, without actually forcing them to put up with that inconvenience.
well damn, getting all programmer on that shit
don't you know people like to complain about being programmed even though they love it?
Nullsoft Install System Firmware?
pc master race
console peasants gtfo

« first day (1344 days earlier)      last day (3973 days later) »