[QUOTE=sarge997;48837504]Was working on texture painting my knife model, worked on it for over an hour, was almost done.. [I]Then Blender crashed on me..[/I] :v:
I guess I'll have to try again, and make it better. So learn from my experience, and [I]SAVE OFTEN[/I].
Here's the untextured, boring looking knife.
[IMG_Thumb]http://i.imgur.com/JETDhoI.png[/IMG_Thumb][/QUOTE]
How do you not spam ctrl-s every time you do anything in life?
[QUOTE=Darwin226;48838578]How do you not spam ctrl-s in every time you do anything in life?[/QUOTE]
To be fair, in Blender you have to press an extra button. It's actually Ctrl+S, then LMB or Enter.
Recoding my GUI framework in DX for overlay
[IMG]https://dl.dropboxusercontent.com/u/10798900/staging/store/push/2015-10-06_16-40-42.gif[/IMG]
[QUOTE=Doritos_Man;48838341]For all of you in Uni/College, how math heavy is your Computer Science degree?
My Comp Sci degree plan puts me one senior level class away from getting my math minor. I'm just so tired of math though.[/QUOTE]
At least somewhat I'd say. About half of my current courses are maths or very mathy, but I just started out.
[code] static mean(points: google.maps.LatLng[]): google.maps.LatLng {
function add(l: google.maps.LatLng, r: google.maps.LatLng) {
return new google.maps.LatLng(l.lat() + r.lat(), l.lng() + r.lng());
}
const sum = points.reduce(add);
return new google.maps.LatLng(sum.lat() / points.length, sum.lng() / points.length);
}[/code]
Find the bug.
[QUOTE=Darwin226;48839177][code] static mean(points: google.maps.LatLng[]): google.maps.LatLng {
function add(l: google.maps.LatLng, r: google.maps.LatLng) {
return new google.maps.LatLng(l.lat() + r.lat(), l.lng() + r.lng());
}
const sum = points.reduce(add);
return new google.maps.LatLng(sum.lat() / points.length, sum.lng() / points.length);
}[/code]
Find the bug.[/QUOTE]
Pretty sure this doesn't work properly due to spherical projection alone, at least over wider ranges and near the poles.
Additionally it will give strange results across poles and longitudes across 0°.
You could probably most quickly do this operation with normals in Cartesian coordinates, unless there's an easier way I don't know about.
[editline]6th October 2015[/editline]
As an aside, which language is that? It looks like something between JS and C++.
[editline]edit[/editline] Nevermind, [URL="http://pastebin.com/C06Q9gKq"]seems like it's in "TypoScript"[/URL] :v:
Did they remove auto merge? :v:
[editline].[/editline]
Oh nvm, it merged now, weird. I must've refreshed at the same time you posted.
[QUOTE=Tamschi;48839196]Pretty sure this doesn't work properly due to spherical projection alone, at least over wider ranges and near the poles.
Additionally it will give strange results across poles and longitudes across 0°.
You could probably most quickly do this operation with normals in Cartesian coordinates, unless there's an easier way I don't know about.
[editline]6th October 2015[/editline]
As an aside, which language is that? It looks like something between JS and C++.[/QUOTE]
Well, looking for a mean on wider ranges doesn't really make sense anyways so this is fine for my purposes, but this wasn't the case here. All the points were in a 200km range in Europe.
The problem is that the sum keeps making LatLng objects which are a bit smarter than normal vectors so when I expected large numbers, I got small ones because it wrapped around the Earth.
Very very sneaky.
It's TypeScript btw.
[QUOTE=Tamschi;48839196]As an aside, which language is that? It looks like something between JS and C++.[/QUOTE]
Looks like TypeScript?
[QUOTE=Darwin226;48836761]I wrote a solver for that sliding numbers puzzle thing [url]https://gist.github.com/130260e97c3d60572280[/url]
I'm amazingly pleased with how well it works. It solves anything in the 4x4 category on this site [url]http://mypuzzle.org/sliding[/url] in a second or two.
It uses a heuristic to narrow down the search and I can't say for sure how far it is from actually optimal solutions but it definitely seems close.
What I like about the solution is that it separates the generation of the solution space and it's traversal. First I generate an infinite tree of possible moves, simply relying on lazyness to not generate unvisited nodes, then I traverse it with some priority queue.[/QUOTE]
As long as you don't use specific rules to skip ahead more quickly, this seems like a problem generic A* should be able to do well.
Your algorithm is pretty close to that anyway, if I'm not mistaken, except for that division by two [URL="https://gist.github.com/LukaHorvat/130260e97c3d60572280/291f1bad49794cc29a41ce5be908fe32bb5c5d5f#file-sliderpuzzle-hs-L90"]here[/URL] which seems to result in different scales for the heuristic and path taken.
[editline]edit[/editline]
That said, I'm inferring this from fairly small parts of your code because I can't read it well enough to be sure what every part does.
[editline]edit[/editline]
The /2 is because the empty tile is present as tile for the distance, right?
In that case I think your solution may in fact be A* already.
[QUOTE=Tamschi;48839257]As long as you don't use specific rules to skip ahead more quickly, this seems like a problem generic A* should be able to do well.
Your algorithm is pretty close to that anyway, if I'm not mistaken, except for that division by two [URL="https://gist.github.com/LukaHorvat/130260e97c3d60572280/291f1bad49794cc29a41ce5be908fe32bb5c5d5f#file-sliderpuzzle-hs-L90"]here[/URL] which seems to result in different scales for the heuristic and path taken.
[editline]edit[/editline]
That said, I'm inferring this from fairly small parts of your code because I can't read it well enough to be sure what every part does.[/QUOTE]
This is A*. At least what I call A* :D
My definition of A* was always "Dijkstra + Heuristic" which is what this is. As far as the division by 2, it's a tradeoff between how strongly it favors heuristic moves, which provide faster solutions, and how much it branches out, which makes for more optimal solutions.
Since this isn't pathfinding in a metric space, it's harder to find a heuristic that would still ensure optimal solutions. The space of possible moves is also vastly larger since something like [Left, Down, Right, Up] doesn't lead back to the same state.
It might be interesting to try and binary search the best factor for the distance penalty. I don't know how I'd determine what "best" means in this case.
[editline]6th October 2015[/editline]
[QUOTE=Tamschi;48839257]
The /2 is because the empty tile is present as tile for the distance, right?
In that case I think your solution may in fact be A* already.[/QUOTE]
My heuristic is a sum of the Manhattan distance of every tile to it's correct position.
[QUOTE=Darwin226;48839315][...]
It might be interesting to try and binary search the best factor for the distance penalty. I don't know how I'd determine what "best" means in this case.
[...][/QUOTE]
I think the most "useful" metric would be if you ascribe a cost to the calculation and execution of the result, and then minimise that.
Around two moves per second seems reasonable, though if you have to read the solution during that time I think it's good to assume a bit more :v:
Of course it's different for online puzzles and the like (which could be solved faster if you can somehow start before you get the final result).
(Do you do caching of previous solutions? My Haskell isn't good enough to tell.
[del]For 4x4 you'd ideally need only about 131kB to store all paths, if you can quickly restore the board states from their index.[/del]
[editline]edit[/editline] Whoops, wrong formula. The real amount is just under 42TB :shock:)
[QUOTE=Doritos_Man;48838341]For all of you in Uni/College, how math heavy is your Computer Science degree?
My Comp Sci degree plan puts me one senior level class away from getting my math minor. I'm just so tired of math though.[/QUOTE]
I did Discrete Mathematics for Computing (binary maths, base conversion, pseudo code etc) and Foundation Mathematics (algebra, mostly). My course is 8 units for the major (Applied Computer Science), 8 other units from the degree (Bachelor of Information Technology) and 8 other electives that could be anything at all including stuff from an art degree. Both those maths classes fell into the degree electives so I think I could have done it without doing any maths classes if I really wanted (seems like a bad idea).
Pastebinned the class names if you are interested: [url]http://pastebin.com/LzNBtUee[/url]
[QUOTE=Darwin226;48839315][...]
My heuristic is a sum of the Manhattan distance of every tile to it's correct position.[/QUOTE]
It seems you also [URL="https://gist.github.com/LukaHorvat/130260e97c3d60572280#file-sliderpuzzle-hs-L59"]count the movable 0 tile for the distance[/URL] but count swaps as having a cost of one (I think. I couldn't find where you increment it.), which means your initial heuristic scale is twice of that of the cost of the previous path.
Then dividing it by 2 gives you the necessarily optimal solution again.
At least if I don't misinterpret your code.
I'm definitely not used to that many short variable names and (anonymous?) members used in pattern matching, so I can't really follow it.
[QUOTE=Tamschi;48839502]It seems you also [URL="https://gist.github.com/LukaHorvat/130260e97c3d60572280#file-sliderpuzzle-hs-L59"]count the movable 0 tile for the distance[/URL] but count swaps as having a cost of one (I think. I couldn't find where you increment it.), which means your initial heuristic scale is twice of that of the cost of the previous path.
Then dividing it by 2 gives you the necessarily optimal solution again.
At least if I don't misinterpret your code.
I'm definitely not used to that many short variable names and (anonymous?) members used in pattern matching, so I can't really follow it.[/QUOTE]
Well, since your goal is to also get the zero tile to the bottom right, I think it makes sense to also reward getting it closer to that goal. On the other hand, if all other tiles are in place, the zero must also be there.
I'm still not really clear if I can make any kind of optimality guarantee, no matter what I do with the cost. To be able to say that my heuristic is always optimistic or pessimistic I need something like the triangle inequallity so I can put a bound on it. Since this is a search in a space that doesn't permit a metric like that, I can't really tell anything about how well my heuristic approximates the actual distance from the solution. Especially since you can't swap tiles as you please so even though a tile may have a Manhattan distance of 4 to it's destination, there's no way to get it there in 4 moves. I'd be interested in hearing if you have a better idea on how to calculate that.
As far as readability goes, I think you didn't miss anything. The anonymous members in the Board type should be named. It's how it is because I started with a simpler representation and then added too much to it
Has anyone here worked with Scala for Android? I'm interested in hearing some experiences, and comparisons to regular Java programming.
[QUOTE=sarge997;48837504]Was working on texture painting my knife model, worked on it for over an hour, was almost done.. [I]Then Blender crashed on me..[/I] :v:
I guess I'll have to try again, and make it better. So learn from my experience, and [I]SAVE OFTEN[/I].
Here's the untextured, boring looking knife.
[IMG_Thumb]http://i.imgur.com/JETDhoI.png[/IMG_Thumb][/QUOTE]
blender autosaves and regularly dumps the current session, did you check both of those to see if your progress has been saved?
[QUOTE=NovembrDobby;48834493]don't be silly, continue posting :eng101:[/QUOTE]
[QUOTE=thatbooisaspy;48834121]Don't be afraid to post dude, I know how you feel sometimes but this is "What Are You Working On", not solving world hunger. Someone's going to appreciate your work here (unless it's a shitpost)[/QUOTE]
Hehe thanks :D. I am not afraid to post anything btw, it's just weird
[QUOTE=Zero-Point;48834693]If it makes you feel any better, it took me 6 days just to figure out the proper math to light LEDs according to a joystick's position in Arduino, so I consider your current progress stupendous. :v:[/QUOTE]
Arduino is another story, registers and stuff are hard to work with (it takes 20% of time to find shit in datasheet and 50% of time to understand what the heck it is saying).
[QUOTE=proboardslol;48835170]What I hate is that everything I do is CLI, and everybody here is making what looks like super complicated enterprise level shit. Anything I do feels dwarfed in comparison[/QUOTE]
Well CLI is just text (what user sees), so not all magic is obvious. After all, Linux can be CLI too.
[QUOTE=Em See;48839992]blender autosaves and regularly dumps the current session, did you check both of those to see if your progress has been saved?[/QUOTE]
Yeah, I checked the autosaves, it only had one where I was finished uv unwrapping.
[QUOTE=Fourier;48840074]
Arduino is another story, registers and stuff are hard to work with (it takes 20% of time to find shit in datasheet and 50% of time to understand what the heck it is saying).
[/QUOTE]
In that case, my problem was I was trying to divide integers. :downs:
You know that feeling when you dive into a topic and suddenly you're in [I]way[/I] over your head? Now there's this hole in my knowledge and I can't let it go until I understand completely
[editline]6th October 2015[/editline]
Also if there's someone here who can explain spherical harmonics and how they're used in game lighting plz steam me or something :v:
[QUOTE=cra0kalo;48838653]Recoding my GUI framework in DX for overlay
[IMG]https://dl.dropboxusercontent.com/u/10798900/staging/store/push/2015-10-06_16-40-42.gif[/IMG][/QUOTE]
How do you like, not get VAC banned developing this stuff?
[editline]6th October 2015[/editline]
[QUOTE=Doritos_Man;48838341]For all of you in Uni/College, how math heavy is your Computer Science degree?
My Comp Sci degree plan puts me one senior level class away from getting my math minor. I'm just so tired of math though.[/QUOTE]
For my CS Associates I have to take Calc 1 & 2, which is the same math requirement for anybody in the science and engineering field. The school I want to transfer to requires
Linear Algebra
Vector Geometry
Physics
Multivar Calculus
Discrete Math
Diff Equations
Combinatorics
Statistics for Engineers
Probability and Statistics for EE
[editline]6th October 2015[/editline]
The non-tech school I probably will end up transferring to for cost requires:
Calc III
Discrete Math
Linear Algebra
Probability and Statistics
Numerical Methods
[QUOTE=proboardslol;48840656]How do you like, not get VAC banned developing this stuff?
[/QUOTE]
[img]http://puu.sh/kABBW/109873516d.jpg[/img]
I don't think he's the right person to ask
[QUOTE=Asgard;48840782][img]http://puu.sh/kABBW/109873516d.jpg[/img]
I don't think he's the right person to ask[/QUOTE]
That's overwatch, not VAC. Completely different things.
[QUOTE=proboardslol;48840656]How do you like, not get VAC banned developing this stuff?[/QUOTE]
IIRC you can start source games with an -insecure parameter which completely disables VAC for the session.
Obviously you can't play online with that, but bots should still work.
You can also play on servers with VAC turned off, I think?
I wonder if you could write a ML aimbot; it uses image recognition to tell the difference between an enemy's head and the rest of the environment. Then knows the optimal area to aim in relation to that head to aim for a headshot; it does this without interacting with the executable of the game at all so no VAC ban; it just reads a videostream of the entire screen.
[QUOTE=Darwin226;48839759][...]
I'm still not really clear if I can make any kind of optimality guarantee, no matter what I do with the cost. To be able to say that my heuristic is always optimistic or pessimistic I need something like the triangle inequallity so I can put a bound on it. Since this is a search in a space that doesn't permit a metric like that, I can't really tell anything about how well my heuristic approximates the actual distance from the solution. Especially since you can't swap tiles as you please so even though a tile may have a Manhattan distance of 4 to it's destination, there's no way to get it there in 4 moves. I'd be interested in hearing if you have a better idea on how to calculate that.
[...][/QUOTE]
I think you're mistaken, but I'm not sure if I can show it formally.
If a tile is further than 1 away from its ideal position then other tiles will also not be at [I]their[/I] goal position, increasing the distance to the correct value.
The 0 tile however always moves together with a different tile, and all other tiles move together with the 0 tile.
This means that if you count [I]swapping[/I] (i.e. moving the 0 tile [I]and[/I] one other tile by one [I]each[/I]) as having a cost of one, your distance heuristic should represent that as 0 being free to arrive at the same scale.
(You could however also increase the swap cost to 2 instead. This would again give you the correct relative scale, but it may branch differently while searching which may be better or worse.)
If you think about it, you still operate on a regular grid but in 4*4=16 dimensions, but effectively only with edges of cost=2 along diagonals in dimensions 0 and n != 0. Illegal moves represent obstructions between the states.
This immediately turns into to a plain cost=1 grid with axis-aligned edges if you remove dimension 0, and to match that you have to disregard tile 0 for the distance heuristic.
(The connection graph is exactly the same because the position of tile 0 is fully determined by the other 15, and as such no valid nodes in the 16-dimensional grid collide when projected into 15.)
A* will give the optimal solution on any spaces where the heuristic gives you the unobstructed distance, and while the two possible heuristics give seemingly different results at higher values they as you can see from the paragraph above still represent the same problem accurately once you take the no-stacking constraint into account.
[QUOTE=BackwardSpy;48840974]You can also play on servers with VAC turned off, I think?[/QUOTE]
I can't understand why there's servers with this option disable, i know that this let people with vac ban play, but... this is not a cheater's nest too?
[QUOTE=proboardslol;48840984]I wonder if you could write a ML aimbot; it uses image recognition to tell the difference between an enemy's head and the rest of the environment. Then knows the optimal area to aim in relation to that head to aim for a headshot; it does this without interacting with the executable of the game at all so no VAC ban; it just reads a videostream of the entire screen.[/QUOTE]
I'm pretty sure this had been done before as a proof of concept for CS:S but you had to use special high contrast textures (CT completely bright blue, T completely bright red) for it to recognize players and even then it was very slow and unreliable. Might work better with current hardware.
[editline]6th October 2015[/editline]
Also, you still can't calculate spread without accessing the games memory, as it is semi-random.
Sorry, you need to Log In to post a reply to this thread.