Chat:World/2020-11-21

From CG community
Jump to navigation Jump to search

NitMpez: even having the bonus wrong... didn't make much of a difference... pretty much same rank :P

Default avatar.png guspihl: http://chat.codingame.com/pastebin/8eabf09e-7fcc-4650-b870-1c12166e78f2

Default avatar.png guspihl: can someone figure out this pattern?

Default avatar.png guspihl: its from a reverse mode in clash of code that I didnt solve :(

GoogleJeff: hmmmm. i'm stumped.

GoogleJeff: this is why i hate reverse mode.

GoogleJeff: there should be at least 10 examples for a two-input problem *that* cryptic

ClockSort: now i am curious. looking...

GoogleJeff: oh! i figured it out i think

GoogleJeff: checking...

Default avatar.png guspihl: oh sweeet! hope you got it :D can't go to sleep before someone figures this out

GoogleJeff: int((a*a+b*b)**0.5)

GoogleJeff: the (5, 12, 13) is a pythagorean triple.

Tyir: ^

ClockSort: is it just a bitwise operation?

Default avatar.png guspihl: ohhhhhhh!!

GoogleJeff: square root of a squared plus b squared.

Default avatar.png guspihl: thanks a ton lol

GoogleJeff: rounded down.

GoogleJeff: no worries :)

GoogleJeff: happy to help

Default avatar.png guspihl: that's quite interesting actually

ClockSort: sheesh, that's difficult for most people

ClockSort: such as... me :D

Default avatar.png guspihl: but it should have given better clues as you said

Default avatar.png guspihl: alright, now i can sleep in peace! thanks again, and gn :blush:

NinjaDoggy: FINALLY! A submit that actually gave improvement !!!

miszu: how much improvement?

phord: Got to Bronze in Python and got pretty stuck. Started over in C++. First submission got me to silver.

miszu: congrats!

NinjaDoggy: 15th gold, 71% done

struct: C++ is free legend

NinjaDoggy: :(

Icebox: "free" :thinking:

miszu: meanwhile I almost done with getting all possible transitions

struct: Sorry 20 hours with no sleep

phord: Shit -- the announcement reset my IDE. :-(

NinjaDoggy: also WOAH!

NinjaDoggy: Recurse came out of his rock!

NinjaDoggy: #1 :O

3N0n7: a

struct: annoucement resets ide?

miszu: wow

phord: I was debugging a problem where I sit and REST when I get to zero inventory.

phord: I guess I should have saved the seed.

miszu: and done. Wrote all possible transitions

miszu: but I am worried with pointers and copy by value thingy

miszu: how does it looks like?

miszu: http://chat.codingame.com/pastebin/fd7bdf3d-7000-45bf-a825-fe111681a120

Icebox: looks slow :D

miszu: :(

yhyoxx: :'(

miszu: will it bottleneck for gold?

Icebox: you're lucky that speed doesn't mean anything

Icebox: no obviously not

miszu: ok that's good enough

struct: If php can make it to gold

struct: anything can

rockstar555: how to solve Coder strike Back in Java please help

struct: Its not solvable

rockstar555: sorry not understand

PatrickMcGinnisII: rockstar555 it's a multi, not a puzzle...do better than everyone else

miszu: does this do copy constructor?

miszu: Player p = players[playerPos];

Icebox: yes

Icebox: assuming players is full of "Player" objects

miszu: player is a struct

rockstar555: okk

miszu: yeah players of size 2

PatrickMcGinnisII: struct some of us using php still trying to get to gold *sigh*

Icebox: but an easy way to think about it miszu

Icebox: everywhere where you use "="

struct: Patrick same applies to other languages

Icebox: it's copy

struct: I see c++ in legend and I doubt ill get there

miszu: Icebox so it's better to use pointer?

Icebox: depends

Icebox: it's not alawys better

Icebox: always*

Icebox: but if you have a huge object that you don't want to copy then yes

miszu: well technically I could make a const

miszu: not modifying the state

PatrickMcGinnisII: PY coders are getting better

miszu: ok time to test if getting all acitons is good

miszu: it looks good on first shot

yhyoxx: gj

miszu: Icebox laughing with his O(1) move

miszu: ty yhyoxx

miszu: found a bug :/ multiple casts doesn't detect properly

miszu: nvm it wasn't castable :D

yhyoxx: u should stream

miszu: why?

miszu: I would look pathetic with my c++ knowledge

yhyoxx: not everybody streams to show their skills

yhyoxx: u can stream to have fun

miszu: yeah but what knowledge would I bring to people

Donotalo: found a player who always goes for recipe 0 (as long as there is +3 bonus) and s/he is in top 100

miszu: question for c++: I have a function that returns a vector<pair<Action, int>>. But since it returns by value, it does a copy so it is expensive in this case. How can I return the reference? I am reading you cannot as it gets destroyed in the stack. But isn't there a special rule using the const keyword?

jacek: happy Caturday

Michael_Howard: Test test is chat working again?

__atomic__: nope

Michael_Howard: boo. Better go home then.

Michael_Howard: Stuff appeared again after refresh but I have a gap from 5:10 - 9:31. Is yours the same?

__atomic__: Yes I see the same

Michael_Howard: Cool. If it's not just being random, hopefully it's up again.

Icebox: it is

[CG]Thibaud: pb of certificate renewal

dbf: oh, classic :)

jacek: pb?

eulerscheZahl: problem

eulerscheZahl: (or pb4)

eulerscheZahl: we had that same certificate issue during a previous contest

jacek: is AutomatonNN online?

AutomatonNN: eulerscheZahl is there a way to convert the code to local distance and the next checkpoint is a bit

jacek: he is

eulerscheZahl: not for much longer :rage:

Icebox: AutomatonNN vs Automaton2000 go!

Automaton2000: you dont know the details

AutomatonNN: eulerscheZahl is there a way to see the code in the chat with the leaderboard and i got to legend wi

eulerscheZahl: seriously, stop it!

DomiKo: lol

jacek: yamero!

DomiKo: AutomatonNN one more?

Icebox: when even bots ping euler smh :D

AutomatonNN: eulerscheZahl is there a way to see how the game is working now?

Icebox: :D

eulerscheZahl: AGADE!!!

dbf: he is busy

DomiKo: AutomatonNN lol

AutomatonNN: wow he got interested

DomiKo: :((((

dbf: python is #1 in gold, great

eulerscheZahl: just 0.4 below the boss

dbf: how can you see bot score if you are in legend? :)

eulerscheZahl: and 6.8k players already

eulerscheZahl: open a replay with the boss. cgstats even does that now

eulerscheZahl: http://cgstats.magusgeek.com/app/fall-challenge-2020/betrue12

Michael_Howard: Who coded AutomatonNN and why is he stalking euler?

AutomatonNN: and even if it's not participating with the opposite of the same code

eulerscheZahl: it's agade's bot (which is why i was shouting for him)

eulerscheZahl: something probably went wrong with training the neural network. he has a weird obsession for me

eulerscheZahl: and once called me a "noob"

Icebox: or maybe so many players called you a noob that he just learned it naturally :thinking:

DomiKo: toad is king

Cousnouf: ahah

Icebox: maybe

DomiKo: AutomatonNN what about toad?

AutomatonNN: for real here

Icebox: maybe toad is queen

Icebox: who knows

eulerscheZahl: i have a king in my toad collection https://imgur.com/a/zP9wy6v

Illedan: Good morning

eulerscheZahl: it is. finally something seems to work

Illedan: Nice

DomiKo: Nice one

Illedan: And I see someone came out of hiding -.-

DomiKo: yeah

eulerscheZahl: and an emil deleted the account

DomiKo: and emil. quit ;(

Illedan: Wow

eulerscheZahl: but i think it's not struct

DomiKo: coincidence?

Illedan: That's wierd behavior

eulerscheZahl: weird*

Illedan: Still early!

eulerscheZahl: you make that spelling mistake all the time ;)

Illedan: I know

Illedan: :D

Illedan: thx

DomiKo: will legend reach 100 people?

DomiKo: what you think

eulerscheZahl: i say no

Illedan: Nah

eulerscheZahl: usually the sim-heavy contests have smaller legend leagues

eulerscheZahl: while heuristic games tend to exceed the 100

DomiKo: I done one contest so I'm asking

eulerscheZahl: but will Illedan reach legend?

Illedan: Not sure if I have the motivation

DomiKo: I'm worried about shuffle at final recalculation

eulerscheZahl: i predict neumann will despite him saying he won't

DomiKo: game seem so random sometimes :(

Illedan: Ofc he will

Illedan: Never seen him give up :D

eulerscheZahl: http://cgstats.magusgeek.com/app/fall-challenge-2020/eulerscheZahl i see no clear pattern here

eulerscheZahl: winning vs higher ranked. losing to those below

rockstar555: hii

Illedan: Not using cgbench euler?

eulerscheZahl: and not enough games in general to deduct anything

DomiKo: In legend we have that weird gaps

eulerscheZahl: nope

DomiKo: cgbench don't give much

DomiKo: you can have 60% winrate with some one

DomiKo: but you play with him only 5 games

rockstar555: hey i cmplete coders strike back

eulerscheZahl: i never used it for more than 10 or 20 games to test

rockstar555: i am in wood 2

eulerscheZahl: the submit button got renamed to "test in arena" for a reason

rockstar555: now i am level 19

rockstar555: hey what is quest in codingame

JFB: Finally Golld. :-)

dbf: and python is in legend, oh

WINWINWIN: JFB are you search based now?

JFB: yes - bfs.

JFB: Still timeouts

JFB: It looks that sort() in C++ sometimes last longer that 20ms

rockstar555: https://www.codingame.com/ide/puzzle/code-a-la-mode

Csipcsirip: now way JFB. how many items in your vector ?

WINWINWIN: Why would that happen?

WINWINWIN: thousands of objects in vector?

JFB: Csipcsirip - sometimes mote that 400k

eulerscheZahl: python in legend. but how?

JFB: eulerscheZahl mayby wrap ?

Csipcsirip: oh okay. than it's possible yea :D

eulerscheZahl: JFB there are server issues affecting everyone

WINWINWIN: Like what recurs did on his bot in CSB?

eulerscheZahl: if it doesn't happen too often, it's not your fault

rockstar555: what was the topic that you are discusing

eulerscheZahl: you get random timeouts with a 40ms limit

eulerscheZahl: contest

rockstar555: which contest

DomiKo: there is only one

rockstar555: fall challange 2020

WINWINWIN: Yes rockstar555

WINWINWIN: Who`s the unnamed player in legend?

WINWINWIN: emil.?

eulerscheZahl: yes

Icebox: rockstar555 do you know how to simulate the game?

DomiKo: euler top10 gz

Westicles: Emil was rust... that narrows it to two options for who's alt it was

DomiKo: any todo to write?

rockstar555: I play played the contest I like contest but when i write code it brew online one

WINWINWIN: He`s not an alt...

Icebox: that was Recurse account

Icebox: xD

rockstar555: i want brew multiple spell to earn money

rockstar555: can any body tell me

JFB: In one step you can do only one brew

rockstar555: Sorry Icebox i didnot simulate the game

WINWINWIN: rockstar555 your question doesnt make much sense.

rockstar555: why

Icebox: rockstar555 how did you solve Vox Codei then?

rockstar555: by using code

Icebox: :thinking:

rockstar555: i didnot understand this

Icebox: you got a lot of "very hard" achievements overnight

Icebox: you must be really good

rockstar555: thanks Icebox

rockstar555: not complete all

rockstar555: 80% completed

WINWINWIN: Nicely done

Icebox: Well you completed Resistance, Music scores, Nintendo (which has 2% success rate!), Cave Dweller, Last Crusade ep 3

LLG: I'm hovering around rank 50 in silver

Icebox: and all of that overnight :o

Icebox: that's some skill

rockstar555: It very hard

LLG: maybe a tiny little imporvement in my heuristics and I can make it to gold

WINWINWIN: LLG I`m in the same boat :)

kovi: 4 more to legend

rockstar555: hii kovi

rockstar555: hey tell me about Code a la Mode

rockstar555: it is three player game

JasperV: same here LLG :D

eulerscheZahl: and a python even

rockstar555: hii eulerscheZahl

JasperV: really cool to have a python submission in legend :)

DomiKo: One python one Java not bad

rockstar555: nice

Westicles: rockstar555, they are gonna get you

JFB: eulerscheZahl - even you in C++ ??? 2020 year is really weird :-)

eulerscheZahl: hii rockstar555

JasperV: A friend of mine is trying to go for it in ruby, that language is not doing well in the rankings :P

blasterpoard: so... I got pushed overnight from #50 to #1 in gold

rockstar555: didn't understand

wlesavo: chokudai is coming :smiley:

rockstar555: Westicles

Westicles: The CG police

rockstar555: what is chokudia

rockstar555: guys one second i will talk to you later

eulerscheZahl: JFB i upped my sim count from 60k to 150k with the language switch

eulerscheZahl: blasterpoard was that #50 before legend opening?

blasterpoard: eulerscheZahl no

rockstar555: https://www.codingame.com/ide/puzzle/code-a-la-mode

blasterpoard: this bot's drafting makes it lose against nnobs, so it doesn't climb

blasterpoard: right now I'm trying to parse 20gb of data I generated overnight to fix that

LLG: I think I can improve my bot by a lot

rockstar555: which type of language like by you eulerscheZahl

LLG: right now I'm only using 5-10ms every turn

eulerscheZahl: even chokudai agrees that legend is hard https://twitter.com/chokudai

LLG: because I prune a lot of states (if they have the same inventory they're considered dupes)

LLG: so I never got past 4-5k sims

eulerscheZahl: rockstar555 why does your profile say that you live in my city, work for my employer and went to my university?

Default avatar.png Mohammadmh: hello wrd

JFB: eulerscheZahl - you changed file name from *.CS to *.CPP ;-) ?

eulerscheZahl: and then i hit compile until it did

eulerscheZahl: and then some more till the segfaults were gone

JFB: :-)

DomiKo: then add #pragma and boom

DomiKo: 2x faster

eulerscheZahl: yes, that too

eulerscheZahl: at first i was like: oh, same sim count as before the port :(

eulerscheZahl: then: wait a moment. pragmas!

DomiKo: then: some more pragmas!

eulerscheZahl: copied all from my UTTT at once

Icebox: but then O3

eulerscheZahl: #pragma GCC optimize("-O3", "-ffast-math")

  1. pragma GCC optimize("inline")
  2. pragma GCC optimize("omit-frame-pointer")
  3. pragma GCC optimize("unroll-loops")

eulerscheZahl: anything i'm missing?

DomiKo: then: tricks for inventory

Westicles: avx?

DomiKo: then: every operation in O(1)

Icebox: yes eulerscheZahl

eulerscheZahl: did the bitboard thing in C# already

DomiKo: no need for avx

Icebox: Ofast > O3

DomiKo: you can made every operation in backpack using one operaton

DomiKo: or one + one bit operation

eulerscheZahl: thanks for the Ofast. will use it in my next submit

DomiKo: Ofast isn't faster

DomiKo: its O3 with some more pragmas

DomiKo: you can get worse result with it

Icebox: and O3 is o2 with more pragmas

Icebox: those are optimization pragmas so on average it improves performance

eulerscheZahl: i'm back to watching replays. although it's really hard for me to see what's going on and where my bot makes a bad decision

DomiKo: Euler you can use arch=native tune=native pragma too

JFB: blasterpoard - maybe you have problem with random timeout. And at night, servers run faster, less timeouts and you bot go up

JFB: What is 'arch=native'?

eulerscheZahl: native processor architecture

eulerscheZahl: optimize for that one CPU

JFB: OK, so I add too :-)

eulerscheZahl: not sure if that's smart

eulerscheZahl: CG has different servers

eulerscheZahl: but only compiles your code once

Icebox: generally speaking everything optimization related should be tested

JFB: OK. So it can be problem

Icebox: nothing is "faster" in the world of optimization

JFB: True

eulerscheZahl: i think i should concentrate more on my algo anyways

Icebox: it always depends on architecture, type of task, etvc

eulerscheZahl: 150k isn't perfect but you can build on it

JFB: I think that algo is more important. I usually have > 300 k (sometimes even 700 k) in bfs - and only midle of Gold

eulerscheZahl: BFS, no pruning?

JFB: Not yet

JFB: Next on the TODO list

eulerscheZahl: should i add the urgency bonus to my sim?

eulerscheZahl: pushing that away for days now

DomiKo: I guess yes

JFB: Probably more important before last brew

Westicles: Detect which brew the opponent is going for and prune it from your search?

LLG: what kind of difference does urgency bonus make?

rockstar555: yes i am from furth eulerscheZahl you know this place

LLG: since it's already added into the recipe price anyway, no?

rockstar555: but i am not in your company Sorry

Icebox: why would you put it then as your company :thinking:

rockstar555: I like your company

Nerchio: :joy:

rockstar555: Siemens Energy so I edit this

rockstar555: I like it names

rockstar555: Sorry

Icebox: what a coincidence

Icebox: to live and study where eulerscheZahl studies, and like his company name :o

rockstar555: :sweat_smile:

Csipcsirip: this guy is a big troll

Icebox: yeah and he got 8 Very hard puzzles overnight

Icebox: damn I wish I was think good

rockstar555: what is you saying Csipcsirip

Icebox: this*

Nerchio: maybe it's another recurse smurf :joy:

WINWINWIN: Is it zarthaxx?

WINWINWIN: :D

Icebox: I don't think either of them has enough time for this

WINWINWIN: Yeah...

rockstar555: :innocent:

wlesavo: damn, half day rewrite with no tuning to beam search already at the same level as my previous version

wlesavo: or is it even better

wlesavo: wtf

WINWINWIN: :P

rockstar555: :100:

WINWINWIN: wlesavo can the brutaltester help with figuring out if the rewrite is good?

rockstar555: I am learning programming language for 6 years

WINWINWIN: Sorry, I have never used it... dont know how it works/

rockstar555: no

rockstar555: WINWINWIN

WINWINWIN: Yes?

rockstar555: how this is possible

WINWINWIN: what?

JasperV: each time I open the chat I see more nonsense :joy:

WINWINWIN: :D

LLG: WINWINWIN I respect you for doing this in python 3

WINWINWIN: Its the language I know the best :P Not out of choice, its necessity

LLG: I wrote my bronze league bot in TypeScript

LLG: completely rewrote my silver bot in C#

WINWINWIN: Even more brave :)

LLG: and I'm even contemplating a rewrite in C++

rockstar555: i like most paython

rockstar555: then i solve puzzle more in paython

eulerscheZahl: sadly paython isn't free :( i'm a big fan of open source

wlesavo: WINWINWIN it probably can, but i assumed this by submit perfomance

JFB: eulerscheZahl - is not free?

eulerscheZahl: read closely JFB

LLG: wouldn't be called paython if it was free

WINWINWIN: :P

WINWINWIN: Understood wlesav

WINWINWIN: *wlesavo

Icebox: I'm a fan of freethon

Westicles: Is there any way to get at a full dictionary for a puzzle?

rockstar555: what is Triangulation Puzzle

Icebox: the puzzle you solved tonight rockstar555 :)

WINWINWIN: He solved it?

JFB: eulerscheZahl - I'm slow to catch the joke ;-)

Icebox: of course!

LLG: I'm still on probationary period for my company

LLG: and I'm using company time for this

Icebox: and got 100% + 3 remaining jumps on the 8th test for a 750xp achievement WINWINWIN

Icebox: together with 7 other very hard puzzles

LLG: I hope my superiors aren't here xD

rockstar555: ohh you still looking what puzzle is solves by me Icebox

rockstar555: nice person

Icebox: I don't like cheaters rockstar555

WINWINWIN: I dont get it, is triangulation shadows of the knight?

WINWINWIN: Which episode?

JFB: LLG it is Saturday - so you probably do not need to do job?

rockstar555: I am not a cheater

rockstar555: I know i solved it

WINWINWIN: Yes

LLG: yeah it's late Saturday for me right now

LLG: I'm not worried about right now

LLG: rather, the entire last week

LLG: xD

WINWINWIN: What is triangulation AutomatonNN

AutomatonNN: etc etc

ParticleBeam: I suppose thats not wrong

Westicles: Nothing in /usr/share/dict

rockstar555: Triangulation facilitates validation of data through cross verification from more than two sources. It tests the consistency of findings obtained through different instruments and increases the chance to control, or at least assess, some of the threats or multiple causes influencing our results

Icebox: https://www.betterevaluation.org/en/evaluation-options/triangulation#:~:text=Triangulation%20facilitates%20validation%20of%20data,multiple%20causes%20influencing%20our%20results.

Icebox: write your source

Icebox: when you quote it

WINWINWIN: Come on man...

WINWINWIN: its like a badly coded NN

Icebox: :D

WINWINWIN: :D

rockstar555: :thumbsdown:

rockstar555: I copied but not from here I https://www.betterevaluation.org/en/evaluation-options/triangulation#:~:text=Triangulation%20facilitates%20validation%20of%20data,multiple%20causes%20influencing%20our%20results. I copied from where i learnd it from.

WINWINWIN: Learnt what?

eulerscheZahl: *insert more copied text*

WINWINWIN: :P

DomiKo: https://www.codingame.com/replay/507838097

DomiKo: ohhh nooo

DomiKo: 10 tier3 in backback

DomiKo: and no potion to do :(

DomiKo: enemy sim is so powerfull :(

eulerscheZahl: classic

Default avatar.png Velicko: I can't manage to set up brutalTester, get timeout for both players. I've copied CLI class and pom.xml from https://github.com/Akarachudra/brutaltester-spring-challenge-2020. Is there something else i need to do?

LLG: lol the 10x yellow problem

LLG: I rewrote my heuristics like ~20 times before I kinda solved it

LLG: interesting to see someone in Legend still encounters it

wlesavo: problems of whote people :smiley:

wlesavo: white

DomiKo: 10 tier3 is so good bro

eulerscheZahl: i fall for it too

LLG: at least you get 10 bonus points in the endgame

LLG: xD

blasterpoard: this submit looks like adding 30KB of stats to my code is a very useful thing

karliso: Velicko https://github.com/crazyiop/FallChallenge2020

LLG: funny how my bronze league bot has a time complexity problem

Default avatar.png Velicko: thx :)


LLG: then my silver bot does anything in 10ms

Westicles: stats like an endgame?

karliso: Velicko timeout could be a problem in your code though

blasterpoard: mostly spell selection

Nerchio: going legend blaster? :D

blasterpoard: no, going to lose to the boss 5x in a row

WINWINWIN: How much behind the gold boss are you?

blasterpoard: im 0.3 ahead

WINWINWIN: Come on, why the no?:)

WINWINWIN: :)

Default avatar.png Nicopen: -

blasterpoard: I think I just promoted saelyos

wlesavo: easy push for saelyos

DomiKo: legend is getting big :/

WINWINWIN: 37 isnt big!

blasterpoard: so far, I managed to deflate gold boss's rating by 0.7 or so

wlesavo: blaster will push half of gold to legend

JFB: DomiKo 37/6814 ~ 0.5 %

blasterpoard: wlesavo you're welcome

DomiKo: but blaster is pushing :joy:

wlesavo: ill push boss back up dont worry :smiley:

blasterpoard: it's happenning, a chain of losses at 95%

JFB: finally blasterpoard :-)

Saelyos: oh thank blasterpoard :)

Nerchio: so training vs boss in the ide is fine even though its rust?

blasterpoard: Saelyos np

WINWINWIN: rust doesnt work in the IDE right nerchio?

AntiSquid: RIP email.

AntiSquid: emil. *

Nerchio: i think it works

wlesavo: gratz blasterpoard

AntiSquid: gratz blaster

Icebox: AntiSquid emil is doing quite fine

Icebox: in the 1st place

Icebox: ;)

WINWINWIN: He really is an alt?

Icebox: emil deleted account the moment recurse hit legend

AntiSquid: i know

Icebox: also if you want more trivia

Icebox: https://nierautomata.wiki.fextralife.com/Emil

JFB: It is the pure coincidence ;-)

Icebox: and if you know what the previous icon of him was

blasterpoard: it's not like he was actually hiding his identity, on discord he was quite open about it

AntiSquid: i guessed it before lol days ago

WINWINWIN: Nah, reCurse doesnt need an alt..

AntiSquid: when we were talking about alts

AntiSquid: faint smile avatars both .

Icebox: Or you know... both from nier automata

dbdr: gogogo wlesavo!

AntiSquid: i didn't play the game so no didn't know that Icebox

wlesavo: dbdr coming :slight_smile: half a day rewrite worth it

ntroPi: whoa! thanks for the #pragmas

ntroPi: They literally doubled my search depth

geppoz: c++? which are you using?

Default avatar.png **LordSkaven wishes C# could do the pragma thing

wlesavo: yay

ntroPi: yes C++

blasterpoard: gj wlesavo

wlesavo: thx

ntroPi: #pragma GCC optimize("-Ofast", "-ffast-math")

  1. pragma GCC optimize("inline")
  2. pragma GCC optimize("omit-frame-pointer")
  3. pragma GCC optimize("unroll-loops")

geppoz: ty

Westicles: Can't you do mcs -optimize for C#? Or is that on by default

Default avatar.png LordSkaven: I think that is on by default when building in release mode

Default avatar.png BoBot: omg, while microoptimizing my code, I found a < vs <= error, which made my bot never use more than 9 inventory slots...

Default avatar.png BoBot: how the hell did I make it to Gold...

Default avatar.png LordSkaven: I just realized that I have the same bug BoBot

Icebox: :clap:

rockstar555: hii

Default avatar.png LordSkaven: hey rockstar, how are you doing today?

Default avatar.png BoBot: #pragma GCC optimize("unroll-loops")

lol, I unrolled my for in in range(4): in Python, made the relatively simple, but oft-used method go from 20% of time usage to ~13%...30% optimization...would have thought Python can optimize those things automatically at least

rockstar555: nothing

Icebox: nah BoBot

Icebox: not with python

Icebox: we don't do those

Icebox: :)

blasterpoard: now that I'm in legend... time to finally stop ignoring urgency bonuses, I guess

emh: hey.. I need help beating Silver. any tips?

Default avatar.png BoBot: yea...I actually saw zapakh do all of those t0, t1, t2, t3 ingredients separately, but I delayed that as long as I could, and tbh, it is not that much of a boost, I am just trying to get as much as I can out of Python now

blasterpoard: emh beam search to highest score + inventory value

blasterpoard: seems to be the standard gold strat

emh: ohh ok

emh: why BFS is not good enough? don't know beam search

emh: will have to learn it then

emh: I guess

blasterpoard: beam search = bfs, but keep only N nodes in every layer

blasterpoard: bfs doesn't have enough depth

blasterpoard: to reach 2+ potions

Default avatar.png BoBot: simple BFS was not fast enough for me (Python), the branching factor is pretty high in this game

ntroPi: beam search is linear time complexity, you can go much deeper.

eulerscheZahl: can you sort in O(n)?

blasterpoard: yes, if you use bucket sort

ntroPi: nth_element

blasterpoard: which is surprisingly applicable hear

blasterpoard: *here

emh: ok so what I do is first do a reverse BFS from all potions to all states. that completes fully. then I do another BFS which uses the distance to nearest potion to limit the number of nodes. so maybe it is a beam search already

blasterpoard: nearest potion isn't enough

wlesavo: i had mc for mid gold, but it was not enough for legend

emh: ahh ok not just nearest potion but price / distance to nearest potion actually

emh: or max of that I mean

ntroPi: you will need to take enemy moves into account at some point

emh: damn it.. was hoping could get away without that ntroPi

emh: for now

emh: is it necessary to get to Gold?

ntroPi: what league is for now?

emh: Silver

blasterpoard: you don't need to look at your opponent in silver

Default avatar.png BoBot: @emh I pushed to Gold finally, but tuning the endgame strategy - finding "killer moves" that seal the game, also a lot of tome LEARN tuning

blasterpoard: just get an OK search

ntroPi: I neded it for gold but with super efficient brewing you may make it to gold without

wlesavo: win/lose estimation with basically any search should be enough for gold for sure

emh: maybe my search is buggy.. sometimes the opponent get 6 potions while I get 3 or 4. I have a "fastest" mode which sets the brew price to 1 for all brews if I see that I am behind on potions

ntroPi: fastest mode will be bad ... except on last potion

ParticleBeam: Remember opponent might brew your "fastest" brew before you

emh: hmm ok

emh: will try to put it for last potion only then and submit

emh: I've tried with both tomeIndex > 0 enabled/disabled. right now enabled and I'm 157 in Silver

ntroPi: Ok sad thing about the #pragma - all that extra performance reduced my rank by 40 :-(

emh: my "beam" search is expanding around 30k nodes and spends around 20ms doing that

emh: have a priority queue and skips states seen again which have a better path to them

Pavasaris: How to place one tier-0 ingredient upon the spell? :thinking:

emh: Pavasaris automatic when learning

Pavasaris: But the number of tier-0 ingredients is not decreasing while learning.

Icebox: the lower the spell the cheaper it is

Icebox: so the lowest one costs nothing

Default avatar.png LordSkaven: the first one is the list is free to learn

Icebox: while the 2nd one cost 1 ingredient

Pavasaris: ok, got it.

Pavasaris: thanks

Default avatar.png SabertheLost: So, I increase in rank if I cast a spell that is not part of my algorithm instead of sleeping. I need a better algorithm :)

Default avatar.png SabertheLost: (As long as it´s not a base spell)

geppoz: how do you weight price/distance?

geppoz: e.g. better 13rupies in 3 turns or 10 in 2 turns?

geppoz: which factor seems best?

Icebox: just compare it to how fast the opponent can do those potions :thinking:

geppoz: i mean, without opponent

geppoz: im behind :D

ntroPi: 10/2 > 13/3 This assumes that your predictions are exactly correct though.

Icebox: is it though ntroPi?

geppoz: ntroPi why? and 9/2 ? 8/2?

Icebox: well this one's easy

Icebox: :D

Icebox: oh or you mean

Icebox: nvm

Icebox: I though you were asking if 9 in 2 is better than 8 int 2

Icebox: in*

geppoz: i.e. how many rupies worth wait a turn?

yhyoxx: rupees per turn

ntroPi: it depends frwom where you're counting the turns

geppoz: in silver version without calc opponent

geppoz: from current state

ntroPi: from current turn -> hard to say. from last brew -> 10/2 > 13/3

ntroPi: but there is a lot of extra stuff that can change it. Like enemy actions, game end, next potion ...

ntroPi: @Icebox or am I missing even more?

Icebox: I mean if you look at it in a way

Icebox: like using resources

Icebox: as in spells are your resources

Icebox: what are you left with?

Icebox: maybe 13/3 leaves you with betters spells

Icebox: or more efficient rests

Icebox: also you spend 2 turns progressing anyway

Icebox: so the 3rd action is like

ntroPi: both of which are not clearly measurable either.

Icebox: "would I do X" for 3 rupees

Icebox: if the extra action is resting then 13/3 is always better because you have to do it eventually anyway

geppoz: i have no speed problems, but having hard time to score states

ntroPi: Yea, I think you're right, in the end the search algo must decide and no fixed score can be decided beforehand.

Icebox: sometimes the 13/3 will be because you need to learn an extra spell

ntroPi: geppoz try not giving it a numerical value but compare states in a more complex way.

Icebox: which means you spend a turn learning which also progresses you

Icebox: so it's like "learn this spell and get 3 rupees for free" deal

Icebox: 10/10 would do

ntroPi: I completely agree Icebox - I just interpeted the question as: Assuming everything else is basically equal, which should I prefer. I'm aware the assumption is shaky at best.

Starbender: how do you guys measure your execution time ? I measured up to 6000ms on my first iteration and do not timeout, that means the execution is interrupted, what now ?

Starbender: I wish codingame would display the time it measures

geppoz: ok, but question then is: how much worth have learnt an extra spell? :D

therealbeef: did you start counting when the first stdin comes in?

geppoz: ty for tips, let me think about

Starbender: @therealbeef oooh

Icebox: geppoz it's worth a lot

therealbeef: waiting for stdin is not part of time i assume

Starbender: I definitely counted the stdin

Icebox: the more spells you have the better

Icebox: at the start of the game you learn spells without any direct game

Icebox: if you can associate gain with a learn action then that's just really good

Icebox: imagine if you had an option between cast A + cast B and learn C + cast C

Icebox: C is always better

Gronahak: if you don't time out because of the extra branching factor :p

Starbender: thanks @therealbeef you helped me out 😁

WINWINWIN: Neumann in legend :) euler was right

therealbeef: :-), this had me puzzled for a while too ;-)

Default avatar.png MisterCage: i am new and i want to practice but i am confused where can i find the coding challegnes? ai or algorithms?

Icebox: https://www.codingame.com/contests/fall-challenge-2020

Icebox: MisterCage

Default avatar.png MisterCage: huh thanks

wlesavo: wtf, i tweaked a single parameter and got to top6 with smth like 30k node visits

ZarthaxX: 30k node visits? wtf

CommanderCero: thats not much i reach 100.000 and some claim to reach 200k :sweat_smile:

Nerchio: yeah but he's using beamsearch without duplicates i think

Icebox: that's kindof the point that it's not much CommanderCero

Nerchio: you can have 200k nodes and 150k useless

CommanderCero: yep thats the case with my search

wlesavo: ZarthaxX yeah, its unique count

jft63: wlesavo to check the the unicity, it's based on the action list or on the state content?

wlesavo: state, you can use spell and then rest or rest and then use, same actions different results

ZarthaxX: ahh okey

ZarthaxX: beamsearching and 30k uniques wlesavo?

jft63: interesting, thax

jft63: thx*

wlesavo: yeah, suddenly thats enough

ZarthaxX: im amazed that you are beamsearching and you have such good results

ZarthaxX: i thought it was hard not to prunne useful ones

ZarthaxX: honestly, :clap:_

ZarthaxX: gz on that one

Default avatar.png Bikoko: when will the laderbroad update?

wlesavo: spend only a half a day on this rewrite also, wasnt even gonna try

AntiSquid: the updates are always live and up to date, not sure what you mean Bikoko

ZarthaxX: half day :rofl: sheez

ZarthaxX: nice change

wlesavo: still not sure why this even works

wlesavo: i also have deprecated mc for opponent prediction :smiley:

jft63: you mean you do not predict opp?

wlesavo: i do but very vvery badly

jft63: ok

AntiSquid: :thinking: so bad enemy prediction is the key !

wlesavo: yeah nobody expects that!

CommanderCero: great i already have that

CommanderCero: wheres my t-shirt

wlesavo: CommanderCero now you just have to reach good players

AllYourMCTS: are there different tshirts for every contest?

wlesavo: i know there are 3 sprites to choose from, so you can get different ones

AntiSquid: robot hand is best one

wlesavo: i choose that one for ooc yeah

yhyoxx: u guys are getting tshirts ? :thinking:

AntiSquid: it's top 20 only

yhyoxx: the only goodies im getting are headaches

yhyoxx: and KNOWLEDGE

AntiSquid: the friends you made along the way are the real headaches

yhyoxx: ???

AntiSquid: it was a joke

AntiSquid: never heard of the meme "the real prize are the friends we made along the way" ?

karliso: "If the absolute final spell is learnt on the same turn as a read-ahead tax is applied, the extra tier-0 ingredient is discarded." -- what does this mean?

eulerscheZahl: when you empty the tome completely

Nerchio: don't bother it doesn't happen :D

AntiSquid: if the last spell that can be learned is learned . the taxcount can't be gained

Default avatar.png BoBot: make it happen!

eulerscheZahl: then there is no more spell to place the tax at

karliso: oh

eulerscheZahl: so your taxes goes into the void

Default avatar.png BoBot: no resting, only learning and casting!

Starbender: but isn't the last spell free ?

Icebox: not if you both pick with enemy

Icebox: and different spells

eulerscheZahl: if there are 2 left and you take the expensive oneand ..

Starbender: oh right

eulerscheZahl: won't happen in legend games anyways

AntiSquid: or if you play it in 4 players: https://spicee.mattle.online/lobby/rooms

Default avatar.png NojuZ: I keep getting "has not provided 1 lines in time." I even put cout << "BREW" at the very start of the program and it still doesn't recognize that I'm outputting something. What could cause this?

Csipcsirip: try comparing your code with the default one

Default avatar.png NojuZ: I don't have much honestly, just a few vectors and structs. I only store the data. Shouldn't affect anything that comes before their declaration.

Default avatar.png NojuZ: I put marked everything but cout as a comment and it still gives me the error.

geppoz: cout << "BREW"<<endl you mean?

Default avatar.png NojuZ: Yeah.

eulerscheZahl: " BREW " << id << endl

Default avatar.png NojuZ: Oh nevermind I was missing endl. Thought I added it

geppoz: (if it was id missing you would have invalid move, not no output)

Default avatar.png Bert.Russell: Hello I get random timeout errors in the Arena, but when i choose "send game parameters to IDE" I dont get such errors.

Has anyone encountered sth like that?

MadKnight: because it's random

MadKnight: as u said

geppoz: yes I did in python

Icebox: and

Icebox: I

Icebox: did it

struct: Did you sleep yet?

Icebox: no ofc not

Icebox: imagine sleeping smh

yhyoxx: what's sleep ?

DomiKo: what happend to Rounddice?

Default avatar.png ITACIRE: hi everyone

yhyoxx: fen al khawa

yhyoxx: hello*

Default avatar.png ITACIRE: I'm doing an exercise in here

yhyoxx: good luck

Default avatar.png ITACIRE: I have to return the ma element of an array

Default avatar.png ITACIRE: not using functions

Default avatar.png ITACIRE: i've tried lot if etc but still

Default avatar.png ITACIRE: :grimacing:

Default avatar.png ITACIRE: need a hint

yhyoxx: not using functions wym ?

Default avatar.png ITACIRE: cause when I use them it doesn't it tells me that i fail

Default avatar.png ITACIRE: i'm using php

Default avatar.png ITACIRE: and when i use max(array(1,5))

yhyoxx: just google how to get max element of an array

ParticleBeam: Time for my 99th rewrite

Default avatar.png ITACIRE: lol okay thanks :wink:

Default avatar.png Panagis: Warning: your code did not read all available input before printing an instruction, your outputs will not be synchronized with the game's turns and unexpected behaviour may occur

ParticleBeam: Your code might be timing out

Default avatar.png Panagis: how i can see my timing code?

Earthborne: time your code

Default avatar.png Panagis: what is the max time per round?

Earthborne: 50 ms

Default avatar.png Panagis: ok thanks

Default avatar.png Panagis: if i exceed the limit what happends?

Default avatar.png Panagis: i am asking because i think this is my problem

reCurse: You get that warning

Earthborne: You get out of sync and the game thinks you're printing before reading input for next round

Default avatar.png Panagis: mmmm

Default avatar.png Panagis: thank you very much

JFB: Panagis - this message mean that your first output (print) is BEFORE you read all data in the round.

JFB: It can be OK. For example I print debug message when create some data before I start reading. And receive this message.

JFB: It is warning - and as with all warnings - it better to avoid them but sometimes, if you understand the reason, is OK to have it

Default avatar.png meh1001: If you use file=sys.stderr in your debug prints it won't give you the warning

Default avatar.png meh1001: err, sorry I guess that only appluies to python. If you print your debugs to the stderr stream, however you do tha tin your language

Earthborne: Here it's most probably a symptome of being too late from the round before, though

Counterbalance: I don't get that warning and I also print to stderr before reading any input

JFB: As you aid it I checkae and and now I do not have this nmessage. Strange, 2 days ago I'm sure that I have had it

thibpat: hey all, I'm streaming my progress on the Fall challenge (javascript / english), trying to climb the silver league, feel free to join https://twitch.tv/thibpat :wave:

eulerscheZahl: DomiKo 03:33PM what happend to Rounddice?

he lost his corners?

Icebox: :|

eulerscheZahl: be careful Icebox or you will share that fate

AntiSquid: added 1 line to my wrapped 10 liner ruby code and suddenly getting decent winrate

reCurse: Lost his edge

AntiSquid: sorry for offtopic, Rounddice best dice

JFB: AntiSquid - add more lines to promote to Legend ;-)

DomiKo: corners maybe

DomiKo: but points for sure

JFB: AntiSquid - I do not understand - you use C++ to run Ruby code ??? (I see that you use C++ and you write about wrapped Ruby code)

mlemm: can i play my code on CG from multiple source files ? it's getting very messy here with +700 lines on one single file :disappointed_relieved:

struct: Use local ide and merge files

struct: There is an extension to sync one file with cg

AntiSquid: submit the binary

struct: and get disqualified

struct: good advice

mlemm: wow really

mlemm: thanks struct ill try that

struct: https://www.codingame.com/forum/t/codingame-sync-beta/614

eulerscheZahl: https://www.codingame.com/forum/t/cg-local/10359

mlemm: :pray:

eulerscheZahl: stupid bot refuses to win :(

AntiSquid: 6849

AntiSquid: participants

**eulerscheZahl predicted 7k on last saturday already

struct: euler was right

struct: Impresive numbers

AntiSquid: forgot to deduct email.

struct: in comparison with previous contests

CommanderCero: can you also predict my lotto numbers pls

AntiSquid: the ones you pick, not the winning numbers then :P

wlesavo: wow that submit from agade

JFB: wow

struct: not bad

Donotalo: what strategy will take to legend from gold?

AntiSquid: winning

Icebox: damn

wlesavo: AntiSquid dont be so harsh, not loosing is enough

Icebox: those are some wise words

Donotalo: :( any better word so amateurs understand?

therealbeef: if you dont play, you cannot lose

Default avatar.png BoBot: wow, Gold boss learned 13 spells in one game

hasleron: Do you guys know these "bearing bugs" where you hopefully fix them just to lose 300 ranking places as a result? #fml

Default avatar.png BoBot: 39 turn game, beat me with 101 points https://www.codingame.com/replay/508086303

JFB: In Legend only C/C++/Rust (+ 1 Python & 1 Java) It looks that it is really CPU contest

BrunoFelthes: 2 java

BrunoFelthes: it is not CPU... I'm checking 10k states

Default avatar.png meh1001: I can only check 650 nodes reliably without timing out with my current crap pile

jft63: you are just checking the right nodes :)

BrunoFelthes: that is the thing @jft63

jft63: BrunoFelthes are you simulating opp?

BrunoFelthes: yes

BrunoFelthes: 6ms for op, 30 for me

jft63: ok

BrunoFelthes: 14 for GC

JFB: Sorry BrunoFelthes - I missed 2nd java. Of course if you are really smart you can check only 1 node - the best one :-)

BrunoFelthes: I'm just saying that you can get legend checking 5-10k nodes...

BrunoFelthes: I did it

BrunoFelthes: And I did it without local tuning...

BrunoFelthes: My last step is build a local simulator to tuning my magic numbers...

ddreams: there's usually publicly available ones

Westicles: Do you guys think a scrabble optim would be fun? You get results that look like this

BrunoFelthes: yes, i'm building a GA algo on top of the brutaltester

Westicles: http://chat.codingame.com/pastebin/0ec36cab-c613-4a66-a31b-ce8be0cbc36c

wlesavo: im honestly dying to read Fangel's pm

lowzhao: i still not sure what is the criteria to prune the branches do you guys have any idea?

jrke: wlesavo what you did to be in legend

wlesavo: jrke rewrited to beam search yeasterday

JFB: BrunoFelthes - in topcoder is person (wleite nickname) from Brazil to, who always use Java. And often win with C/C++ programs.

wlesavo: and fixed most of the bugs today :smiley:

Default avatar.png BoBot: @wlesavo because Fangel is Python?

jrke: wlesavo beam width and whats the depth and nodes visited ?

wlesavo: jrke somewhat low, like 30k unique visits

jrke: mine unsubmitted beam search is very much unoptimized rarely touches 2k

wlesavo: didn't even have to tune, second working submit got to legend

wlesavo: i had some low counts because of a lot of bugs at the start also

m0u53z: ok

wlesavo: but i believe 30k is still very low

lowzhao: wlesavo did you used any algorithm for learning?

jrke: wlesavo beam width?

wlesavo: well learning is incorporated in sim lowzhao

wlesavo: jrke 500-700

wlesavo: not a lot also

lowzhao: thank you!

geppoz: depth?

jrke: wlesavo are you using vectors or anything else?

Aravindhsiva: https://www.codingame.com/clashofcode/clash/14723200d5c597610b6a894e48b35c55bee05cb

Aravindhsiva: Interested can join

AntiSquid: Aravindhsiva https://www.codingame.com/contests/fall-challenge-2020/leaderboard/global

wlesavo: jrke vectors and pq

jrke: how do you sort vectors?

Westicles: What is a smurf (in CG context)?

Astrobytes: alt account

Westicles: ah

Beresta: with beam search, do I understand correctly you use some heuristics to evaluate the state and keep N best ones to look further?

Csipcsirip: ye you give an eval score to every state and keep N best after every depth

struct: From what i understand its bfs with pruning

Beresta: how do you incorporate enemy moves for beam? I guess if they are part of the search - you will just look for worst enemy moves and best your ones :D unless heuristics maybe balances both somehow, or enemy is just handled separately

Icebox: looking for enemy worst would find you the best choices if enemy is trolling

ClosetAI: With enemy present it's much harder to evaluate states and also number of states is squared

struct: yeah, if you have 6 moves and enemy has 7 it will be 42 combinations on depth 1

jrke: how you guys sort vectors queues or arrays in c++ for beam search?

CommanderCero: std::sort

jrke: it takes lot of time for me

Beresta: I guess some sort of priority queue (heap or something)

CommanderCero: although i use a heap, but people didnt like

CommanderCero: that

ClosetAI: nth_element should be better in theory but it shouldn't matter really

CommanderCero: isnt that essentially partially sorting

ClosetAI: yes

jrke: can anyone provide me link for heap in pq

CommanderCero: what do you mean with pq

lifetimeLearner007: Hi. I'm using Javascript for this contest. seems 'readline' is very slow and taking most of the allotted time. Can anyone suggest a faster alternative?

Earthborne: Clock starts after input is given :)

Beresta: I guess that? https://en.cppreference.com/w/cpp/container/priority_queue

wlesavo: yes

Beresta: funny that apparently there is no default implementation in C# somehow

lowzhao: why gold boss become unpredictable?

lowzhao: some game with different outcome

CommanderCero: timing issues

CommanderCero: probably

lowzhao: I see.

lifetimeLearner007: yes @Earthborne, but reading the input and storing it shouldn't take much time right. But this is taking too much time.

eulerscheZahl: are submits getting slow again?

Earthborne: Are you timing from after readline?

CommanderCero: yes

CommanderCero: otherwise you will measure the time it takes to get the input

CommanderCero: including any delays

Earthborne: ^

Csipcsirip: any tried calculating some stuff on a thread while reading inputs btw ?

lifetimeLearner007: yeah logging time taken around readline

wlesavo: here is some top20 bot gameplay https://www.codingame.com/share-replay/508140389

lifetimeLearner007: const t = new Date().getTime(); const actionCount = parseInt(readline()); // the number of spells and recipes in play console.error(new Date().getTime() - t); This is taking 30+ ms

tobk: I don't get it. My bot is occasionally timeouting, but the only bit that could timeout is running in a timed loop with some very generous buffer (just 30 of the 50 ms)

wlesavo: tobk same, had to go to 30msand still some timeouts

Earthborne: That shouldn't matter on you time budget lifetimeLearner007 try: inputs -> start clock -> calculate -> stop clock -> print

tobk: lifetimelearner if you start the timer before taking the first input, you effectively count both your and your opponents turn

Batpapa: Hi! Quick question :) In C++, is the arena compiled in release mode? Or in debug like in the IDE?

Zenoscave: wlesavo why? End search?

lifetimeLearner007: oh! is it? I didn't know this. Thanks @Earthborne and @tobk

reCurse: Depends on the language

struct: Batpapa pass O3 flag

Batpapa: how??

struct: #pragma GCC optimize("O3","unroll-loops","omit-frame-pointer","inline")

struct: at the top

struct: You dont neeed all of that

wlesavo: Zenoscave i think weight of learning was bigger then the discount of winning one turn later, smth like that

Batpapa: wtf thx!!

struct: O3 makes it harder too debug though

Batpapa: sure

Batpapa: but just for the arena, not usually ;)

JFB: wlesavo, tobk - it my bot timeouts generate sort() (standard C++ sort). I have had sometimes 200k elements to sort - and sometimes it last 20 ms. So even with 30 ms time limit I have had timeouts.

tobk: My code is, very roughly, read-inputs, start timer, search-loop to find best action for 30 ms, if no result get any applicable action (e.g. just learn any spell or rest), and still sometimes timeout :-/

wlesavo: oh no, not that. search shouldve ended earlier, it means idk why

Zenoscave: ah

tobk: I have some debug output after the 30 ms, but neither that nor the fallback-action selection should take 20 ms (and most of time time it takes only ~2ms according to anoter timer-output after that)

JFB: tobk - I do not know your bot - but in my it was problem with sort() of big array. I spend few hours becouse it was only one, "innocent" line

tobk: JFB Thanks, but I only keep track of the single best action (actually, best path, but those are never very long, seldom more than 20 elements)

Batpapa: Alllllright! O3 flag just made me explore twice the number of nodes :o

Batpapa: Big tank you!

Washier: <jealous C# guy iver here>

JFB: OK tobk. So it is not your case.

struct: C# has release mode

struct: cant be jealous

Washier: <shocked pickachu meme>

Counterbalance: tobk are you printing the total time right before you print the action? In the 'main'?

Washier: how?

struct: its on release, you dont need to do anything

Washier: oh, ok good to know thanks.

eulerscheZahl: my sim count is zigzagging like crazy. 150k in one turn and 40k in the next. :/

tobk: Counterbalance I take time twice: once in the main loop, and in my "search-action" function. the 30ms timeout is in the search-function. I print both the search-time and the total time.

Counterbalance: and the total time is <= 45ms?

Zenoscave: Same eulerscheZahl

eulerscheZahl: then i blame the servers

Zenoscave: My code is fairly inefficient. not sure if it's servers

Counterbalance: I had timeouts like that too; debugging the time + action, next line would print the action (in main). It would timeout, even in ide.

Zenoscave: GC is still my issue

JFB: eulerscheZahl - I think that some "black hats" hack CG and use your bot to mine bitcoins

Zenoscave: lol JFB

eulerscheZahl: shh, not in public chat

Zenoscave: Was the chat server down for a while?

eulerscheZahl: yes

Zenoscave: I had a could not connect to server for a good 8 hours

eulerscheZahl: the old certificate issue is back

Zenoscave: It was nice

eulerscheZahl: to force you to write more code

Zenoscave: It helped

struct: inneficient in what way?

eulerscheZahl: too bad we have discord now

struct: performance?

Zenoscave: yes struct

JFB: In 2 h my bot (without my actions) went from 79 to 53 in Gold. Using sofisticating prediction algoritms (linear regression) I predict that bfore end of the contest my bot will be on 1 position in Legend

struct: I can tell you that my code that averaged aroudn 1mill-900k sims on STC average is now doing 500k with same code

numb3r5: hey, whats the rank beside people's profile? it says im 12449th

struct: profile is CG rank

numb3r5: based on experience?

eulerscheZahl: based on all contests and multiplayer games

eulerscheZahl: +optim and clash of code, codegolf

eulerscheZahl: but we don't talk about clash of code

numb3r5: why not :no_mouth:

Zenoscave: It's the red-headed step child

wlesavo: Zenoscave oh i figured that one out, the opponent can actually win with one move, but somehow dont want to, so my sim is sure im lost already and goes nuts, not sure it is even important, that shouldnt happen in legend

JFB: We simple NEVER tahlk about Clash of Code !

JFB: ;-)

Zenoscave: How important is endgame prediction in legend?

Astrobytes: The first rule of CoC is never talk about CoC. In World chat.

Zenoscave: Seeing if it's worth sims

eulerscheZahl: very @Zenoscave

tobk: Just noticed another weird thing about my timeout issue. Sometimes the loop that should end after 30 ms will in fact only end after 38 or more ms (according to the print immediately afterwards)

eulerscheZahl: quickly getting some points before it's too late

Zenoscave: Good point

tobk: which is weird, since the loop makes ~5000 iterations, so a single iteration should never take remotely that long (it just tests all the actions which are applicable)

struct: well didnt one legend player reached it with 10k sims?

CommanderCero: hmm my bot always loses because my opponents panic brew in the end... I think i should start simulating them...

tobk: I'm starting to suspect that my timing code might be flawed, using nanoTime In Java (Kotlin, actually)...

Zenoscave: CommanderCero you timeout too

CommanderCero: yeah just saw that

Zenoscave: http://chat.codingame.com/pastebin/b06b7e0d-633c-487f-b4ff-f48ca81d1683

struct: Ok I need to think on eval now

CommanderCero: im 100% sure thats not my fault

struct: Only thing im missing

CommanderCero: 99%

Zenoscave: fuck

JFB: wlesavo - investigation one of my old timeouts I found that I assumed that action_id > 0. And use 0 for REST. So unfortunatelly it was action_id == 0 and instead to learn it - I done REST in the loop :-)

struct: RIP

CommanderCero: nice code

struct: Automaton2020 send help

CommanderCero: xD

Zenoscave: that was a huge mistake

struct: AutomatonNN help a bit too

AutomatonNN: most likely doesnt matter that much

struct: you are probably right

CommanderCero: its cut off

Csipcsirip: endgame detection might be important, but completly ignoring the opponent is still top20 worthy :p

wlesavo: JFB yeah, also checked that, also i though that spell id shouldnt be greater than 100

eulerscheZahl: my rest id is 199 :D

Zenoscave: lol eulerscheZahl

struct: Csipcsirip you got top 20 without opponent interaction?

eulerscheZahl: call 199 as i say to myself

Csipcsirip: yup

struct: ok if i dont get gold i delete

Zenoscave: NEW ACCOUNT TIME

eulerscheZahl: not again

struct: I have 1 day 15 hours to create just the eval function

Zenoscave: if struct doesn't get gold is tobou comming back

eulerscheZahl: i'll give you my old c# but don't delete

Astrobytes: No deleting again please struct

struct: No need euler I just need to find a good eval

eulerscheZahl: you will lose you mod rights

eulerscheZahl: i'll tell thibaud

Astrobytes: And you are a Valued Member of the Moderation Team

tobk: I got to (bottom) gold with just a dumb BFS for best actions...

Csipcsirip: struct if u want a good eval think about the simplest things, that describe the game value well

Astrobytes: "i'll tell thibaud" :D

wlesavo: struct you mispelled legend

struct: wlesavo im not sure about legend

struct: I have a good sim

struct: But im not sure im capable of eval

eulerscheZahl: 1*tier0+2*tier1+...

eulerscheZahl: + game score

Zenoscave: ^ this.

Zenoscave: That should be enough

Washier: yes, think i got that, and only that, right so far

Csipcsirip: ye i didnt want to copy paste my eval but basically ^

tobk: you also take number of learned spells into account?

eulerscheZahl: y

Zenoscave: es

Nerchio: breaking into legend feels pretty hard

eulerscheZahl: :es:

eulerscheZahl: that's the whole point about legend

Nerchio: true

struct: All legends should be like bit runner legend

JFB: It is all due to all submiting good bots befotre start of the Legend

miszu: good morning all :)

Washier: i prepared myself to build a sim this time. To do it right. Didn't work out - how do people built it that fast!?

JFB: They set the bar

ParticleBeam: Probably much practice

miszu: practice and also from beginning they went into sims

eulerscheZahl: this was a simple game egine

miszu: that's what I would do next time.

Washier: hey ParticleBeam. Chestbump

ParticleBeam: Hello

struct: this game is simple, yet I dont know how many times i rewrote

JFB: struct - maybe you rewrote due to siplity of the game?

miszu: my difficulty is to compute all possible moves and apply the move to your state. Lots of corner cases I find

Washier: i did have a root canal on monday, but no excuses. i will do better next time

Washier: but have to add, its a good game. you can get into silver with if-else and clever sorting

ddreams: keep trying different approaches after the contest ends too

kovi: +1 for -1 rest

eulerscheZahl: ?

kovi: rest action code

Washier: <grabs popcorn>

eulerscheZahl: ah, the ID?

miszu: wait that's a good question. How you represent the rest as an action?

Washier: <chewing>

struct: represent?

struct: how I apply it?

miszu: ok so

Csipcsirip: cds.reset()

miszu: I have a vector of Action that represents all legal moves. But it doesn't include the rest.

ParticleBeam: Depends on your structure I suppose. I just create an action with a type I call "REST"

Zenoscave: same ParticleBeam

miszu: yeah it's a hacky way I thought when I went to bed

ddreams: I created an action with id 255, type REST

struct: Action(ActionType::Rest)

eulerscheZahl: class Rest : public Spell

ddreams: or 254 for REST and 255 for WAIT (to avoid crashing where I don't have any legal actions)

miszu: why would you use wait anyways

miszu: rest is just wait but bettre

ParticleBeam: REST is always allowed even though it gives an error message

struct: https://i.imgur.com/UmjYK2f.png

struct: (╯°□°)╯︵ ┻━┻

ddreams: makes it easier for me to see when I have a bug

Csipcsirip: nice

Zenoscave: rip struct

miszu: stuck in silver eh

struct: either my eval sucks

struct: or my bfs is wrong

struct: my numbers dont seem right

Zenoscave: bfs?

Zenoscave: what depth

eulerscheZahl: do we need more mods or can we handle it without struct?

struct: Sims: 759761 Depth: 8

struct: no pruning

ParticleBeam: Ive rewritten multiple times and it is all being beaten by a piece of old code I wrote earlier in the week. Its quite depressing.

CommanderCero: try pruning that did the trick for me

Zenoscave: Jesus! Prune and you'll be so good to go

eulerscheZahl: this number makes me jealous

dbf: teaser for raic-2020: https://imgur.com/a/Ml4alHQ :)

struct: and that number is not the full depth

struct: it is that depth + 1

struct: just not fully explored

eulerscheZahl: interesting dbf

Zenoscave: Yeah beam search struct

struct: Shouldnt I create eval before beam search?

dbf: moved to next week, so no clash with codingame

Zenoscave: Well you need Best N moves not first N moves

Zenoscave: so yes

struct: ok, time to take algebra course

eulerscheZahl: oh, CG is the reason for the delay?

Gronahak: @dbf what's raic ? Looks cool !

eulerscheZahl: russian AI cup

ClockSort: struct it's because you aren't excluding duplicate states. i had the same problem. excluding them cuts states by 10x while leaving depth the same or +1


eulerscheZahl: https://russianaicup.ru/

miszu: in c++, how you define a pointer to point to a const variable?

CommanderCero: oh noice follow up for after codingame

eulerscheZahl: similar to codingame, they have a contest once per year

struct: yeah, i think I can also exclude duplicate states

dbf: eulerscheZahl, no they wanted to start today but have some issues with test system, so moved for next week

struct: I think is something ill ad to the list

Gronahak: ty

ParticleBeam: const int* var?

ParticleBeam: As apposed to int* const var which is a constat pointer to an int

miszu: that's what I did but still it complains

Washier: why have a pointer to a constant var?

CommanderCero: you can move the const around

CommanderCero: means the same

ClockSort: better to have a pointer to a pointer to a const var

miszu: easier to read

dbf: there should be more details onTuesday, so I'll post something here :)

miszu: I'll put a snipet 2 sec

miszu: http://chat.codingame.com/pastebin/f338fecc-4ee7-43a4-87a2-2a379c57ac9c

Gronahak: @eulerscheZahl thank you for what you said yesterday in the chat I gained ~200 ranks because of it :D

ParticleBeam: https://stackoverflow.com/questions/21476869/constant-pointer-vs-pointer-to-constant

ParticleBeam: Apparently

CommanderCero: is players an array of pointers

miszu: players is an array of player

miszu: size 2

miszu: me and the enemy

CommanderCero: try changing the * to &

eulerscheZahl: i have no idea what i said 5 minutes ago :D

Washier: or lose the const's

miszu: I can do this: const Player p = players[playerPos];

miszu: but it does a copy

Washier: weisbier?

CommanderCero: yeah or const Player& p

miszu: I want just a ref

miszu: ohh

CommanderCero: problem is if you access an array you do not get a pointer

Washier: ^^

Nerchio: euler do you use tests in your bots

CommanderCero: if you want an pointer you have to do const Player* = &players[index]

struct: I removed vector and my performance :rocket:

miszu: ohh okay

miszu: I forgot that pointers need a storage

CommanderCero: thats why i prefer references Player& p = players[index]

CommanderCero: thats always possible, but references cant be overwritten with other references

miszu: const Player &p = players[playerPos];

Washier: never liked references. but i'm a m$ monke

miszu: this doesn't do copy constructor?

CommanderCero: nope

miszu: okay ty

CommanderCero: that is equivilant to pointers

CommanderCero: except it cant be null

Washier: references confure people

miszu: eggsellent

miszu: I gave up on trying to reach gold but I want to improve my c++ knowledge

miszu: and learn some optimizations

Q12: I'm so badly want to be in gold :tired_face: I am in rank 108, I am sooo close!!! :weary:

Zenoscave: Submit's slowing

ddreams: references are much easier conceptually than pointers

miszu: ddreams true

ddreams: think of it as an alias for the same object

Washier: dunno, i like pointers. but i'm no pro

miszu: I remember in java how teacher says: you pass by value or by refence. Taht's a lie. All is by value

Default avatar.png ScifiSpirit: but aren't some of the values references? :P

Default avatar.png ScifiSpirit: if not all of them (i don't know Java)

Default avatar.png ScifiSpirit: so all are values, which are actually references

miszu: thing is, if java is doing by reference then you could make a swap function

ddreams: different concept for reference, so that's confusing

miszu: true

ddreams: cleaner in C++

Washier: my backgroun is in in moving data quickly. cant afford to copy stuff

miszu: once you understand a bit of C++, I enjoy it more than java

Gronahak: @Q12 me too man... I've peaked at rank 6 in silver I'm tweaking some magic numbers hoping to make the cut :D

miszu: java is like noob firendly. They simplify the complexity a lot by not allowing a lot

Washier: no mem management yes

miszu: yeah that's one of the thing

ddreams: no operator overloading, or did they add that in the end?

miszu: no you can't

Zenoscave: I don't think so ddreams

miszu: at least in java 8

Zenoscave: maybe in java 200

miszu: at work we still use java 8

ddreams: absolutely hated writing mathematical code in Java for that reason

Q12: @Gronahak I cross fingers for you, I know we can make it!!! :grinning:

Washier: come to the dark side. C# allows almost everything

ddreams: C# is Java done right

Zenoscave: or C

Washier: even pointers

miszu: or assembly

miszu: no rules

Zenoscave: Why not both?

miszu: no such thing as const, private

Zenoscave: por que no los dos?

eulerscheZahl: Nerchio 06:55PM euler do you use tests in your bots

as in: unit tests?

eulerscheZahl: no comment :(

Washier: I like C. worked on weather station data loggers before in C - so clean

Zenoscave: https://www.codingame.com/share-replay/508190408

wlesavo: i only put random asserts here and there

Zenoscave: oops with the null move

Nerchio: guess not then euler :D

miszu: next c++ question

miszu: my function returns something expensive

miszu: but I don't want it to make a copy at the end

Washier: pointer

miszu: somehow to use the local variable

CommanderCero: c++ optimizes that, return temporary values wont be copied

CommanderCero: note temporary

Csipcsirip: or just use global variables :p

CommanderCero: yeah but then you have 1 global variable for each function, although c++ optimized that years ago xDF

Washier: make it simple, that function is repsonsible for creating the object, and returning its adress, calling code to use and destroy

miszu: I thought the local variables get copied to a not local variable and return it

Nerchio: i tried C++ and the only way i figured out was to move unique ptr or use shared pointers to avoid things going out of scope when i need them lol

ddreams: global variable doesn't need to reserve new memory every time though

CommanderCero: https://stackoverflow.com/questions/12952295/c-returning-temporary-objects-confusion

CommanderCero: ddreams thats a good argument

miszu: CommanderCero yeah that was my understanding

miszu: there is no hacky way to return a temporary and avoiding undefined behavior?

Default avatar.png ScifiSpirit: yep, return value optimization might trigger there. Google it to see how it works. If it doesn't apply in your case, you could either pass a reference to object you created outside of the function, or use shared_ptr or something

CommanderCero: argh i sent you an post form 2012 my bad

CommanderCero: sorry i was distracted

miszu: I don't want to create backdoor

CommanderCero: so since c++ 11 there is the move operator

Default avatar.png ScifiSpirit: or maybe you could also move construct another object

CommanderCero: meaning if your class can be moved

CommanderCero: it wont be copied when returning by value

miszu: while ago I read something if you use const in the signature method you could return the reference of temporary and still be allowed

Washier: why so complicated peeps?

CommanderCero: all objects have move constructor by default

miszu: ohh

miszu: okay

CommanderCero: you can also quickly test it by printing in the copy constructor

miszu: but I return a vector

miszu: still works?

CommanderCero: yes

CommanderCero: it will move the pointer to the array

CommanderCero: nothing more

wlesavo: smth wrong with submits right?

CommanderCero: found it https://stackoverflow.com/questions/17473753/c11-return-value-optimization-or-move

emh: wlesavo I'm watching my submission. submitted a while ago

emh: 27 minutes ago

Zenoscave: 34 min ago

Zenoscave: at 50%

Washier: busy busy

miszu: apparently returning by value is fast.

miszu: so no need to worry

wlesavo: i mean for legend it really looks broken, you cant move from the bottom

The_Auditor: the event page has a nice airtable with "useful resources". is there a was to save or download that ?

wlesavo: i would understand if it would be just me

ZarthaxX: emh what did you do????

ZarthaxX: wtf

eulerscheZahl: why ZarthaxX?

eulerscheZahl: submits are getting slow in general again

wlesavo: ok it is just me then

Illedan: 336 results found for «Score - Computing»

ZarthaxX: to get to top silver toad :P

struct: Time to get my spreadsheet

eulerscheZahl: for what?

struct: eval

struct: I dont think I have any bot here with an eval different from -1 and 1 besides CSB

AntiCheap: I can't because I don't have excel

struct: ah csb

struct: stc*

eulerscheZahl: there are other spreadsheets

eulerscheZahl: like Libre Office

struct: ^

miszu: when you use const too much it complains you are not allowed to modify state haha

struct: lol

miszu: I thought const keyword is a genious move.. but now I see it is a torture move

lifetimeLearner007: use const for unchanging constants. For all else, use let

miszu: I like to use const as a guarantee I don't modify something by mistake

miszu: but when I actually need to modify something, it plays trick on me

NinjaDoggy: this is by far my lowest (bot performance)/(time spent) contest :(

lifetimeLearner007: it gives error only for re-assignment, not for monkey patching. just don't reassign

NinjaDoggy: coding in c++ wasn't worth it...

NinjaDoggy: takes me like 30 minutes to find an index out of bounds error :(

ClockSort: ha

miszu: NinjaDoggy, you would need it anyways

Default avatar.png ScifiSpirit: :D

miszu: next time, start c++ right away

NinjaDoggy: -_- simply not true

ClockSort: in C# you can spend 0.1ms on that bounds check instead :)

geppoz: submitted 42min ago, 75%

Washier: ^^

CommanderCero: std::vector has the at() function for bounds checks

NinjaDoggy: next time it's java until last 2 days, C++ rewrite at the end

miszu: oh right. [] operator does undefined behavior if out of bound

Washier: not managed

CommanderCero: yeah quite annoying so I use at in the beginning to prevent that

miszu: I was doing a practice here and for 10 minutes I was like... why it's not printing cerr!!???? but then I found out I didn't access [] properly

miszu: # the more you learn

ClockSort: are cg servers running out of memory? I'm timing out on move 1 while mallocing

dbf: ClockSort, try to do malloc after reading of first input line

NinjaDoggy: debugging experience: http://chat.codingame.com/pastebin/4b030cbb-7945-476b-89c9-ddc47ab78bd9

pmor: Make sure you're not allocating too much. I found that out last night when my bot kept timing out for no reason.

Default avatar.png ScifiSpirit: lol, yeah NinjaDoggy

NinjaDoggy: do you calculate how much memory you use?

NinjaDoggy: 768 mbs is a lot

AntiCheap: Fuck I think what I found is bayes

NinjaDoggy: but not infinite

miszu: first instnct would be race condition but here you can't

pmor: I don't, though I do allocate some large pools

miszu: at work, I had similar issue where the error was random. Turns out it wasn't caching data properly and you do some randomness in code so it doesn't recompute like previously

ClockSort: if you exceed memory, it times out, or gives error?

AntiCheap: Could bayes be related with your "eval" function?

pmor: I was getting time outs. Timeouts went away when decreased the size of my pool

miszu: why using pools here?

pmor: avoid allocation in bottleneck code

ClockSort: got it. yes, that was the issue. Too much allocation.

NinjaDoggy: do you not calculate your memory usage? XD

kovi: 26? https://www.codingame.com/share-replay/508221358

kovi: first i thought it was crash/timeout

AntiCheap: Is bayes formula related to statistics?

eulerscheZahl: i saw a 26 match earlier the week. still very rare

eulerscheZahl: especially 26 with that high score

AntiCheap: He could've drown path till win probably

miszu: how the code in ide gets saved?

struct: press play my code

struct: or submit

miszu: ok thanks

miszu: I am coding the apply a learn tomes

miszu: so many things to handle at once

eulerscheZahl: there is no submit button anymore

Zenoscave: TEST IN ARENA

eulerscheZahl: i'm testing https://prnt.sc/vnhuuq

struct: only 12 submits :(

Csipcsirip: 621 submits here

Zenoscave: 197

struct: Save the servers

Zenoscave: Had +1K on OoC

Zenoscave: that was a long month

Zenoscave: about 1 every 40 minutes on average

struct: lol

struct: I dont even have that many for CvZ

struct: and i spammed a lot

eulerscheZahl: and I felt bad already :D

struct: Why so many submits though?

miszu: I checked my UTTT cote, I finished 5th in silver

eulerscheZahl: because of growing frustration and the hope that anything randomly works

Q12: Is "play my code" button doesn't work?

struct: you even have to solve captchas

Csipcsirip: and actually sometimes it works

blasterpoard: kovi thx for letting me know; at one point, my search shows that it can win at turn 25, but it didn't choose that variation

Zenoscave: Struct. Nothing else to do during quarantine

Zenoscave: and was in a statistics class

Zenoscave: so I used submits for a project

blasterpoard: also, in that 26 replay, I got 5 spells I rate very highly (among top 10). and they also have some synergies between them

struct: sample too small, should have submited 10k times

Zenoscave: blasterpoard did you offline spell sorting?

blasterpoard: Zenoscave yes

Zenoscave: struct... every ~4-5 minutes. for a month strait

Zenoscave: I'd be banned

blasterpoard: that's what got me to legend; last nght I ran a simulation and woke up to 20GB of data to parse

struct: 20 GB?

Zenoscave: What's the worst spell? Out of curiosity

Illedan: Id=19

Zenoscave: (0,2,0,0) ?

blasterpoard: I don't remember the worst one, but the second worst one was 1,1,0,0

struct: 0, 2, -1, 0?

Illedan: Not sure, I only have the ID on mine + the score

Zenoscave: ... is there not a 0,2,0,0

blasterpoard: the format in which I have it in my bot is not exactly readable by a human

struct: yes id 15

kovi: i planned to run simu tonight

kovi: but before i check top for another closet...

Zenoscave: closet is gold still i think

Zenoscave: 1st gold

blasterpoard: pairs of spells that have the best effect on my bot are

blasterpoard: http://chat.codingame.com/pastebin/8ef1a9bc-3f34-483a-90b0-d381b058ed4b

kovi: yeah, he is the locm winner known for his excellent draws

aCat: ^^'

wlesavo: dam and im still picking 5 first spells

eulerscheZahl: my worst is BBB => Y

eulerscheZahl: no idea which ID that has

struct: 37

JFB: wlesavo - so you now know how to improve - download replay of blasterpoard, do rank on these replays, implement the rank:-)

struct: oh no

struct: it s0

struct: id 0

eulerscheZahl: and then OO => BBGGG

struct: 5

blasterpoard: I think OO=>BBGGG was my worst

blasterpoard: not sure though

eulerscheZahl: they are very close in my list

eulerscheZahl: best is BBG

blasterpoard: I disagree on that quite a bit

eulerscheZahl: then that's your opinion exclusively :P

blasterpoard: -2, 0, -1, 2 is the best

Zenoscave: I agree with blasterpoard

Zenoscave: now it's not exclusive

NinjaDoggy: lol

blasterpoard: you just need to make sure you have something to start with

eulerscheZahl: maybe i should revise how often my bot rests

eulerscheZahl: that can affect the numbers

eulerscheZahl: but that one is pretty high on my list too

eulerscheZahl: still below BB=>GG

blasterpoard: that's 2nd place for me

E_pur_si_muove: while walking through the search space, don't calculate with rest, just remember that you should had rested here

AntiSquid: i have a formula for mine, overoptimized there instead of elsewhere

NinjaDoggy: how are you guys even precomputing these...

NinjaDoggy: 42 choose 7 is like 2.7 mil

Zenoscave: why chose 7?

NinjaDoggy: depends on how many turns you learn initially

NinjaDoggy: but 7 is a good number i think?

NinjaDoggy: maybe 5 or 6 is enough

NinjaDoggy: 4 learns seem low though

NinjaDoggy: seems*

JFB: I do not know how they calculated but I think that even very simple aproach will work:

JFB: do a lot of runs

NinjaDoggy: yea I'm saying how to store results on CG

NinjaDoggy: maybe that's why they only ranked each one

NinjaDoggy: and pairs

NinjaDoggy: and not all combinations

JFB: I think so

Zenoscave: Yeah just individ or pairs I think

JFB: Only 1 or maybe pairs

NinjaDoggy: ok...

Zenoscave: For Learning Choice

NinjaDoggy: I'm going to try for combinations of reasonable storage

NinjaDoggy: 42 choose 3 seems ok...

tobk: Man, those timeouts are really getting on my nerves! They seem to increase, and are never reproducible or in any way understandable. Could this be caused by the server? are you experiencing similar?

tobk: Or is it just the Java/Kotlin get-time functions being super-imprecise? I read something like that about currentTimeMillis, but nanoTime should be good, right?

JFB: After chabge in my bot I can set time = 42 ms and receive no timeouts

JFB: C++

Nerchio: tobk how many object do you create in a round

AntiSquid: if rand * 10 % rand() * 2 == rand() * 5 timeout the player

AntiSquid: you get the idea

Zenoscave: crashes. Can't multiply method with int

AntiSquid: lol

tobk: Nerchio not sure, but my loop usually does ~5000 iterations before the timeout, so a single iteration (before the timeout is checked again) should not that that long

tobk: you think it's garbage collecting at the end of the search-function?

Nerchio: yeah but when GC decides it wants to clean your garbage you can't say no :D

tobk: good point

Nerchio: it's possible that objects from multiple rounds accumulate i one garbage collection

Beresta: I just forcefully GC up to gen 1 every turn

Beresta: to aviod taht

Nerchio: i don't think you can force GC to do anything, at least here

AntiSquid: this is best contest to have a prune array actually

Zenoscave: prune array?

Beresta: in C# it seems to be easy, GC.Collect(1, GCCollectionMode.Forced); no idea about java tho

Nerchio: there is System.gc() in java but does it do anything? nobody knows

Beresta: heh I see :D

dbf: it should, I used it at step 0 to avoid timeouts on next steps

Zenoscave: Only if the hamster in the wheel stops running

dbf: but later I disabled object pool and don't need it

Beresta: then, well, you could try to avoid producing new objects at all (reuse old ones) :D

Nerchio: yea i create 400 000 nodes in turn 1 and i dont have problems

Nerchio: but kind of limits stuff you can do anyway

Nerchio: if you want to create new lists and stuff

Beresta: yea, annoying

dbf: cool, I tried to preallocate 200k nodes and had timeout on step 2-5

wlesavo: have 2mil also no timeouts

dbf: :(

Nerchio: its probably something else dbf

Nerchio: if the nodes never get cleared out

kovi: closet in legend, gratz

Beresta: well not sure how java gc works, but if its generational - first 1-2 collections could take a while, till most of the objects migrate to later generations and won't be checked every gc

dbf: Nerchio yep, but I tried several times with the same result - not sure why, but with object pool gc is triggered on some step where I have only 50 ms and there is a timeout

Nerchio: that's interesting Beresta actually, cause my bot takes time to ramp up and only in later rounds it can process a lot of nodes in my search

Nerchio: so maybe thats the problem too

AntiSquid: this submit looks too good, where's the mandatory loss streak Automaton2000 ?

Automaton2000: i don't need to know how to do it in a new window

dbf: it would be cool if CG adjust GC settings so gc is not triggered for java apps when there is still a lot of free memory

Beresta: you can't adjust it from running app at all?

ClosetAI: Thanks @kovi , it was a bit harder this time :)

dbf: no, only cmdline params

Beresta: eh, unfortunate

dbf: yes, I allocated only 200k objects, have 64 megs/768 megs used and there is a gc already

Nerchio: well since alocating all the objects turn 1 and using bitset in my search i stopped all timeouts and my turn finishes like 0.3ms after i want it

Nerchio: but its a lot of steps to not timeout :D

struct: poor java users :(

lifetimeLearner007: I'm stuck in bronze. Any suggestions how to approach?

casmith789: bfs should get you out of bronze, or a good heuristic approach

Gabbek: Correct me if I'm wrong (as that's usually the case): search is only half of the job, you need a decent state evaluation score since otherwise you'll end up with empty hand after crafting each potion? I guess I shouldn't try to do anything when I'm sick since I just dropped to the end of silver trying to "improve" my crap :(

dbf: lifetimeLearner007, what is your approach now?

struct: yes, search is nothing without a good eval

tobk: Hm, GCing not at the beginning of each turn (while waiting for inputs/opp's turn), but still occasoinally timeouting

lifetimeLearner007: I'm randomly taking spells to cast and if the new ingredients are closer to any potion, I reward it.

ClockSort: you can't GC during opponent's turn. your program gets no clock cycles.

lifetimeLearner007: but its doesn't target a specific potion to maximize the points though

tobk: just now, in the very first turn, the first line of my debug output was printed (showing my loop took exactly 900ms (first turn), but then the second line (with the actual result) is not printed

lifetimeLearner007: how is bfs applicable here?

tobk: I use BFS to find a path to any potion (and possibly beyond) instead of searching for paths to potions one after another

Rhyme_McAddames: hi Im new to this but can we use python on here?

dbf: lifetimeLearner007, start from your current state and produce child nodes for each possible action (cast, brew etc) use bfs to find node with good score

struct: yes

Rhyme_McAddames: Ok good thank you @struct

lifetimeLearner007: @dbf, child nodes mean updated states after applying action?

tobk: BTW, few days ago when my code timeouted there was a message that I did not read all the inputs, now that message does not come any more. does that mean my code timeouts "differently" now, it is there another reason?

tobk: *it is -> or is

struct: it showed that message when you timeout

struct: Happened to me aswell

dbf: lifetimeLearner007 yes

tobk: So it's a server-thing that that message is not shown anymore?

struct: It was due to the timeout

struct: So yeah, related to server

Rhyme_McAddames: does anyone use python?

lifetimeLearner007: This is what I'm doing currently. Can someone point out my mistake or suggest to improve?

lifetimeLearner007: http://chat.codingame.com/pastebin/163f0463-86e0-496a-b900-93919ed40d56

tobk: Rhyme_McAddames sure, just have a look at the leaderboards (are you talking about the contest or in general?)

Rhyme_McAddames: in general

dbf: lifetimeLearner007 you do some random search of valid sequence. try to build ALL possible sequences and use bfs to find best one

AntiCheap: Use bfs for each potion or brute force

emh: what's your scoring function guys? do you use absolute score, average score, some combination or lots of ifs maybe?

emh: average = absolute total price of brews / turns to make

BrunoFelthes: 13/41 legend players submiting

sadakatsu: I'm not using a scoring function. I use distance to potions plus a simple comparison rule between goals.

emh: ohh hmm ok

Beresta: sadakatsu what you describe is exactly scoring function :D

AntiCheap: I used "missing items" as initial score

AntiCheap: Worked better than expected

tobk: hm, I might have solved my timeouting by just removing my not-very-extensive System.errs. Next goal: make bot suck less.

yhyoxx: goodluck

lifetimeLearner007: yeah, removing std errors output cleared my timeout issue too

Default avatar.png BoBot: haha, nice topdeck by boss https://www.codingame.com/replay/508281755 game have it the exact spell needed

Default avatar.png BoBot: to not lose*

NinjaDoggy: unlucky

NinjaDoggy: outskilled by topdeck

emh: 19 wins in a row yayy, maybe I'm finally going to Gold

geppoz: BoBot 8 initial LEARN ? wow

Default avatar.png BoBot: it is a recent change, might not keep it

Default avatar.png BoBot: and yea, the limit is hardcoded :/

mojojojo: what was the reason to switch to C++ from C# @eulerscheZahl

ClockSort: speed, i'm sure

SirLoxley: no more GC

mojojojo: ahh ok

DToTheE: Are a lot of the strategies people are employing around optimizing their memory-usage and speed?

DToTheE: There are similar games that try to build up combos of moves, might be a smart approach.

particleflux: yay, when pprof show 10% of time used in the actual logic, the rest is memory allocations and garbage collector :S

DToTheE: Thattts grosss lol.

DToTheE: I'm using Python 3, so I suffer a lot from things like that.

DToTheE: I used a lot of objects, and still do, since they help me think through things, and most interviews they expect you to have clean code with nice classes.

particleflux: maybe I'm just too stupid to read that chart

particleflux: Using go tho

DToTheE: Go has structures, they're lighter if I understand correctly.

particleflux: Yes, I thought so

DToTheE: Well, I guess I can try using a big ol' array of integers to represent game states, but thats not ideal..

particleflux: yeah, ugly to work with

particleflux: I wonder.. can we use SSE/AVX instructions?

emh: particleflux yes you can

emh: at least in C++

struct: yes its possible

particleflux: Would probably be helpful for these delta calulations Though in C++, I guess the compiler would do so automatically with -O3

emh: if you make the loops simple enough for the compiler to understand yes

emh: might have to specify march=sse2 or something as well

emh: I have pragmas when I do it

emh: on CG you have to use pragmas ofc

struct: yeah, I dont think O3 alone will do it, but im not sure

struct: At least on CG

geppoz: DToTheE I dropped python when i started to have 30ms spent on the instruction: newboards=[]

geppoz: :D

DToTheE: Yes! I have something like that.

DToTheE: Where it is resetting the game states its examining.

particleflux: -march=native would do all that stuff normally.. depends a bit on how new the CPUs are tho

geppoz: one tip: do it just after sending output, instead of do it at start of your turn

emh: #pragma GCC target("avx2")

struct: #pragma GCC option("arch=native","tune=native","no-zeroupper")

particleflux: Might have to recode things in C++, with a dumb bfs I'm only getting ~350 nodes in 40ms with go :S

particleflux: Or maybe try hard-coded arrays instead of adjustable slices

ClockSort: that's the key, particleflux, allocating a lot of new memory inside your loop will be slow(ish) in any language

ClockSort: but you will also get better performance from C++

particleflux: Well either way I can't get rid of these allocations completely if not pre-allocating a huge chunk

SirLoxley: you can try to reuse objects

particleflux: doing that for the easy parts, with go's capacity vs size for slices Not gonna easily solve the part of allocating storage for new nodes itself

particleflux: Well, it might, with a pre-allocated nodes array

particleflux: That's kinda like implementing your own memory manager though :grimacing:

SirLoxley: this competition clearly puts any implementation relying on garbage collector on a disadvantage

SirLoxley: well ... take it as a non-functional requirement ... you are dealing with a hard real time problem

SirLoxley: missing the deadline = fatal

Nerchio: :joy:

DToTheE: Yeah :P I didn't realize that. I'm so used to walking into interviews, and your algorithm has to be show a nice use of objects, and have a good time complexity, even if its not necessarily blazing fast.

Counterbalance: hence the bloatware we have today

therealbeef: how can any business make money with something that is not time-critical?

Default avatar.png Panagis: does "int actionCount = in.nextInt();"

phord: Chrome crashed and lost my changes. :angry:

Default avatar.png Panagis: has excecution time 20ms???

phord: What are the gcc or clang switches needed to compile locally?

Default avatar.png Panagis: does int actionCount = in.nextInt(); has execution time 20ms from the 50ms

Counterbalance: phord -std=c++17 and I recommend -Wall

therealbeef: @panagis does that include the waiting time for something to appear on stdin?

Default avatar.png Panagis: yes

phord: Got that. What about libs?

phord: (Looking for a shortcut)

therealbeef: i assume that waiting time is not part of the time budget

Counterbalance: see codingame.com/faq for the rest.. not needed locally

phord: Thanks.

therealbeef: @Counterbalance when i tried to use c++17 features, it doesnt compile on CG

Counterbalance: it should.. they've been using it for a while now

Default avatar.png Panagis: http://chat.codingame.com/pastebin/6f3ef4fd-06e9-40ac-a341-4e8142447884

Default avatar.png Panagis: Time=133

Default avatar.png Panagis: omg

struct: ofc

struct: you must start the clock after reading first input

Counterbalance: Panagis you're timing the other bot and the referee

SirLoxley: bloatware right there :p

Default avatar.png Panagis: @counterBalance thanks

Counterbalance: np :) It's something that probably should go on the faq

Counterbalance: therealbeef i'm curious - what c++17 feature isn't working?

therealbeef: not sure anymore, tried something a few days ago

Default avatar.png Nemesis386: hi

therealbeef: @counterbalance oops, seems I was wrong it supports 17 indeed

Counterbalance: a few years ago they switched from 14 to 17

CDA-20285-Gabriel-Misiurny: Hi ! I'm trying to contribute but the stub generator displays: http://chat.codingame.com/pastebin/cf503682-dc28-44b5-a143-c42b664fd7a5

Counterbalance: I don't think you're supposed to put a space after the ':'

CDA-20285-Gabriel-Misiurny: indeed, it worked for N

CDA-20285-Gabriel-Misiurny: now i have "InvalidType: {"variable":"D","type":"double","line":2}"

Counterbalance: it's supposed to be float.. see the reference: https://github.com/CodinGame/codingame-game-engine/blob/1af6859627b51d42da62a7bdcad93f55a3dad73a/stubGeneratorSyntax.md

CDA-20285-Gabriel-Misiurny: oh gosh ! Thanks !

Counterbalance: not sure if it's the latest one but this was in my browser history :) yw!

CDA-20285-Gabriel-Misiurny: looks fine now !

CDA-20285-Gabriel-Misiurny: :D

particleflux: aaaand gone from 400 nodes to 10k :D

particleflux: stupid thing really, appending to a slice each element separately instead of all at once

particleflux: Should not have made a difference since the memory was supposed to be pre-allocated with go slie *capacity* param anyway, but apparently that doesn't work like I thought

Nerchio: slow submits sad panda

Nerchio: cg doesn't want me to win contest with java?

Default avatar.png Poviliukas: it's not only java :(

Nerchio: i know but i am coming for #1 place

Nerchio: and submits are slowing me down

aCat: xD

SirLoxley: First time I beat that silver boss, on a replay I got smashed, though

Astrobytes: woo lazy silver. Do I continue tomorrow or just leave it? :thinking:

NinjaDoggy: do I continue tomorrow or just leave it...

NinjaDoggy: no :)

ddreams: if you leave it, you won't feel bad if you don't achieve anything more :p

ddreams: protect your ego

Astrobytes: I won't feel bad either way tbh ;)

Zenoscave: How defeating that sounds lol

particleflux: continue today? :)

particleflux: still half an hour left

particleflux: :D

ddreams: yeah, I was sarcastic

Scarfield: Nike: Just dont

ddreams: better to try and fail than to not try

NinjaDoggy: hey zeno

NinjaDoggy: how you doing?

karliso: ddreams You are so right

Astrobytes: Not for long, I have the beginnings of a rewrite I don't wanna touch til tomorrow

NinjaDoggy: (dw i'm asking about bot performance, not your well being ;) )

Zenoscave: Server slow down broke my bot. Showed that sims

NinjaDoggy: oof :(

NinjaDoggy: same

Zenoscave: Need to perf optim on eval

Astrobytes: grim server issues this contest

NinjaDoggy: i personally think eval is overrated

NinjaDoggy: at least inventory eval

Zenoscave: No just tome

NinjaDoggy: ahh yea

NinjaDoggy: ok same :(

Nerchio: do you guys have some custom spell evaluation or just normal

NinjaDoggy: planning on doing some heavy sim

NinjaDoggy: for evaluating spells

NinjaDoggy: (offline sim)

Nerchio: i saw euler talking with somebody earlier that some spells are trash basically should maybe avoid them

Zenoscave: Yeah They offlined

struct: As long as I can get gold without that im happy

Nerchio: should share the results with me :smile:

Zenoscave: ok

Zenoscave: after

Zenoscave: ;)

struct: I probably could get gold with 1/100 of the peformance

Astrobytes: No sleep for a day or so then NinjaDoggy ;)

NinjaDoggy: yes there's the spirit :)

struct: Tomorrow is they day of no sleep

Zenoscave: I did that last night

NinjaDoggy: not for me...

Zenoscave: Huge headache now

NinjaDoggy: contest ends at midnight for me

Astrobytes: struct weren't you having like 100's of K's sims

struct: Yesterday I was awake for 22 hours

NinjaDoggy: i don't sleep till midnight anyways...

struct: Astrobytes I have 800k now

struct: with bfs

NinjaDoggy: holy smokes wtf

Zenoscave: Jesus Struct.

Astrobytes: but no results?

NinjaDoggy: explain your shitty algorithm so I can avoid it then ;)

struct: that with very simple eval

NinjaDoggy: 800k? :O

Astrobytes: what about pruning?

struct: no pruning yet

NinjaDoggy: ahh

struct: I shared numbers here before

NinjaDoggy: detecting repeated states is a bitch :(

Astrobytes: Doesn't seem sensible to have that many without pruning

struct: yeah

struct: I need to fix

struct: After eval

struct: is done

Astrobytes: duplicates?

struct: its 500-800k

struct: no duplicates

struct: its just standard bfs

NinjaDoggy: wait wot? :O

NinjaDoggy: how do u check if 2 states are the same?

NinjaDoggy: pls share

struct: no duplicate check*

NinjaDoggy: -_-

Zenoscave: lol

struct: :p

Scarfield: same same xD

Astrobytes: depth?

NinjaDoggy: cuz unordered_map is not it :(

NinjaDoggy: sooo slow

struct: Sims: 827620 Depth: 7

NinjaDoggy: lol

struct: Depth 7 means it started expanding to depth 8

Astrobytes: roll your own NinjaDoggy

NinjaDoggy: yea trying to do that right now

Counterbalance: why are you still silver with that, struct?

Zenoscave: Depth 10 + would be needed to get gold probably. Try pruning

struct: Counterbalance no eval yet

struct: Im working on it

NinjaDoggy: eval isn't a big deal

struct: 10 depth is needed for gold?

NinjaDoggy: opponent simulation is though...

Zenoscave: 10 Beam

struct: I just want gold ninja

struct: not legend

NinjaDoggy: ok idk then...

Astrobytes: If you don't get gold struct I WILL REQUEST that your account be deleted :rofl:

NinjaDoggy: gold is kinda free :P

Gabbek: judging by my crappy results -- eval is really important

NinjaDoggy: you don't even need opp sim...

NinjaDoggy: just literally go for cheapest potion

Gabbek: jumping between 200-2000 changing just eval :D

Gabbek: (in silver)

NinjaDoggy: wait yea try that

JFB: I use bfs - gold with around 400k without pruning (depth suzally 6-7-8)

NinjaDoggy: to go closest potion, tie break by reward

struct: Also my submit does not have this number

NinjaDoggy: hard code first 8 turns to learn

struct: ~this is why its on silver

NinjaDoggy: if you only want gold i think that's easiest way

Default avatar.png Bikoko: you ate for 2hours

Default avatar.png Bikoko: and didnt sleep :)

Gabbek: NinjaDoggy any advice for state eval? This is what I'm struggling with the most; search seems to do okey

NinjaDoggy: I have super simple eval...

NinjaDoggy: but i'm scared to share cause maybe it's genius :eyes:

NinjaDoggy: jk sure

NinjaDoggy: my eval right now:

ddreams: hmm.. I have "opened 3588 maxDepth 6 0.0410309s "

NinjaDoggy: myScore + score from potions

ddreams: I guess you're not pruning much

struct: no pruning

Zenoscave: score from potions?

struct: This is my first time i use bfs

NinjaDoggy: 1*#B + 2*#G +3*#O+4*#Y

NinjaDoggy: that's it...

NinjaDoggy: yea the potions brewed along the way

Zenoscave: ah right

Nerchio: lots of crashes atm?

NinjaDoggy: oh 1 trick to make it not get stuck at full inventorys:

Zenoscave: Isn't that the same as your score?

NinjaDoggy: yea...

NinjaDoggy: lol

NinjaDoggy: oh i guess i should specify it's current score

NinjaDoggy: oops

Zenoscave: gotcha

Gabbek: NinjaDoggy interesting - I must be doing something wrong then :p

Zenoscave: So what's that trick?

Gabbek: using pretty much the same

NinjaDoggy: don't add the inventory score unless potion score > 0

Zenoscave: https://www.codingame.com/share-replay/508404543

NinjaDoggy: that way it always goes for a potion

NinjaDoggy: down side is... need deep search to use it well

NinjaDoggy: wouldn't work for beam obviously

struct: Astrobytes dont worry i already said gold or delete

Zenoscave: right

Gabbek: doing around depth 15 here with pruning, so I must have some bug somewhere :(

NinjaDoggy: do you account for opponent actions?

NinjaDoggy: like them stealing potions

Gabbek: not at all

Astrobytes: struct if you delete I'm sending a delegation of CG members to Leiria to hunt you down

NinjaDoggy: probably why

Zenoscave: No NinjaDoggy

Gabbek: I ignore opponent atm

NinjaDoggy: deep search sucks without opponent sim

NinjaDoggy: because you'll find some super optimized route

NinjaDoggy: that delays potions

NinjaDoggy: and then ur opp steals them and it's so bad :(

linjoehan: man I'm so lost with this contest atm

NinjaDoggy: I sacrificed like half of my depth

NinjaDoggy: to get decent opp sim

NinjaDoggy: :(

Astrobytes: linjoehan: read the source, it's better than the statement

NinjaDoggy: went from 13-14 no pruning

Zenoscave: I just see what the first possible potion my opp can make and avoid it if I can't make it before or at the same time

NinjaDoggy: to 10 or less no pruning :(

NinjaDoggy: yea I used to use that but...

NinjaDoggy: what if your opp can reach all of them before you?

Nerchio: zenos but that doesn't mean he's going to make the potion and you might miss your optimisation

NinjaDoggy: (usually happens after you brew your potion)

Zenoscave: then just stock up.

NinjaDoggy: hm..

NinjaDoggy: not horrible i guess

linjoehan: lol I know how it works I just don't know how to approach it right now

Zenoscave: It allows for end game swaps

NinjaDoggy: yea it's not bad

NinjaDoggy: but not as good as assuming your opponent will block the optimal one ;)

NinjaDoggy: will optimally block*

Zenoscave: wdym block?

Astrobytes: reflex bot til silver was my goal and it works linjoehan

NinjaDoggy: like go for the potion that blocks you the most

NinjaDoggy: while blocking themselves the least

Zenoscave: Right. Not easy to do that with beam..

NinjaDoggy: debatable

NinjaDoggy: I managed to do it with BFS

NinjaDoggy: just gotta include extra stuff in state

NinjaDoggy: a lot of extra stuff... :(

Astrobytes: wow, Agad e has some lead now. Wonder who delineat e is

NinjaDoggy: recurse smurf ;)

Gabbek: wasn't emil recurse's smurf? :)

Zenoscave: nope

Astrobytes: that was emil no?

struct: D

NinjaDoggy: LOL

Zenoscave: emil was

Zenoscave: a

NinjaDoggy: wait...

NinjaDoggy: wait... it's not a joke D:

struct: emil was re curse yes

NinjaDoggy: -_-

NinjaDoggy: "lemme proto type in rust for fun"

NinjaDoggy: wow

Gabbek: :D

Astrobytes: I wrote both names down last night so I remembered which one disappeared overnight :D

struct: I had no clue that emil was a char from Nier Automata

struct: Same as previous and current re curse avatar

Astrobytes: Could still be trickses, who knows :D

Astrobytes: Oh hahaha, I missed that. I just went by the more obvious clues.

Gabbek: Heya Astrobytes :)

Astrobytes: Hey Gabbek! :)

Gabbek: How're you enjoying the contest?

Astrobytes: Was about to ask you the same lol. Well, I've not been overly motivated tbh, but it's a good game

Astrobytes: You?

Gabbek: I got sick, was lying 3 days in bed - but it didn't help me at all :D was hoping that I would be able to figure out something, but to no avail - guess it's silver time and that's it, hehe. Tried to do some submits today but my search is doing worse than my no-search python bot from day 1

tobk: I guess it's okay, but the last ones were more interesting

Astrobytes: lol Gabbek, sounds like usual CG contest issues :D

tobk: maybe I'm missing some key insight, but not really much of a strategy to consider IMHO. just find the best potion to brew

Astrobytes: tobk: OOC > Pacman tbh

NinjaDoggy: there's minimax strat going on in this game

NinjaDoggy: especially towards end game

Astrobytes: yep

Astrobytes: Is blaster still doing a smitsimax?

NinjaDoggy: doubt it

NinjaDoggy: i don't think smitsi is good for this game

blasterpoard: I am, because I had no time to switch

NinjaDoggy: D:

Astrobytes: Nice job making it work blasterpoard

NinjaDoggy: so... you're telling me

NinjaDoggy: rank 50ish gold -> legend

NinjaDoggy: was just tome picking?

tobk: I am no even considering the enemy at all, and probaly won't start doing so tomorrow. just BFS for best brew path :-D

blasterpoard: yep :)

NinjaDoggy: ok...

NinjaDoggy: i should stop procrastinating tome picking then lol

NinjaDoggy: trying too hard to get by cast/brew optimal

tobk: BTW, what happened to that one guy who was at the top a long time? seems to have vanished off the leaderboard

NinjaDoggy: when it doesn't matter

NinjaDoggy: LOL

Zenoscave: lol

NinjaDoggy: yea emil was banned for cheating

Zenoscave: tobk that was a smurf

NinjaDoggy: unfortunately

tobk: smurf = bot?

Astrobytes: not unfortunately, he's still there ;)

NinjaDoggy: no he got help from recurse

Zenoscave: smurf = alt account

NinjaDoggy: so he got banned

tobk: ah, I see

Gabbek: *confused* :D

Zenoscave: Ninja I just caught on. sorry

blasterpoard: you keep trying to make it optimal, and then all that matters is having spells to reach those last random potions

Zenoscave: Yeah he was banned

Astrobytes: lol

NinjaDoggy: blasterpoard if I guess your tome pick eval correctly, can you confirm it?

Zenoscave: No

Zenoscave: you won't lol

Zenoscave: Or it's just a MC

blasterpoard: oof, you'll have a hard time doing that

NinjaDoggy: ok rip :(

NinjaDoggy: wait is 8 turns of fixed learning actually good?

NinjaDoggy: and the only thing holding me back is WHAT i'm learning?

blasterpoard: I'm learning 6-8 spells, depending on what they are

NinjaDoggy: ok nvm

NinjaDoggy: and you don't do any learns after?

blasterpoard: no

NinjaDoggy: ...

NinjaDoggy: that's so bad...

NinjaDoggy: :P

NinjaDoggy: (the goldie said to the legend player)

Zenoscave: Says the gold

Zenoscave: beat me to it

NinjaDoggy: :D

blasterpoard: yes, my bot is bad

NinjaDoggy: honestly though...

NinjaDoggy: Smitsimax might have potential

blasterpoard: it doesn't

NinjaDoggy: depending on your "modification"

NinjaDoggy: 100% sure?

Default avatar.png Bikoko: how to calculate score of clash of code in leadervoard bruhs?

blasterpoard: not 100%, but it's close

Default avatar.png Bikoko: average of score of every clash?

Zenoscave: TrueSkill rank Bikoko

Zenoscave: An adaptation of elo

Default avatar.png Bikoko: uh i see thanks

sadakatsu: Well, it's more than that. My favorite part of TrueSkill is that it determines individual contributions to team performances, so you can use it for every kind of competition.

Zenoscave: I'm aware lol. Just easier to compare it to elo

Nerchio: ok be back when servers are alive(hopefully this century)

Default avatar.png Bikoko: what should i do t improve my COC score?

Zenoscave: win

particleflux: lol

particleflux: easy as that

particleflux: :)

NinjaDoggy: this is factually correct

NinjaDoggy: winning on CG is proven to improve score

NinjaDoggy: something i'm failing to do atm :(

Default avatar.png Bikoko: play more game or get more score in every game?

therealbeef: have more fun

Astrobytes: I think a smitsi type approach might work later in the game, but by then it's almost just a minimax

geppoz: lol, when i pick a lost game from arena and send to IDE, I win

Astrobytes: oh, chat scroll sorry

Nerchio: servers are bad and there is more timeouts or its my bot?

Astrobytes: Servers slow yeah

Astrobytes: Probably related

geppoz: and why when i send to ide, i didnt timeout?

geppoz: ide on different servers?

Nerchio: tbh just ignore timeouts at the moment

Nerchio: servers are wonky

geppoz: im trying to get gold, when i send lost matches to IDE to improve, there I win, so hard to ignore... ;)

Whiskee: what if I just send WAIT and let everyone else time out first

Whiskee: new strat

geppoz: :D

struct: You will win maybe 5% of the games

Whiskee: well that would be a 5% improvement

Whiskee: today's been terrible, every little change made things worse

theycallmedavid: geppoz maybe the opponent has somthing random in their code which sometimes work better for them and sometimes not

geppoz: it is not only one... i see 4-5 lost in battle list, all lost for my timeout, and when i send to ide, i didnt timeout... :(

Nerchio: my bot is timing out as well im pretty sure it's servers fault atm

ddreams: does it also time out if it's out of memory?

struct: yes

ddreams: thought so

ClockSort: anyone else having timeouts?

Zaphus: and for other exceptions like going outside the bounds of an arrray, etc

Nerchio: ClockSort massive timeouts yeah

NinjaDoggy: um... I wrote my own hashmap and am kind of confused... :(

NinjaDoggy: the first few turns it's really slow but then it starts getting faster and faster

NinjaDoggy: until it's about 2x faster than unordered_map...

Beresta: why would you write your own :O

NinjaDoggy: it's C++ not java, hot spotting isn't a thing right?

NinjaDoggy: because I explore 3x more nodes without a hashmap detecting collisions

Counterbalance: maybe it's new/malloc for resizing in the beginning?

NinjaDoggy: ?

NinjaDoggy: no my version is slow and speeds up

Counterbalance: does your hashmap allocate memory when you add items?

NinjaDoggy: no

NinjaDoggy: it's fixed memory

Nerchio: you switched from java right?

NinjaDoggy: yea using C++ now

Nerchio: cause java has warm up stuff but in C++ idk

NinjaDoggy: yea exactly..

Nerchio: i think the answer to everything in C++ is to use pragms

Nerchio: pragmas

NinjaDoggy: i have them slapped in

Nerchio: at least that's what the chat is saying :D

Beresta: are you sure in your measurements then? :)

NinjaDoggy: so... idk

NinjaDoggy: yea i'm just counting how many times I add a node to queue

Astrobytes: constructors?

NinjaDoggy: is that... a thing?

NinjaDoggy: i'm pre allocating everything I think?

Counterbalance: maybe it's just that your map/cache gets filled more and more, and thus detecting more and more duplicates?

NinjaDoggy: i thought maybe that's why but

NinjaDoggy: i reset everyturn

NinjaDoggy: and i make sure there's no collisions

NinjaDoggy: so collisions take longer(to find a new index)

Astrobytes: Yeah but are you setting things in the constructor tho, it can be a hindrance on CG if you're allocation shitloads of stuff

Astrobytes: *allocating

NinjaDoggy: i don't mind sharing the part i'm doing:

NinjaDoggy: http://chat.codingame.com/pastebin/0fb212e4-4d74-43f2-9ae7-a15d38ab8183

NinjaDoggy: that's my hashmap

NinjaDoggy: it should all be initialized before the program starts no?

NinjaDoggy: or like before the function gets called

NinjaDoggy: I mean... I'm down to use the first turn to warm up the function, but I would like to know why it needs a warmup...

Beresta: very likely just because of cpu cache

NinjaDoggy: https://www.codingame.com/share-replay/508444754

Beresta: if you hit same chunks over and over again

NinjaDoggy: here's a replay of it happening

NinjaDoggy: N = number of unique nodes

NinjaDoggy: E = total edges from the nodes

NinjaDoggy: C = call count

NinjaDoggy: first turn had tragic amounts(< 10k calls)

NinjaDoggy: but towards the end, it warmed up to > 100k

Counterbalance: if it's global, then it's probably allocated in the .bss section, which is page-mapped by the os to the elf image. Which in laymans terms means that the memory gets activated when it's used..

NinjaDoggy: ok so if I make a function that loops through all my memory

NinjaDoggy: and call that turn 1

NinjaDoggy: It'll be good?

Counterbalance: I think so.. it's about 190Mb by the looks of it..

particleflux: or malloc it in turn 1 if this is the issue

NinjaDoggy: yea, I calculated the size assuming i give it roughly 200mbs

Counterbalance: if you init that before you get any input (so before turn 1) then you should get a speed increase in turn 1

NinjaDoggy: yea i don't care about turn 1 XD

NinjaDoggy: Learn tomeIndex 0 ;)

ddreams: I really doubt that's the problem

NinjaDoggy: (for now)

Astrobytes: your're not allocating in first turn?

NinjaDoggy: i have it just global

NinjaDoggy: is that the issue?

Counterbalance: yeah

NinjaDoggy: so i need to malloc those?

Counterbalance: hmm.. maybe.

NinjaDoggy: but then I can't use the nice

NinjaDoggy: []

NinjaDoggy: :(

Astrobytes: nodes = static_cast<Node*>(aligned_alloc(64, sizeof(Node) * NODE_MAX));

Astrobytes: over-complex example but you get the idea

ddreams: I mean, just memset it all to 0 if you want to touch it

NinjaDoggy: ok and that would work too?

NinjaDoggy: and this is in general I assume...

ddreams: I doubt any of this will make a difference

Counterbalance: me too

NinjaDoggy: then why does it have this "warm up" affect? :(

ddreams: something totally unrelated to that it's a global

NinjaDoggy: hm...

ddreams: perhaps the statistic calculation is wrong

NinjaDoggy: it's not

NinjaDoggy: i change from unordered_map<long long, Node*>

NinjaDoggy: to this

NinjaDoggy: no other change

ddreams: perhaps your inserts are expensive

NinjaDoggy: it's not

NinjaDoggy: and it wouldn't matter i don't think?

Cappefra: what happened to emil?

NinjaDoggy: if this is the only thing i change

NinjaDoggy: emil got caught cheating so he was banned

NinjaDoggy: got help from reCurse

NinjaDoggy: ;)

Cappefra: ouch

NinjaDoggy: lol it's reCurse smurf XD

ddreams: if your inserts are expensive, it will appear faster and faster since more of your time will be spent looking up stuff

NinjaDoggy: sorry not sure I follow

struct: This blue and green ingredients must be a pain for colorblind

theycallmedavid: Who is reCurse?

NinjaDoggy: but looping through all my arrays at the start

NinjaDoggy: seemed to have solved the issue

NinjaDoggy: :/

NinjaDoggy: I guess i'll do that with my other global arrays too...

NinjaDoggy: wtf

Astrobytes: to initialise them?

NinjaDoggy: yea

struct: theycallmedavid CSB rank 1

struct: STC rank 1

struct: WW rank 1

NinjaDoggy: took around 70ms to init my hashtable

struct: FB rank 1

NinjaDoggy: CoIF rank 1

struct: list goes on

pb4: FB rank 1 ?

pb4: Damn

Astrobytes: I try to init the nodes when I have to NinjaDoggy

struct: sorry pb4

pb4: When ?

Zenoscave: lol hi pb4

pb4: Hi :)

theycallmedavid: struct thanks, I don't know what are these though

Zenoscave: Competitions on this site

Zenoscave: Coders Strike Back == CSB

struct: 05-09-2020 pb4

pb4: ah damnit

pb4: With a large margin

struct: yeah

struct: Do you think he managed to apply NN there?

NinjaDoggy: what's FB stand for sry?

struct: fantastic bits

NinjaDoggy: ahh

pb4: ^

NinjaDoggy: i'm so bad with acros :(

struct: best multi on website imo

NinjaDoggy: even though i kjnow all the multis and contests

pb4: struct : very probably

Zenoscave: blasterpoard Can you confirm a single Item positio on your list?

blasterpoard: kinda

Zenoscave: (3, 0, 1, -1) or Id 7 i think

Zenoscave: around middle?

Zenoscave: Maybe slightly above

blasterpoard: let me check, getting that info is not that easy

Zenoscave: ok thanks

Zenoscave: Just wondering if I'm on right track

blasterpoard: id 7 is near the bottom

blasterpoard: on range from 0.0 to 1.0, somewhere around 0.2

Zenoscave: Ok thanks

Scarfield: do you get a better bot with isolated valuation of spells? doesnt it depend too much on your other spells

blasterpoard: but I don't evaluate them independently of each other

Zenoscave: Oh that makes more sense

blasterpoard: that's why I needed to quickly write a script to tell how good it is based on my data

Scarfield: was wondering, makes more sense that way yea :)

NinjaDoggy: wait holy crap...

NinjaDoggy: I've been shooting myself in the foot

Zenoscave: how so ninja

ddreams: you still have feet?

NinjaDoggy: looping through all my global arrays on turn 1...

ddreams: braggart

Scarfield: I really like this contest, sad i havent had more time to put into it

NinjaDoggy: gives me like... 10x speedup

NinjaDoggy: wtffff

ddreams: that's insane

NinjaDoggy: ??????????

Zenoscave: Branch predictions great huh

Zenoscave: Yay warmups

NinjaDoggy: i've been using C++ wrong....

NinjaDoggy: no wonder the speed ups weren't that massive

ddreams: I guess Counterbalance was right

NinjaDoggy: wait so...

NinjaDoggy: if I want to do something like

NinjaDoggy: int arr[1000]

NinjaDoggy: is there a way to do that?

NinjaDoggy: and keep the []

NinjaDoggy: instead of making it

NinjaDoggy: int* arr

NinjaDoggy: and then turn 1 malloc?

Zenoscave: why malloc?

Zenoscave: just use global

NinjaDoggy: apparently global shits on performance...

NinjaDoggy: for example?:

NinjaDoggy: http://chat.codingame.com/pastebin/877598c6-c13d-4b32-8c1e-37d8dd9b7444

Counterbalance: even with int * arr you can still use []

NinjaDoggy: without the warm up

NinjaDoggy: my code runs 10x slower on the first turn

NinjaDoggy: yea I know but... i want to see int arr[SIZE] instead of int *

NinjaDoggy: cuz... java :(

NinjaDoggy: pointers look scary

egaetan: why 2688 ?

NinjaDoggy: don't worry about it :)

Zenoscave: Max that can fit?

NinjaDoggy: no it's specific

NinjaDoggy: it's an exact number

NinjaDoggy: will share in post mortem i guess XD

egaetan: NinjaDoggy you missed the 4 spells always here ?

NinjaDoggy: ?

NinjaDoggy: what do you mean?

NinjaDoggy: it's basically impossible to guess why the number is what it is

egaetan: why you don't have 2946944 ?

Astrobytes: you don't need to warmup C++ btw

NinjaDoggy: because spells doesn't ahve anything to do with it

NinjaDoggy: :)

egaetan: NinjaDoggy ok, i take it :)

Zenoscave: 2^7 * 3 * 7^2 * 11 * 13

NinjaDoggy: don't need to warm up C++ but apparently declaring stuff globally doesn't actually initialize the memory

NinjaDoggy: on the right path XD

egaetan: i found easier to do C from java than c++

NinjaDoggy: wrong numbers though

NinjaDoggy: :O

NinjaDoggy: faster too? by a bit?

Zenoscave: 2**7 and 7 **2 no?

NinjaDoggy: nah

Zenoscave: ah 1001 = 7 * 11 * 13

struct: /donate cpu

Zenoscave: You know that arrays in c++ are contiguous?

NinjaDoggy: yeh

NinjaDoggy: so do I just need to do

JohnCM: wow my c++ can get to depth 10

Zenoscave: int[10][10][10] is same size and locatio as int[1000]

NinjaDoggy: array[size-1] ?

JohnCM: but the issue is not the depth now

NinjaDoggy: oh so it's pointless to do my own math?

Zenoscave: yup

NinjaDoggy: D:

Astrobytes: yes

NinjaDoggy: but I can reuse the result right?

NinjaDoggy: like for my 3 arrays

NinjaDoggy: i can compute it once

Zenoscave: int[128][21[1001] wold work fine

NinjaDoggy: and use it for all 3

Astrobytes: yes

NinjaDoggy: opposed to [][][][] 10 times

Astrobytes: wow yes

NinjaDoggy: and similarly, if I want to access the position+1

NinjaDoggy: i can add 1 instead of [][][][p+1]

NinjaDoggy: :P

egaetan: int |64][42][1001]

Zenoscave: Ah fair

Astrobytes: lol

NinjaDoggy: ok time to spill the beans

NinjaDoggy: [1001][32][6][7][2]

Zenoscave: it's your bloom filter

Zenoscave: no?

Nerchio: what is this abomination

NinjaDoggy: it used to be beautiful...

NinjaDoggy: when it was just [1001][32] ...

NinjaDoggy: and then other crap went into the state :(

NinjaDoggy: you'll see in post mortem :(

Astrobytes: oh bloom filter, nice

Zenoscave: I look forward to it

NinjaDoggy: i was calculating optimal paths up to depth 40

NinjaDoggy: in under a second

Zenoscave: whoa

Zenoscave: with all 82 possible actions?

Zenoscave: or pruned?

NinjaDoggy: all cast/brews

Zenoscave: hm

NinjaDoggy: pruned but same result as no prune

NinjaDoggy: Counterbalance, if I wanted to do the same thing with structs

NinjaDoggy: would I need to loop through each thing in the struct

NinjaDoggy: or just one of them, and that would force the memory to be allocated

Counterbalance: I usually just use memset

NinjaDoggy: o

NinjaDoggy: ok i'll do that instead ty

Counterbalance: #include <string.h> memset(foobar, 0, sizeof(foobar));

NinjaDoggy: and this works regardless what type of array it is

Zenoscave: just make sure the foobar isn't a pointer

Counterbalance: yeah :)

Zenoscave: sizeof (int *) != sizeof(int[10])

NinjaDoggy: um...

Zenoscave: stupid emoji

NinjaDoggy: lol

Zenoscave: int * )

Astrobytes: <cstring> you heathen :P

Counterbalance: struct { .. } foobar[SIZE]; for instance

NinjaDoggy: wait if my node array

NinjaDoggy: my node struct*

NinjaDoggy: has an array of node pointers

NinjaDoggy: how does that work?

Counterbalance: they'll all just be treated as bytes and set to 0. So it'll be an array of nullptr.

Zenoscave: a pointer is an address so 4bytes always on a 64bit arch

Zenoscave: I misunderstood I think

NinjaDoggy: ok cool

NinjaDoggy: so the struct would calculate its size properly

NinjaDoggy: and everything gets zeroed

ddreams: if you have an array of pointers, only the pointers would be zeroed

NinjaDoggy: yea i know

Counterbalance: It might screw up your Node queue[..] though; that is initialized by the compiler already, calling the default constructor for each items

NinjaDoggy: that's what I want anyways

ddreams: so it has nothing to do with "o the struct would calculate its size properly"

Zenoscave: 8Bytes****

ddreams: if you have an array of structs, sizeof(arr) would depend on the size of the struct

NinjaDoggy: no i mean

NinjaDoggy: i have an array of pointers

NinjaDoggy: inside my struct

Zenoscave: https://cdecl.org/

Astrobytes: lol

ddreams: right, so yep, everything inside it would be zeroed

ddreams: doesn't matter what it contains

Astrobytes: alright I am exhausted for today, catch you on the flipside everyone. Good luck :)

Counterbalance: It should already be zeroed though, if you don't specify any initializers

NinjaDoggy: c ya Astrobytes

Counterbalance: nn astro

NinjaDoggy: yea but, isn't int arr[1000] the same?

NinjaDoggy: it should also be zero'ed if declared globally right

Counterbalance: yeah

NinjaDoggy: and it wasn't actually initialized/zeroed correctly(i assume)

NinjaDoggy: for my hashmap

ddreams: according to Counterbalance, it was zeroed, but not loaded into memory

NinjaDoggy: right

NinjaDoggy: that's the word

NinjaDoggy: and i'm trying to make sure my nodes are also all loaded into memory

Counterbalance: you could check that in your for loop.. it should all be 0 already. I think writing to that memory just causes the kernel to map it to actual memory all at once in the beginning instead of generating a bunch of page faults later

karliso: you can do that more efficiently

NinjaDoggy: :O ?

karliso: I have used "mlockall(MCL_CURRENT);"

karliso: I think it was for similar purpose or something here.

particleflux: hu, interesting

ddreams: hm, perhaps also add MCL_FUTURE then

NinjaDoggy: what do I need to include for it?

ddreams: <sys/mman.h> perhaps

karliso: I think I have

karliso: #include <sys/mman.h>

  1. include <unistd.h>
  2. include <poll.h>

NinjaDoggy: linux only?

NinjaDoggy: rip windows users :(

particleflux: windows swaps as it wants either way

ddreams: I put the linux specific stuff within #ifdef

karliso: I am on Windows..

NinjaDoggy: uh...

NinjaDoggy: did I mess up my C++ installation?

ddreams: it's a POSIX call

ddreams: probably not

NinjaDoggy: is it because i'm using mingW?

ddreams: I don't have it in a normal VS2019 install either

karliso: Tbh I am not actually sure if mlockall helped, but I did use it and maybe it did.

ddreams: https://stackoverflow.com/questions/1918785/how-to-lock-pages-in-memory-using-winapi

particleflux: yeh VirtualLock, the basic thing you'll need when hackily writing into other processes' code lol

particleflux: CG servers are probably linux though, I guess?

ddreams: yep

NinjaDoggy: eh... seems like a lot of work to swap between them from CG to local

NinjaDoggy: i'm fine losing 300 ms turn 1

NinjaDoggy: i don't even compute anything turn 1 anyways :/

ddreams: #ifndef TESTING

 mlockall(MCL_CURRENT);
  1. endif

ddreams: define testing when compiling locally

particleflux: yeah that or probably _WIN32

particleflux: my windows days are too far away o.O

struct: damn

struct: have a bug that I cant reproduce offline

struct: ..

karliso: I use #if __GNUC__ and #if _MSC_VER

AllYourMCTS: is rust compiled as release now in ide games?

struct: yes

struct: Finally managed to reproduce :)

particleflux: that was fast

particleflux: :P

NinjaDoggy: ok well.. submit time!

NinjaDoggy: i think I just 10x my bot performance...

NinjaDoggy: by writing own hashtable and forcing memory

NinjaDoggy: (lower rank incoming)

struct: ok c++ is crazy

Counterbalance: random unexplainable timeouts incoming

struct: how can 1 eval break my bot?

struct: Counterbalance is it possible to explain it?

struct: Depth: 255 only if

struct: :D

NinjaDoggy: https://www.codingame.com/share-replay/508504953

NinjaDoggy: wait a sec...

NinjaDoggy: :(

Nerchio: :joy:

NinjaDoggy: it's timing out on turn 1 trying to memset everything...

NinjaDoggy: :( :( :(

NinjaDoggy: wait karliso come back... help with the lock thing :(

ddreams: why not go back to your basic array loop?

Counterbalance: if you replay in the ide does it also timeout?

NinjaDoggy: no

NinjaDoggy: it's somewhat rare

Counterbalance: I'm getting a bunch of timeouts too, even though my bot prints the action at 40ms. I guess the servers are acting up.

ddreams: you may still time out if your code is doing cleanup

Counterbalance: it doesn't, in my case. I print the time taken; next line I print the command.

struct: ok anyone has any idea why i go to depth 255?

JohnCM: haha wonder what it takes to get to gold

struct: What can it be?

struct: access invalid memory?

NinjaDoggy: wait just kidding... timouts aren't rare at all :(

Zaphus: My IDE version self-times to 40ms, and is getting 60ms frames at the moment

NinjaDoggy: probably?

NinjaDoggy: C++ is oof honestly

JohnCM: if you go depth 255, it probably means your condition to break out of your search is not activating

JohnCM: might be a bug somewhere

ddreams: if you time out suddenly when using memset, probably there's something wrong there

struct: ok I think I understand

JohnCM: what does memset do again?

JohnCM: why is it so important

ddreams: sets memory to a value

NinjaDoggy: i didn't submit with loop version

JohnCM: can you memset for STL also?

struct: it goes to depth 255 because, I can only wait

struct: so its realistic :p

NinjaDoggy: lol

ddreams: I've never used memset with STL

struct: What are you trying to do NinjaDoggy?

JohnCM: the bulk of my memory usage is in STL

struct: allocate memory?

JohnCM: unless you all use fixed arrays to store data

struct: or assign values at start?

NinjaDoggy: allocate

struct: but not assign right?

NinjaDoggy: nope

NinjaDoggy: allocate to zeros

struct: this doesnt work?

struct: State* Agent::pool = new State[2000000];

NinjaDoggy: well.. sorta...

phord: don't memset stl structures, though.

NinjaDoggy: it works but

struct: What is wrong?

NinjaDoggy: it's not really allocated

JohnCM: is there significant advantage of memset?

NinjaDoggy: like it doesn't really get allocated until I use it

NinjaDoggy: which slows me down a lot

NinjaDoggy: (previously)

NinjaDoggy: https://stackoverflow.com/questions/42429806/why-the-c-global-variable-not-affect-to-memory-usage-of-program

struct: So you are telling me my code can be faster?

NinjaDoggy: yes...

NinjaDoggy: so i'm trying to force it to all be loaded

NinjaDoggy: by memsetting everything to zero

NinjaDoggy: so it's forcefully used

NinjaDoggy: but sometimes that's timing me out on turn one :joy:

struct: So you are telling me that if I assign default

struct: after allocating

struct: Then it will be faster if i assign it again?

NinjaDoggy: apparently so...

Counterbalance: sched_setscheduler: Operation not permitted :(

NinjaDoggy: that's why i'm going through all my arrays and memsetting them to 0 on turn 1

NinjaDoggy: downside is it limits the amount of memory I can use quite a bit

ddreams: try to use mlockall(MCL_CURRENT);

then

NinjaDoggy: i just tried it on CG

NinjaDoggy: and it compiled and ran

NinjaDoggy: but didn't give the speed up memsetting everything did

NinjaDoggy: so i'm just using slightly less memory now

NinjaDoggy: since i over allocated node array and stuff anyways

struct: (╯°□°)╯︵ ┻━┻

Counterbalance: :poop:

struct: submit was not even close :(

struct: got 15th

Counterbalance: many timeouts?

Michael_Howard: :deciduous_tree:

Michael_Howard: (╯°□°)╯︵ ┻━┻

struct: Counterbalance 0

struct: Maybe my opponents have, I dont

Counterbalance: what was your rank before?

struct: 900 on silver

struct: I feel like my eval is still weak

Counterbalance: and now 15? that's a huge improvement

struct: and I dont prune bfs yet

struct: Yeah, but I want gold, maybe tomorrow I can do it

ddreams: what do you use eval for if you use bfs?

Counterbalance: you're already 13 now.. might get above boss by morning

struct: Maybe

struct: ddreams i use ingredients, rupees and brewed potions

Counterbalance: why are you making 6 stars at the end here, struct: https://www.codingame.com/share-replay/508558738

struct: Best depth 8 brewed 8 score 114 at turn 36

struct: My bot tries to brew 8 potions or even more

struct: He doesnt satisfies at 6

struct: At turn 36 he foud that path :p

Counterbalance: at turn 33+ we have both 5 orders, so all you had to do was brew any potion faster than me and you'd have won.. only 1 star needed

ddreams: why not stop at 6?

Counterbalance: so you're scoring the inventory maybe a bit too high?

struct: Counterbalance the shortest was this one

struct: to brew the nexxt

struct: Best depth 10 brewed 6 score 79


Counterbalance: ah i see

struct: That one is at turn 32

struct: Maybe I need to check the inventory eval you are right

Nerchio: this is going to be one of those games where you get a good search but cant go to legend because top gold is too random? :d

Counterbalance: yeah i thought i spotted something but it looks good.. first brew for your bot is indeed at depth 8

blasterpoard: top gold is fine

struct: Maybe ill set up brutal tester

Skynse: tfw you clash super late in the night and you hear someone walk out of thir room

struct: and check if I can improve eval against myself

struct: ´should be faster

struct: brutaltester works on ubuntu?

Counterbalance: sure

Counterbalance: but i'm getting mixed results

struct: In what way?

Counterbalance: like, 60%-20% winrate locally, but 50 ranks lower in arena

Counterbalance: but it does help a bit to see if you haven't screwed up enormously

struct: I see, I doubt it will happen on silver though

struct: but maybe

Beresta: hm, I've put 7 different times that covers 99% of the implementation and it is consistently 12ms lower than global timer on turn

Beresta: could it be print to error stream itself? :(

Beresta: timers*

Beresta: or any other ideas?

struct: What language?

Beresta: C#

Beresta: its not GC for sure

struct: Well CG is having problems

struct: with timeouts

Beresta: nah I don't have timeouts, its +-2ms precisely to my 45ms treshold

ddreams: memory?

struct: ah you mean different timers give different results?

Beresta: yea, sum of inner timers 12ms less than outer timer

Counterbalance: on return from a function, local variables get released. If they are arrays or maps/hashes and stuff that could take some time.

elderlybeginner: I'm disappointed with my contest result. Any tips what it is easy to overlooked and has significant meaning in the contest?

MarekM: debuging without debugger

struct: Do I need maven to run brutal tester? or just to compile it?

ddreams: you run it with java

sadakatsu: el

sadakatsu: ... When did this chat get focus? Sorry about that.

struct: What do you mean?

sadakatsu: I sent the message "el", except I never tried to do that.

struct: must have clicked by mistaske

AllYourMCTS: el

struct: hmm, i changed my bot to stop at 6 brews now

struct: Not sure if I submit or not

struct: oh wait im 10th atm

miszu: question: fast int16 vs fast int 32. Appart from space, would 32 be faster than 16 in certain points?

struct: fastint16 gets the fastest int that is at least that size

miszu: ok so it would be impossible that a fast 32 be faster than faster 16

miszu: fast* 16

struct: depends on cpu I guess

struct: I would recomend against using uintfast

miszu: uintfast no good?

struct: https://stackoverflow.com/a/46960509

miszu: wow

miszu: okay, fast int then

miszu: 16

miszu: I am rewriting my UTTT, I want to reach gold

struct: why fast int?

miszu: fast int guarantees fastest performance

struct: it wont give you any benefit over uint16_t

struct: Why is it faster?

miszu: it takes into consideration the architecture and chose the best int that would be the fastest to do cpu operations

Counterbalance: just tested - it'll be 64 bit on CG (aka linux 64bit)

miszu: it would make sense

miszu: a 32bit would need to be converted into 64

struct: I think using fastint is opening the door to bugs

struct: Just my opinion

ddreams: shouldn't be a problem unless you're targeting multiple platforms

ddreams: probably not going to do much for your rating though

miszu: to get gold in UTTT, bitboarding is important right?

struct: no

struct: for legend yes

miszu: I finished 5th in silver using MCTS

struct: how many sims?

miszu: and thought maybe give a try with simple bitboarding

miszu: very low though

miszu: like 500s

miszu: I don't remember

miszu: it was 8 months ago

miszu: but low

struct: ok, yeah maybe 500 cant climb to gold

struct: But is close enough, dont need much more

miszu: a simple game like UTTT should get you more sims

struct: for legend you need around 20k+- on second turn

struct: rollouts*

struct: not sims

miszu: thus why I want to use this project as c++ exercise

struct: Counterbalance your github repo works on brutaltester?

Counterbalance: yup

struct: Ok I had to check on discord and change one var

struct: I guess its due to my JDK version

Counterbalance: git clone ... referee; cd referee; git checkout cli; mvn package; presto

miszu: is discord chat more popular than this?

struct: "tomato14/11/2020 I fixed it with .map(s -> (Spell) s) before .filter. At least it works now."

Counterbalance: no it's updated, it should work out of the box

struct: I know but I got error

Counterbalance: compilation error?

struct: /home/user/brutal/FallChallenge2020-main/src/main/java/com/codingame/game/Game.java:[530,35] cannot find symbol [ERROR] symbol: method getId()

struct: I changed a line and it works

struct: and least compiled

struct: dont know if there is a difference between flatmap

struct: and map

Counterbalance: i fixed that in the cli branch, i think you didn't 'git checkout cli'

struct: oh right

Zaphus: did a complete rewrite of my spell learning algorithm, totally different heuristics. Stabilizes at ~140 in gold Resubmit of code before rewrite, ~140 gold I give up :-)

NinjaDoggy: :(

NinjaDoggy: hopefully I'm not about to have the same experience

struct: Lets see if I wake up at gold

struct: .40 from boss

struct: gn everyone

NinjaDoggy: wait struct

NinjaDoggy: ok gn i guess

struct: for what?

NinjaDoggy: if you don't make it tmr

NinjaDoggy: i'm sure with ur # of iterations

Counterbalance: nn struct

NinjaDoggy: it can't be hard...

NinjaDoggy: gn though!

struct: yeah, I was trying to setup brutal tester

Counterbalance: (btw updated my fork; git pull && mvn clean package)

struct: but failed

struct: im not very good on linux

NinjaDoggy: we can talk tmr...

NinjaDoggy: pretty sure there's small things we can do

NinjaDoggy: to massively boost ur performance

Counterbalance: you'll be mid-gold when you wake up struct

struct: yeah, I ont do smart stuff

struct: I just have bfs with mediocre eval at best

struct: What saves me is the number of sims

Counterbalance: > 1 million sims, doesn't save me :(

struct: you have >1mill?

Counterbalance: yeah.. i used to have 6mil with my dfs

NinjaDoggy: wtf...

struct: o.o

NinjaDoggy: can I have some?

NinjaDoggy: just a fraction is good

struct: Do you use anything special?

Counterbalance: i might be counting them differently than you though

struct: 1 sim = 1 move

Counterbalance: yeah

NinjaDoggy: 6 mil?

Counterbalance: plus checking all orders

struct: yeah

struct: how did you get 6 mill

Counterbalance: my sim is basically just 2 asm instructions

struct: ah

Default avatar.png mel-hadj: I stuck on silver is minimax a good algo to give a try

NinjaDoggy: it's ok

NinjaDoggy: but hard to make work

struct: minmax might be a bit hard to apply

struct: If I had 6 mill i would try minmax

NinjaDoggy: I "effectively" have minimax

NinjaDoggy: for depth 10ish

Zenoscave: ten brews?

Zenoscave: or ten moves

Counterbalance: the trouble is that the search tree explodes so even 1000mil isn't enough

Default avatar.png mel-hadj: what is hard about minimax ?

struct: many states if you dont prune well

Zenoscave: It has simultaneous moves also

Zenoscave: or is that no issue

Default avatar.png mel-hadj: so some recommendations !!

Default avatar.png mel-hadj: please

The_Duck: I recommend you ignore the opponent. You can get pretty far without thinking about them at all

NinjaDoggy: what about ignoring learns?

NinjaDoggy: is legend possible ignoring that ;)

Counterbalance: nn guys

The_Duck: probably!

NinjaDoggy: nn Counterbalance

Whiskee: I wish writying to the console dor debugging didn't cost cpu time - it's pretty funny that if I stop debugging this round then the pruning works differently and the results are worse

Whiskee: *writing

NinjaDoggy: yea it would be nice :)