« first day (621 days earlier)      last day (4400 days later) » 
00:00 - 22:0022:00 - 00:00

12:46 AM
whats the most logical way to loop from a x:y to get tiles around it
trying to make a loop that checks them all
 
for(x = curX - 1; x < curX + 1; x++) ?
Kinda... Trivial question no? :P
 
not sure u understood :P
a given tile will have 4 tiles adjacent ud have to alter x and y
 
You want to loop over 4 tiles? :P
 
no i need to check the 4 tiles touching the given tile im referring from
 
Which is... 4 tiles? :P
 
12:50 AM
yes
as im not including diagonal tiles at the moment
 
I think you're right, I don't understand. :P
 
lol :P
 
var tiles = new HashSet<Tile>(4);
tiles.Add(GetTile(x - 1, y)
tiles.Add(GetTile(x + 1, y)
tiles.Add(GetTile(x, y - 1)
tiles.Add(GetTile(x, y + 1)
foreach(var tile in tiles) { /* do stuff */ }
Better?
 
oh thats clever :P
 
12:53 AM
yes :P
 
1:10 AM
this look right so far ? paste.to/MzkxODE0
 
No clue. :P
Ask @John John.
 
@JohnMcDonald does this look right so far: paste.to/MzkxODE0
i think he's away so ill await his reply tomorrow :)
 
no, I'm here, but not for long
open is a 2D array?
It should be an array of tiles
So, 1D
 
im starting with a 1 tile sized building
to make life easier for me to build it
 
@Dave k, that's fine
 
1:20 AM
the two values are X:Y
path is an array of where path tiles are
 
Umm... well. The open list is a 1-dimensional list, it stores "tiles" and then the tile should know about its own coordinates
Or... I suppose you could make a list of points
But it's still only a 1D list
 
i thought open had to contain the building's tiles not the tiles "around it" as we discussed earlier
 
It does
 
thats what i done
 
here, I'll write out a bit of an example from the google doc
 
1:24 AM
the building is positioned at 10:10
 
Is that what you're trying to say by var open = [ 10,10 ]?
 
yeh thats basically [X,Y]
so open[0] and open[1]
or are u saying the array should hold 1010 so its only open[0]
 
Ok, ic. So yeah..., that should be a list of points that contains a single item
 
oh ok i can make it 1010
instead of 10 : 10
 
Well... I don't know how to make array in... this is javascript, right?
 
1:27 AM
yeh that is how u do the array with square brackets and comma seperated values
the issue is if i do 1010 how do i know its 10 : 10 and not 101:0
 
Ah, ok, well... you want (10,10) stored as a single value somehow
There's a point-type variable right? or maybe you can make one?
 
unless i do a multi dimensional array
so [0] = [x,y];
 
Here's a point class: upshots.org/javascript/javascript-point-class but yeah, I suppose you can use an array of arrays?
Like I mentioned, I only have a short time, so I've gtg
 
ok no worries :) bye
 
 
2 hours later…
3:03 AM
How unique is a GUID?
"128-bits is big enough and the generation algorithm is unique enough that if 1,000,000,000 GUIDs per second were generated for 1 year the probability of a duplicate would be only 50%. Or if every human on Earth generated 600,000,000 GUIDs there would only be a 50% probability of a duplicate."
That's pretty unique. :P
 
 
1 hour later…
4:07 AM
50% is a pretty big probability IMO
 
1,000,000,000 GUIDs per second is a lot of GUIDs... per second.
 
Good point
 
And that's for a whole year. :P
 
3.1536 × 10^16 for a year. :D
 
user4704
I saw a GUID collision once.
 
4:14 AM
hey
 
But you're like 800 years old @Josh, you don't count.
 
user4704
I'm not even THIRTY!
 
user4704
:(
 
That's 800 in some base
 
 
7 hours later…
11:34 AM
@JoshPetrie I was talking about non of those cases written there.
I was talking about the time, you are trying to implement a new feature,
but whatever you do, you can not make it bug free.
in these specific times, rewriting that specific feature could help you alot.
I'm not talking about anything like rewriting codebase, that's always something wrong.
 
11:50 AM
anyway I'm completely agreed with that article
 
 
3 hours later…
2:42 PM
@JoshPetrie Wow, that must have been an issue
 
2:58 PM
@tylerrrr07 And to put the 50% figure into perspective: you only need 23 people in a room to have a 50% chance that at least two of them will share a birthday: en.wikipedia.org/wiki/Birthday_problem
 
user4704
3:16 PM
@Gajet It is the same problem: "I don't know what is wrong, nuke it and start over," instead of discovering why you "cannot make it bug free."
 
user4704
It's lazy.
 
user4704
@JohnMcDonald It was hilarious. We're actually not sure if it was an true collision or not, or a bug elsewhere. The latter is honestly more likely, but there was not enough forensic information available to make a determination.
 
Hmm, interesting
 
4:09 PM
private void GenerateNoise()
{
Random randomGenerator;
randomGenerator = new Random();

for (int i = 0; i < 32; ++i)
{
perlinNoise[i] = randomGenerator.NextDouble();
}


}
:D
 
user4704
4:20 PM
Why recreate it every time?
 
user4704
Why use a hardcoded limit of 32? Why write to what is presumably a member variable instead of returning the results?
 
Sometimes, I paste code, just to get a o.O from other people :D
3
 
Lol
@JoshPetrie o: Good Suggestions, going to fix it right now
I believe I have to smooth the noise after I generate it?
o-o?
 
user4704
Depends what you are doing, but yeah probably that will be desireable
 
4:25 PM
Im trying to get Procedural Generation with 2D tiles O:
I think that's what its called :/
 
I did something similar for an artillery game a while back, I created a random height for the left-most column, then generated a +/- random number and added that to the previous column all the way across. Then I applied a simple smoothing algorithm, and voila! Some reasonable terrain
 
Unlike unreasonable terrain, which simply will not negotiate.
 
Well... unreasonable terrain can't be negotiated
 
4:52 PM
hey guys
 
hows u
 
U's fine and curvy
V hates him, though
 
lol
 
5:00 PM
Lol
Working on Procedural Generation with tiles, and making a Tile Selector
 
im working on pathfinding
 
o: Sounds hard.
 
yeh i dont get it at all
 
Which algorithm are you using?
 
a*
 
5:04 PM
A*?
 
i get the logic of it all
but to code it - not so much
 
Step 1: The first thing you should notice is that we have divided our search area into a square grid. Simplifying the search area, as we have done here, is the first step in pathfinding. This particular method reduces our search area to a simple two dimensional array. ???
 
wat?
 
Okay, I just snagged that from the article I sent you above lol. They are telling you to make your world/area/game whatever, into some sort of grid.
 
well of course its a grid lol
 
5:09 PM
Lol, I mean like the first image in the article
(btw I have to go soon o:)
 
thats only for explaining the algorithm i get how the algorithm works
 
Lol, maybe I completely misunderstood you. Anyway, I have to go lol
I don't know if you've asked a question on GD.SE, but if you do so, you'll probably get a better answer on how to implement it :)
 
6:13 PM
@JoshPetrie I know, but there is just two big differences.
when first of all when you are implementing a new feature, you don't have anything. so by recoding that feature you don't loose anything.
and two, there is a high chance (at least for me) to do it right the second time. if I spend 1 hour implementing something, and then after 6 hours debuging it still doesn't work, I prefer to rewrite that code (which will take less than one hour) and check if I can do it correctly this time.
refractoring doesn't even mean anything in this case, since you don't have anything solid to work on and make it work better.
 
i finished my path finder
doesn't work tho :P
 
:D
what's the problem now?
 
doesn't find the path xD
 
what language?
 
user4704
@Gajet You are entirely missing the point.
 
6:27 PM
Javascript @Gajet
 
I think you are the one missing my point
@Dave that makes debugging tricky, but post it anyway, I'll try.
@JoshPetrie or maybe I am?
 
@Gajet yes it is bad language for debug : paste.to/MzkyODQ1
 
I think the problem is we are talking about two different situations, which need different solving methods
@Dave what is sdata up there?
I know it's test data, but what does every cell mean?
now I get it
 
it contains location of buildings + walkable tiles
tho i only load the walkable tiles from it in the function
 
and what should sortByF do?
it doesn't seem like any sorting method
 
6:32 PM
no idea i got that function from the jsfiddle
i think it orders lowest to highest in cost
thus returning the shortest method
 
and why do you keep all values as strings in that list?
 
in sdata?
 
yep
 
its the default action when u create it in PHP and json_encode
its how php and js communicate
 
and in sdata what does the third value mean?
I mean first it's x, then y, and what is the third part
 
6:39 PM
that is an array of data related to that tile
realted to what image to load etc - not really related to path finding
 
Hello World
 
hey
 
Hmm.. didn't expect this to work. I got a message I required at least 20 karma to be able to join the chat.
 
karma ?
u got 26 rep
 
Reputation.. ^^ And I didn't consider global rep. Neat
 
6:47 PM
@Dave not a thing that matters very much but I think you made a mistake between lines 118 and 133
just this should be enough
I mean line 123 is not needed
 
true - it is a bit inefficiently written but ill neaten that up once it works
 
user4704
@Gajet If you have code to rewrite you perforce have code to refactor -- the code's age is irrelevant. The important distinction is that refactoring involves thinking about the problem and why it doesn't work. The distinction is only immaterial when you're talking about a trivial amount of code.
 
user4704
"Rewriting" in this context is just blowing it away without considering the problem.
 
user4704
Which is ignorant.
 
that's not the age I'm talking about.
I'm talking about a code which never worked before.
 
user4704
6:49 PM
Doesn't matter.
 
user4704
The important part is to understand the problem and why it does not work.
 
user4704
Saying to yourself, "it doesn't work, oh well, delete!" is naive.
 
sometimes, understanding the problem take much more time than just simply rewriting the code.
 
user4704
...
 
user4704
I am clearly wasting my time.
 
6:51 PM
:(
 
I'm putting a lot of energy into refactoring over rewriting lately.
I'm a big fan of rewriting, but I'm starting to see why refactoring is much better.
I'm starting to understand my issues better.
 
@JoshPetrie I feel bad when someone says something like that ...
 
any xna love here?
 
user4704
6:52 PM
Nobody loves XNA, not even microsoft.
 
user4704
But, lots of people answer questions on it at the main site.
 
let me throw myself into that darkest corner
-_-
 
Also, Josh Josh is an XNA MVP ;)
 
how do you earn a XNA MVP?
 
6:53 PM
maybe I'm too much in competitive method
 
answering a lot of apphub questions?
 
Josh Josh does it by being almost 800 years old and as we all know, the elders are the MVP of communities.
 
I can see why you insist on refractoring, and believe me that's what I do most of the time.
 
user4704
Why do you keep doubling up my name? :D
 
I like the sound of it.
Josh Josh
Like @John John
 
6:55 PM
John John?
 
user4704
@thelinuxlich It's awarded to people who are valuable to the relevant developer community.
 
I'm damaged by Death Valley.
 
user4704
I actually don't use XNA much; but the MVP area is DirectX/XNA. I got it for SlimDX.
 
the same way john is pronounced, means "dear" in persion
 
@JohnMcDonald i made my function :)
 
6:55 PM
oh cool!
 
@Dave Yeah, I saw
 
user4704
Usually you are recommended by somebody, another MVP or somebody internally to MS, and the relevant team at MS votes and such.
 
so john john, basically means "dear john" in persion
 
user4704
It's magic.
 
did you take a look at my paste to ?
 
6:56 PM
I have it open, but haven't read it
 
ok if you take a read let me know cos at the moment its not giving a path return
 
I can remember for a long time I had problem when in one of cartoons a certain person called his uncle "uncle john",
 
It's like an inception name
John John -> Dear John -> Dear Dear -> John Dear
 
I was wondering if he meant "dear uncle" or his uncles name was john!
 
what on earth you blabbering about
 
6:57 PM
Congratulations on your MVP, Jpetrie!
Last Updated: April 01, 2012, though
 
emmm
 
I dub thee, "Tractor @John"
 
@WilliamMindWorXMariager "deere" (with the pronunciation I think it has) means "it's late"
 
John Deere is a brand of tractors. :D
 
6:59 PM
now back to dave's code
 
:P
 
@josh just talking about my experience there are some certain rare times, when I recode something, and it starts to work. later I see the problem was with just a single line of code, or just a single extra semicolon which I didn't see while refractoring and/or debuging.
 
user4704
@Raven Yeah I changed my picture then.
 
user4704
I am thinking about trying a command-line mail client, like mutt or pine. I wonder how well they work with Outlook.
 
does any one still use outlook
 
user4704
7:03 PM
Oh yes. Lots of companies use it.
 
user4704
It's not like there are lots of alternatives.
 
what is the difference between SlimDX and SharpDX?
 
at least my father still uses it
 
user4704
Thunderbird sucks just as bad
 
user4704
7:04 PM
@thelinuxlich SlimDX is older; SharpDX is newer. They're functionally about the same.
 
user4704
Most of SharpDX is generated code though. It also violates the GPL. So that's a thing.
 
@dave is there any way i can test that piece of code?
 
@thelinuxlich, SharpDX appears to have a bit more work done on the crossplatform side of things. That is, SharpDX is tested and works in WINE emulation.
 
from what I can see it doesn't have any problem I can point to.
 
user4704
I have an extremely biased and negative opinion of the author so I will refrain from further comment.
 
7:05 PM
@Josh, Sound like a good decision. ;)
 
it violates GPL?
 
@Gajet not really =/ unless im not suppose to console.log the data variable
 
I saw a blind benchmark weeks ago which shows SharpDX performing better than SlimDX
 
user4704
@thelinuxlich Last time I checked, yes. The repository contains a distribution of gcc-xml without source.
 
there was also tests with Mono
 
7:06 PM
@Gajet I've started to fiddle on jsfiddle: jsfiddle.net/4HEz3 @Dave
 
consider that I have npp+chrome+IE+firefox isntalled on my system
 
*were
 
user4704
@thelinuxlich It does, technically, but in practice it doesn't matter.
 
no?
why performance doesn't matter?
 
user4704
The benchmarks are measuring the interop overhead of what amounts to a handful of IL calls. He builds them by calling the same function millions of times.
 
user4704
7:07 PM
Though technically accurate, they are not too relevant to practical use. If you really care about the interop performance you'll use a custom solution that interops at a higher level.
 
i noticed console.log(data) straight after the loops are only showing []
so data is emtpy =/
 
user4704
Direct wrappers like SlimDX and SharpDX incur a very high transition cost because each method call transitions across the managed/native boundary
 
ah okay
 
If you care about interop performance, you'd just do a CLR project and make advanced wrappers suitable for what you need.
 
user4704
P/Invoke is fast enough
 
7:08 PM
is there any Mono support on SlimDX roadmap?
 
user4704
No.
 
user4704
SlimDX would have to be rewritten to do so (v2.0)
 
user4704
Because mono does not support C++/CLI
 
user4704
Microsoft's shift in DirectX strategy (basically relegating it to a "we don't care" position by rolling it into the Windows SDK) make that an unattractive option right now.
 
user4704
7:09 PM
I'm not actually involved in SlimDX's development any longer.
 
user4704
Or at least, only in a consulting position
 
so I guess Monogame team will use SharpDX to get WinRT support
 
user4704
(I have no interest in the future of Windows)
 
ever the optimist :P
 
Josh Josh is an angry senile old man, half the time he doesn't even know he's talking.
But we still love him.
 
user4704
7:14 PM
I'm not senile. The rest is probably accurate though.
 
Yeah... 800 years is old...
 
thank you Josh Josh
 
user4704
Stop calling me that :P
2
 
@dave it seems you neighbor finding function is buggy
 
how so
 
7:15 PM
after putting lots of debug data :
after running get neighbors for (10, 10)
it returns an empty array
 
according to that
its cos data is empty
 
@Dave, I do believe either your set-up loop is wrong, or the data arrays you have at the top are wrong: jsfiddle.net/4HEz3/9
 
the data array at the top is correct cos thats json from my database
i already draw with that
 
k, then the set up loop is wrong
 
the x in sdata loop?
 
7:21 PM
now I'm thinking if it's because you have string values in sdata, while you are checking if there is an integer value inside it
 
yeh i changed it to == '22'
but no change
@JohnMcDonald is your loop in your jsfiddle the same as mine o_0
 
Of course it's the same loop. I'm just adding debug statements, as you should be. Here's an update: jsfiddle.net/4HEz3/16
 
now I'm having some trouble
 
(and I clicked the little "Tidy Up" button to make it nicer to read)
 
I've added this line at beginning of find neighbor function document.write("data has " + data.length + " enteries<br>");
and it prints "data has 0 enteries"
 
7:23 PM
not sure i understand why sdata[X][Y][2] is showing the number 2
 
It's a 0-based index
 
found the first bug (or at least I think I did) var neighbors = getNeighbors(data, curNode);
is missing an s! it should be sdata
 
u ain't changed sdata have u john ?
 
No, it's only been formatted nicely
 
oh shit hang on
 
7:26 PM
You're getting those values back because JavaScript uses 0-based indexes
 
there is also another bug
 
yeh i was meant to check position [1] not [2]
its getting close to working now :P
do tell @Gajet?
 
return value for find neighbors is not a node
so you can not simply use var neighbor = neighbors[i];
I think there is a major flaw in you implementation there
 
hold ill check that in a moment
just checking sumin in the loop
im not sure why.. but it stops looping once it finds a walking tile =/
 
yeah, I noticed that too. Figure out what it does in that if-statement that causes it to crash.
May I ask why you chose javascript for this?
 
7:34 PM
the entire game is javascript
 
seems logical to me
 
Well... what I'm getting at is that debugging, among other things, are much more difficult in JS than other languages
 
@Josh, what OS are you on these days then?
 
yeh @JohnMcDonald i know :P but as its a browser based game i wanted to use js
 
Your funeral
 
7:37 PM
lol not really
 
I'm not sure why there isn't a decent debugger for such a highly used interpreted language.
 
Well.. I think you can debug it if you use something like FireBug
 
yeh browsers have debug tools
but this aint a syntax issue its logic
 
Well... that's what debuggers are best at finding
 
With firebug and chrome inspector you can step through code.
 
7:39 PM
where is inspector
on chrome
 
right click, inspect.
 
that shows html elements
 
user4704
@Noctrine Still Windows (7) at work.
 
user4704
I do almost everything on my Mac at home though.
 
user4704
I have a box with W8 on it and I hates it :D
 
7:41 PM
The brief time I spent interacting with W8 definitely made me lose concern over the future of windows.
 
ill ask on js overflow about the loop issue
 
user4704
I intend to do most of my hobby development on the Mac though
 
@Dave I know what the problem is, but I wanted you to think about what the problem was before just telling you
 
well i thought document.write aborts the loop
but its not the case
 
No
Here's a hint: What is data?
 
7:43 PM
an array set prior to the loop : var data = [];
 
Well, what's data[x][y] then?
 
thats creating data[x][y] with the value of something
 
I've grown more accustomed to Win8 after using WP7. I'm loving tiles. :P
 
Does javascript just create a second array and a variable named g in the following statement? data[x][y].g = 0;
 
yeah it would
 
7:46 PM
Can it go from
`var data = [];`
to
`data[x][y].g = 0;`
with no errors? because I think that's what's causing the crash
Boom, it crashes right on this line: data[x][y].g = 0;
 
hmm let me try declaring prior then
 
var data = [];
data[x] = [];
//data[x][y] = 0; // works
data[x][y].g = 0; // fail
 
hmm i could change it to data[x][y][0]
 
Names are better if you can find a way to use objects or variables
 
got that part fixed
 
8:06 PM
Well that's good
 
yup
jsfiddle is actually quite useful for debugging compared to using browser
 
8:57 PM
Hi guys
 
@dave is there any way to print an object as JSON?
 
umm
yeh just write it to document
like my sdata
 
it prints something like :",,,,,,,,,,,,,,,,,,,,,[object Object],[object Object],[object Object]"
I don't think that's JSON
 
console.log(obj)
or what ever the name is
will show its inner stuff
if u want it to show in html etc u have to loop the data with a function
 
9:52 PM
@dave what do you think about this NULL values :jsfiddle.net/4HEz3/36
 
as in why is it happening
 
it's still not running correctly right?
 
u have to do
neighour[x]
no wait
x is number so u have to know the key so neighbour[key]
 
i've added x and y values for each data cell
but now I'm wondering what "type" suppose to mean?
 
00:00 - 22:0022:00 - 00:00

« first day (621 days earlier)      last day (4400 days later) »