Chat:World/2020-05-13

From CG community
Revision as of 11:44, 15 June 2021 by Chat Log (talk | contribs) (Created page with "<img src=/a/44247984870201> thethiny: You price yourself <img src=/a/44380143301109> Ikhadem: thanks <img src=/a/43912586850775> Kellthazar: Well, in this case, you can chec...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

thethiny: You price yourself

Ikhadem: thanks

Kellthazar: Well, in this case, you can check if the pac is in the same place for more than one turn.

Kellthazar: and tell him to try to go to another direction

kdhakal: could you explain that in code plz

Kellthazar: your pacman could be an object, and have two properties: currentPosition, lastPosition

Kellthazar: even the currentDirection that he'is going

Kellthazar: if currentPosition == lastPosition

Kellthazar: try another direction

kdhakal: thanks I'll try that

Kellthazar: But this is not the best approach to take this problem... :)

Kellthazar: you receive the grid layout on the begining...

Default avatar.png SamuelTheBad: the best approach to the problem is to avoid it happening :wink:

Default avatar.png SamuelTheBad: i say in agreement, having still not implemented any proper pathfinding myself

Pranab: help any1. how to find if a pac is dead?

Default avatar.png SamuelTheBad: assuming you're in bronze, you'll have to use the fact you don't receive an input line for a dead pac

Pranab: okay thanks

Dav1dS: wow! I added some basic collision detection and avoidance and my rank jumped 200 points

thethiny: is there a way to hide the IDE?

AlexArb: (about the "get a better job" form)¿in which country is OK to ask for a Minimum annual salary of over 20k USD? Mine is 2.7k and can't complain lol

AntiSquid: hi

anid: Hi, I have a certain battle where I had a timeout

anid: https://www.codingame.com/replay/462479488

anid: But I am not able to replicate it in the IDE as the opponent`s bot is not deterministic

anid: Is there anything that can be done?

anid: dbdr

anid: https://www.codingame.com/share-replay/462540012

anid: Is it a problem on the server as dbdr is timing out as well?

Uljahn: you can't make games in ide vs rust. they'll timeout

anid: K, but how do I replicate my timeout in the IDE?

anid: I have done several replays in the same seed and it is not happening

dbdr: anid https://cg.spdns.eu/wiki/FAQ

anid: thanks dbdr

Illedan: dbdr having that on speed dial :D

dbdr: yeah, need to script/bot it

Illedan: Maybe Automation2000 can help

dbdr: writing the FAQ was a good investment

Illedan: :)

darkhorse64: @anid: For someone that went from noob to guru in a mere two weeks, you seems to miss some key knowledge

dbdr: :thinking:

Default avatar.png JBM: :see_no_evil:

AntiSquid: going up and down the ranking based on time of the day

dbdr: let depth = 10 + cos(time.hour) * 5;

Default avatar.png WINWINWIN: We can use the pathfinding in the referee right?

Default avatar.png WINWINWIN: I mean to say that we can translate it to our language and make modifications right?

darkhorse64: Add a decay on the constant and you have the right formula for me

Doju: Hey everyone

Doju: do you think that i should go for a sim or just trying to perfect a probability system

Uljahn: Automaton2000: what do you think?

Automaton2000: maybe you dont have an opening book

Uljahn: good point

Default avatar.png WINWINWIN: :/

Uljahn: Automaton2000: do you like that spoonfeeding contest?

Automaton2000: not sure how to change it?

Quidome: I have a deterministic bot, playing against myself still gives me different match length, how is that possible? (seem seed)

Doju: Quidome i have the same thing

Uljahn: with the same seed and deterministic opponent?

Quidome: yep

Doju: i think it might have something to do with sets since they arent ordered

Quidome: ok, I use set's indeed

Uljahn: ye, your bot isn't deterministic

Quidome: I don't use random

Uljahn: doesn't matter

Quidome: :thinking:

RoboStac: HashSet / HashMap in rust does use random though

llllllllll: yesterday evening i was ~150th, this morning ~300th. SLOW DOWN GUYS

llllllllll: take a sleep or something, jeez

Quidome: Aha, that explains

Quidome: annoying

Quidome: I was blaming the other bot :D

Quidome: It was me...

jrke: why my rank increase time by time same code why is that

Doju: there's a lot of noise jrke

Doju: you just get lucky or unlucky sometimes

Default avatar.png WINWINWIN: In order to get to silver, which is the more important ability SPEED or SWITCH?

llllllllll: switch

Quidome: Yes and i hace the same, when you don't submit for a day you go up

Doju: WINWINWIN i'm not silver but i'd say speed

jrke: hey winwin

llllllllll: i havent used speed until I reached top~400

llllllllll: speed is hard, compared to switch

Doju: whatt

Doju: i'm just spamming speed

Doju: don't even have switch coded in

Doju: and i'm at 350

llllllllll: then I guess that works too

Doju: i think once i get pathfinding working so that pacs won't collide with eachother i'm gonna climb another few ranks

Doju: we'll see. hoping to get it online in an hour or so

Default avatar.png WINWINWIN: Doju, I was seriously considering copy-pasting the referees pathfinding and tweaking the allowed points to avoid collisions :P

Doju: hmm

Doju: what's the referee...?

Uljahn: "You can check out the source code of this game on this GitHub repo."

Uljahn: it's in the rules

Doju: oh thaat

Doju: i wasn't sure what you meant by referee. english isn't my first language

Uljahn: server-side code with full game rules which manages your actions

Doju: yup, i figured it out. thanks

Chkoupinator: hey peeps, I wanted to ask some questions about performance to know which programming language to select

Chkoupinator: I'm more used to Python but I'm pretty good at C++ too

Chkoupinator: does performance matter or can I pick any?

llllllllll: C++ >> Python in speed

Doju: performance matters if you want to do something fancy

llllllllll: if you want to reach top position, performance will matter

Doju: such as simulating moves

llllllllll: look at the top guys programing language picks

Chkoupinator: I'll go with C++ then thanks

Doju: gl

Chkoupinator: yeah I saw that but I also saw python3 somewhere in the top 100

Chkoupinator: so I thought maybe it'd be fine?

Chkoupinator: thanks a lot btw :3

llllllllll: for top 100, python should be enough

Doju: Btw, are almost all of the top 100 seriously simulating?

llllllllll: for top 10, possibly not

AntiSquid: what is "seriously simulating"

Doju: as opposed to non-seriously simulating

Doju: no jk

Doju: like it can't be that all of those people have coded that?

Doju: isn't it pretty complicated?

AntiSquid: ok whatever serious means, mine isn't serious yet, quite crappy bot at #50 and has bunch of annoying bugs i try to fix, does this help doju

llllllllll: it is, but even I did it

llllllllll: so it should be feasible

Doju: how many lines for the simulating part llllllllll?

Doju: just to give me a frame of reference

Doju: AntiSquid yes it does help, thanks

llllllllll: in python ~1000, but there are still some things not finished

Doju: oh jeez

Doju: i've 550 and i'm doing basically nothing

Doju: a thousand more to that? ugh

Doju: Or maybe i could leverage my existing classes

Doju: throw a few parallel universes in there, AntiSquid

Doju: :p

MSmits: it's weird, my bot hasnt changed in 2 days and it's still between 10 and 15 most of the time.

MSmits: I guess people dont improve that much outside of the weekend?

llllllllll: i fell 150 places

MSmits: I hope I am getting into legend on friday

llllllllll: so your code is good

MSmits: Ihate having to work past gold boss, it's hard

llllllllll: ++

MSmits: yeah it's ok, it does one thing really well

MSmits: other than that it needs improvement

MattSOrme: hmm. So i tried calculating routes from everywhere to everywhere, and i got through 83 positions in a second... thats not good enough

MSmits: I am going to try to fix the corner chase problem and get some easy kill/survival on dead ends

MSmits: MattSOrme which language?

MattSOrme: python

MSmits: yeah on python it is hard to do this for two reasons

Doju: What do you guys do to make it so slow lol

MSmits: 1) it is slow to begin with, having an interpreter and not a compiler with optimizations

Doju: Ohhh maybe you're doing the same thing that i did

Doju: MattSOrme are you printing something out on every line?

MSmits: 2) You dont have much insight in what is happening under the hood, so that you dont realize when something you do is really inefficient

Doju: in your path calculating function

MattSOrme: nah, only prints are once i time out 0.99 seconds

Doju: i tried debugging my path precompute function and figuring out why it timed out

Doju: added more prints

Doju: timed out even more

Doju: took me 2 hours lmao

MSmits: One thing you can do MattSOrme, is instead of generating a list of neighbors, then iterating over that list, is generating all neighbors for all cells at turn 1 and then just using those lists on other turns

Doju: yes MSmits that's a good one

MSmits: also make sure you use the right data structures for your "explored cells"

Doju: hm

MSmits: you dont want that to be a list where you have to go through the entire list to find if something is in there

Doju: i have that in the cells themselves

MSmits: that works too

MattSOrme: Another thought i just had was find all routes for ~50 random positions. Then later I can find route to a know anchor :/

MSmits: that seems like an unnecessary solution

MattSOrme: should i not be buildings lists and looking through?

Doju: no

MSmits: for neighbors you should

Doju: if explrored

MSmits: not for the explored part

Doju: sets

MSmits: your way is better than a set doju

MSmits: keep a toggle on the cell object

MSmits: "explored = true

Doju: Oh is it? I thought it'd be slower

Doju: that's nice to know

MSmits: what you can also do is what i do in c++

MSmits: I have an array explored[595]

MattSOrme: So store a "False" grid, and set to true when i explore?

MSmits: I memset the whole thing to 0 before bfs

MSmits: each cell has an id

MSmits: so i just do the array lookup to see if its set to true

MSmits: MattSOrme yes thats exactly what i do

Doju: Is a 2-dimensional array lookup really faster than a set lookup?


MSmits: depends on the language

MSmits: if you're using c++ and the dimension size is fixed and constant, it doesnt matter

Doju: huh, okay

MSmits: its going to view your array as a 1D array

jrke: ya c++ for me

MSmits: the 2D part is just visual for you

jrke: how to predict best direction?

Doju: jrke that's your job to figure out

Uljahn: how to win the contest?

Csipcsirip: isnt a 2d array an 1d array of 1d array pointers ?

MSmits: no

Csipcsirip: wow

MSmits: a 2D array is just 1 pointer to the first element of the array, the way i do it

MSmits: map[17][35] for example

MSmits: thats just the same as map[595]

Doju: oh huuuh

Doju: that's smart

Csipcsirip: hm good to know

MSmits: its different when the size is variable

Doju: i have it set up the way Csipcsirip does it

Doju: or at least presented

MSmits: you can do map + 20 and you will just get map[1][3]

MSmits: well you will need to dereference in the first case if i got it correctly

jrke: are there are only fixed map or generates new each time

Doju: new one each time

MSmits: each map has a seed

AntiSquid: everytime MSmits gets asked a question, his teacher instincts kick in and he can't stop, Automaton2000

MSmits: I like this seed:

Automaton2000: i didn't think it would help if i can make it to legend

MSmits: seed=7270017022198506500

MSmits: you know me well AntiSquid

jrke: so what can we get from seed is there any help from seed

Doju: AntiSquid that's true and it's awesome

Doju: thank you MSmits for being awesome

MSmits: :)

MSmits: jrke you can watch a game with a certain property, note down the seed and use the seed with a different opponent

MoMaT: Doju, in python your own indexing might be slower than a set of tuples. what MSmits is saiyng works great, but for C.

MSmits: yes, do correct me if you have python knowledge... I only have a little

Doju: MoMaT tuples won't work since i constantly mutate them

Doju: waait no i dont

Doju: i mutate the objects they refer to

Uljahn: in python you can use numpy 2D arrays...

Doju: oh shoot, what am i doing

MSmits: Uljahn I've always wondered how those stack up against other language arrays' speeds

jrke: hey is only right use of speed and switch can take us to silver

MSmits: pretty sure they wont beat c++, but maybe comparable to C#/java?

Doju: jrke i think you don't even need switch to get to silver

Doju: or maybe not even speed if your bot is really efficient

Uljahn: most of numpy is in c++, MSmits

MSmits: I know, but its precompiled right?

Uljahn: ye

Doju: So um...

MSmits: so it's not in relation to the rest of your code. Not flexible

jrke: whats good speed or switch

Doju: i have no idea what i should use now lmao

MSmits: not sure how well c++ compilers do this

Doju: maybe i'll just stick with my current thing until i hit performance issues

MSmits: but in any case, all python users should numpy as much as possible I guess

Doju: i don't use it at all atm

MoMaT: for memory of "visits" use dictionary or set.

jrke: fory switch their pac guys in silver do they switch their pac type to DEAD:stuck_out_tongue_winking_eye:

jrke: *for

Doju: and performance is fine for now

jrke: DOJU whats your rank in bronze

Doju: 367 currently

jrke: K

Doju: soon to be better

Doju: a lot better i think

MSmits: MoMaT that is faster than a list, but it is slower than a direct memory lookup, would they not be better off with an array that you dont have to iterate, but that has a direct lookup?

jrke: me also submitted again before that it was 297

Doju: wait are you using your super shallow depth simulation jrke?

jrke: no

jrke: its timeout for that

Doju: okay

MSmits: for huge maps, you could not use direct lookup, but with at most 595 cells, why not just have 595 visit toggles

jrke: now normal if i am not able to be in silver then i will try it again

jrke: before silver opened my rank 700 and now 800+ in silver and i am 300 in bronze:stuck_out_tongue:

MSmits: plenty of time left to experiment. If you intend to do more contests in the future, you could just try different ways of doing things and get better

MSmits: good practice

MSmits: and consider a promotion to silver a bonus on top of learning if it does happen

jrke: yeah i am 13 years old and only spent 5 months on coding lot to explore

MSmits: I started coding around 30 or so

fasil: hey there

MSmits: well serious coding that is

jrke: hey how u collaborate with other pacs

MSmits: randomly do simulations and see which combination of moves led to the best result

jrke: but it gives time out in c++ i created nested loop

MSmits: you need very high performance to get this to work

MSmits: dont do recursion or anything, just randomly select moves and deal with moves that cause conflicts

MSmits: two pacs going to the same cell, select one of them to stop

jrke: what if i send my pac in other directions in starting

MSmits: thats fine, just randomly pick moves

jrke: K

MSmits: they're going to do different things every time

jrke: thanks MSmith\

jrke: :-)

Doju: BuT iT

jrke: :)

Doju: Is UnDeTerMeNiStIc

Doju: :D

MSmits: yeah... just dont spend days on this if you cant get it to work, it's not as easy as i now many it out to be. The move conflicts get complicated with speed

MSmits: make it out ot be that is

jrke: hey just type colon and closing ) and enter in chat box it will automatically chages to smile

MSmits: and you get two pacs trying to exchange positions, moving through eachother. No move conflict there, but still not allowed

jrke: hey my collision are solved but they don't callobarate which other

MSmits: ye, it's the hardest part and the only reason my bot is doing well.

jrke: what u did i know you won't tell:)

MSmits: no, i did tell... the monte carlo random moves is what does this. But the details of it I won't share no

jrke: Whats monte carlo

MSmits: random moves :)

jrke: K

MoMaT: MSmits, the thing is, if you use your own index arithmetic, it might be slower than heavily optimised native data structures. dictionaries are surprisingly fast in Python.

jrke: who is first presently

Doju: MoMat oh maybe that's why i haven't run in to performance issues

Doju: I'm doing a lot of things with dicts

jrke: main thing is Dist and collaboration

MSmits: MoMaT sure that's possible, I have no idea how fast these things are in python

MoMaT: I'm just saying, not many optimisation tricks in C apply to Python. best is to test with "timeit".

MSmits: makes sense

MoMaT: example timings -- adding values to list, set, and dictionary: https://pastebin.com/LaXpMKvs

MSmits: hmm yes, but the most relevant part is the lookup

MoMaT: sure, but you would never expect such close results from C++ STL for example.

MSmits: true

MSmits: they would be far apart

Default avatar.png Derthek: In the montecarlo, do you just pick moves that can be performed in this turn or any random move is fine?

MSmits: allowed moves only

MSmits: but you could be more strict than that and not allow all "allowed" moves

Default avatar.png Derthek: really nice, I will try implementing some montecarlo algorithm once the contest is over :)

MSmits: for example, dont allow moves where pac 1 and pac 2 go to the same cell

Default avatar.png Derthek: yeah, that should not be a valid move ^^

Doju: oh damn i have a bad flaw in my thing that i've been writing for the past hour...

MSmits: never a good thing when you have a bad flaw in your thing

MSmits: hard to find a doctor with time for you as well

Doju: xD

MSmits: easy way to practice monte carlo: https://www.codingame.com/multiplayer/optimization/code-vs-zombies

Doju: my Cells have a variable called "block" which can be 0 for a walkable thing, 1 for a wall, 2 for a friendly pac and 3 for an enemy

Default avatar.png Derthek: Id love to know if you using some special hamiltonian or just pellet value

Doju: oh wait nevermind

Doju: it's not a flaw

Doju: a cell can't be both a wall and a pac

Doju: Btw how would you set the "blocking criteria" for a flood fill function

Doju: if the cells have two attributes that can bock

Doju: block*

Doju: like flood(criteria = (wall == True, pac == True))

Doju: but that's not gonna work

MSmits: i just calculate whether an opponent pac has advantage in some way (considering cooldown and type) and if they do, then it's a wall in my sim

Doju: yeah i didnt mean like the theory behind that but how it's actually written

MSmits: well at risk of giving too much detail: Keep a tiny array on each cell object to state whether the cell is blocked for any particular pac of yours

MSmits: blocked[5]

Doju: that's pretty much what i'm doing at the moment

MSmits: just make sure you reset it every turn

Doju: oh wait no

MSmits: as our code grows, you tend to forget small stuff like that and you get stuck for hours

Doju: well kinda but anyways what if i sometimes want to check for both walls and pacs but sometimes only walls?

MSmits: i have a separate property wall and blocked

MSmits: well actually, i dont need the wall property as i keep a list of cell neighbors

MSmits: so if its a wall it wont be in the list of neighbors

MSmits: so i automatically ignore walls when finding a path and i can, if i want to, check for opponent blocks

Doju: huh, my cell neighbors dont have that since i also use them for other things

JohnCM: i have a different array to store the walls, and a different array for my pellets

JohnCM: so i don't confuse myself

Doju: okay

MSmits: i dont know why you would ever include walls in your neighbors list

Doju: actually now that i think of it i don't know why i'm doing that either MSmits

Doju: hahah

Doju: the other thing also checks for walls and gets rid of them

MSmits: hehe good luck improving that. gotta go do some stuff now :)

MSmits: ttyl

Doju: alright thankss

RoboStac: MoMaT - that benchmark doesn't show anything useful as you don't clear the dict / set / list so the list continues to grow to 1000 * 10000 long and other than the first run you only time set / dict lookups

MoMaT: that's what I thought too. I was lazy and use single line timeit without setup. I got similar results when cleared...

Uljahn: also the faster way is: "arr = np.zeros(1000); a[:] = True" or even "arr = np.ones(1000)" :smiley:

Doju: nice, at least i haven't broken my code by chanigng a bunch of things

Doju: that's always good to know :)

MoMaT: yes, if you set the entire vector at once. but if you loop, and add elements one by one, it would be slower than lists.

Doju: say that i have a "visited" array like that using numpy

Doju: if i want to reset the array

Doju: would it be faster to the np.zeros thing

Doju: actually nevermind

Doju: yes it would be faster xD

wlesavo: Doju i think there are even faster ways to do so, but i dont think that it is the slowest part of code anyway

Doju: yeah it was only a performance issue when i ran it wayyy too many times

Doju: although, say, hypothetically, if i wanted to calculate all the distances again every move, that'd be a thing to consider

Doju: wink win

Doju: wink wink

Doju: if there was maayybee some math magic that would be useful

Doju: Lol my pacs are so stupid atm

Doju: enemy was just in front of me and at a corner

Doju: Enemy is not visible anymore? Must have vanished out of existence then.

MoMaT: robostack, just because I like you :P more tests for you (and Uljahn): https://hastebin.com/arukosemuz.bash

Uljahn: :/

Uljahn: "for i in range(100): a[i] = 1" you are measuting iteration here, just use vectorized a[:] = 1 or a.fill(1)

MoMaT: that's a typo, should've been a[i] = I, as I want to store different elements.

MoMaT: *a[i] = I

MoMaT: sorry, autocorrection knows better...

Uljahn: then a = np.arange(100, dtype=int) would be better

wlesavo: Uljahn he is talking about looping over np arrays, that make sence, obviously for this simple example there are better ways to do so

Uljahn: you should avoid iterating through numpy arrays with python at all cost

wlesavo: this was his point i think :slight_smile:

Uljahn: ye, choosing the wrong tool

MoMaT: sure, but you taking it to literally. we were talking about remembering visited nodes.

MoMaT: there is no vector to store, just one value at a time. and there is no sequence either...

Uljahn: preallocating an array in numpy costs nothing, but adding elements to lists, sets, dicts requires much work under the hood

Uljahn: such is the difference between static and dynamic data structures

MoMaT: well, theoretically yes. but look at the timings. dictionaries beat everything for small N.

Uljahn: sure

Default avatar.png AlexRSS: Any tips on testing optimisation in this interface?

Doju: AlexRSS not sure if it's the best way but i printed out all the inputs, copied them

Doju: then made a generator function that acts as input()

Doju: and profiled it locally

Default avatar.png AlexRSS: I've done that kinda, which is why I'm confused

Default avatar.png AlexRSS: I;ve got a function which when run in the IDE times me out

Default avatar.png AlexRSS: Outside of the IDE it runs in less than a millisecond

Doju: hmm

Doju: that's odd

Default avatar.png AlexRSS: This is running on first turn so I should have 1000ms to play with

Doju: Are you sure it's doing the exact same thing?

Default avatar.png AlexRSS: Yep

Doju: bizzarre

Doju: bizarre*

Uljahn: using flush=True in your debug printing in browser IDE?

Default avatar.png AlexRSS: I'm basically saying "If pacs can see no pellets, have them navigate to the four corners as backup inputs"

Default avatar.png AlexRSS: The function is checking the four corner inputs against the current map to make sure they're valid inputs

Default avatar.png AlexRSS: How do I use flush=True?

MoMaT: inside print function, as argument.

Uljahn: print(my_var, file=sys.stderr, flush=True)

Uljahn: so you'll recieve the output even when timeouted

Default avatar.png AlexRSS: Cheers, I'll give that a go

MadKnight: basically python caches output instead of sending it right away

MoMaT: if you have a weird timeout, its most likely infinite loop.

Icebox: ah I remember that tip saving my ass like 4 years ago after I spent 3h debugging my timeouts Uljahn :D

Icebox: and so have my prints have been flushed ever since

Uljahn: ye, deserves to be in faq

Icebox: we should make a language specific FAQ

wlesavo: i would put fflush in stub if it would be possible

Uljahn: good point

MoMaT: the Python environment could be set to flush stderr by default. someone suggested it already on the forum.

wlesavo: also spend quite some time trying to figure out why was the last input missing

Astrobytes: Yea Robo posted about it, Thibaud was gonna suggest to the devs

Astrobytes: It's probably the most common Python issue people seem to have on CG

Clagus: lol, I just got a tie as a battle result

Clagus: didn't know that was possible

Default avatar.png AlexRSS: So that's helped me figure out which run it's failing on

Default avatar.png AlexRSS: But I still don't understand what is making it take so long

Earthborne: Gosh thanks Uljahn for the flush tip, I've been banging my head all day not finding where I time out!

Default avatar.png AlexRSS: Bah, will time.time() outputs work alright in CG if I import it?

Doju: AlexRSS are you printing a bunch of stuff?

Default avatar.png AlexRSS: Nope

Doju: alright, that was my problem while i tried to "debug" my distance precompute function xD

Default avatar.png AlexRSS: Only printing being done is 5 lines of debug

Doju: alright

Default avatar.png AlexRSS: Everything else is just writing to/modifying lists for later use

solaimanope: Gold league will be unlocked in 4 hours right?

Illedan: yes

Uljahn: AlexRSS, im using this: http://chat.codingame.com/pastebin/e0a18ff4-95d0-49c7-acc3-2affe55a0256

Default avatar.png AlexRSS: Thanks :-)

Default avatar.png AlexRSS: Okay, that was actually very helpful

Default avatar.png AlexRSS: It looks like the issue was actually coming from writing the map to a list

Default avatar.png AlexRSS: That's taking 4000 ms

Doju: oh this is beautiful

Doju: pacs considering other pacs as walls looks sooo much better

Doju: although sometimes they take stupid routes when they could just wait a turn or two...

Default avatar.png AlexRSS: At what point does the game start counting for timeout?

Earthborne: After first input

Uljahn: ^

Default avatar.png AlexRSS: Because this 3000 ms delay is coming from the inbuilt code to read the map from input

Earthborne: I think someone said

Default avatar.png AlexRSS: It's timing out before I get to make my first input though

Earthborne: Is timeit reliable when used in the online IDE?

Uljahn: yep

Earthborne: And the turn limit is 50 ms=

Default avatar.png AlexRSS: It says in the specs

Default avatar.png AlexRSS: Response time for the first turn ≤ 1000ms

Default avatar.png AlexRSS: But the inbuilt game code is taking longer than that to run

Default avatar.png AlexRSS: So i've got no clue how to debug this

Uljahn: what's the inbuild code?

Default avatar.png AlexRSS: width, height = [int(i) for i in input().split()]

Default avatar.png AlexRSS: According to timeit that takes 3841.825 ms to run

Uljahn: just start the timer right after this line

Doju: Oh wow yeah this definitely helped with the ranking

Doju: might go to silver with this

Doju: why haven't i done this earlier ._.

Doju: oh okay i'm the top player in bronze

Default avatar.png AlexRSS: Found the bugger

Doju: sure i'll take it xD

Doju: nice AlexRSS

Default avatar.png AlexRSS: Got an infinite loop in the coord checking

Doju: what was it?

Doju: ah

Earthborne: Great to lurk in the chat, this discussion really helps my debugging as well :D

Default avatar.png AlexRSS: The check scans across the row and if it gets to the middle without finding a valid space, it's meant to increment the y value and start again

Default avatar.png AlexRSS: What's actually happening is that it just jumps infinitely between 16 and 17

Default avatar.png AlexRSS: All of that, because I forgot to set the midpoint to int(width/2) rather than width/2

Default avatar.png AlexRSS: I'm going to go have a quick cry-break

Default avatar.png AlexRSS: :joy:

DomiKo: do someone know what happens if there are two shortest paths?

NickStahl: Doju what was your main change to get through bronze?

NickStahl: I'm still to lazy to write a sim, so I'm just doing some heuristics but not sure if that will get me to silver.

Doju: NickStahl I made pacs consider other pacs as walls

MSmits: dont do that when you know your pac has advantage based on type and cooldown

Doju: hm

Doju: okay, i'll add that to the to-do-list

MSmits: it's not critical but helps

Default avatar.png AlexRSS: What's the output to move a pac and activate speed?

Default avatar.png AlexRSS: Or can you only do one per turn?

Doju: only one per turn

RockyMullet: Doju you probably miss some kills because of that

Doju: RockyMullet my pacs are pacifists anyways

RockyMullet: or avoid a pac ou shouldnt avoid

Doju: that is true though

RockyMullet: Doju there always those suicidal pacs you throw themselves at you :P

MSmits: I think you cant avoid having two types of code, one to optimize pellet gathering and one to kill and avoid other pacs

RockyMullet: you gotta let them

MSmits: the hard part is combining the two

NickStahl: Tx for the answer Doju

Doju: np

Clagus: YES! SILVER LEAGUE FINALLY! xD sorry for spam :P

MSmits: well done

Clagus: thx :D

Clagus: implementing BFS helped :P

MSmits: yea it does

Kellthazar: Today Ill try to apply a Monte Carlo approach to my bot.

Kellthazar: Find a paper about Monte Carlo Plan on RTS games that I think that fits with this contest.

Kellthazar: Found*

Doju: Cool Kellthazar

Default avatar.png Derthek: Could you share that paper? I am interested on it as well :D

Schade: https://webdocs.cs.ualberta.ca/~jonathan/publications/ai_publications/mcsearch.pdf ?

MSmits: title sounds perfect for this yes

Default avatar.png Derthek: thanks!

Schade: confirm with Kellthazar if it's the good one :)

Schade: Do you need a simulation of the game for the Montecarlos renforcement learning ,

Schade: ?

NormantasStankevicius: forgot to say, congrats Doju getting to silver

MSmits: ok, first of all, it's not reinforcement learning I think Schade

Doju: Thanks NormantasStankevicius

MSmits: unless it's something else entirelty

Doju: Next goal: gold :P

MSmits: and you *always* need a simulation

Schade: Is there a simulator on the spring contest ?

MSmits: for anything

NormantasStankevicius: last contest gold for me was hell

MSmits: even basic heuristic bots will simulate something

Schade: an external environment simulator if you prefer

Uljahn: you can use the referee

MSmits: oh, no not really, but you can steal the source code

MSmits: = referee

Uljahn: link is in the rules

Default avatar.png Derthek: How do you use the referee?

Schade: ah yes ! merci

MSmits: usually it is poorly optimized though

MSmits: also you might want to simplify parts of the simulation

MSmits: Derthek the referee is mostly to gain insight in implementation detaikls

MSmits: what happens when two pacs enter the same cell and such

MSmits: but the description covers most of this pretty well

MSmits: i barely looked at the referee

Default avatar.png Derthek: aah ok

MSmits: in some games you really need to study it

MSmits: for example CSB simulations

MSmits: though other players have figured out and shared simulation details for that

Default avatar.png Derthek: CSB?

MSmits: grid games like this, you usually dont need to bother looking at it

Schade: it's why I asked for external simuiator :)

MSmits: coders strike back, physics racing game

Schade: Is there a way to add macro on VIM integrated plugin ?

Schade: or Is there a config file for VI editor ?

IAmNoob: hi:)

Uljahn: you mean for Monaco IDE editor?

Schade: no I mean for VIM edition mode

anid: Gold opening tonight?

ZarthaxX: 3 hs

AntiSquid: hi i am new, when is gold opening?

Schade: ohh gold is not opening ? oh I'm not so late ^^

ZarthaxX: AntiSquid yesterday

anid: ZarthaxX where can you find the clock for league opening?

ZarthaxX: there isnt one

ZarthaxX: but it's always at that time

Uljahn: it's the same time the contest opened i guess

anid: But how did u find out which day?

AntiSquid: you have to track it, just like hidden info games

Schade: Anyone used VIM mode editor ? If yes, do you know if I can add some map ?

AntiSquid: day is actually in the IDE, when you click on rank, idk maybe there should be a faq somewhere?

ZarthaxX: yeah

anid: Hmm, so there is only 1--2 days with a legend league?

AntiSquid: 2+

MSmits: it doesn't matter, we're already fighting the same players

MSmits: therés just other players also

anid: Yes

AntiSquid: a lot more quitters this time

AntiSquid: but few new people

Ramzel: How to use speed ability and switch type?

IAmNoob: std::cout<<"SPPED "<<pacID<<" | ";

IAmNoob: output SPEED

IAmNoob: than pacID

Ramzel: Thanks

IAmNoob: np

Ramzel: and how to Switch?

AntiSquid: i think finally solved some really disgusting bug, but will wait for gold now to open, Automaton2000 cheer me up

Schade: otherwise your read rules :)

IAmNoob: dont forget to ouput" | "

Automaton2000: i'm doing this for a while

AntiSquid: bronze only top 200 promoted, wonder if it's worse for gold

AntiSquid: :D

JohnCM: haha when is gold coming ou

JohnCM: out

eulerscheZahl: i predict 50-100

eulerscheZahl: in 3h

AntiSquid: ya was thinking 50 too ugh

JohnCM: i see.. wonder if i'll make it

JohnCM: will know tmr

JohnCM: have a good day everyone

AntiSquid: bye

eulerscheZahl: you would even have a good rank for a boss

eulerscheZahl: and python too. that's an advantage if you want to be the boss

AntiSquid: lol, would be hard to predict as a boss, the bot in the arena does some weird shit

AntiSquid: ah wait whom you talking to ?

eulerscheZahl: john

AntiSquid: ah ya i guess

eulerscheZahl: i didn't check the actual bot, just the rank

wlesavo: AntiSquid also have a good rank for a boss :slight_smile:

AntiSquid: silver boss with smilies would be nice

wlesavo: nah, thay will cut it

wlesavo: they

AntiSquid: lame :(

wlesavo: true

JohnCM: anyway you also won't know who is chosen as the boss

AntiSquid: euler i see mataranga / Febrin / robo closest to 100

JohnCM: but if it's my own code I'm pretty sure i can beat it with a few tweaks

AntiSquid: maybe robo even has clearner code? :thinking:

JohnCM: i realise i have two systems in my code

JohnCM: each taking 400 lines

JohnCM: but i don't use the first system anymore

JohnCM: so actually i can shorten it to 400 lines

eulerscheZahl: but we don't know if they will go for top100 or even above

JohnCM: lol.. but i keep it there for legacy

AntiSquid: wlesavo for silver lol

eulerscheZahl: i'm beyond 1.2k already. could do some cleanup but now below 1k :D

AntiSquid: just under 1k here

AntiSquid: repetitive code though

JohnCM: yup if i do more recursion i could probably make it 300

JohnCM: but this is not a contest about neat code

JohnCM: so yea.. haha

AntiSquid: what are the chances they go again for 200 ?

eulerscheZahl: :thumbsdown:

eulerscheZahl: probably after some more promotions at the edge of the leagues

dbdr: did they actuall pick 200 for silver, or it was just the drip promotion?

AntiSquid: 200

dbdr: it went up super fast

AntiSquid: they said they will increase it later, slowly ... but i didn't see any actual mass promotion after that

eulerscheZahl: but it was a really smooth opening of a large league

dbdr: it did increase to 450 in a short time.

dbdr: maybe it was partly that

dbdr: but weird with the few matches

dbdr: and the broken bots

dbdr: :D

AntiSquid: was top 20 initially because of that

AntiSquid: but wanted to experiment with some stuff so ...

dbdr: top 20 in silver? :D

dbdr: silver is the new legend

JohnCM: that's a massive cut

eulerscheZahl: with crashing bots

eulerscheZahl: DEAD

JohnCM: i think maybe this time legend can go for top 10

AntiSquid: yes with the crashing bots around got to top 20

dbdr: I predict large gold and small legend

eulerscheZahl: medium gold + small legend

dbdr: CG is % 2

JohnCM: small gold + tiny legend

Default avatar.png Xlos: small gold + huge legend

JohnCM: haha

wlesavo: AntiSquid i wouldnt really mind to be a boss :slight_smile: but 40 seems to small for gold and i dont want to resubmit :slight_smile:

dbdr: all silver directly in legend, and super hard gold boss

dbdr: that would be fun

JohnCM: time to make your code weaker then

JohnCM: so the boss will be easier

JohnCM: haha i really didn't know the players' bots are the bronze/silver/gold bosses

JohnCM: i thought there was a benchmark already set out in advance

wlesavo: nah, its weak enough, i can resubmit same code to #140

eulerscheZahl: i was the gold boss in botters of the galaxy

JohnCM: how would you know?

dbdr: because of the bugs ;)

eulerscheZahl: play me vs boss and codingame told me

wlesavo: lol

eulerscheZahl: then double hulk appeared and crushed me

JohnCM: anyway whoever is the bronze boss in "ghost in the cell" is so hard

eulerscheZahl: and i ignored groots

eulerscheZahl: ghost in the cell has weak bosses

JohnCM: massive difficulty increase from the grass levels

dbdr: there was acheese like sending groots around the sides

eulerscheZahl: perform a range attack and groots will come to kill the closest player

eulerscheZahl: and i ignored them, was easy to kill me

dbdr: ah yes, bait them to attack the opponent

eulerscheZahl: i was well aware of that bug but didn't care as i didn't expect to become the boss

JohnCM: haha maybe i haven't tried hard enough for it then

AntiSquid: botg multi is strange with small gold league

dbdr: maybe it helped me get my first legend eulerscheZahl

eulerscheZahl: oh, you missed legend in your first contest

eulerscheZahl: but was a tough one for new players

dbdr: yeah, MM, was top gold. didn't know what a sim was :)

eulerscheZahl: not a single tshirt winner (top20) was a first-time winner

wlesavo: wow

eulerscheZahl: usually it's about 50-50

eulerscheZahl: mean max was really hard for new users. those with CSB experience had an advantage

eulerscheZahl: just too chaotic to get much done with heuristics

JohnCM: i think codingame is moving into multiagent games more and more

JohnCM: i think it is a good trend. it is hard to find good heuristics there

JohnCM: like 1v1 games like checkers have multiple good approaches to solve them already

Chkoupinator: terminate called after throwing an instance of 'std::bad_alloc'

 what():  std::bad_alloc
-;

Chkoupinator: I think I'm giving up on trying to solve this with C++

IAmNoob: you could try just using the "new" keyword

IAmNoob: and delete

IAmNoob: it is easier

Chkoupinator: damnit

Chkoupinator: everything I made is using shared pointers

IAmNoob: :)

IAmNoob: it is not a problem

IAmNoob: but in future it will be harder

IAmNoob: try dynamic allocation

Chkoupinator: I don't even know what's causing the error

Chkoupinator: isn't shared pointers dynamic allocation by itself?

IAmNoob: I think those pointers

IAmNoob: Chkoupinator not everytime

Chkoupinator: I'm using make_shared to instantiate things instead of new

Chkoupinator: which is supposed to be best practice

IAmNoob: not he best

IAmNoob: i will recomand new and delete

IAmNoob: are more flexible\

IAmNoob: but it is you time to chose

pmor: you only want shared_ptrs if you want ref-counting...otherwise use make_unique

IAmNoob: unique pointers are a good idea

Counterbalance: bad alloc is when you allocate too much memory

Chkoupinator: how much is too much

Counterbalance: -1

Counterbalance: 768mb is the max (this includes the executable, stack etc..)

AntiSquid: 300 more participants and this contest beats the accountant too :o

eulerscheZahl: and the number for TAC is a lie

AntiSquid: yes but it would be amazing if it even beats that lie

Chkoupinator: I don't understand what's causing the memory hog

Chkoupinator: and I suppose there are no tools to help me with that?

IAmNoob: no tools

IAmNoob: you can try to delete the pointer

pmor: if you can run locally, visual studio has a memory profiler

IAmNoob: 's*

IAmNoob: or to try unique pointers

Chkoupinator: I'll need some decoy input tho

Chkoupinator: nah with unique it's worse

Chkoupinator: they get deleted when they become out of scope

pmor: if you have allocated memory existing out of scope, that's a leak

Chkoupinator: isn't the point of using make_shared automatical destruction?

Chkoupinator: automatic*

pmor: you want make_shared if there are going to be multiple owners of the pointer

Chkoupinator: I store everything in an array so that I can use the "fringe" of the current depth in the next depth

pmor: then when the last owner goes out of scope, the memory is deleted

Chkoupinator: ^ which should happen only when moving to another pacman in my code

Chkoupinator: but so far I didn't solve even wood league so idk

Chkoupinator: feelsbad

Chkoupinator: I think I'll move back to python I'm tired of C++

Chkoupinator: and the integrated IDE doesn't help at all

pmor: sounds like you don't have the lifetimes and ownerships structured properly

Chkoupinator: I honestly don't know and I don't even feel like looking at it anymore

Chkoupinator: even though it's properly written it feels like I'm so wrong that it'll need a full rewrite

Chkoupinator: and I really don't feel like doing that for now

Chkoupinator: is python any viable or should I give up and be done with it?

PatrickMcGinnisII: I guess I'm not getting out of bronze

eulerscheZahl: depends on what you want to do with python

Doju: How many different constants do you guys have?

Doju: i currently have 1 and i can't even get that to the best value

Doju: and in my next plan i'd have like 10

eulerscheZahl: like magic constants of my own for scoring?

eulerscheZahl: or game constants too like 5 pacmen max per team

Doju: magic constants for your scoring or decision making anyways

eulerscheZahl: 5 i think

Chkoupinator: eulerscheZahl I honestly don't even know what I'm doing anymore

Chkoupinator: I was trying to do some simple search with a static depth and move according to which gives most point

Chkoupinator: points*

eulerscheZahl: for simulation python is a bad choice it's just slow

Chkoupinator: then I guess I'll just give up

JohnCM: well i got to top 100 with python

JohnCM: it is a viable language

JohnCM: just not for monte carlo

JohnCM: you have to use breadth first search to enumerate the value of various paths

Chkoupinator: that's what I was trying to use in C++

Chkoupinator: but I ended up with memory issues somehow

JohnCM: and you need to cleverly go for the big pellets

JohnCM: that is a key thing for victory

Chkoupinator: yeah I think I'll do that instead

JohnCM: focus pathfinding on the big pellet first

JohnCM: then when it is gone then it is free for all

MattSOrme: I can't seem to find an answer to what direction CG chooses when dist is the same.

JohnCM: you also have to prioritize your various pacs

JohnCM: which is nearer to the pellet etc.

JohnCM: don't all go for one big pellet

JohnCM: that will lead to congestion

Chkoupinator: yeah that should be easy

Chkoupinator: I already was preparing for that in C++

JohnCM: another key concept: spread out your forces

JohnCM: how you do it is up to you

Chkoupinator: thanks

JohnCM: but good algo always has the pacs far from each other

JohnCM: no point covering the same area twice

Default avatar.png WINWINWIN: JohnCM if you try your own pathfinding for super pellets, wont the opponent get it first?

JohnCM: think of how to implement it

Doju: Not always JohnCM

Chkoupinator: I had just deleted my python project and you gave me hope again :3

Doju: you could argue for an aggressive strategy where you trap pacs

JohnCM: the opponent can get to the big pellet first

Default avatar.png WINWINWIN: Doesnt make a difference for me :D I dont know pathfinding

Doju: and kill them

JohnCM: then you either let him have it

JohnCM: or you go near it and hope he doesn't get it

JohnCM: some even kill at the big pellet

JohnCM: i know my algo is weak against that

eulerscheZahl: MattSOrme 03:59PM I can't seem to find an answer to what direction CG chooses when dist is the same.

add your own pathfinding, makes it easier

Default avatar.png WINWINWIN: Ok, so far I have been focussing on the big pellets above all, looks wrong

JohnCM: big pellets can get you so much only

JohnCM: after that it is the middle game

Default avatar.png WINWINWIN: Yes

JohnCM: where you need to focus on optimizing your paths

JohnCM: note i say paths

JohnCM: because you need to optimize ALL your pacs

Doju: wdym you cant make a big pac train?

Doju: next meta

JohnCM: if one pac goes the wrong way or just gets "lost", you lose a lot of pts

JohnCM: and in the top few bots, every move counts

JohnCM: and yea the next pointer will be "SPEED"

JohnCM: use it all the time when you're not in danger

JohnCM: means your pathfinding algo must output two steps in advance

JohnCM: hope this helps

JohnCM: gd luck

Chkoupinator: btw in the map input there is only ' ' and '#' right?

Doju: yup

eulerscheZahl: and \n

Doju: ah yeah

Chkoupinator: thanks

SurajMishra2209: what is the rank required for silver league?

Doju: SurajMishra2209 above the boss

SurajMishra2209: got it...tks

wlesavo: ,

Kiripot: lol

wlesavo: ,,,,,,,,,,,,

wlesavo: oh sry

Default avatar.png WINWINWIN: 3 more guys going to silver

llllllllll: top 10% will go to gold?

llllllllll: at 6 o clock, right?

IAmNoob: no rank

eulerscheZahl: sounds about right

H1ggsb0s0n: so there's no boss bot for promotion to gold ?

eulerscheZahl: not yet

llllllllll: after 6, there will be

dbf: top 11% will be better

H1ggsb0s0n: ah,

eulerscheZahl: in 1.5h (as i don't know your timezone)

JohnCM: exciting:)

H1ggsb0s0n: thanks! I slacked after being promoted to silver and delayed any improvements to the bot until Thursday

H1ggsb0s0n: thought I missed my chances to go to gold

MattSOrme: if they could promote top 350, thatd be great ;)

llllllllll: haha, they won't

MattSOrme: its alright, im re-writing half my stuff, to try and level up

Default avatar.png ChooJeremy: I don't think it matters if you delay

Default avatar.png ChooJeremy: they'll just assign a bot for gold and if you beat it anytime after you get promoted

MattSOrme: finding so many silly bugs, but for all i know, those bugs helped haha

JohnCM: hi jeremy, i just realized you're from NUS too

llllllllll: I had the same: I fixed 2-3 real bugs (incorrect calculations, etc) and I lost ~200 positions

llllllllll: I was like ???

Default avatar.png ChooJeremy: Oh hello JohnCM, I just realised that too xd

Doju: Same. My distance to cells was actually about the distance ^ 2

Doju: not sure why that helped

Doju: oh wait, yes i do

Doju: not gonna tell you :P

JohnCM: haha is this your first competition jeremy?

Default avatar.png ChooJeremy: Yup, was actually bored and just randomly stumbled upon this site after exams about a week ago

MattSOrme: Its my first time playing at the same time, and im a bit obsessed

MattSOrme: But i still have a day job to do as well

JohnCM: same here

JohnCM: i found out about this site via kaggle actually

JohnCM: i was submitting for the ConnectX simulation, then noticed a link here. glad i checked it out. it's been great

Hjax: did they fix the exploits in connectx yet?

JohnCM: nah

Hjax: amazing

JohnCM: top two still winning via glitches

JohnCM: i used monte carlo tree search, now about 20th place

JohnCM: still haven't worked on implementing alphazero yet

JohnCM: but it'll be done soon

JohnCM: but it's more fun here haha. though not deep learning but still pretty fun still

Default avatar.png ChooJeremy: Cool, took a look at connectx, looks like a pretty similar competition

JohnCM: that one can't beat this site in terms of feedback

JohnCM: you get 50+ games played out within 5 minutes here

JohnCM: amazing servers

jrke: servers are boosting

JohnCM: sometimes i wonder how the game is played out so fast. 1 sec per move, 200 moves, but you get the result in 5 sec

Chkoupinator: pellets can only have a value of 1 or 10 right?

jrke: ya

JohnCM: yup

jrke: 1 or 10

MattSOrme: 50ms per move JohnCM after first move

jrke: but input also takes time

Default avatar.png WINWINWIN: whats alphazero?

Default avatar.png ChooJeremy: That's true

MattSOrme: Assuming they call both bots at the same time, 20 turns a second after first turn. so 5-10 seconds for 100-200 rounds

Default avatar.png ChooJeremy: at 50ms per move @ 200 moves that's 10 seconds per game

jrke: ya

DollarAkshay: Not everyone really uses the whole 50ms

MattSOrme: silver players prob are

DollarAkshay: Naa

DollarAkshay: 10 ms

DollarAkshay: Simple haeuristics bot

MattSOrme: then you win the prize of waiting less time

Default avatar.png WINWINWIN: @DollarAkshay if they use a simulation wouldnt they need the full 50ms?

jrke: hey DollarAkshay sup

DollarAkshay: You can check Euler's bot hes printing his time

jrke: ya some players are also printing time

DollarAkshay: @WINWINWIN Yeah, but most of them are just using heuristisc

drykberg: sup guys... i geth "has not provided 1 lines in time" since i made 5 if statements that check for visible_pac_count and produce the corresponding amount of printf statements...

eulerscheZahl: at least if i manage to print it in time... https://www.codingame.com/share-replay/462746991 100ms for tracking alone :scream:

Default avatar.png WINWINWIN: :D 100ms?

JohnCM: ah i see...

MikeHoward1: My gameplay window keeps stopping & not loading new "Play my code". Have to reload the page to fix. Is there a better way to fix? (Firefox.)

drykberg: what the hell am i doin wrong

JohnCM: yea makes sense

JohnCM: 100ms

JohnCM: i confused it for 1 sec per move

eulerscheZahl: 100ms. that's why i lost the match :(

jrke: :(

eulerscheZahl: had a huge lead by points already

njaber: eulerscheZahl how are you doing the tracking?

njaber: I've worked on a tracking algorithm for way too long, curious to see if you did it differently

eulerscheZahl: see opponent in turn X and later in Y again

njaber: mine runs in decent times

JohnCM: hmm.. euler looks like you may need to do fewer sims

JohnCM: if not losing by timeout is a pity

jrke: hey you can add some functions before input its not counted

njaber: Oh so you don't complete possible poses inbetween?

eulerscheZahl: list all possible paths that lead from the first to the second position and that's slow

njaber: I basically complete the paths with new nodes each turn

jrke: is it good if i choose path best for next 4 turns

eulerscheZahl: i partially do that too: try to guess the current location based on the past

njaber: that way the calculations are done on a longer period, and I take into account line of sight, pellets taken etc.

eulerscheZahl: in some corner cases it's even possible to deduct the actual position that way

eulerscheZahl: so i have 2 trackers

kovi: same here...

jrke: how many lines of code do you have

eulerscheZahl: but the first one failed here

eulerscheZahl: 1250

kovi: i dont try all paths though, its quickly become useless

njaber: I've got 1750, I've been coding way too much since the beginning of the challenge

jrke: i have only 300

eulerscheZahl: i trim some paths too

jrke: thats why my rank :(

eulerscheZahl: but here it's not enough

MattSOrme: *sigh. My code is borked somewhere

njaber: I don't really try all paths, I actually merge them into paths that end on the same node, and keep track of the minimum and maximum lengths of the paths, which is enough to deduce all other info back

eulerscheZahl: and if i assume that it will be too much, i just skip the tracking

eulerscheZahl: no point in computing the last 20 turns for my opponent

wlesavo: euler you dont need the tracking to be perfect though, unlike ooc

eulerscheZahl: but it would help for sure

njaber: I still like to keep track of where the opponent CANNOT be

eulerscheZahl: sometimes you can remove some pellets without seeing them

JohnCM: like for dead ends i guess

JohnCM: my code doesn't do that though, i want to be as optimistic as possible for the endgame

dbf: yes, I'm trying to remove pellets based on opponent pack locations now, but it works only for some trivial cases

jrke: hey you all will laugh after listening what happened with me before silver opened my rank 800 in bronze and now 898 in silver and i am still in bronze

dbf: don't want to use any probability maps, so trying to remove pellets only if it is 100% not avaialbe

njaber: I don't do any probabilities, I only check possibility/impossibility rn

wlesavo: jrke well you still need to get better to pass the boss, you wont promote by others leaving

eulerscheZahl: but some cells are more likely than others

jrke: yes i am doing well

JohnCM: true that

njaber: Yeah but I still haven't implemented anything that deals with probability

JohnCM: i guess if you truly want to map the opponent's moves, it is possible but you will have a probability map

JohnCM: using bayes' method

JohnCM: but haha too much work for 50ms

njaber: Doing bayes all the way would be too inefficient I think

njaber: yeah

JohnCM: well i would say kovi's exploration algo is quite good, and i don't think he tracks the opp much and he's doing well

JohnCM: so.. exploration is key in this comp

jrke: hey any suggestion how to collaborate with my pacs

JohnCM: well i haven't implemented anti-ambush algo yet, so still ways to go for my code

JohnCM: i keep getting killed at the super pellet

njaber: I'm trying an other approach that relies way less on exploration, it's doing very poor rn, but I hope it can become quite good once I add a few upgrades

JohnCM: @jrke, for starters, get your pacs to different regions of the map

JohnCM: how you split the region is up to you

jrke: K

JohnCM: and never assign them to the same square

JohnCM: basically don't self-sabo and collide yourself

jrke: ya that i have

JohnCM: that is totally preventable

JohnCM: how to spread your pacs out is an art

jrke: i got an idea now

JohnCM: can't share too much because this is the crux of the competition

JohnCM: if your spreading algo is better, you'll win

jrke: it just clicked my mind thanks

JohnCM: np

Nerchio: gold in 1h?

wlesavo: time to start resubmiting

Nerchio: what do you mean

Nerchio: leave me alone haha

Nerchio: i got a lucky 29th spot i want to keep it

wlesavo: same here :slight_smile:

drykberg: what to do if pacs block each other? ^^

H1ggsb0s0n: It depends

H1ggsb0s0n: Your pacs shouldn't block each other by design because they should include each other's preferences when choosing a path

drykberg: i dont have path finding

H1ggsb0s0n: if an enemy blocks your path you can retaliate and change your type to eat the enemy

drykberg: im not that high up yet

jrke: drykberg which league

drykberg: wood

jrke: wood2 or wood1

eulerscheZahl: just ignore blocking

dbf: can't tune scoring function to work well on short distance and capture far 10-point pellets the same time, looks like a time for hardcoding :)

Doju: for wood even just checking if they're stuck will suffice

drykberg: all i got is index of coordinates ranked by value

eulerscheZahl: same dbf :D

drykberg: and for loop for multiple pacs

eulerscheZahl: the big pellet gives 30 points for me :D

jrke: ignore collision for wood 1

drykberg: well in the old wood league, where you had 1 pac. they automatically changed direction

drykberg: now they just get stuck

wlesavo: euler lol thats the same thing i come up with, manually increasing the score of big pellets

dbf: eulerscheZahl, lol, maybe should try, it is only 15 in my code :)

jrke: which league you are in wood 1 or wood 2 confirm drykberg

drykberg: wood 1

eulerscheZahl: interesting. i'm not the only weirdo doing hacky things here

jrke: K

eulerscheZahl: i still feel like i should find a better scoring instead

MattSOrme: if (wanted_to_move and didnt_move): target=random Done

jrke: so just give output of any visible pellet for each pac its enough to be in bronze

dbf: I don't want to build too long pathes but on some maps large pellets are far away and my pathfinding is broken

kovi: 15 for me

jrke: and yes don,t chose same pellet for 2 pacs drykberg

eulerscheZahl: my path finding is fine. bu the scoring for my final position isn't

drykberg: yes, they get different pellets

drykberg: but if their paths cross, they are screwed

dbf: I have max_length in my path, is not enough sometimes )

jrke: kovi kovi kovi when you open leaderboard only one name

eulerscheZahl: get a bigger monitor jrke

jrke: means didn't get u euler

drykberg: all i wanna do is tell them to turn around

wlesavo: or become #1

Doju: Ok i'm still not sure why the bug made my bot better

Doju: but i'm gonna reintroduce it :D

Doju: temporarily

llllllllll: tfw my bot ran for 71ms and didnt get stopped

jrke: :grin:

eulerscheZahl: is it me of is the forum down?

llllllllll: sorry, my bot is running

llllllllll: taking up all CG's resources

wlesavo: works for me

Astrobytes: Forum is fine for me

Doju: this feels shameful but i'm submitting an intetionally buggy bot

Illedan: There are never bugs, just unintended features

eulerscheZahl: 2 browsers, no forum :/

eulerscheZahl: https://imgur.com/a/12Tsc5z

kovi: happened to me few time this week

Doju: Yes Illedan, same thing for rockets that have rapid unscheduled disassemblies

Illedan: Forum works for me

Illedan: Nothing new though

eulerscheZahl: wanted to link something old

Illedan: :D

eulerscheZahl: and i tried a 3rd browser without success

eulerscheZahl: not even epiphany loads it

Illedan: How many browsers do you have :/

dbdr: CSP violation

eulerscheZahl: same

Default avatar.png journeyvivek: hello

dbdr: might be a network issue that corrupts sth? def weird though

Default avatar.png journeyvivek: not on discord

dbdr: Refused to load the script '<URL>' because it violates the following Content Security Policy directive: "script-src 'report-sample' <URL> <URL> <URL> <URL> <URL> <URL> <URL> <URL> <URL> <URL> <URL>". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.


dbdr: I get it too

eulerscheZahl: i disabled the policy in firefox for now

Counterbalance: eulerscheZahl try https://forum.codingame.com

Counterbalance: i got the same as you when not using https

eulerscheZahl: that works Counterbalance :o

jrke: you all wish to be in gold i am wishing to be in silver

Doju: Ahh what the hell am i doing lmao

Doju: i flood fill to the nearest pellet

dbdr: nice Counterbalance

Doju: and instead of doing some calculations on the actual distance

dbdr: CG should redirect http to https

Doju: i do them on the precalculated distance :|

Default avatar.png goore: none is online :/

Default avatar.png alexandreb09: Yop, anyone can help me with Winamax puzzle ?

Default avatar.png logdog775: no

Default avatar.png alexandreb09: I can't figure out how to solve tests 9 and 19

Doju: alexandreb09 i haven't done them but what are they about?

Default avatar.png alexandreb09: It reproduce a golf game with balls and hole. Balls can cross each other. Balls have several shoot possible (1 to n). First shoot is n jump, next n-1 and so on..

Default avatar.png alexandreb09: My problem is too long because when there are no more obvious move, I look at all combinations and start iterating. But when the number of balls comes high, it's a very bad approach

Default avatar.png alexandreb09: My problem is *that my code is* to long because

Default avatar.png alexandreb09: Maybe you can see it in Sponsord puzzle

Doju: found it

MattSOrme: how can i set a maze seed?

wlesavo: you sure your brute force have no infinite loops? i remember that for me some simple recursion was quite enough

Doju: MattSOrme you need to enable the expert mode in the editor

AntiSquid: no gold yet ugh ?

Doju: from the settings

Flashy911: is there a parameter to see if a pacman is dead in silver div?

solaimanope: AntiSquid how to know which player is the silver boss?

Tiramon: guessing from prev contests gold should arrive in the next hour

Default avatar.png alexandreb09: Yes, initially, I search all possible path with a recusive function. Then, I reduce all the paths till there are obvious movement (ball with only possible move to reach a hole). But for test 9 and 19, I face a moment there are a lot of balls with several movement allowed. Then, I compute a product among all possibility and iterate

Doju: uhh yeah i have no idea how to solve that hah

Doju: sorry cant help

Default avatar.png alexandreb09: No worries, thx :)

Flashy911: is there a parameter to see if a pacman is dead in silver div?

Tiramon: yes

Tiramon: typeId changes to DEAD

Tiramon: problem is DEAD are listed, in bronze they were skiped

Flashy911: Thanks <3

drykberg: cant figure out what to do if pacs get stuck... they all just lump together and nothing happens

drykberg: there must be some variable i can track each turn to figure out that they are stuck and should change direction

Doju: drykberg a simple (definitely not elegant) solution to that is to just give them random directions whenever they are stuck

Tiramon: compare with x/y of prev turn

Default avatar.png duckquackduck: check if they are in the same position as last turn?

Doju: and they are stuck if their last pos is equal to the current pos

drykberg: okay

Hjax: im surprised gold isnt open yet

AntiSquid: yes it's strange

Tiramon: they are late

AntiSquid: maybe they're still deciding whether to do the cut off at 10 or not :P

Tiramon: [CG]Thibaud any eta for the boss? he is missed ...

AntiSquid: or they forgot ... happened once

Tiramon: oh yes =)

dbdr: when?

AntiSquid: during botg

AntiSquid: had to remind them

dbdr: was it same day?

AntiSquid: "oh its wednesday?"

Doju: hah

Tiramon: thats why i pinged thibaud ... maybe it helps ;)

kovi: goldelay?

Doju: that's funny

AntiSquid: well first got told that it opens on wednesday ... dbdr

Tiramon: and the is no computing bot right now in silver that looks like he will be the boss

dbdr: ok, but which wedesday? ;)

AntiSquid: ?

Tiramon: or maybe because thibaud does not respond [CG]Maxime knows an eta of the boss

dbdr: that's typical, announce the day, but not the week, etc.

Illedan: lol

[CG]Maxime: :)

AntiSquid: well no way the would have prolonged contest after insisting to have it for standard period dbdr

Illedan: Gold /o/

Icebox: pogu

Icebox: I'm instantly in gold

Icebox: very generous

solaimanope: Gold :D

AntiSquid: didnt update for me damn

Illedan: What rank?

Icebox: 200

Tiramon: oh boss arrived ... evil silent [CG]Maxime ;)

Illedan: 200?

Icebox: yes

Illedan: Daym, so many

RockyMullet: yay !

Tiramon: yes and i was 199 ;)

Earthborne: type_id DEAD is only given for my own pacs, right?

Tiramon: for all

RockyMullet: now, is it where my bot will die.... likely

Tiramon: and LOS does not matter

RockyMullet: 111 so far

Earthborne: So I can use it to delete opponent pacs that have died regardless of where they were?

JohnCM: haha great news!

AntiSquid: hi JohnCoder did you get any sleep?

AntiSquid: JohnCM *

JohnCM: about to

Hjax: yeah gold seems pretty huge

JohnCM: was busy doing some work just now

JohnCM: just in time for league change

JohnCM: :) going off then cya

Hjax: i havent submitted since my DEAD fix on monday, and my bot got gold from rank 180 or so

Earthborne: Oh, sry Tiramon, you answered the next question as well, thx :)

AntiSquid: imo gold isnt much harder than silver, little diff

Tiramon: no changes in golf

Tiramon: *gold

AntiSquid: gonna get big soon

Default avatar.png Thiesjoo: Yay, my rank is increasing due to people going to gold. Already went up 100 ranks

sunksuperset370: :(

shashwat986: I barely made it into gold XD

sunksuperset370: >:(

AntiSquid: ?

sunksuperset370: wood 1

sunksuperset370: me wood 1

sunksuperset370: sorry

sunksuperset370: i am just playing with yall

shashwat986: I think my last submission just inched past the boss-line

sunksuperset370: which level

sunksuperset370: league

sunksuperset370: sorry

Doju: silver to gold

jrke: how many in gold presently

sunksuperset370: jiam

Quidome: 212

sunksuperset370: jiam

Doju: that's a lot of people :o

sunksuperset370: that's a lot

AntiSquid: lol

sunksuperset370: :o

jrke: K means they again took 200

AntiSquid: and legend be like 10-15

Doju: the boss doesn't rhyme with inky :(

Doju: what a tragedy

AntiSquid: boss name?

Doju: Clyde

RockyMullet: there is a a bit more people in this contest than usual

Doju: blinky-pinky-inky....

Doju: CLYDE would be a good name!

Doju: :D

Tiramon: 213

Tiramon: oh chat was scrolled up

AntiSquid: could have been stinky

twray2: they are the names of the ghosts from arcade pacman

RockyMullet: Diddly

MattSOrme: they're the ghost names from pacman

Doju: oh

AntiSquid: dildy? RockyMullet

Doju: okay well that makes sense

Doju: then i have to blame the creator of pacman

RockyMullet: it rhymes

MattSOrme: There isn't a fifth ghost though, so what will they call gold boss?

Doju: damn you Tōru Iwatani!

jacek: unvaccinated kid

AntiSquid: Cherry ?

jrke: whats new in gold

wlesavo: Eat more pellets than your opponent! And avoid getting killed!

wlesavo: thats new

AntiSquid: there is one in pacman2, it eats the arena under certain conditions MattSOrme

kovi: interesting, some new names again in top20

Illedan: Ghosts have arrived in gold

kovi: recalc shuffles

Illedan: kovi, very few placement games

kovi: some were not able to "break through" earlier

Illedan: Just a bunch of luck

kovi: but can compete in top

Illedan: My bot yesterday ended both 2nd and 31st :P

jrke: luck is main i had 24 rank 400 rank with same code in just 2hours

Default avatar.png zarif98sjs: Any tips on how to improve in silver ? :)

Default avatar.png zarif98sjs: i feel like i am always losing like for 10-15 points

AntiSquid: fight harder

kovi: illedan, true...still low number of games

Hjax: i spent some time working on a monte carlo bot, but its considerably worse than my bad heuristic bot

Hjax: now im not sure what i want to do

Default avatar.png zarif98sjs: whenever i try to improve (at least i think i fixed some bugs) it happens to perform poorly

Peudoki: will the number of games be higher in gold than silver?

RockyMullet: Hjax knowing more about enemy possible position helps to know where the pellets are likely already gone

Peudoki: I'm always hoping because of the high variance

kovi: lucly rolls for me

Hjax: yeah i know about enemy tracking RockyMullet, but im trying to work on search first

AntiSquid: avatar came out of nowhere

Hjax: but my attempt at search seems to have gone very poorly :D

RockyMullet: yeah im doing search now

RockyMullet: but its not working yet

RockyMullet: and I got promoted to gold, so its possible without

Peudoki: I'm using bunch of random heuristics on top of eachother

Peudoki: the real scientific methode

Doju: what do heuristics even mean in this context?

Doju: I read last night that they're basically like simplifications or something

Doju: so would going for the closest pellet just be a heuristic?

RockyMullet: ya

RockyMullet: I mean, heuristic is just a word to say "I felt like it would be the best move" without really knowing if it is :P

Peudoki: it's like instead of doing some precise calculations, your AI goes: "feels like it could be kinda good to go there, so let's do it"

Hjax: my old heuristic bot got gold as well

RockyMullet: like Peudoki said hehe

Hjax: my monte carlo bot makes me sad

RockyMullet: yeah... my search is still at the point of "hum no, this is not the best move"

RockyMullet: need some debugging hehe

Hjax: mine is at the point of doing completely inexplicable things

Hjax: like rarely not moving at all

AntiSquid: idk "heuristic" doesn't make much sense, i just need to give my approach a name and suddenly it's a specialized algorithm and not a heuristic anymore

RockyMullet: yah heuristic means "I made up some shit" haha

Doju: Okay thanks for explaining

AntiSquid: named heuristics are shit someone else made up though

RockyMullet: yes

RockyMullet: official shit

AntiSquid: world renowned shit

RockyMullet: :ok_hand:

Donotalo: can a pac take L shaped turn when speed is activated?

Doju: i think so

Doju: donotalo

Peudoki: yes Donotalo

Hjax: i think i dont completely understand how the top bots that are using search work

Donotalo: thanks guys

AntiSquid: just search for an answer

RockyMullet: Hjax search is hard if you dont have enough information

RockyMullet: so I'll propbably wont submit a good search until I improve my enemy prediction

Hjax: my search is just trying to maximize pellets

Peudoki: well I still kind of ignore enemies even if I see them

Hjax: but my search strategy is pretty silly

Peudoki: so I'm far from needing to predict them

RockyMullet: yah, but the result is wrong if you get an enemy in your face

Doju: lmao

AntiSquid: 217

AntiSquid: 300 by the end of the evening

AntiSquid: 500 by the time legend opens

jrke: its night in india

AntiSquid: or more ?

Hjax: make random moves, keep track of how many pellets you pick up, use the move set that got you the most pellets

RockyMullet: and its noon here, evening is far :D

Hjax: boring monte carlo thing lol

Peudoki: how random though?

RockyMullet: mine is brute force so far

Hjax: completely random?

Peudoki: with some heuristic or just full on?

Peudoki: I see

jrke: antisquid which country you are in

WillNess: MadKnight

Hjax: it wins sometimes against my heuristic bot, im probably going to replace it with a real search

RockyMullet: jrke you can see the flag of the country of others if you hover over their avatar

Hjax: maybe working on enemy tracking is worth doing first

Hjax: i just wanted to finish search and be done with it

RockyMullet: enemy tracking can also help your heuristic

jrke: looks server is slowed down again

shashwat986: um i think i broke something

shashwat986: damnn

Hjax: thats true RockyMullet, im just annoyed that my search doesnt work

Hjax: im not sure how MSmits got his working, but whatever he did its better than what i tried

NickStahl: Somebody here that precalculates distance for the whole map in the first turn? I tried to do it but seems to time out.

RockyMullet: yeah I know the feeling, I almost gave up this morning cause I though it was too intense without timeouts

RockyMullet: just had a bug in the end :P

jke: this is my first contest, do you guys at the top generally open source your solutions after it ends?

RockyMullet: NickStahl yes, a bfs

RockyMullet: jke its common from people to share their solution on the forum once its over

Default avatar.png duckquackduck: @NickStahl, yes. You don't ened to map every cell => every cell. Just one cell => every cell, which should give you path for eveyrything

NickStahl: duckquackduck yeah, that's what I did. But seems I suck at optimizing

AntiSquid: hm ladder is a bit too shuffled, can't really test much

RockyMullet: most bots are stabilized tho

AntiSquid: wanted to compared old bot vs new bot

Peudoki: kovi is still the king of pacs

jrke: kovi took his place :)

AntiSquid: kovi got pinged

jrke: ;)

cegprakash: MadKnight I accidentally closed ur message box how do I open it back

BenjaminUrquhart: k tiem to promote really quick

Doju: duckquackduck yes you do need to map every cell > every cell

BenjaminUrquhart: time*

jrke: looks like kovi has magnet for first rank ;)

BenjaminUrquhart: cegprakash click on his name in chat

BenjaminUrquhart: like the message

shashwat986: NickStahl what language?

Peudoki: has anyone ever won a game against kovi?

shashwat986: I have, once or twice, while debugging, but never on the ladder

Doju: Can't you play against people in a higher league?

Doju: ah thats dumb

AntiSquid: it is

NickStahl: shashwat986 c#

BenjaminUrquhart: Peudoki once

shashwat986: hmm, c# should be fast enough to do BFS properly

BenjaminUrquhart: then he resubmitted

shashwat986: my ruby code does it in barely enough time. like 950ms XD

shashwat986: (which means I'm timing out in a small fraction of my games)

NickStahl: shashwat986 Yeah, I should practice some more in the normal games. I probably have inefficient code.

BenjaminUrquhart: I could probably do it in ~100ms java, depends on how well the JVM warms up

BenjaminUrquhart: I do it on CoIF in ~60ms but fro a different purpose

Peudoki: btw how many lines of code do you guys use?

BenjaminUrquhart: doens't matter

BenjaminUrquhart: different langs have different lengths

MarekM: 344.

MarekM: 344

Peudoki: I use 550 C++

Doju: BenjaminUrquhart yeah but you'll still get a vague idea of the complexity of the code

Doju: Peudoki 600 in python

BenjaminUrquhart: 788 java

BenjaminUrquhart: but I write long code

Default avatar.png Thiesjoo: 380 in javascript rank 500 in silver

Peudoki: good to hear, I was getting a bit worried that my code is unreasonably long

RockyMullet: im at 3k now

RockyMullet: and I still think its irrelevent

RockyMullet: in C++

Peudoki: 3k in C++, is that even possible?

BenjaminUrquhart: clearly

RockyMullet: 3175 to be precise

njaber: 1700 C#

Peudoki: okay mine is definitely not worryingly long

BenjaminUrquhart: struct ascend please

BenjaminUrquhart: wait he's not online

RockyMullet: well it includes a lot fo debug output code, some of my custom classes that I reuse, etc etc

Peudoki: I see

Peudoki: I just work from scratch

RockyMullet: some dead code of commented failed attempts

RockyMullet: well a lot of games here are on a 2 grid, so I have a class of a 2d position and some functions that goes with it

RockyMullet: like I started to code a search algo yesterday, only that is 500 lines

RockyMullet: anyway

RockyMullet: I dont think its relevent :P

Peudoki: yeah this is my first contest

Peudoki: maybe I should think about making my code reusable

njaber: I'm trying so hard to heuristic this shit afficiently, I got some good ideas but I still lack the one thing that will push my algorithm from neat to actually useful, it's so frustrating

njaber: https://www.codingame.com/replay/462888772 I like how they move but they still don't have the good incentives/directions, and if I do direct pellet targeting it defeats the whole purpose of what I'm doing (don't wanna spoil tho)

RockyMullet: Peudoki personnally, I digged in old contest and just by digging again and again, it just became more complet

BenjaminUrquhart: I've ascended

RockyMullet: njaber but why arent you moving :thinking:

Default avatar.png Xlos: The question for everyone in bronze league

jrke: what question

njaber: Without spoiling too much I don't have the good incentives, the algo I do judges that it's more optimal to stay in place during times where it isn't, and I just need to find what to modify to remove this incentive

njaber: And I don't want to hard code it either

njaber: there's no point

RockyMullet: it is so rarely the right answer to not move

kovi: it might be safer to stay. just not more effective on average

njaber: Yeah but like I said I can't hardcode it because it just wouldn't do anything useful with my algo

njaber: and if I just change to targeting pellets it just defeats the purpose of this algo

njaber: I've been thinking of ways to fix it tho, I'm just so close yet so far to find it

Default avatar.png Janexor: just got to the silver but im not sure why seeing dead pacs may make it harder/easuer. Am I missing smth?

RockyMullet: Janexor likely a hot fix

RockyMullet: that they realize during the contest "oh, we should probably tell them when a pac is dead"

RockyMullet: and to not greak submited bots, they only introduce it in newer league

RockyMullet: break*

Default avatar.png Janexor: thought that if the pac is dead it is just no in'visible_pac_count'

BenjaminUrquhart: it also won't be there if it's not in your line of sight

Default avatar.png Janexor: thats why i thought so - u cant see dead people :p

aCat: you can

aCat: in silver

aCat: it has special type DEAD then

Default avatar.png Janexor: I know, but i wonder how it could be usefull

njaber: In knowing where enmies are/aren't/what path they could have taken

njaber: I personally really like this addition

njaber: Before there was no way to be sure an enemy pac was dead except from deduction, you couldn't even know WHERE your own pac died, there was no way to know if it was on the first or second cell it traversed

vbplaya: For some reason the chat wasn't working earlier in the week. But I have a question. Have others had issues where the visible pellet count was wrong on bigger maps?

THEASIAN: Does anyone have any tips? I'm trying to learn C#

njaber: I can help if you have specific questions, but I don't really have any tips in mind

RockyMullet: vbplaya in wood they would tell you where all pellets are, but once in bronze you only know the pellet in your line of sight

RockyMullet: THEASIAN go watch a crash course of like 30 min on youtube to know the syntax, then try your hand on easy puzzles here, google when you dont know how to do something

RockyMullet: you should learn over time

RoboStac: vbplaya - are you using python and printing them out to stderr with the last one missing?

RoboStac: (if so check https://forum.codingame.com/t/spring-challenge-2020-bugs-questions/180397/67 )

THEASIAN: @RockyMullet thank you

RockyMullet: np

Quidome: who is the silver boss?

Quidome: do we know?

MadKnight: Automaton2000

Automaton2000: i thought it was a year ago

drykberg: i think im done with this. i keep suddenly keep getting the error "coordinate is outside of grid" ...

AntiSquid: did everyone suddenly improve? old bot only getting up to 200 :/

Seti: are we allowed to use WAIT command? I don't see this one in rules, however it is in source code

drykberg: all i do is store the coordinates of pellets in an array

RockyMullet: drykberg you can watch in the log what you outputed

drykberg: i did

drykberg: and its crazy, it loops through visible pellets sometimes 0 - 10, 0 - 10 etc. and overwrites stuff

drykberg: then other times the loop goes from 0 - 100

drykberg: it passes in the same coordinates for different pellets

drykberg: http://chat.codingame.com/pastebin/775e7236-6ee0-4fa5-b656-d62b6a646be6

AlluringChair: @vbplaya it happened to me once, and my game crashed because of this. Although it happened only once in hundreds of games, it could be my error but i don't see how

drykberg: if (i=10) {

           fprintf(stderr,"%d x input %d\n",i,x);
           fprintf(stderr,"%d y input %d\n",i,y);
           }

drykberg: if (i=10) { fprintf(stderr,"%d x input %d\n",i,x); fprintf(stderr,"%d y input %d\n",i,y);}

RoboStac: that almost certainly needs to be ==

drykberg: true that

jrke: hey yes it should be ==

BenWo: afternoon folks

BenWo: got excited about my rank until I saw that gold has opened, lol

AlluringChair: is there a way to check my current response time? i'm trying to measure it with time function but i get 52-60ms and since that would result in a timeout it's obviously not correct...

BenWo: from what I've been told, start your timer right after your first input read in the loop

drykberg: MOVE 0 14 91 |MOVE 1 18 92 |

drykberg: i just dont understand where these values come from.... :(

AlluringChair: that's what i'm doing but i'm getting too high values

Counterbalance: maybe you forgot a space after the command and before the message, drykberg

AlluringChair: whatever maybe python time.time() is bugged

BenWo: I used time.process_time()

BenWo: usually get a sub 1ms number

MarekM: alluring, i am using time.time() and looks ok, isnt timeout 100ms?

AlluringChair: oh sorry you were right i had it before first input

AlluringChair: not it's 1-2ms

AlluringChair: now*

DaFish: we have all made that mistake...

tobk: whops, got pushed up :-)

MarekM: ouch, 50ms, ok then :)

tobk: somehow my motivation for that big refactoring I had in mind suddenly dropped...

BenWo: heh

AlluringChair: looks like i've got plenty of time for realtime a*

BenWo: yeah as long as you're not inefficient

Doju: i don't really get why you'd want to do a*

BenWo: heya Doju

Doju: Heya BenWO

Doju: BenWo* :D

BenWo: :)

BenWo: how goes?

Doju: uuumm pretty decent

BenjaminUrquhart: ok I guess

Doju: i'm applying some fixes atm

BenWo: :thumbsup: fixes are good

Tiramon: great i'm motivated to learn at udacity and now their auth isn't working ...

Doju: BenWo Not always

Ramzel: Game Summary: Inky has not provided 1 lines in time

Ramzel: Bot crashed?

Doju: fixed a relatively major bug and dropper in ranks by 200

BenWo: lol that's the best

Tiramon: that's normal everbody has that moment when a major bug is fixed and bot performs worse ;)

BenWo: Ramzel - scroll up in the log, see if it shows a crash the turn above

BenWo: I've had that so many times because I forgot a "if X is not None:"

Ramzel: I m checking if my pacs change class right now propertly, so i started another play. The bot crushed in first move and i won taking all pellets

Doju: starting to do some work on paths instead of distances

Doju: i bet i'm gonna have so many off-by-ones

jrke: hey anybody know how push a queue in c++

Earthborne: push()

Ramzel: q.push(int x);

Ramzel: it dont need to be int

Ramzel: q.front() - return front elemnt and q.pop() - erase front element

jrke: but it just pushes one int

Quidome: all pellets eaten and a draw :D

Quidome: https://www.codingame.com/replay/462963979

Default avatar.png SamuelTheBad: Perfectly balanced, as all things should be

jrke: if i have to do append.list(9,8) in python so what should i write it in c++

Doju: i think you mean list.append

jrke: ya

Earthborne: If you it's static in size I guess a simple array would do?

Default avatar.png SamuelTheBad: I'm glad someone mentioned that after first input thing, I thought I was nearly out of time, but that's far from true...

Doju: umm

Doju: how do you do anything before the first input?

AlluringChair: he means measuring frame time

Default avatar.png SamuelTheBad: Yeah, I was starting my clock before the input came in

Doju: oh

Doju: i see

drykberg: i put 2 debugging fprints in the game loop to see whats happening

drykberg: 1st - immediately at start of game while loop, it prints "while loop starts"

Doju: i'm working on both Cell instance and pos tuples

Earthborne: jrke vector is a good option in c++

Doju: should i write basically every function to accept either one as input or is that bad practice?

drykberg: 2nd - when the number of pacs is passed in, it prints "mine pac count ="

drykberg: while loop starts

drykberg: mine pac count = 5

drykberg: while loop starts

drykberg: mine pac count = 1

drykberg: what the fuck is this shit

BenWo: dang Doju, sounds like you have the same architecture going on that I do, lol

BenWo: half of my functions take a touple, have take a node object, lol

BenWo: *tuple

Doju: same :/

Doju: it kinda sucks

Counterbalance: you could have cell extend from pos..

Doju: pos is just a tuple?

Doju: can you extend a tuple?

BenWo: I don't think so?

Doju: i mean...

Earthborne: You can encapsulate that tuple in a class

Doju: isnt everything a class in python though

BenWo: yeah just was thinking

BenWo: technically I guess it's possible

Earthborne: oh, that's true

BenWo: feels weird though

Earthborne: So can you extend tuple?

Doju: uhh

Quidome: in python you can;t extend a tuple

Doju: i made my Cell class inherit from tuple

Doju: got an error saying "tuple expected at most 1 arguments, got 3"

Quidome: o sorry

Doju: when i tried to do Cell(x, y, value)

Quidome: misunderstood

Bastett: Nice. Silver promotion. Wonder how I'll perform with the same bot

drykberg: this is totally broken isnt it?

BenWo: https://stackoverflow.com/questions/41390372/why-cant-i-subclass-tuple-in-python3

BenWo: Doju ^

Tiramon: oh great just found a reason for a strange left/right dancing of my pac - that way looks good- oh a blocking pac other way - now that i don't see that pac anymore the old way looks good again ... oh a blocking pac

Tiramon: drykberg what should be broken?

Doju: Oh nice BenWo, that's exactly the thing

Doju: I think this is getting even more messy

Doju: but whatever

Doju: embrace the mess

BenWo: yeah I had just been reading that when you said

BenWo: lol

Bastett: hm, documentation is a little thin on the ground. What is the meaning of the new Dead status? Is a cell with a dead pac traversable?

Doju: i'm learning so many things

Tiramon: yes it is just information

Tiramon: no effect on the game

Bastett: nice

Bastett: thanks

Tiramon: else you could walk around the corner and killed one without knowing it

Tiramon: now you know

Maliamnon: It's just there to break you assumptions when you ascend to silver and make you fix code ;)

BenWo: yeah this challenge has certainly pushed me to learn a bunch too :)

Default avatar.png DIAGA: hey everyone ! i need assistance with Coders strike back i have no idea how to work with the angles and distance where can i learn more about game programming with c++

BenWo: diaga - angles you want to look into trigonometry

Default avatar.png SamuelTheBad: vector maths might also be helpful

AntiSquid: suddenly getting captchas wtf?

Default avatar.png SamuelTheBad: though they're p much the same thing

Hjax: AntiSquid is a bot confirmed

AntiSquid: Hjax identified as a crosswalk

Default avatar.png DIAGA: thanks BenWo & SamuelThebad! apreciate it alot

BenWo: welcome :)

Bastett: totally Maliamnon

BenjaminUrquhart: Automaton2000 is human confirmed

Automaton2000: you don't have to check the referee

Doju: BenWo i still haven't figured out how to make the tuple thing work lol

Default avatar.png ashikujjaman: how to multi comment in codingame?

seronis: concat them with a pipe seperator

seronis: nvm.. i read 'multi command'

jjdb210: Anyone know if there is a bug involving speed where if you have 1 do it, the rest get it as well?

jjdb210: See this match for an example: https://www.codingame.com/replay/462999109 Blue ID 2 should not beat Red ID 0 to the power pellet...

Quidome: so now I have my collision detect in order what to do, hunting or gathering ?

Quidome: maybe first sleep...

eulerscheZahl: hunting is fun

Quidome: yeah I think so too

Quidome: and it pays of to make the kill i suppose

AntiSquid: shit now i broke my bot and have to rewrite Automaton2000 is there an easy way ?

Automaton2000: i guess there is some kind of monte carlo

Quidome: need opponent tracking, ok first sleep

eulerscheZahl: especially in the early game it does

AntiSquid: hah !

AntiSquid: Automaton2000 making sense

Automaton2000: so i only have to check if they are not

Quidome: no gold today :(

Ramzel: Can i see every super pelet at game begin?

Quidome: yes

NickStahl: Ramzel yes

Quidome: always 4 of them

Ramzel: Ok

Quidome: at every turn byw

Quidome: BTW

jjdb210: Can anyone explain how blue beats red to the pellet at 21,7 in this game? Is speed broken on turn 1? https://www.codingame.com/replay/462999109

NickStahl: jjdb210 looks like you only move one cell each time although you have speed enabled?

Hjax: yeah you are wasting your speed moves, so you arent moving faster

Quidome: you have set your target at least at distance 2

NickStahl: jjdb210 make sure to move to a pellet that is two steps away each move

Quidome: or in this case more easy target the super pellet

muy31: ^

Quidome: speed will follow

jjdb210: ah that could be it

jjdb210: thank you

muy31: you don't have any control over the speed turn

muy31: so you just have to do what everyone else is saying

Quidome: you do, but you don't move

muy31: well, you cant for example move somewhere and move back during speed

Quidome: Uh, yes true

Quidome: that's somewhat annoying

muy31: really

muy31: ik

DollarAkshay: Auto promoted to gold league ?

DollarAkshay: LOL

eulerscheZahl: next stop legend?

Ramzel: Are there always 4 superPellets?

eulerscheZahl: yes

Quidome: yes

Icebox: how is that normal that steady_time returns 57 ms and I'm not timing out

muy31: Someone look at this stomp:

muy31: https://www.codingame.com/replay/462984265

eulerscheZahl: do you measure after reading input Icebox?

muy31: Icebox, it's not accurate/ give or take

drykberg: is there a way to start over?

eulerscheZahl: but sometimes you can exceed the max time without getting killed

Csipcsirip: you have some extra milisecs but seems to be random

Icebox: eulerscheZahl is this my first competition? xD

Icebox: yes ofc I measure after input

drykberg: i dont know why, but for some reason my pacs always get sent of grid...

eulerscheZahl: sorry :(

Icebox: I might be stoopid

Icebox: but not _THAT_ stoopid

eulerscheZahl: but not that stupid

Hjax: ive definitely taken 55 ms after reading inputs and not gotten killed

Icebox: rip no markup

Tiramon: drykberg there is a reset to default code button in the top right (the arrow)

drykberg: thanks

Icebox: I'm consistently getting 55-57

Icebox: so I'm wondering is the measurement inaccurate

wlesavo: the restriction is not so strict i guess, its quite approximate

Icebox: or is the game not very strict

eulerscheZahl: as strict as other games

eulerscheZahl: same framework

muy31: yeah, its not too strict

Icebox: well I don't program in C++ so I doubted my measuring for a second there

Icebox: but steady_time is pretty steady afaik

Icebox: :upside_down:

perseverent: how did you solved the problem with the pellet 10 value

eulerscheZahl: give it 30 oints

eulerscheZahl: points

perseverent: :)

perseverent: does not help me

MSmits: :pig: oints oints

perseverent: some idea to solve allocation problem

eulerscheZahl: i wasn't collecting them sometimes, so i helped a bit

MSmits: my code is a mess already :(

perseverent: sometimes it's tricky

MSmits: 1800 lines

eulerscheZahl: wow

Quidome: still have time

Quidome: Rebuild!

eulerscheZahl: but it's a successful mess

perseverent: if close pac is send you loose other one that was also yours

muy31: do you need enemy tracking to get out of silver?

eulerscheZahl: no

MSmits: yeah eulerscheZahl i am really surprised. This is the same code basically, that I had monday morning

perseverent: nop

MattSOrme: mine is 1000 lines of spahetti mess. I keep trying to tidy it up, but i really wanna use multiple files

MSmits: I would have expected it to drop

Nerchio: Automaton2000 are you good at micro with marines

eulerscheZahl: but you will need tracking to reach legend i think

Automaton2000: u need to get all the info you need

Nerchio: lol

Nerchio: automaton2000 with the wisdom

Automaton2000: but i didn't get that far

eulerscheZahl: MattSOrme then use multiple files. and run a script to merge them before you submit

drykberg: can I write code everywhere?

eulerscheZahl: you are a coder, you can build such a system!

perseverent: there must be some algo to solve for the optimum alocation of pac tu big pallet

drykberg: or just inside the game loop?

drykberg: should i put the array of pellet coordinates inside the gameloop? or outside?

perseverent: some resource allocation algo

Quidome: I was looking into that

perseverent: but no luck finding it

Quidome: but decided to start with collision

eulerscheZahl: https://en.wikipedia.org/wiki/Matching_(graph_theory)

muy31: im slowly auto climbing to gold? hope i get there

Quidome: ah thnxs

eulerscheZahl: but here one pacman can collect multiple pellets, so not a 100% fit

drykberg: int p_v[10] = {NULL}; int p_x[10] = {NULL}; int p_y[10] = {NULL}; put this inside the game loop or outside?

eulerscheZahl: anyways: 5 pacmen, 4 pellets. easy to bruteforce

drykberg: to store the coordinates?

drykberg: and value?

Quidome: yes bruteforce, but what about the enemy

perseverent: thaks eulerscheZahl

muy31: so many people have decent code that it must be hard for codingame to actually compare AIs accurately

Quidome: 10 pacs 4 pellets?

eulerscheZahl: if you add opponents, yes

Quidome: I am now at 45, is it possible to vlimb over night?

eulerscheZahl: but 4¹⁰ > 4⁵ :scream:

Doju: BenWo I think I got the tuple thing working

muy31: for example, this is the dude on his way to gold... https://www.codingame.com/replay/463027062

eulerscheZahl: might be. go to sleep and find out

eulerscheZahl: i'll do the same

Doju: had to use some weird things i didn't know about but hey it works

Quidome: :grin:

Quidome: Anyhow Tommorow I go for the kill :)

Quidome: bye

BenWo: nice

Tiramon: damn i hate it when the engine cuts the log output in late game

BenWo: what weird things did you use?

Doju: also i have more magic methods and weird things than i've ever used

Doju: but that's fine

Doju: __new__ and super()

Doju: yeah it works!

BenWo: awesome

Tiramon: ok guess i can submit again ... at least no strange behaviour in my solo games right now

Doju: I can't this anywhere

Doju: so i have a cell class which inherits a tuple

Doju: python btw

muy31: i feel like i just get unlucky when it comes to finding new pellets

Doju: i have a method in the cell class that calls for pos as a tuple. Can i do something like super().self since it's already a tuple?

Default avatar.png WINWINWIN: Finally in Silver YES!!

Ramzel: Finaly found stiupid bug

Tiramon: ok found another strange behaviour, ignoring a superpellet in the neighbour cell is wrong

Default avatar.png jdsfklsd: Does practicing on this website actually help you improve or is it a sugar pill?

Tiramon: i learned many new algorythms by using this side ... and the names for some i used before ;)

Doju: jdsfklsd i don't know about the actual practices but the spring challenge that we're all working on has definitely taught me a lot

Doju: just learned about __new__ and super() in python

Default avatar.png jdsfklsd: What's the spring challenge?

Doju: https://www.codingame.com/contests/spring-challenge-2020

Tiramon: current contest

Tiramon: lasting 10days

Tiramon: great if i run the same code localy it gathers the super pellet, in game it does not ...

Default avatar.png Xlos: I'm starting to lose big time due to running out of time :(

Tiramon: then improve your code for more performance

Default avatar.png Xlos: waaa

Kukiss: 1st time joined gold during contest :)

Default avatar.png Xlos: Actually, did any of you guys have something like floyd warshall at the start for distances between points

Default avatar.png Xlos: I optimized it with some rectangle method thing but it still TLEs about 1/10th of the time

Doju: Xlos I do breadth-first search

Doju: like many others

Default avatar.png Xlos: On every iteration?

Doju: from every cell to every other cell during the first move

Doju: and from pacs to pellets during the other moves

Default avatar.png Xlos: Oh you do bfs once per point

Tiramon: yes that is not changing information as long as there is no blocks on the way

BenWo: using BFS currently as well, I do it every few iterations

BenWo: often for all 5 pacs in a single iteration, still only taking ~2ms apparently

Default avatar.png Xlos: Hmm I like my starting routine but I will use bfs while looking for pellets rn I'm going through everything, that should help a lot

daffie: how do we know when a pac is dead ?

Default avatar.png Xlos: it won't be given in the input

Doju: it will in silver

drykberg: is "int pellet_x[200] = {NULL};" the correct way to declare and initialize and array for storing x coordinates from a for loop?

drykberg: does anyone whos good with C/C++ know ? ^^

daffie: I can't seem to figure out a way to officially know 100% when a pac is dead

BenWo: not much good with C++, but that doesn't look right

BenWo: daffie - your own pac?

daffie: yes sir

Doju: you can

Alshock: daffie once you're in silver the inputs will tell you

Doju: if it's not visible it's dead haha

Default avatar.png Xlos: bruh that's trash

Alshock: oh your own pac? then just see if it's in the visible input

BenWo: well, yeah it changes from silver on up

Default avatar.png Xlos: why does it give more info for silver

Alshock: @Xlos because it's a patch

Doju: anyone good with python here?

BenWo: because they realized it was an issue, but didn't want to break the whole challenge

Alshock: hum, somewaht okay, why?

Edrevan: drykberg https://www.dummies.com/programming/cpp/initializing-an-array-in-c/

Counterbalance: drykberg the official way is int * pellet_x = new int[200]; the fast way is int pellet_x[200]; memset(pellet_x, 0, sizeof(pellet_x)); // requires #include <string.h>

daffie: how am I supposed to get to silver then

Doju: Alshock my cell class inherits from tuple. How can i access the tuple?

daffie: mine just keeps erroring out and crash from trying to give directions to a dead pac

BenWo: before silver, you just stop getting updates for a pac that is dead

Doju: like pos = cell.super().self?

drykberg: okay thank you will look into it thanks

Doju: but that doesn't work

Edrevan: daffie you know a pac is dead when you don't see it in your visible pac input

Alshock: @daffie target the closest big pellets or pellet if there's no big left and don't get eaten too easily

MattSOrme: Does anyone know if 10's are always in the visible list, or only on first turn?

Alshock: Doju just like you would with a tuple

BenWo: super pellets are always visible

Edrevan: every turn, check the pacs you are given as an input. If you didnt get one, then its dead

Doju: Alshock no but when i do reference_to_cell = cell it doesn't give me the tuple but rather the clel

daffie: yea that is what i am doing now, and still getting trashed by the boss lol

Counterbalance: drykberg int pellet_x[200] = {0} is closer but only sets pellet_x[0] to 0; you'd have to add 199 more; A simpler way for you is maybe do a for loop and set each one to 0.

Doju: and that's exactly what i what most times

Doju: but sometimes i want to access the underlying tuple

MattSOrme: That explains one of my bugs from like 2 days ago haha. thx

Doju: without going pos = (cell[0], cell[1])

Alshock: Doju what is it you can do with that pos that you can't with cell?

daffie: I thought maybe I it would be great to simply assign each boss pac to one of mine, and switch once they're in view and kill them until I realized there is fog of war

Alshock: keep it as simple as you can

Doju: :/

BenWo: doju - tup = cell.super() doesn't work?

Doju: BenWo nope

BenWo: :-/

BenWo: tup = *cell ?

BenWo: guessing at this point

Alshock: my question was sincere though, what use do you have of pos that requires it to be another tuple?

Default avatar.png josegomez: https://jcg.pictures/gdhcXjg0hdjwl.png

Doju: Oh, originally i didn't even inherit from tuple

Default avatar.png josegomez: decided to vizualize the game graph I generated

BenWo: Alshock - I assume sending the coordinates as a command

Default avatar.png josegomez: and it looks freaking awesome

Default avatar.png josegomez: #Unrelated

Doju: but i like half of my functions take tuples as input and half of them take cells

Doju: and it's rather confusing

NinjaDoggy: :O nice!

Doju: but like*

NinjaDoggy: i does look freaking awesome

Alshock: I think they should all take cells, because there's no restriction that way, and you should be able to send your whole cell to all of them regardless

Doju: hm

Alshock: your cell IS a tuple

Doju: it's not

Alshock: oh I thought that now you inherit

Doju: it's a bunch of values

drykberg: @Counterbalance Does {NULL} or {0} not set all values to 0 ?

drykberg: all values of the array?

Alshock: Ok, my very bad then, what's your base class?

Doju: erm

Alshock: object?

Doju: oh right i guess my cell is a tuple

Doju: agh i don't not the terminology

Doju: i have this:

Doju: class Cell(tuple):

Alshock: Yeah it's a tuple then ^^

Alshock: but you may have twisted it afterwards

Doju: oh shoot

Doju: you're right

Doju: hahah

Doju: wait whaat now i'm even more confused

Alshock: on which part? ^^'

Doju: i can do something like

Doju: pos = cell

Doju: and it gives me the tuple

Doju: but i can also do cell.foo

Doju: or bar or whatever that's supposed to do

Alshock: of course you can, because cell IS a tuple with additions

Alshock: but you can't do pos.cell

Doju: huh, okay

Doju: that's rather handy

Doju: thanks for explaining Alshock

Doju: maybe i should stil change all of my functions to take cells though

Doju: since some of them return tuples and like you said i can't do pos.cell

Alshock: oh by the way I just said something wrong thinking of explicitely typed languages

Alshock: pos.foo will work if you just do pos = cell ofc, it's if you call super to get the base tuple that it won't work

Doju: yeah

Doju: but i can't do (5, 3).foo

Doju: and that's a problem that inheriting from a tuple won't solve

Alshock: yep

Default avatar.png SilentSnowflake_d9fc: hey :)

Alshock: hey

Doju: so maybe i'll just change all my outputs to cells and call it a day :D

Default avatar.png SilentSnowflake_d9fc: you know react ?

Insomniak29: Any general tips for handling a pac being stuck? (ie. running into another pac). I'm currently backing them up a few steps and trying again, but that's causing some false positives when they backtrack to their next target normally.

Doju: Insomniak29 I try to path so that they don't crash

Doju: but in some cases they still do and when that happens i just tell them to go to random directions

Insomniak29: I started with random and thought I was improving by back tracking... but you are right, I need to do custom pathing (haven't bit the bullet and tried that yet).

Doju: It's a bit of a pain if you've never done it before

Doju: i've been fixing bugs in my bfs up until today

Insomniak29: <---- never done it before 😬

Doju: now i think it's bug-free

Doju: i recommend bfs (breadth-first search)

Doju: it's pretty suitable for a grid with no weights

Doju: and returns the shortest path every time

Doju: look up the wiki page

Insomniak29: thanks, I appreciate the help

Doju: there's even some pseudocode that you can study

Default avatar.png WINWINWIN: Insomniak29, I didnt bother with a BFS

Default avatar.png WINWINWIN: I just checked if a collision ocurred and if it did, I just avoid the previous target

Insomniak29: I can't seem to break 400 in Bronze and I think I've optimized other areas quite a bit. My next goals are 1) pathing, 2) making my Pacs social distance 3) Improve speed logic

Doju: i think numer 2 is very important

Doju: maybe even more than pathing

Doju: although it's hard to do 2 without 1

Doju: i was sitting at 400 in bronze. Implemented pacs as walls into my pathing and jumped 800 ranks

Insomniak29: yeah, I think pathing will help a lot of my issues. I was also thinking about splitting the map into halves or quadrants and prioritizing pellet assignment based on the quadrant a Pac is in

Insomniak29: Doju nice!

Doju: sure, that's a valid strategy

Valiant_Wolf: pacs as walls is working for me, along with also treating the moves for pacs already planned this turn as walls

Valiant_Wolf: helps for when friendly pacs get stuck when entering a junction

Insomniak29: @Valiant_Wolf nice tip

Insomniak29: (how do you @ someone?)

Doju: you don't need @

Doju: Insomniak29

thethiny: you just type their name

Doju: oh this is so amazing though

Doju: the tuple inheritance thing

Doju: bye bye lines "pos = cell.x, cell.y"

Doju: oh shoot... i think i need to make my pacs inherit from cells now hahah

Kukiss: When you have paths it is also easier to use speed as you only have to take second step from path

Doju: Kukiss that won't help if the pellets are next to you though

Doju: if you're pathing to closest pellet

Insomniak29: Kukiss what do you mean by second step from path?

Kukiss: I am looking for best path with ~20 steps

Doju: if you're doing something slightly less dumb then yess it's a godsend

Kukiss: and taking the first moves

Doju: Insomniak29 instead of getting distances using pathfinding you can get the paths themselves

drykberg: in C/C++: The game passes x and y coordinates for the pellets. I put them in arrays. I log it. But when the visible_pellete loop closes and i open up the array to print the stored values, they are completely different...

drykberg: i cant take it anymore... why

Doju: drykberg aand this is why i'm using python

Kukiss: do you clear the array before reading input?

drykberg: no i dont touch it

MarekM: game dont stop after 200 turns, last was 336 turns

MarekM: didnt

drykberg: i declare and initialize the arrays at the beginning of the game while loop

Tiramon: yay and another bug fixed with dead ends

Doju: MarekM if speed is used then it can go above 200

Kukiss: drykberg, ok if you initialize it every turn than I have no idea what might cause the problem :/

drykberg: then inside the "visible_pellet_count" loop i assign the passed in x and y values to the arrays

Doju: seriosuly inheriting from a tuple was the best thing

Doju: bye bye two nasty lines

Counterbalance: glad that worked out

drykberg: inside the loop i check if they were assigned correctly with fprintf

drykberg: then when the loop is finished, i do a new loop to go through the array and see whats in it

drykberg: inside the pass in loop: http://chat.codingame.com/pastebin/be634ecd-c199-47d9-b252-21073788bcac

Tiramon: damn i time out from time to time ...

Kukiss: the link doesn't seem to work :/

drykberg: i=1 x=1 y=1 i=2 x=2 y=1 i=3 x=3 y=1

drykberg: then outside

drykberg: i=1 x=10 y=15 i=2 x=10 y=19 i=3 x=10 y=14

thethiny: @Doju what is this tuple inheritance you're talking about

Doju: thethiny my grid stores cells as objects. I made those cells inherit from a tuple and it made life so much easier

thethiny: I don't get what's the benefit

thethiny: does that mean you place the enemies/players/pellets in the cells directly?

Doju: yeah i do that

thethiny: oh nice

Doju: and i think i'm gonna make the pacs inherit from cells soon

Doju: but anyways the tuple thing is so helpful because...

Doju: well for example i just deleted like 10 lines from one of my functions

Valiant_Wolf: it's tuples all the way down

muy31: i cant believe all i had to do to start winning again was change some heuristic numbers

thethiny: I'm stuck at 94 now

thethiny: 😭

Doju: Valiant_Wolf That's fine in my books

Doju: oh waait no i can't make my pacs inherit from cells since they move :/

thethiny: @Doju so instead of grid[y][x] == 1 or grid[y][x] == 10 you just do grid[y][x].type == 'Pellet'

thethiny: if that's your case then don't make the Pac inherit from Cell

thethiny: instead have the Cell has an object

thethiny: so you can do sth like

Doju: thethiny instead of "cell = some_path[0] pos = cell.x, cell.y" i just do "pos = some_path[0]"

Doju: for example

thethiny: type(grid[y][x]) == Pac

thethiny: oh okay

thethiny: good work then

thethiny: you could've made a "Point" class

thethiny: and overload the assignment operator

Doju: Hmmmmmm........

Doju: i could :D

Doju: inherit all the things!

Doju: point class inherits from tuple

Doju: cell inherits from point

Doju: pac inherits from point

thethiny: haha

durkside: guys some player move pacs like this MOVE 0 10 7 2.143027 what does it mean ?

thethiny: let me show you a code snippet

thethiny: class Point: http://chat.codingame.com/pastebin/19035dc8-4f52-406e-8412-1d1a8283b813

Alshock: wait wait, that's a detail here, but if you need to test a type isinstance(object, type) is much better

thethiny: yes correct

Alshock: because a Pac IS a Point, but type(Pac) != Point

Insomniak29: durkside they are just printing some value to the screen. probably a distance

Doju: i don't really need to test for that anywhere

thethiny: why does my pastebin say expired

thethiny: class Point: http://chat.codingame.com/pastebin/74d15b9b-f002-424d-8bc2-b552e2231a07

Doju: everything just works now hahah

Alshock: I don't know I just came back and saw that line

Doju: ok

Default avatar.png SparshMc07: hej do

thethiny: @durkside MOVE <pac_id> <x> <y> <Message to display on screen>

Doju: #swe

durkside: ok thanks guys

Doju: i wonder if that's a thing

durkside: where is that Game Protocol section ? cant find it

thethiny: http://chat.codingame.com/pastebin/4f017471-5d68-4ee7-99b7-352772e14a5d

thethiny: guys why are pastes not working?

muy31: it annoys me that Silver bot Clyde isn't good enough, so I lose to it

thethiny: @Mods

Alshock: that happens ever so often

Stanworld: SPEED , does it means i can give 2 commands to each pods with SPEED activated ? or it is only to move 2 tiles with one move command ?

icecream17: Let me try

muy31: latter

Alshock: @Stanworld 2 tiles with 1 command

thethiny: @Stanworld only 1

Stanworld: thanks, mmm ok ok

icecream17: One day there were 01947498571305987345948759743509874359087509382450892543 bugs. Bug #143095714957459847518957 was solved in 489715984357 days, a new world record for the shortest time a bug from 100+ yrs ago was fixed. Wow. Wow. oqi342h53thdsa4'3tju

icecream17: Aww. it didn';t trigger pastebin

thethiny: add lines

icecream17: http://chat.codingame.com/pastebin/5b70e57b-b5ce-4370-9a82-9999ea9bf3dc

icecream17: Hm

drykberg: http://chat.codingame.com/pastebin/85a21ee8-2fac-4a9c-becc-62c70c8ad2ca

Doju: ah i really want my pacs to inherit from cells :((

thethiny: all expired

thethiny: @Doju will create issues for you

thethiny: Since Pac is NOT a cell

thethiny: maybe make it HAVE a cell

Doju: that might be better

icecream17: http://chat.codingame.com/pastebin/c0c94751-5bdf-4b7f-9909-0d56d63e2875

thethiny: def __init__(self): self.cell = Cell()

MonZtaDeluxe: rank 2 - come o

MonZtaDeluxe: n

Doju: nope i need to update it on every move

Doju: not like that

thethiny: yeah you can

thethiny: let me show you how I'm handling update per move

Doju: oh right, i could just throw it in my pac updating function and then all of my problems would be solved again :P

thethiny: def end_turn(self): for pac in self.player_pacs: if pac.action == 'MOVE': pac.previous_position = pac.position else: pac.previous_position = Point() #Reset Counter

muy31: This is how it's supposed to go... https://www.codingame.com/replay/463090497

muy31: but silver bot just doesnt switch does he?

Doju: those are some aggressive scissors

muy31: why thank you

muy31: i was hoping it would trap itself

Doju: right thethiny i definitely need to give the pacs a cell

Doju: atm i'm doing things like this in almost every function

Doju: own_cell = self.grid.grid[self.y][self.x]

Doju: sorry, method.

Doju: i need to practice my coding vocabulary :D

muy31: Doju kill me now https://www.codingame.com/replay/463101600

muy31: Doju, i call methods functions too

Doju: hahah :D muy31

Doju: close fight

Doju: oh whaat

Doju: i've seen a giraffe or something in your avatar

Doju: now that it was larger

Doju: it's clearly not that hahah

Valiant_Wolf: at least you aren't calling them subroutines or something

AntiSquid: so i added another bug and it increased my rank and i can't get any older version of my bot to work properly

Doju: AntiSquid i think it's best just to make one infinite loop and put as many bugs a possible into it

Doju: that'll get you 1st place

AntiSquid: i'll end up doing that if i don't rewrite

muy31: im pretty sure that since everyone' code is half decent CG is having a hard time accurately ranking

AntiSquid: i have perfect strategy actually doju, gonna exercise , shower and then sleep

muy31: w/o destroying its servers

AntiSquid: i am wrecking half of gold with 2 major bugs in my bot muy31, i don't think any accurate ranking would help

Doju: AntiSquid that sounds like a solid plan. Taking a break is often times the best course of action

muy31: well i cant promote to gold b/c im stuck behind 56 other goons...

muy31: jk they are good too

muy31: but everyone's bot is like the same

muy31: you know what i mean

icecream17: gold opened?

AntiSquid: it's waiting for you icecream17, enter

muy31: hey doju btw you move dead pacs

Doju: muy31 do i?

Doju: uhh

drykberg: is there a way to ask someone in the community to look at my code and tell me what i can improve?

Doju: you're right i do move them

Doju: not sure how that's happening

Doju: maybe silver broke my bot

Doju: oh yup it sure did

Doju: Thanks muy31. Fixed (in ide, at least)

icecream17: i'm all the way back at bronze....

BenjaminUrquhart: what do, work on contest or break minecraft

Doju: why is there a comment in my code that just says

Doju: # BUG

BenWo: good reminder

Doju: with absolutely no reference to what the issue might be

icecream17: sleepproblemssleep? I remember someone saying... aw I forgot to take notes agaion

Doju: and i've been looking for an off-by-one for the past few hours

Doju: just as i predicted

Doju: lovely

icecream17: Yes! By moving away from opponents it's a slight increase from 77 pellets to 84

icecream17: *my players, not opponent

MSmits: it is somehow conforting to be able to explain almost every loss on a submit with something still on your todo list :P

Tiramon: wow stupid bug ,,, instead of 80ms per turn it's done in 3ms

MSmits: nice one

Stanworld: so even with speed , i cannot go front and back in one move ...

MSmits: you cant

MSmits: because there is one end-cell and it will assume you're not moving at all

icecream17: This is gonna slow me down so much. Person in like, 1300th place beat me by 2 points.

Default avatar.png Drastic_Loontastic: How do I move multiple pacmen at once?

mrawson: pipe delimiter

MSmits: read the description

MSmits: MOVE 0 17 5 17 5|MOVE 1 20 3 20 3|MOVE 2 11 6 11 6|MOVE 3 29 10 29 10|MOVE 4 3 10 3 10

Codewalker: is the challenge down?

Default avatar.png Drastic_Loontastic: Oh, thank you so much!

MSmits: oh btw, the extra numbers in my command are messages, ignore that

MSmits: just the first 3 numbers

thethiny: idk if the challenge is down but I'm down for the challenge

MSmits: pro-pun

MSmits: :thumbsup:

icecream17: Heave excited breathing!

icecream17: Won first 12 games of submit! 13!

Doju: nice icecream17

NapTown: and the 14th?

Icebox: rip icecream17

Doju: xD

icecream17: no. not the 14th. i lost to someone in 1108th place. got totally wrecked. but still doing much better than last time

Icebox: yeah you already wrote that you won the first 6227020800 games

icecream17: https://www.codingame.com/replay/463140624 lost by the 4th frame

icecream17: noo i think i jinxed myself. just lost 7 games in a row

Uljahn: is it ceg's clone? :unamused:

icecream17: ?

Astrobytes: Worse Uljahn

Icebox: oof

drykberg: could it be that the game does not let you sort before making first moves?

drykberg: if i make the move conditional on sorting being finished i lose for producing no line

drykberg: if i dont make it conditional, then it will execute the move, even though the sorting isnt ready yet

Astrobytes: Either your sort is timing you out by taking too long or you are not returning any output from it I guess

Uljahn: game doesn't let you exceed time limits

drykberg: does the debugging cost time?

Uljahn: yep but not very much

Astrobytes: if you output a helluva lot then possibly, I'm guessing this isn't the issue

Astrobytes: What are you sorting and what are your conditions?

Doju: drykberg i tried to a timeout caused by my prints for 2 hours :D

drykberg: haha

Astrobytes: If this is another Python buffer flush issue I am just gonna... growl silently

drykberg: well i have 4 arrays for x, y, value and bestindex

drykberg: so i go through the value array and put the index of the big points in the bestindex array

drykberg: when i do my moves i take the value from the bestindex array

Astrobytes: Why not a 2d array of x,y with the value?

Astrobytes: *as the entry

drykberg: because im on C and i dont even know if thats possible

Astrobytes: er...

drykberg: i know its with object properties in java and python whatever but i have never done it there either

drykberg: dont think you can in C

drykberg: can you?

icecream17: Nested Array?

Astrobytes: int arr[x][y] ?

drykberg: ah well

icecream17: board[0] = [' ', '#', ' ', ' ', '#', '#']?

drykberg: okay well i have seen that before

Counterbalance: struct Pellet { int x, y, value };

Astrobytes: With sizes of course

drykberg: 2d array

drykberg: but does that help me?

drykberg: maybe i should just look through the array from the end

Astrobytes: also see Counterbalance's suggestion

drykberg: thank you counterbalance

Counterbalance: it makes things a lot easier.. your array would then be:

struct Pellet pellets[400]; and you can access them like pellet[i].x etc..

Counterbalance: you can also do struct Pos { int x, y; } and struct Pellet { Pos pos; int value; }; that will come in handy

Doju: argh, what is this about ._.

Doju: https://www.codingame.com/share-replay/463161845

Astrobytes: you lost Doju

thethiny: @Doju I followed your advice

thethiny: class Cell: http://chat.codingame.com/pastebin/d24a76c7-62fd-46dd-954b-20c597e6871e

thethiny: def __int__(self): return self.value

thethiny: now all I need to do is int(cell)

thethiny: and it'll give me the value

Twelve0: ,

NapTown: Doju your pacs are dancing

Doju: nice thethiny

Doju: not sure if it's any better than doing cell.value but sure, that's nice :D

thethiny: I can do cell.value as well but int(cell) allows me to do: if int(cell) == -1:

 continue

Doju: if cell.value == -1?

thethiny: as I said it works too lol

Doju: ok lol

thethiny: the only advantage here is Cell == Cell

thethiny: no need for .value

Doju: hmm

Doju: sure, that's fine i guess

Doju: since you don't have duplicate cells

thethiny: or I can Cell == -1, since I can override int comparison

thethiny: Cell == -1 or -1 == int(Cell)

Doju: so you can check for their identity with if cell is cell

thethiny: anyways I'm not using it yet I just have it in the code

thethiny: thanks for the tip though

Default avatar.png ashikujjaman: https://www.codingame.com/replay/463165661 this is the best match from me:heart_eyes:

Default avatar.png ashikujjaman: how you guys manage to pass throw the cave? how you guys managed to find shortest path through the cave?

thethiny: you mean the warp?

thethiny: or the blocked corners

Default avatar.png ashikujjaman: warp

Doju: ashikujjaman i have that in my cell.get_neighbours() method

Doju: or rather

thethiny: Basically there are 2 ways to do it

thethiny: 1, you calculate the distance from your place to the warp, then from the opposite warp to you

thethiny: 2, you do BFS/DFS/A* and it auto does that

Doju: as a "consequence" of having my cell.get_neighbours() method output the other side of the map if it's at the edge my BFS gets the path for me

thethiny: https://imgur.com/a/yRDTQvq

thethiny: you know Doju what's funny about your Pacs is that they have "Logic" on top of their head

Doju: you know

Doju: debugging :P

Doju: if they have logic on their head then they use some logic in their movement

Doju: otherwise not

NinjaDoggy: lol

muy31: 11th? maybe moving to gold?

duckquackduck: hmm, not calculating path from every cell to every cell at the start is causing me issues. Doju, you were right. I think I have to do it, but mine never finishes under 1 sec

duckquackduck: i was only doing 1 cell to every other cell at start.

Doju: duckquackduck what algorithm are you using?

duckquackduck: BFS

Doju: okay, and do you use it so that

Doju: you run it once for each cell

Doju: or do you run each cell times for each cell

Doju: in other words:

muy31: cleaning the board: https://www.codingame.com/replay/463173792

duckquackduck: each times for each cell.

Doju: don't do that.

duckquackduck: each cell times each cell *

muy31: that's fine duckquackduck

Doju: it's not

muy31: for precalc

Doju: youre running it each cell too many times

Doju: and it's timing out

muy31: you make a different BFS for each cell in the beginning

muy31: that's what 1000 ms is for

Doju: yes do that

Doju: noo

Doju: muy31 you don't understand

muy31: ?

Doju: he's not flooding the board once for each cell

muy31: explain

Doju: he's flooding the board each cell times for each cell

Doju: he can get the exact same result by only flooding once

muy31: oh yeesh

muy31: i see

Doju: duckquackduck so the problem is you're running a bfs to a target cell

Doju: you shouldn't have a target

muy31: duckquackduck make an array of the last cells you flooded and only flood the empty neighbor

Doju: but rather just take note of the distance every time you hit a new cell

muy31: flood the whole board

Doju: no

muy31: that can be done w/ a 2d integer array

Doju: that's not what im talking about lol

muy31: Lemme show you my BFS...

duckquackduck: So I do a BFS from a starting cell to every other cell on the Map. Then I store the path from the that cell to starting cell.

Doju: don't copy paste code

muy31: static int[][][][] distances;

Doju: just tell me what it does

muy31: just snippets

muy31: no biggie

muy31: it doesnt matter

muy31: http://chat.codingame.com/pastebin/4ef64b19-e207-4142-ac45-cfb51079708c

Doju: duckquackduck you do a flood fill from each cell of the map

Doju: you don't give the "bfs" a target cell that stops it

muy31: oh yea pastebin doesnt work

Doju: you just let it run until the queue is empty

duckquackduck: ah you guys are also floofilling

Doju: and for every new child you map the distance

muy31: by child he means neighboring cell

duckquackduck: as in scoring the neighbours? and so on?

duckquackduck: ah, I think I get it

Doju: neighboring cell that is not a wall

duckquackduck: thanks a bunch

muy31: yes, with distance

muy31: the score is the distance from the start position

Doju: you can also store the path if thats what you want

duckquackduck: and then you just trace back when you want to find distance from a->b?

Doju: but distance works too

muy31: true

Doju: sure, that works

Doju: might be a tad slower than storing a "depth" variable and ++ing it for every layer in the graph

Doju: but it's easier to change to output the path instead

muy31: Here's how i did it

muy31: start w/ empty integer array

muy31: 2) make start poition 1

muy31: make neighbors 2

muy31: 3) for every new neighbor ++

muy31: these neighbors should not be repeated

muy31: so, they need to be empty or 0

muy31: distance i going to be equal to the integer of the target cell - 1

muy31: since we started with 1

muy31: and just do that for every coordinate in the beginning

muy31: so you precalc all distances in about 10 - 15 ms

Uljahn: that's right, im doing it with scipy in python under 20ms

Doju: Uljahn any optimizations?

Uljahn: all distances + paths

Uljahn: but you need to build a graph first

AntiSquid: everything is possible in C

AntiSquid: ah chat scroll

Clagus: damn... precalcing all distances in C# takes ~300ms for me :P

Clagus: but well... c#...

Doju: about 100 ms for me with no optimizations in python

Uljahn: nice

PiterYeh: Clagus my naive implementation in C# takes about 30ms iirc, i think you're doing somethign strange

Clagus: probably allocating too much memory

Clagus: are you using HashSet?

Clagus: ^ PiterYeh?

PiterYeh: i'm just using a byte[x,y,x,y]

PiterYeh: for the distance matrix

Clagus: whaaaaat :P

PiterYeh: var matrix = new byte[W, H, W, H]

Default avatar.png pakha: is there some ressources or something that we should study, that will help ?

Clagus: PiterYeh - yeah I got it, but why such strange structure

Clagus: and where is distance in it?

PiterYeh: well because it gives me access to anything in constant time and it's just one allocation

PiterYeh: var distance = matrix[A.x, A.y, B.x, B.y]

Doju: OOOOHH

Doju: i'm not removing super pellets!

PiterYeh: Doju i've been there :D

Doju: but why am i not doing it :/

Clagus: PiterYeh - I've got a List<Path> :P and each path has a Origin and a List of targets with distance in it :P so it's not very optimal xD

PiterYeh: are you storing the path too? or just the distance?

Clagus: I was thinking about the path (that's why i called it that), but for now only distance xD

Clagus: but plan was to store entire path too

PiterYeh: hmm right now i do a DFS every time i need to know the path, i should measure if it's worth to store all the paths

Doju: How did i only notice this bug now o.o

Clagus: Doju - yeah I had that moment too

Doju: :D

Clagus: when I realized my bots are actually blind xD

Clagus: but after fixing it, I actually fall in ranking xD

Clagus: I guess I've been optimizing things based on a invalid assumption of bots being able to see when they weren't

Clagus: and it really struct me HOW ON EARTH i didn't notice it watching my games :D

Doju: I'm just throwing away performance by doing clearing the super pellet cells and updating them right after

Doju: but whatever

Doju: erase "doing" from that sentence

Doju: i need to go to bed

Clagus: :D

Clagus: i need to get out of silver league

Clagus: but not today

Clagus: for now the question is, how to evade enemies and not evade pellets doing that

Doju: it's still doing it :(

Clagus: consider writing some unit tests? it helped me in finding my "blind pacs" bug

VicHofs: damn I missed out

Doju: how do you do that Clagus?

VicHofs: for two days now I'm screwed

Doju: actually i'll just google it dont bother typing

Clagus: xD

SemChumboPT: Hi, back again to try and get to silver league today !!

Clagus: good luck, been there, done that

Clagus: implementing proper distance checking did the trick for me

SemChumboPT: today..like tomorow, because it's almost tomorrow

Clagus: for me it's alredy tomorrow

Doju: there's something seriously wrong with my bfs

Clagus: really? bfs seems like an easy stuff... i wrote my own based on wikipedia page xD

Doju: yeah it's easy but i somehow managed to fill it with bugs

Clagus: it's ok

Doju: the precalc works but this thing that i do every move has a bug now :/

VicHofs: Doju u get to silver bro?

Doju: VicHofs yup

VicHofs: dang

VicHofs: care to share what got u in? lol

Doju: sure

Doju: i just made my bfs care about other pacs

Doju: in the sense that they are walls

Doju: that's the single change that threw me almost 800 ranks up

Doju: and now there's a bug in the same method :D

VicHofs: so you just run from them?

VicHofs: no combat?

Clagus: i'm still using the default A* implemented by the game itself xD

Doju: yeah

VicHofs: hmm

NapTown: i did that too

VicHofs: I might try that

VicHofs: I've been trying combat but it's not working too well

Doju: or no

Doju: currently i just dance in place

VicHofs: what

Doju: https://www.codingame.com/share-replay/463204524

Clagus: for getting to silver I would recommend calculating all distances before the game

VicHofs: ...as a joke I assume lmao

VicHofs: Why tho Clagus

VicHofs: cause you don't really know where the pellets and pacs are gonna be right

Clagus: you know at the start

Clagus: and you know always the big pellets

VicHofs: pellets and pacs? pretty sure you don't

Doju: who had the brilliant idea of blocking the ide when you open the previously submitted verions

Doju: versions

Clagus: cause they are visible outside fog of war

VicHofs: the big pellets yeah

VicHofs: but my BFS isn't timing out anymore

Clagus: you know where the pacs are at the start

Clagus: it's mirror map always

VicHofs: so calculating distance isn't a problem rn

VicHofs: I know Clagus but they move right lo

Clagus: yeah yeah sure

Clagus: :P

VicHofs: what I'm tryna get at is like

Clagus: I just don't care :P

NapTown: be pretty easy if they didn't

Clagus: NapTown Doju or dancing in place!

Clagus: :P

VicHofs: even if you precalc'd everything at the start, how are you implementing it throughout the game?

NapTown: easy and entertaining

Clagus: VicHofs I assume the pellets are there

Clagus: ignoring enemies for now

VicHofs: I think it'd be hard NapTown

Clagus: and scout with my pacs

VicHofs: Cause u wouldn't move either ;)

Clagus: if they see no pellets, i update my board

VicHofs: huh Clagus

NapTown: but what if you did, you win

VicHofs: cool approach

VicHofs: then yea NapTown

VicHofs: What's wrong with dreamin

Doju: VicHofs just check all the pellets for their precalculated distance and take the smallest one

VicHofs: Yeah I thought of that but isn't it pretty much the same as just BFSing it?

VicHofs: since you only know where pellets are if you see them at least once

Doju: well it's actually worse

Doju: since you can't update the walls dynamically

Clagus: got to go, good luck people! let's all meet in gold :P

VicHofs: My BFS isn't timing out anymore btw

Doju: but anyway

Doju: what did you do to it?

Doju: no strings?

NapTown: bye Clagus

Doju: please tell me no strings

VicHofs: I'll try :( Clagus

Doju: lol NapTown xD

VicHofs: Doju no the strings are working just fine surprisingly

Doju: oh are you serious

Doju: found the bug

VicHofs: I just stuck visited nodes together in a different way

VicHofs: yeah Doju

VicHofs: it works

Doju: break doesn't apparenty only exit a loop but also exits a method

Doju: great to knwo

Doju: how do you even exit a while loop without setting the statement as false?

Doumaki: "HELLO WORLD"

Doju: or condition or whatever it's called

VicHofs: I only know this sort of BFS (the one with string concatenation) well enough because when I was doing A* for other projects I would need not only the destination node but the step order as well Doju

NapTown: break like you just said

VicHofs: yeah what NapTown said

Doju: but that doesn't continue the rest of the code?

Doumaki: what wht d u mean break in a method

VicHofs: yes but it breaks the loop

NapTown: after the loop yes

Doju: whaaat

Doju: this is the bottom third of my bfs flood fill thing

Doju: http://chat.codingame.com/pastebin/8076d0d1-c9fb-4e20-b086-4e8dfe441a57

Doju: oh right that doesnt work

NapTown: if you don't want to continue the code try return :D

Doju: well anyways path = construct path

Doju: (in a while loop btw)

VicHofs: well that works only in functions tho

Doju: then i call break

Doju: then it should reset cells and return path

VicHofs: sweet

Doju: but it doesn't return path

VicHofs: gl

VicHofs: make sure return is after the loop

VicHofs: if it is it should run...

Doju: it is

VicHofs: what the heck then

VicHofs: is it returning anything at all

VicHofs: or just the wrong value

Doju: oh what

Doju: it does run

Doju: how can a list of cells be reset by setting their parent and visited as none...?

VicHofs: idk write a method for it in the class or something

Doju: oh what the hell

Doju: its not the resetting method

NapTown: in a method, make new lists for that stuff every call

Doju: sorry i already have the method

Doju: i was wondering how it's possible that it's doing that

Doju: but apparently it's not

Doju: seriously whatt

rcar: debugging someone else's code over chat seems like hell

Doju: path = self.construct_path(start, child)

NapTown: it's not fun :)

Doju: break

Doju: return path

Doju: and it returns none

Doju: but if i just do return self.construct_path(start, child)

Doju: it returns the path

Doju: :|

VicHofs: kinda but helping is cool so whatever rcar :)

VicHofs: -so is getting help-

rcar: I'm all for helping and being helped, but it's usually easier when you can see code

Doju: that was the code lmao

VicHofs: tru but we can't share right

Doju: OOOOOOOOOOHHHHHHHHHHH

rcar: I don't know the exact rules, but I'd assume you can share small blocks

Doju: wait no

VicHofs: why don't u implement it without the variable name then Doju

NapTown: little bits is fine i think

VicHofs: if it works that way

Doju: VicHofs people say returning from multiple spot is the root of all evil

Doju: spots

VicHofs: you did that?

Doju: why cant i speak english

Doju: huh

VicHofs: did you figure something out?

Doju: apparently python doesn't like the variable name "path"

rcar: path is a fine variable name

CodingCarter: lol no it's probably already used somewhere

rcar: it's not a reserved word in the language

CodingCarter: maybe an imported module...?

VicHofs: pretty sure it isn't

Doju: actually i dont think it's the name

Doju: but still returning from the middle works

rcar: break works as people have described, so you probably just have a bug somewhere else

rcar: if returning from the middle does what you need, just do it

VicHofs: you know what I always say is

VicHofs: if it works,

VicHofs: don't mess with it

Doju: does break run to the end of that iteration of the loop?

rcar: break ends a loop immediately

rcar: continue ends an iteration of a loop and starts the next one

Doju: i shouldn't waste your time

Doju: just forget about it

Doju: i'll find it on my own

rcar: you should just share the one function you're trying to debug

Doju: uuhhh

Doju: should i?

VicHofs: I'd say it's fine honestly

VicHofs: what the heck is anyone supposed to gain by that lol

Doju: well, it's a mostly working bfs function

Doju: actually i think i know the reason

Doju: or

Doju: umm maybe not

Doju: def bfs_to_criteria(self, start, value_criteria, block_criteria=block_criteria): http://chat.codingame.com/pastebin/08e7d46b-5b28-4b20-8e72-072dfc55f3fa

Doju: still doesnt work

Doju: https://imgur.com/bc3ZcG9

Doju: oh and

Doju: i introduced another issue just there

Doju: just_output_this_path_pls is just_output_the_correct_path_pls

Doju: i mean the other way around xd

NapTown: so you're doing bfs and want the path from start to end yes?

Doju: yup

Default avatar.png Xlos: Wow, after hours of trying to find a bfs function, I can steal this guys code

NapTown: why not keep track of parents and then walk back after?

Default avatar.png Xlos: what a scrub

NapTown: also you don't need dequeue

Doju: that's what im doing naptown

Doju: construct path does that

NapTown: oh ok

Doju: and that outputs the correct path when instead of just_output_this_path_pls = self.construct_path(start, child)

NapTown: where you have break just return construct_path?

Doju: i do return self.construct_path(start, child)

Doju: yeah it works but why

Doju: it does nothing else than print a thing

Doju: and i can even comment that out

NapTown: it's printing the type of your path probably

pmor: I'm not a python guy, but doesn't your break, just break out of the for...you'll still be looping in the while

pmor: ?

Doju: OH

Doju: you're right

Doju: or at least there's no other sensible thing

NapTown: that's right, so return instead of break and try printing there

Doju: i don't really need to print

Doju: ill just look at the pacs

NapTown: probably easier to print it but you do you

Doju: hard to really see whats going on when printing

pmor: unittest :)

Doju: yeah

Doju: now it's fine though

Doju: returning from the middle of the loop

NapTown: you'll get some null paths also, since you are blocking paths, fyi

Doju: and summoning some demons by doing that

Doju: yeah i know

Doju: but thanks

Doju: thanks everybody for being patient with me :)

NapTown: good luck :)

rcar: stepped away for a sec but it seems like you got it now?

Doju: yeah, the break only got out of an inner loop

rcar: haha yeah, it'll do that

Doju: and so it gave the furthest pellet

Doju: well hey, that's an unintended function

Doju: quite an excuisite looking map

Doju: seed=2915771865364200400

NapTown: not bad

drykberg: cant figure out a logic to compare current pac location against some old location... ^^

drykberg: maybe im done for the day

NinjaDoggy: does anyone know exactly how collisions work?

NinjaDoggy: when collisions occur between 3 or 4 pacmen?

pmor: you can look at the code on github, but it's pretty wonky

muy31: what drykberg you trying to extrapolate the othe pac's move?

Zandy156: more than 2 pacs would mean that at least 2 would be on the same team so all from that team would be blocked and so would any of the opponents that share a type with any other pac in the collision. How I understand it.

drykberg: no, im a beginner and was advised to give this a go anyhow. Im trying to make my pacs turn the other way when they collide. Currently they bump into each other indefinitely.

drykberg: although now i have the problem that after 30 seconds or so the pac_count suddelny goes up to 25 and my thing crashes

drykberg: up until round 23 i print the correct pac_count of the match, then in round 24 it says pac_count 1 and then pac_count 25

drykberg: overflow?

Toeler: That sounds like you're reading the wrong number of lines for something

drykberg: well, im just using the default loop that passes in pac_count.

drykberg: if i have 2 pac, then it correctly logs 2 until 10-20 rounds into the game

drykberg: yes, i think my oldposition[round] array was too small, at size 10 it crashed after 10 rounds, at size 20 after 20 rounds, and at size 100 after roughly 100 rounds

cegprakash: i'm stuck in silver

cegprakash: anything I can do to target better pellets?

cegprakash: I still go to the closest one

Durkin: Do you target the big pellets to start?

cegprakash: yes

cegprakash: I do that

cegprakash: I'm rank 218 at Silver

cegprakash: I also collaborate well and counter opponents

cegprakash: but going to closest pellet doesn't seem to be optimal

Icebox: then you should be top 10

cegprakash: I don't assume enemy moves

Icebox: I'm going to closest pellet and don't counter opponents, my last valid submit was 49th xD

Icebox: in gold

cegprakash: oh

Zandy156: wow I took the opposite approach

cegprakash: counter in the sense.. defend

cegprakash: I assume opponent kills me if he can in next turn and I assume opponent uses switch

cegprakash: when I am about to kill him

Icebox: yes I understood that

Zandy156: I'm still trying to improve my pellet gathering efficiency. Do you at least keep track of pellets that aren't visible?

cegprakash: yes I assume every invisible pellet as visible

cegprakash: and change visibility after what I see

cegprakash: when I mean going to closest pellet it may not be in vision but I assumed a pellet should be there

Icebox: there are absolutely no problems with that approach

Zandy156: then yeah I'd say that is optimal quite often

cegprakash: I don't know what I'm missing then

cegprakash: rank 219/758 in silver

Zandy156: do your pacs stay close to each other?

cegprakash: no

cegprakash: should they?

cegprakash: like I don't mind staying closer though

Zandy156: not with the colsest pellet technique

cegprakash: if u want pacs to spread out I think I can't target closest pellet

BenjaminUrquhart: my pacs spread just fine with closest pellet smh

Durkin: do you value deadends less than other paths (Could similarly devalue points as they get closer to a different pac perhaps)? doing that personally and found it helped.

cegprakash: oh

cegprakash: but u are only 20 ranks above me with that

cegprakash: :|

cegprakash: there is something big we are missing

Icebox: literally the first replay I looked at

Icebox: and your movement is whole new level of bugged

cegprakash: I'm wasting so many turns going to closest pellet and walking empty handed

Icebox: you're moving one step with speed 2

Icebox: with million pellets around you

Icebox: watch your replays as often as you ask in chat and you'll get legend no prob :D

cegprakash: so when I'm in speed 2 I must always move 2 steps?

cegprakash: yes I prefer to move 1 step

cegprakash: but not sure if it would make a big deal

Icebox: so you prefer taking 1 pellet instead of 2?

Hjax: if you only move 1 step you might as well not use speed

Icebox: ^

Hjax: you are wasting your speed by moving 1

Waffle3z: you aren't required to move 2 steps but whatever position you pass to the move command you'll move 2 steps toward it

Jay_Jayjay: Well, suppose you're in a dead end with a pellet ahead. It would be useful if you could go there and back in the same turn with speed

Icebox: yeah that's not possible

daffie: for me when my pacs don't have speed activated it's sort of like they are only allowed to move every other turn,

Icebox: but also not relevant

Icebox: his pacs are literally eating pellets in a line

daffie: but it's still 1 space per turn as far as I know

Icebox: one pellet per turn

Icebox: with 2 speed

Icebox: which makes like 0 sense

daffie: yea it's 1 per turn, but probably the 2nd turn is the same turn still

daffie: it just looks like 2 turns on the screen

Icebox: no daffie, unfortunately it is not

Icebox: and yes I'm aware what you're talking about

daffie: ah nvm then

Icebox: the rest of the pacs move with his pacs staying

cegprakash: do u havae that replay?

cegprakash: it shouldn't be happening

Icebox: you said you like moving 1 per turn :D

Icebox: I thought that's intentional

cegprakash: I have an eval

cegprakash: which chooses it

cegprakash: so need to check why it chose it

cegprakash: may be it thinks after picking this pellet it has to come back

cegprakash: so it's better to move back

cegprakash: which is not possible

cegprakash: so do it next turn

Icebox: https://www.codingame.com/replay/463219903 Frame 25, you move 1 step (pressumably not to suicide in dead end?) and then suicide in dead end on the next turn :D

Icebox: id 0

Icebox: I saw this in like 3 replays of yours

Icebox: it's really not that uncommon

Icebox: I assume you lose like half of your games because of this

cegprakash: what u mean he will eat me

Icebox: he eats you anyway

cegprakash: if I go there

cegprakash: mm

Icebox: you won't have speed on the next turn

Icebox: it doesn't matter what you do

Icebox: you're dead anyway

cegprakash: mm.. let me force a step 2 move

cegprakash: see what happens

Valiant_Wolf: cursory guess is that it's picking its current position as the target when it stops, then dodges into the dead end when threatened

Valiant_Wolf: wouldn't have known not to start down the dead end because the enemy wasn't in sight when it did

cegprakash: should I avoid accidents?

Icebox: still does not explain his magic 1 step

Icebox: the trap is not the problem Valiant_Wolf

cegprakash: I submitted with forcing step 2 on speed

Valiant_Wolf: ah, but the speed just wore off didn't it?

Icebox: nope he had 1 more left

Default avatar.png o_imej: guys what's the best way to avoid my pacs to block each other ?

Default avatar.png o_imej: my way is to naive

Valiant_Wolf: oh, yeah, so you're right

cegprakash: u can't go up and down on same turn

Icebox: you're not supposed to

drykberg: 11 hours later and my pacs choose a new target pellet if they are blocked

cegprakash: when he has speed

cegprakash: I assume he will eat me

cegprakash: by moving 2 steps

drykberg: makes you wonder if i am lacking what it takes

thethiny: you're cracka lackin

drykberg: lacka de cracka schmackin

Valiant_Wolf: o_imej people seem to be using all kinds of map interpretations; my method is to prevent pacs from moving into a space if a friendly pac has already calculated it should move into that space this turn

Valiant_Wolf: consider where the pacs will be, not where they are now

drykberg: how would you know where they will be?

Valiant_Wolf: well if you've decided on a move for a friendly pac already then you know exactly where it's going to go

Default avatar.png o_imej: no there's a bug with my code in intersections

drykberg: one thing after another...

Default avatar.png o_imej: my method is if the distance <= 1 i turn to other side, but doesn't seem to work all the time

Valiant_Wolf: there are two ways to cause a bump

Valiant_Wolf: two pacs try to swap positions (distance = 1)

Valiant_Wolf: two pacs try to move into the same space (distance = 2)

thethiny: Guys did the serve change its behavior?

thethiny: Flood Fill for 12x33 in 0.28857994079589844s

thethiny: in the morning it was 0.7

VicHofs: idk but I stopped timing out for what it's worth

thethiny: that's what I'm saying

thethiny: they either upgraded a server or sth else changed

thethiny: on another note, can you guys give me a 17x35 map?

VicHofs: a seed you mean?

BenWo: maybe they did an upgrade or added to the load pool ?

BenWo: this challenge has been quite popular

thethiny: @VicHofs yes a seed

thethiny: @BenWo looks like it

BenWo: here's a 17x33: -8826700466890008600


thethiny: I need 35x17 for the maximum possible

thethiny: if you don't mind

BenWo: one sec, just found one

BenWo: 17x35:

7331818917789923300

BenWo: or preferably, a 35x17 ;)

BenWo: another: 8679062213686104100

thethiny: thanks dude :D

BenWo: now I'm wasting time looking for interesting seeds :D

BenWo: and np

thethiny: I have some if you want

BenWo: sure

thethiny: infinite loop: -7826971533994987500

thethiny: Trap at start: -759772380780911870

thethiny: Test your pathfinding -5313551966370276400

thethiny: Test your enemy attacks -5170449188659183600

cegprakash: damn I had a bug

thethiny: Difficult to win 5381810492425624600

BenWo: that's ominous ;D

BenWo: thanks

thethiny: :D

VicHofs: wym infinite loop?

thethiny: look at the warps

thethiny: they're connected

BenWo: nothing blocking the tunnel view

BenWo: have you seen more than 4 tunnels?

thethiny: I've seen 3 max lol

BenWo: here: -1480812346427365380 max size, 4 pacs, 4 tunnels

VicHofs: how are you guys dealing with pacs going in the same general direction?

BenWo: currently, I'm not :-P

VicHofs: you in silver?

BenWo: yep

VicHofs: bruh lol

BenWo: yeah it's on my list

VicHofs: idk how to improve anymore to get to silver

BenWo: the only thing I did was make sure my pacs can't pick the same destination

VicHofs: yeah I did that too

VicHofs: did you make sure that the one that keeps the destination is the closest?

BenWo: my next rewrite is a full pathing change.... again....

VicHofs: cause I didn't and I think it might be a problem

BenWo: no I didn't

BenWo: it's very situational whether that's good or bad

VicHofs: what'd u implement to get to silver if you don't mind sharing lol

VicHofs: cause I'm out of ideas in any plausible conceptual universe lmao

BenWo: pretty plain BFS to find pellets, give super pellets top priority at the start (though that's not perfect currently)

BenWo: don't path right past, or into, a pac that can kill you

VicHofs: damn

VicHofs: I already have that but I

BenWo: and some basic defensive switching

VicHofs: 'm 1700 in Bronze lmao

VicHofs: I have the switching too

BenWo: which oddly looks rather offensive a lot of the time

BenWo: I also ditch the current path as soon as I spot an enemy

BenWo: and basically every few turns constantly

BenWo: oh and they use speed a lot

VicHofs: hmm interesting

VicHofs: I use speed when cornered

VicHofs: mostly

VicHofs: cause using it off cooldown wasn't working

BenWo: using speed and getting at least equal super pellets can be pretty deciding if all else is fairly equal

VicHofs: ok ty a lot

VicHofs: I'll try and review my stuff

BenWo: no problem

Hjax: you should use speed whenever its off cooldown

SemChumboPT: and avoid enemies when speeding :)

SemChumboPT: because you can't change

thethiny: Flood Fill for 17x35 in 0.8232488632202148s

thethiny: that gives me about 0.177s

BenWo: VicHofs I can't find your bot in the list

thethiny: @BenWo if he's in a different list you can't

BenWo: hm ok

thethiny: I'm starting to see repetitive matches

BenWo: I can see a few bronze ppl though

VicHofs: I'm in bronze BenWo :(

thethiny: almost all of my seeds are repetitive now

thethiny: seed=6858087742637927400

SemChumboPT: I'm Bronze

thethiny: cool to test your corner meta

ProGramp0926: I'm such a noob

BenWo: I feel like a noob too, I've just been coding and reading since the weekend

VicHofs: ty thethiny

BenWo: yeah my pathing is kinda crappy

BenWo: maybe I'll get to that rewrite if work stays slow

Zenoscave: What is a good way out of silver?

Zenoscave: What is the bare minimum?

VicHofs: well I'm -literally- a noob at bot coding

VicHofs: lmao

BenWo: I've done one or two puzzles on here and that's about it

elkhayder: The messaging system is new right ?


thethiny: "What is a good way out of silver" asks people in Bronze


Zenoscave: No elkhayder it just shows up once you're level 3

elkhayder: Ahhh

Zenoscave: also the is world chat. Not just "people in bronze"

VicHofs: guess I'm just dumb then ¯\_(ツ)_/¯

SemChumboPT: you just have to beat Inky bot, and he is very predictable

BenWo: well, you have to rank higher than him

SemChumboPT: It's so easy that I'm still in bronze

SemChumboPT: :)

thethiny: @Zenoscave it's a joke, relax

Default avatar.png Xlos: Make sure you're tracking all the pellets so you don't get stuck at the end

Zenoscave: here's a general pseudo to get out of bronze: http://chat.codingame.com/pastebin/c4bec5b7-6d22-4aee-903b-2eb6a8c4188c

Zenoscave: Oops pastes are invalid because contest.

VicHofs: yep

VicHofs: It wasn't before really

Zenoscave: thethiny sorry. Long work day. slightly hungrt

Zenoscave: hangry*

Zenoscave: They usually don't turn them off until it's an issue with code pasting

Default avatar.png TheTwister: Guys how does people display emotes above pacs?

Zenoscave: what language are you writing in?

VicHofs: just append to any command

thethiny: @Zenoscave all good man, it'd be worse if you're fasting :P

Default avatar.png TheTwister: @Zenoscave i am on JS.

thethiny: @TheTwister just print the emoji

thethiny: if you're on windows 10 it's Windows + ;

thethiny: 😂😭😍🤷🏻‍♀️😞🤲🏻🤷🏻‍♂️😏📿🥁😠👍🏻😆😇🤣😉👇🏻👀🤦🏻‍♂️😅😳🙄♥💯🤔🤪🥕🐡😡😒🤞🏻🔥🤘🏻😈😢👋🏻🐼😁

Zenoscave: Ramadan Mubarak ;)

thethiny: To you too Brother ;)

Default avatar.png TheTwister: ok, ty

berries: how do you make a 2d array in python

berries: im switching over my code from java

thethiny: var = []

Zenoscave: TheTwister here's one example: console.Log(`MOVE ${pac.Id} ${target.X} ${target.Y} \u{78}`)

thethiny: var.append( another array )

VicHofs: why tho berries

thethiny: I think there are issues with js

berries: i have been advised too by someone much smarter than me lol

thethiny: no one is smarter than you but tomorrow's you

thethiny: else you'd never learn

BenWo: well berries I could give ya that one, but have you googled for it?

berries: said its much better for when you start implementing complex algorithm

thethiny: 🙏🏻

BenWo: it'd be good to have a bit more understanding how it's structured in Python

berries: yeah i did and theres a bunch of different answers and its weirdd

VicHofs: idk dude if you're used to a language no matter what it's usually better to stick to it

BenWo: ok this is a one time thing!

list = [[None] * x for _ in range(y)]

thethiny: @berries because in python you don't fill an array beforehand

BenWo: gives you an array in format: list[y][x]

thethiny: you just add on the fly

VicHofs: I know three languages well some of which are more optimized than python

thethiny: in our case:


thethiny: width, height = 33, 17

VicHofs: but I stick to python cause that's what I know best

thethiny: as an example

berries: thanks ben

thethiny: you can just do

BenWo: 👍

thethiny: grid = []

thethiny: for i in range(height): row = [] for j in range(width): row.append(value) grid.append(row)

berries: okay yeah thats what i have been doing

thethiny: I hate this chat

berries: it makes sense now

VicHofs: wym thethiny

thethiny: I can't send code

thethiny: it says expired

BenWo: expired?

thethiny: yeah let me try again

thethiny: class PathFinding: http://chat.codingame.com/pastebin/5bd16446-d099-40b6-b1c6-7dafbccad09a

thethiny: see

SemChumboPT: there is a twich video with a guy doing a very basic aproc in python

Zenoscave: they disabled pasting large portions of text

thethiny: why so?

SemChumboPT: you'll get started

Zenoscave: they often do so in order to keep contests fair

BenWo: oh wow, ok

BenWo: guess I'm not too upset

thethiny: thanks Zenos

Zenoscave: np

Zenoscave: been here to ask enough questions figured I should answer some eventually

thethiny: hahaha

thethiny: guys is there a point that we can ALWAYS guarantee it's a point?

thethiny: I'm writing a path finding algorithm that needs a CONSTANT starting point that isn't a wall

Zenoscave: No

thethiny: damn

VicHofs: I don't think so

VicHofs: not other than pac spawns

Hjax: thats a really weird requirement

Zenoscave: and pac spawns are random too

Zenoscave: Hjax is right

thethiny: baiscally

thethiny: I'm trying to get the edges of the map

thethiny: and the corners

thethiny: in order to do so I need to scan the entire map

thethiny: but I need a starting point

Zenoscave: just do a scan for the first non wall edge first each time and start there

BenWo: what's wrong with (0, 0) ?

thethiny: yes that's what I wanna do but I thought maybe there's a point

thethiny: @BenWo if I start at 0,0 and it's a wall my algo stops

BenWo: yeah obv, it'll be a wall

BenWo: but start looking there

thethiny: I'll just brute force it then

Zenoscave: Hjax gold yet?

thethiny: is Gold open yet??

BenWo: yeah opened today

Hjax: im gold yes

thethiny: oh nice!

thethiny: That's why I'm 70 then (down from 200)

Zenoscave: What's the silver-boss-to-gold meta

VicHofs: bruh yall too good at this

Hjax: not sure, i promoted when it was open

Zenoscave: Damn

Hjax: my bot from monday was better than the boss

Zenoscave: I've not had much time to work on this with my job

VicHofs: no need to rub it in Hjax

Zenoscave: Woohoo end of sprint release cycles

icecream17: I'm still in bronze. what's the new stuff for silver?

Hjax: the only new thing is that it tells you when pacs are dead

BenWo: only 1 thing new

Zenoscave: Theres a new type. DEAD

Zenoscave: and you should just skip those lines

Zenoscave: major breaker for many bots

icecream17: wow that's really useful!

Zenoscave: Some were complaining about id's changing between turns i believe. Can't please everyone. There's not a good way to do it

SemChumboPT: wow i submited and got so dam down on bronze i was afraid i would get to wood again!!

SemChumboPT: Rank 2,328 2,482... :/


BenWo: the re-submission curse

Zenoscave: You can't go back leagues. once in bronze you can only go beyond

SemChumboPT: Zenocave, my luck then !!

Zenoscave: but yeah dropping ranks after a 'fix' or even the same code is always at the whim of RNGesus

VicHofs: RNGesus -always- gets me

icecream17: hm. how does brutaltester... aw its 929 gn

VicHofs: what

thethiny: yes but actually no

cegprakash: wow top 50 silver for the first time

cegprakash: watching lot of replays helped me fix a crucial bug

cegprakash: but now I die to random accidents

cegprakash: no idea how to avoid accidents

drykberg: congrats

cegprakash: not sure if tracking opponent will help me avoid accidents

BenWo: yeah randomly getting killed at a corner is a tough one :-/

SemChumboPT: Lool i'm ignoring the edge of map and was killed when passed from right side to left :/

cegprakash: lol

cegprakash: so avoiding corners can cause accidents too

cegprakash: interesting

cegprakash: I was thinking about adding choke point avoidence

Ltrltrltr1234: hi

cegprakash: avoidance*

Ltrltrltr1234: Is this chat for the entire site?

NapTown: ya

Ltrltrltr1234: oh ok

Ltrltrltr1234: im having trouble with power of thor

Ltrltrltr1234: for some reason the code to prevent him from going off the map doesnt work

Ltrltrltr1234: got any ideas

thethiny: what is the code you're talking about?

thethiny: your code or their code?

cegprakash: wait I'm #7 at 91%

cegprakash: :D

Ltrltrltr1234: my code

cegprakash: so Gold is a real possibility

thethiny: let me check, wait

thethiny: @Ltr

Ltrltrltr1234: Im not really good bear with me

thethiny: okay so

thethiny: you have the map's coords

Ltrltrltr1234: yeah\

thethiny: what you need to do is on this step, you simulate the next step

thethiny: example

cegprakash: #3 I resubmit :D

thethiny: if you're at 0, 0

Ltrltrltr1234: then

thethiny: you need to simulate that you're going to all directions

thethiny: then whichever works, you actually go to

Ltrltrltr1234: oh ok

thethiny: you shouldn't first go, then you simulate

Ltrltrltr1234: thanks for help

thethiny: :D

Ltrltrltr1234: :grinning:

thethiny: guys anyone got a seed where the Big Pellet is trapped from 3 corners?

BenWo: trapped?

thethiny: 3 walls around it

BenWo: you mean it's a dead-end, gotcha

BenWo: 4881390214237379600 that enough?

MoMaT: 1737599522231088900

thethiny: Yes thank you a lot

cegprakash: 14% rank 11

cegprakash: Get rekt SIlver boss coming for u

WillNess: 36% rank 222 in bronze :/

Zenoscave: cegprakash how many wins in first 10/

WillNess: oh wait 51% rank 49 let's goo

Zenoscave: ?

HKTran: 212 bronze :))

VicHofs: WillNess still way better than me lol

cegprakash: 9 in first 10

Zenoscave: Ok first one is loss?

cegprakash: no

cegprakash: Rank 1 24%

Zenoscave: gz

Zenoscave: what did you change?

cegprakash: changed my depth = 1 to depth=10 after fixing a silly bug

Zenoscave: in search/simu?

cegprakash: yea

Zenoscave: beam?

BenWo: dang, nice

drykberg: how do I tell a pac to go to the nearest pellet? ^^

WillNess: 70% rank 10 am I gonna make it??

cegprakash: The bug was I was using a global variable instead of a local variable inside function

VicHofs: try Breadth First Search drykberg

thethiny: @drykberg calculate the distance to it, then move to it

WillNess: yessssssssss

Zenoscave: Is not turning around unless needed a good idea ceg?

Zenoscave: I spend wasted moves going back and forth a lot

Zenoscave: like MOVE 0 10 10 ... MOVE 0 9 10 ... MOVE 0 10 10 .. MOVE 0 9 10

cegprakash: yes

VicHofs: my charitable chaps who are in silver? could one of you summarize what you have going just so I have an idea?

cegprakash: that's what got avoided in my sim

cegprakash: I mean

cegprakash: not really

cegprakash: previously 2 of my own pacs go to same choke point

cegprakash: because they are closer to those choke point

cegprakash: but now because I have this depth I am able to figure out 1 of the pacs can take all of those

cegprakash: so other pac will move for a different pac

cegprakash: *different pellets

BenWo: sounds perfect :)

cegprakash: Zenoscave did u understand what I said

cegprakash: or should I repeat?

cegprakash: so I have 2 pacs closer to 5 pellets.. the problem I had was both these pacs went for these pellets

Zenoscave: I understand

Zenoscave: coding it now

cegprakash: :D

cegprakash: I dropped boss so much.. diff between him and me is now 4 points

cegprakash: 3 days of suffering

VicHofs: cegprakash how u doing that?

cegprakash: and finally here

cegprakash: beating boss VicHofs

MoMaT: VicHofs, you need two things: (1) get the bonus dots closest to you, (2) walk trough each tile only once (if possible) with only one unit (that is, explore without redundancy). if you have more than one choice, prioritise certain infromation (dots you see).

VicHofs: ty MoMaT

Zenoscave: MoMaT algo for non redundant walk? just weighted Kruskal?

cegprakash: do u track invisible pellets Zenoscave

Zenoscave: no

Zenoscave: like seen previously but uneaten?

Zenoscave: how do you make sure ops havent eaten

MoMaT: maybe if you want to be really pro, you could use a spanning tree, but to get to silver, all you need is to make best choice at the moment you need to make a choice. even if globally it is not optimal.

Zenoscave: Ok weighted kruskal spanning tree

cegprakash: that's a must Zenoscave

Zenoscave: ok thanks I think I have enough

cegprakash: I don't make sure Zenoscave

VicHofs: even I have that implemented lol

cegprakash: I just assume it's still there

cegprakash: how did you get to SIlver without Pellet tracking Zenoscave

cegprakash: :D

cegprakash: hacks?

Zenoscave: Magic

VicHofs: cegprakash u implemented that too right

cegprakash: yes

cegprakash: that's what got me to Silver

VicHofs: do u analyze if enemy pacs ate any of them?

cegprakash: nope

VicHofs: I couldn't find a proper way to do it so I just ignored it and did it for mine

cegprakash: not yet.. not sure if it's worth it

VicHofs: oh ok

VicHofs: ty anyway

Ltrltrltr1234: Not sure how to do power of thor, perhaps later

VicHofs: just trying to see what I need to focus on to get to silver

cegprakash: Yes u need Pellet tracking

cegprakash: Bronze is the hardest place to promote

cegprakash: coz it's flooded

VicHofs: got that already :)

VicHofs: I think my use of abilities is shitty tho

cegprakash: only 70 games and u need to win 70% at least

VicHofs: maybe I should give that some thought

cegprakash: Icebox u said u are in top 50

cegprakash: are u testing something

Durkin: Looking at some of your loss replays, you seem to just be timing out a lot Vichofs. fixing the error in that if it's your actual current code would be massive

VicHofs: timeouts again?

VicHofs: guhh

VicHofs: hate that shiz

VicHofs: aight thanks for the heads up Durkin

VicHofs: I thought I'd fixed that

MoMaT: but to make it work right, you would have to use it in a line graph. personally I think it is an overkill, given the uncertainty of the information. it's better to be as flexible as possible and use speed correctly.

Default avatar.png ndosm: if I'm seeing the message "Only pacs with the SPEED ability enabled can move:" , am I doing something 'wrong'? I'm not sure what the message actually means to me

VicHofs: no it just means someone is using speed

VicHofs: and they get an extra move round while active

VicHofs: when only they can mve

VicHofs: *move

Default avatar.png ndosm: ooh, thank you

VicHofs: np

VicHofs: Durkin would you happen to have one of those replays? lol

VicHofs: I can't get it to happen anymore...

VicHofs: (although that would be preferable)

berries: can you have x + 1 as an argument in a function in python

Durkin: https://www.codingame.com/replay/463269086

berries: cant find it on google

VicHofs: not that I know of berries

VicHofs: but why would you

berries: less lines of code i gues

VicHofs: just take the argument x and do x=x+1 on the first line

berries: yeah thats what ill do

VicHofs: x += 1 actually

VicHofs: better format

VicHofs: imo

VicHofs: ty Durkin

berries: i need to retain x so im gonna do x1 = x + 1

VicHofs: your call dude 👍

MoMaT: of course you can do f(x + 1).

MoMaT: you can pass any expression. it will be evaluated and used by the function. it doesn't change the value of the original variable.

VicHofs: anyone know a good timeout method for functions in python?

VicHofs: as in "if it takes longer than x ms just break the loop and provide y"

Icebox: put if (time > limit) at the top?

VicHofs: yeah but I mean like in dependenciess

VicHofs: I'd just import time and do time() - start but I wanna get a second opinion

Icebox: that's pretty much the only way

VicHofs: ok ty

MoMaT: import time module, there are many methods there. wall clock or CPU time based.

VicHofs: ya was just wondering if maybe there was a timer() function or something

VicHofs: but good old time() - start it is

Icebox: I have never tried it on CG but generally speaking you could try it with multiprocessing

VicHofs: the what now

Icebox: it has process.terminate() method

Icebox: which ends a process

Icebox: you can time it

Icebox: to terminate after some MS

VicHofs: huh

VicHofs: interesting

Icebox: no idea if it's supported on CG though

VicHofs: but since I'm dealing with a while loop here I think time's fine

VicHofs: ty tho

Icebox: it is, there are like no benefits of using it

Icebox: unless you could get your code to multithread and would get 10x performance from that

Icebox: :shrug:

VicHofs: lol

VicHofs: I wish

MoMaT: do you have more than one core though? if not, it's irrelevant.

VicHofs: yes

Icebox: MoMaT just checked it

Icebox: it's unfortunately only 1 core

Icebox: that is available to us

VicHofs: on CG tho

Icebox: it has hyperthreading tho

Icebox: yeah on CG

VicHofs: I mean for other uses

MoMaT: OK, for a moment I though something changed.

VicHofs: ty for the info regardless

VicHofs: nah that's not what I meant MoMaT

VicHofs: sry lol

MoMaT: hyperthreadin is just marketing. you get maybe 10% more speed. not 2x more.

VicHofs: why can't I see the full stderr?

VicHofs: this suckcs

VicHofs: any way around it?

Icebox: I don't think it's ever marketed to give 2x boost

MoMaT: that happens when you talk to much in a chat...

VicHofs: what does the chat have to do with it lmao

MoMaT: with all the Intel vunerabilities like Meldown or Spectre, I wonder if HT is even enabled on CG.

Icebox: it is

MoMaT: I'm not so sure, the FAQ might be outdated. Do you know which IaaS is CG using?

Icebox: it could be outdated

Icebox: but since there was no update regarding such changes

Icebox: I'm gonna go with old info and say it's still there

MoMaT: but the thing is, all new Intel CPUs have it disabled by deafult. also I'm not sure CG would go so far as to build their custom kernel, and default ones would have all mitigations on.

MoMaT: anyway, I was just wondering, it's not that I care that much.

Default avatar.png k3null3d: is there any way to see a clash of code solution ?

SemChumboPT: Well. it's not today that I'll get silver :(

VicHofs: SemChumboPT same dude

SemChumboPT: I'l try again tomorrow

VicHofs: I feel ya

VicHofs: good luck!

SemChumboPT: Made so many changes and got even worse... tomorow i'll get it !!

SemChumboPT: I hope

VicHofs: boa sorte :)

SemChumboPT: ;)

shashwat986: k3null3d only if a solver shares their code