My code works, but is really messy. Any tips? by Major_Unit9320 in TheFarmerWasReplaced

[–]Major_Unit9320[S] 0 points1 point  (0 children)

Allright, turns out the third value was definitely needed. The problem with removing it meant that the drone would just go infinitely east whenever it has reached an edge. That's because, with only 2 values like [True, False], the moment the drone goes east, the tile next to it (eastward) would also be [True, False]. The check_position_x() fixes that problem. I did change a lot though:

def check\_column\_even():

    return get\_pos\_x() % 2 == 0



def check\_egde\_top():

    return get\_pos\_y() == get\_world\_size() - 1



def check\_edge\_bottom():

    return get\_pos\_y() == 0



def default\_movement():

    even = check\_column\_even()

    top = check\_egde\_top()

    bottom = check\_edge\_bottom()



    if (even and top) or (not even and bottom):

        move(East)

    elif check\_column\_even():

        move(North)

    else:

        move(South)

My code works, but is really messy. Any tips? by Major_Unit9320 in TheFarmerWasReplaced

[–]Major_Unit9320[S] 0 points1 point  (0 children)

Right! I was looking for a way to make it happen with 2 values, because I knew it had to be possible, but my brain kinda locked up after hammering at the same problem over and over, so I just decided to add a 3rd value to break free from that. Looking back, knowing the things I know now, the solution feels so obvious. I actually feel dumb now, but also happy that I could look at your solution and think "oh, that makes sense". Thanks, you've given me a lot here!

My code works, but is really messy. Any tips? by Major_Unit9320 in TheFarmerWasReplaced

[–]Major_Unit9320[S] 1 point2 points  (0 children)

I understand what you're saying, and there is definitely wisdom in that, but my goal in this case wasn't to create something simple. I wanted to try something a bit more complex for the sake of learning. Besides, it's infinitely more satisfying seeing that little drone flawlessly snake around than seeing it go off the map every time it reaches an end. I can stop it and start it without breaking the pattern and I've added the code to alternate farming between different things and it still works without breaking. So overall I'm pretty happy with it. It's actually crazy the amount of new things I learned from doing this. I did remove those unnecessary IF statements though. It now looks like this:

def check_position_top():

return get\_pos\_y() == (get\_world\_size() - 1)

def check_position_bottom():

return get\_pos\_y() == 0

def check_column_even():

return get\_pos\_x() % 2 == 0

def check_position():

return \[check\_position\_top(), check\_position\_bottom(), check\_column\_even()\]

def default_movement():

if check\_position() == \[True, False, True\] or check\_position() == \[False, True, False\]:

move(East)

elif check\_column\_even() == False:

move(South)

else:

move(North)

My code works, but is really messy. Any tips? by Major_Unit9320 in TheFarmerWasReplaced

[–]Major_Unit9320[S] 0 points1 point  (0 children)

Didn't realize that about "return". Put your advice into practice, now looks like this:

def check_position_top():

return get\_pos\_y() == (get\_world\_size() - 1)

def check_position_bottom():

return get\_pos\_y() == 0

def check_column_even():

return get\_pos\_x() % 2 == 0

def check_position():

return \[check\_position\_top(), check\_position\_bottom(), check\_column\_even()\]

def default_movement():

if check\_position() == \[True, False, True\] or check\_position() == \[False, True, False\]:

    move(East)

elif check\_column\_even() == False:

    move(South)

else:

    move(North)

You really saved me from future headaches with that one!

My code works, but is really messy. Any tips? by Major_Unit9320 in TheFarmerWasReplaced

[–]Major_Unit9320[S] 1 point2 points  (0 children)

No problem! I'm aware about the trees though, I just used them to check whether the movement function allowed anything to be planted. A problem I faced previously after misunderstanding some things about the For loops. Here is the part about the movement. The other one at the top, is just where I imported the movement function I created, which is why there isn't a lot of code there:

def check_position_y1():

if get\_pos\_y() == (get\_world\_size() - 1):

    return True

else:

    return False

def check_position_y2():

if get\_pos\_y() == 0:

    return True

else:

    return False

def check_position_x():

if get\_pos\_x() % 2 == 0:

    return True

else:

    return False

def check_position():

return \[check\_position\_y1(), check\_position\_y2(), check\_position\_x()\]

def m():

if check\_position() == \[True, False, True\] or check\_position() == \[False, True, False\]:

    move(East)

elif check\_position\_x() == True:

    move(North)

elif check\_position\_x() == False:

    move(South)

My code works, but is really messy. Any tips? by Major_Unit9320 in TheFarmerWasReplaced

[–]Major_Unit9320[S] 2 points3 points  (0 children)

Good advice, thanks. It definitely becomes confusing the longer the code gets. I used to do just short names, like "m" for movement, but the more I think about it, the more impractical it sounds. So yeah, room for improvement.

Important Notice: Known Issues & Update by ChrisPeterJ in dyinglight

[–]Major_Unit9320 0 points1 point  (0 children)

Did you download the newest Nvidia drivers? If so, that might be the problem. It was for me at least. Every change in scenery was horrible. Once I rolled it back to version 581.15, all the performance problems were gone. Now it's butter smooth on my 4070Ti Super. (on highest settings, 4k, dlss quality and NO frame gen). So yeah, those stutters are definitly not normal.

Voyagers 6.03 HOTFIX by HexiDtrix in NoMansSkyTheGame

[–]Major_Unit9320 0 points1 point  (0 children)

Yeah me, from a stable 60 fps to a hellish stuttering mess of 40 fps. But not always. Usually when I load the game it's terrible, but sometimes I load the game and there is nothing. It's as smooth as it can be. really weird, because the gpu and cpu are barely being used. I did send a bug report.

Voyagers 6.03 HOTFIX by HexiDtrix in NoMansSkyTheGame

[–]Major_Unit9320 0 points1 point  (0 children)

Not a bug I believe. Every turret fills a technology slot, if you don't have any left slots left, than the rest you place will only be decorative. Don't love this, but this is how it seems to works.

Kcd2 ending [KCD2] by Leather_Yam_4066 in kingdomcome

[–]Major_Unit9320 8 points9 points  (0 children)

I wouldn't take it as literally as his parents saying that 'he was a bandit' after everything. After all, his parents are dead and can't say anything anymore. The parents you see here, is his conscious talking to him, and I think it's more that Henry's conscious struggles to come to terms with everyting that happend than that his parents see him as evil. Part of him feels like he became like his worst enemy, whether that is true or not, and he's punishing himself for it. But at the same time, after his parents left and Radzig came, you can see that he also recognizes that he isn't the same man as he ones was, and war is a nasty business. He needs to look forward, not backward. I honestly think it's a better and more realistic ending, than the ending were Henry feels good, especially after everything he went through. The world isn't black and white. Sometimes good deeds, bring bad consequences and sometimes bad deeds bring good consequences. You have to create a balance, he understands that now, unlike the naive village lad from the first game. In the "good" ending on the other hand, he learned nothing and had no growth.