« first day (1137 days earlier)      last day (3812 days later) » 

4:00 PM
I've fought off so many ICEs, I'm not gonna let this bug stop me :E
 
And the world of that small set of function objects is about to get kicked hard in the balls.
Things like std::greater<> and poλys are coming!
3
 
@R.MartinhoFernandes at last =)
 
@R.MartinhoFernandes polambdays?
 
user3010322
@melak47 There's always dropbox, you know. :O
 
Xeo
polandays?
 
4:06 PM
polymorphic lambdas
 
@ThePhD :D
 
Hmm, TeamCity is still lonely.
@melak47 I'm not giving up on spelling them as "poλys".
It looks awesome.
 
@R.MartinhoFernandes i like it, too :-)
 
@R.MartinhoFernandes And it's not hard to read.
 
And if you are a designer you can easily make a cool logo out of it.
I'm not a designer.
 
4:11 PM
Now that I think of it.
 
It's just damn hard to type (╯°□°)╯︵ ┻━┻
 
The main problem with the AI is it cannot predict death.
 
@Pawnguy7 path to what?
 
@BenjaminGruenbaum the food
 
The path can not be simply to the next food.
 
4:13 PM
@Pawnguy7 How so?
 
That won't work - just like you said it cannot predict death. What about having a heuristic that says - path to next dot and then contract the snake in itself so it takes the least space as possible with the head outwards?
That's not optimal - but it sounds like a reasonable solution
 
What do you guys mean by predicting death?
 
@R.MartinhoFernandes it is multiplayer. Using any techniques I have seen, they go to the food if they can reach it. But one move of another snake changes everything.
 
Oh. Multiplayer.
 
@R.MartinhoFernandes if you are going to run into a wall
 
4:14 PM
@Pawnguy7 if it's multiplayer - you need mini-max - well expectimax since you have a random element.
 
Does that work for more than two people?
What I could do, though.
Is for each AI move, play off the expected two moves ahead of everybody else.
 
@Pawnguy7 you can adapt the algorithm to multiple agents, yes. It all depends on how smart you need it to be.
@Pawnguy7 2 is probably not enough.
 
Well no.
But using my current method.
 
@BenjaminGruenbaum So it can easily be surrounded?
 
@R.MartinhoFernandes I didn't know it was multiplayer when I said that
 
4:16 PM
A search depth of 10 is slightly slower than what it should be - that is, it waits on it.
So when one of the AI dies, you notice the speed increase.
I can probably optimize it though.
Say, when a path is obviously only going to get worse.
 
A* with 'the current path cuts the most space' might work nicely in multiplayer
 
That was my origional thought.
But a single blocking move of another could be deadly.
At first I was thinking like you are.
If it saved space, there is a good chance of survival.
 
You can weight and join multiple heuristics
 
But most of the deaths I am seeing, are caused by a single move, where there is then only, say, 2 empty spaces left to them.
 
I'd use some sort of "controlled space" heuristic.
 
4:19 PM
I've std::list<T> as my member variable. Should I return const std::list<const T>& from my getter or const std::list<T>&
 
I guess that in multiplayer controlling the board is important: you get more food, you get bigger, you control more space, you force your opponent into a smaller, possibly surrounded, space.
 
I generally return the second one. but today I was thinking shouldn't I return const std::list<const T>& instead ?
 
Take this level.
The lack of potential death prediction is terrible.
One second a long path might be open.
The next closed.
 
Like, which parts of the board can you reach before your opponent does? Those are "yours". When picking paths, weight "your" positions much higher than your opponents.
 
but your search shouldn't take long to explore the tunnels, since there's no choices to be made in there, right?
(at leaast the thin ones :))
 
4:22 PM
@melak47 not the problem. If I don't simulate opponent's moves, then it might appear totally free, and you choose it. But it might get blocked the next move.
 
@NeelBasu First one doesn't work.
 
@Pawnguy7 didn't know the map wasn't open
 
@BenjaminGruenbaum I have three maps, the AI isn't great at any of them though.
 
The heuristic here is more like "keep a path back and try to reach food, assume opponents are optimal "
 
@R.MartinhoFernandes Yes But isn't the second one a falacy ?
Though I am doing this for long
 
(minimax, with alpha beta pruning, or expectimax)
 
user3010322
@NeelBasu Make both. const version returns const list, non-const returns regular list. If the list isn't meant to be mutable from the outside, make a const std::list<T>& get () const only.
 
@NeelBasu It depends? What is it supposed to model.
 
@Pawnguy7 If the opponent can reach it before you can, consider it blocked.
 
Generally no.
 
4:23 PM
They tend to do better as you pick the lower ones.
 
@NeelBasu I wouldn't know. I don't know what it is supposed to mean.
 
Even on the last one, though, they exhibit the merging behavior.
And when they are closed like that, one always dies.
 
Xeo
@ThePhD Learn to read
 
Once you get down to two they get fairly long though.
 
@Pawnguy7 you probably need to change heuristic weights based on wall density
 
4:24 PM
@ThePhD I am returning a list which is not mutable. But user can mutate an item
 
user3010322
Oh.
 
Xeo
@NeelBasu Can he?
Hint: std containers propagate const
 
That's why we have const_iterators.
 
@Pawnguy7 you're not accounting for the opponents in your AI, and you're not accounting for the randomness of the next food positions - thosre assumptions are way too bold to make IMO
 
@Xeo its const std::list<T*>& not const std::list<const T*>
 
4:25 PM
@R.MartinhoFernandes that could work. Although I would think in many cases it makes them shy away. Also, wouldn't it be a bit slow, checking where the opponent can reach? Depends on depth, though.
 
Xeo
@NeelBasu Then that's your own horrible design. :P
 
user3010322
@CatPlusPlus How do I sign up for your TeamCity and stuff?
 
user3010322
I'd like to contribute.
 
@BenjaminGruenbaum how do you account for the randomness?
As far as the other point, you are correct: that is what I wish to fix next.
 
@Pawnguy7 Yeah, I'm describing a very defensive behaviour. You can have some tunable factors to make more adventurous and more conservative variants.
 
user3010322
4:26 PM
vec.emplace_back( std::move( item ) );
vec.push_back( std::move( item ) );
 
@Xeo Did you mean const std::list<T> will return const_reference from operator[] an at methods so its returns are immutable ?
 
user3010322
^ which am I supposed to prefer in this case again?
 
@Pawnguy7 read about expectimax - you use the expected value. If you're not sure what it is - it's the sum of probabilities of events occuring times the probability of them occuring. Try searching for "expected value"
 
@R.MartinhoFernandes how far should I look ahead for opponent's, you think?
 
@Xeo Not getting which one is wrong ?
 
4:28 PM
@Pawnguy7 Not sure. That would depend on things like number of opponents and board size. I'd suggest experimentation and tuning :P
 
Should I continue to use my score-based method?
 
Or, perhaps, use the A* if path else maximize space, using this idea of spaces they can reach being solid?
 
@NeelBasu if you can't redesign around the std::list<T*>, return iterators instead of the list.
 
It can easily be adapted to more than one opponent.
@Pawnguy7 with what heuristic?
Your A* heuristic itself shouldn't just be manhattan distance, it should take things into account. Although I'm not convinced A* is sufficient here.
 
4:30 PM
@BenjaminGruenbaum I don't know much about heuristics yet, but I think the basic type is Manhattan distance.
 
@ThePhD hmm, now it thinks it's calling itself, when I want to call the member function version :E
 
@Pawnguy7 You can also have varying degrees of "solidness", i.e. cells farther from your opponents are not as dangerous as the ones close to them, since you will get time to react if they go that way.
 
> error C2780: 'int AngelScript::Engine::RegisterGlobalFunction(F &,std::string)' : expects 2 arguments - 4 provided
 
Its not the problem.
What I generally do is
struct X{
    std::list<Y*> m_v;
    const std::list<Y*>& v() const;
};
 
@Pawnguy7 so, A* has a heuristic, the cost it estimates at each level is: the cost so far + a heuristic guessing the distance to the goal
 
user3010322
4:31 PM
@melak47 One second, beenr unning around, haven't quite pulled it yet
 
Is there anything wrng with it ?
 
Returning const by value inhibits potential moves.
 
@ThePhD getting some exercise? :)
 
@Pawnguy7 if the heuristic is admissable and consistent (that is, it kind of actually represents a distance) it is guaranteed to return a correct solution.
 
user3010322
@melak47 Pfft. Hardly.
 
4:31 PM
@R.MartinhoFernandes sorry I forgot the &
 
A* is just 'expand then odes that minimize "cost so far + heurstic" and are still not expanded. That's all there is to A*. The problem isn't A* it's finding the heuristic.
 
What heuristic do you have in mind?
 
@Pawnguy7 teach it good snake configurations by example, rate them on the aesthetics of the snape :p
 
At this rate, the AI is going to take longer to make then the rest of the game was.
 
Xeo
@NeelBasu You don't want people to modify the Y behind the pointer, right?
 
4:36 PM
@Xeo Yes
 
Xeo
Why even have a pointer?
 
@Xeo Because Thats unavoidable
 
@ThePhD Just register
 
user3010322
@Pawnguy7 AI is hard.
 
user3010322
@CatPlusPlus Where at?
 
Xeo
4:37 PM
@NeelBasu Why?
 
If you have any projects to add then I'll create 'em
 
Think it would be wise to work on other parts of the game first?
 
For now there's no central auth
 
@Pawnguy7 yes. If you're into AI - there is a canonical book that's worth reading (Shapley and Norvig IIRC)
 
@Xeo Some are non copiable. some are retrieved from underlying API. some are old code
 
4:40 PM
I think the... concept of AI is pretty neat. I mean, to have something play snake that is actual competition to a player would be an accomplishment, for me. I don't have any experience in this area, though (or pathfinding). Or formal education.
 
Xeo
Welp, in the worst case, if you can't remove the pointers, and you want to propagate the const-ness, write a small const_propagating_ptr<T> wrapper or something.
 
user3010322
@CatPlusPlus I have to seperately register for TeamCity?
 
Xeo
// with
T& operator*();
T const& operator*() const;
T* operator->();
T const* operator->() const;
 
user3010322
I was thinking of putting LoungeChat up there
 
Xeo
or something like that
 
4:41 PM
I'm gonna do chat sometime, it doesn't work yet
 
@Xeo Isn't it a very special case ? Why we don't do this generally ?
Not only me. I've seen a lot of codes returning const std::list<T> getter() const
 
Xeo
Indirection in C++ simply doesn't propagate const.
It's not the fault of std::list or any other container
 
@Xeo So without implementing something like const_propagatting_ptr a getter is not IDEALLY Totally const in nature ?
 
user3010322
@CatPlusPlus Doesn't work yet?
 
Xeo
@NeelBasu If you didn't have pointers in your container, it would be
 
4:44 PM
@Pawnguy7 it's a good book :)
 
@ThePhD NuGet complains about something I don't have time or patience
 
@Xeo Yes Its isn't it too common to have pointers in list ?
 
user3010322
@CatPlusPlus Guess I should repull and try to build it again...
 
Xeo
I don't think so. And I also don't think that it's common to just return some of your private state like that.
 
@Pawnguy7 cs.sunysb.edu/~ram/cse537/project01-2013.html this might be a simple place to start - you implement the absolute basic stuff like BFS, DFS, UCS and A* and then come up with heuristics
 
4:45 PM
The build needs to run on Mono
 
user3010322
Oh.
 
user3010322
Well, if Nuget's not playing with Mono, I can't really help you.
 
std::lists are not common at all.
@CatPlusPlus I have two others, but I don't want to take so many configs for myself until we get a license.
 
@BenjaminGruenbaum have you taken an AI course?
 
We probably won't get to 20 any time soon anyway
 
4:50 PM
@Pawnguy7 yes - I have. In fact it's my field of research.
(Not that I have anything interesting to show for it yet)
 
@R.MartinhoFernandes I am putting std::list as an example, it can be any type of container
 
Expose iterators.
 
Doesn't that still not solve the problem though? Since you can modify elements through the pointers?
 
@Polymer With the right iterators, no.
 
Ell
I failed my machine learning course :/
 
4:52 PM
@R.MartinhoFernandes Ya thats a better idea. That I expose often. But sometimes UI people needs std container to convert them to Qt Style container. So they ask to expose the container
 
Even if it's an object with a non const method? Reads up const iterator
 
AFAIK Qt containers work with iterators.
 
@Ell it's probably the hardest course in the CS degree here - especially for students who aren't the most math inclined.
 
@R.MartinhoFernandes there are fromStdList() that takes a list
not iterator
 
@R.MartinhoFernandes I've created you a superproject so you can create subprojects as needed
 
4:53 PM
@NeelBasu WTF
That's so stupid.
 
@R.MartinhoFernandes Hmm
 
 	QVector()
	QVector(int size)
	QVector(int size, const T & value)
	QVector(const QVector<T> & other)
	QVector(std::initializer_list<T> args)
Good job, Qt.
 
Anyway - I have code to write. Talk to you all later.
 
If we get to 15 configs then we'll think about stuff
 
Great pile of garbage.
 
4:54 PM
(Because I reserve 5 for myself haHA)
 
QVector<T> 	fromList(const QList<T> & list)
QVector<T> 	fromStdVector(const std::vector<T> & vector)
 
Ell
@BenjaminGruenbaum I just haven't got enough time to do all the assignments with schoolwork too :O
 
Ell
(I know I am hanging out here so often, but I work too.)
 
Qt's containers are really good
 
4:55 PM
@Ell probably the biggest reason for not doing well on courses :)
 
They're also all COW
 
yes. But for people to have QList I've to return const std::list<T*>
If I just expose iterators, one cannot get an QT Container from that
 
Why is it important to get Qt containers from it...?
 
@CatPlusPlus I've never checked. Heard GUI have some good amount of reusables that needs QT Containers. So I need to expose std::list for them to convert it to Qt Containers
 
@Ell are the assignments not considered schoolwork?
 
4:57 PM
@NeelBasu Then maybe use Qt containers everywhere...?
 
Qt containers are not really that reusable. See above. QED.
 
@CatPlusPlus Hmm But its too late for this
 
Ell
@Pawnguy7 I took this course outside of school, my school doesn't do computer science
 
> Internally, QList<T> is represented as an array of pointers to items of type T.
 
What's most silly is that they are aware of iterators.
 
4:58 PM
Maybe this is where MSVC got their deque design from
 
@CatPlusPlus lol, kinda like an MSVC deque.
 
First
 
iterator 	begin()
const_iterator 	begin() const
iterator 	end()
const_iterator 	end() const
They provide iterators, but don't consume them... Sigh.
 
Also cbegin, cend, AND constBegin, constEnd
 
It's a "convenient API"
 
4:59 PM
Because hey why not
 
Fuck "convenience".
 
I hate COM when it doesn't work.
 
I hate COM always
 
user3010322
@EtiennedeMartel You and me both, brother.
 

« first day (1137 days earlier)      last day (3812 days later) »