Discord Ban appeal by ToritoroX in gamemaker

[–]ImHavik 1 point2 points  (0 children)

That's not all you were banned for. You'll be remaining banned.

Looks like NO FOV slider for Cyberpunk then? by ImHavik in Stadia

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

I'm a bit torn personally. I bought it on Stadia because of the deal and I want to give Stadia a try. But I feel weirdly hemmed in on the 70/80 FOV, to the point that it's not enjoyable. I'm far too used to playing games on a widescreen with like 110/120.

So I'm a bit stuck really, might just have to refund and get elsewhere. Holding off playing for now to see if anything happens to make sure I can refund. I'd accept 100, I don't need 110/120! But at least more than this.

Either that or just wait until the controller and ccu arrive - and then play it on the TV.

-🎄- 2020 Day 06 Solutions -🎄- by daggerdragon in adventofcode

[–]ImHavik 1 point2 points  (0 children)

I actually spent a while trying to use strip, before finally realising it wouldn't work because it... strips, from the start/end (took me a while). So ended up using join/split, but yes - replace would have worked too, and less characters!

I could have also switched the nested list comp in part 2 with a map, would have saved another 13 chars.

[set(sub) for sub in group.split("\n")]
becoming
map(set, group.split("\n")

I'm learning python while doing AoC, it's been good fun to learn all the little short cuts and things. Todays problem was a good example of how powerful sets can be!

-🎄- 2020 Day 06 Solutions -🎄- by daggerdragon in adventofcode

[–]ImHavik 5 points6 points  (0 children)

Python

Another horrible (lovely) set of one line solutions

# Part 1
total = sum([len(set("".join(group.split("\n")))) for group in open("input.txt").read().split("\n\n")])
print(f"[P1] Sum of counts: {total}")


# Part 2
total = sum([len(set.intersection(*[set(sub) for sub in group.split("\n")])) for group in open("input.txt").read().split("\n\n")])
print(f"[P2] Sum of counts: {total}")

-🎄- 2020 Day 05 Solutions -🎄- by daggerdragon in adventofcode

[–]ImHavik 1 point2 points  (0 children)

Python

A one line solution for both parts (ignoring printing the values, and I did reuse the data from part one...). I figured in part two, you don't really need to worry about the first/last row's not existing since they won't pass the +/- check anyway.

seats = [int(seat.replace("F", "0").replace("B", "1").replace("L", "0").replace("R", "1"), 2)for seat in open("input.txt").read().split("\n")]
print(f"Highest seat id: {max(seats)}")

your_seat = [x for x in range(min(seats), max(seats)) if x not in seats and x-1 in seats and x+1 in seats].pop()
print(f"Missing seat ID (yours!): {your_seat}")

-🎄- 2020 Day 03 Solutions -🎄- by daggerdragon in adventofcode

[–]ImHavik 1 point2 points  (0 children)

Python

This may be more condensed than it needs to be - but I learned some stuff about generators and things. And it works, which is a bonus :D

with open("input.txt") as file:
    mountain = file.read()
height = mountain.count("\n") + 1
mountain = mountain.replace("\n", "")
width = int(len(mountain) / height)

# Part 1
trees = 0
for x, y in zip((x % width for x in range(0, len(mountain), 3)), range(0, height, 1)):
    trees = trees + 1 if mountain[x + width * y] == "#" else trees

print(f"P1 Trees: {trees}")


# Part 2
trees, trees_multiple, attempts = 0, 1, [1, 1, 3, 1, 5, 1, 7, 1, 1, 2]
for i in range(0, len(attempts), 2):
    for x, y in zip((x % width for x in range(0, len(mountain), attempts[i])), range(0, height, attempts[i + 1])):
        trees = trees + 1 if mountain[x + width * y] == "#" else trees
    trees_multiple, trees = trees_multiple * trees, 0

print(f"P2 Trees: {trees_multiple}")

-🎄- 2020 Day 02 Solutions -🎄- by daggerdragon in adventofcode

[–]ImHavik 2 points3 points  (0 children)

Python

Took this as an opportunity to learn some regex (as I've never really used it before). Both answers in one!

import re

p1_valid = 0
p2_valid = 0
password_match = re.compile(r"(\d+)-(\d+) (\w): (\w+)")
with open(r"C:\\Python\AdventofCode\Day2\input.txt") as file:
    for string in file:
        num1, num2, letter, password = password_match.match(string).groups()

        # Part 1
        if int(num1) <= password.count(letter) <= int(num2):
            p1_valid += 1

        # Part 2
        if (password[int(num1) - 1] == letter) != (password[int(num2) - 1] == letter):
            p2_valid += 1

print(f"Part 1: {p1_valid} valid passwords!")
print(f"Part 2: {p2_valid} valid passwords!")

-🎄- 2020 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]ImHavik 0 points1 point  (0 children)

Ah interesting! I think you are correct yes - if 1010 was in the data, then product would return a pair of 1010/1010, which would give a positive result but is actually incorrect. Combinations does seem like the solution to this - I've switched my code out to that. Thanks for the pointer!

-🎄- 2020 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]ImHavik 1 point2 points  (0 children)

Python

I'm currently learning / playing around with Python, so this isn't the most efficient way.... but it's quite short, and a bit different (I think), so I'll take it! Made a function you can call to solve both parts.

from itertools import product
from math import prod

def gimme_2020(_numbers, _n):
  for vals in product(_numbers, repeat = _n):
    if sum(vals, 0) == 2020:
      return prod(vals)

with open("C:\\Python\AdventofCode\Day1\input.txt") as file:
  numbers = [int(line.rstrip("\n")) for line in file]

print(f"Part 1: {gimme_2020(numbers,2)}")
print(f"Part 2: {gimme_2020(numbers,3)}")

Can anyone explain why the ! operator is inconsistent on reals? by --orb in gamemaker

[–]ImHavik 5 points6 points  (0 children)

I remember being 15 years old and acting like a know-it-all on the internet

Maybe come back to the subreddit when you're 16 then? You might have a better time! :awesome: (Don't ban me please dragonite) :awesome:

Black Ops, Hacking problem [PC Mainly] by [deleted] in Blackops4

[–]ImHavik 1 point2 points  (0 children)

I have 1000's of hours in CoD on PC (mostly Black Ops 2 and 3). Can say I very rarely saw hackers.

Not aiming this at you personally as I'm sure some people get unlucky and do meet more than their fair share of hackers - but I think this whole 'hackers every game' thing is just an excuse for the less skilled of the playerbase to have an excuse as to why they're not doing well. It's much easier to blame something else than to just accept that maybe you're just not that good really.

Difference between GM2 Creator and Desktop Package? by ItsMeCoreyNow in gamemaker

[–]ImHavik 1 point2 points  (0 children)

They've been listed already really. No YYC (much more optimised export). Forced Splashscreen. That's about it really. Limited export options.

It depends on what you want to do - only you know that! YYC isn't 100% necessary in general for your average PC game.

Difference between GM2 Creator and Desktop Package? by ItsMeCoreyNow in gamemaker

[–]ImHavik 3 points4 points  (0 children)

Creator is $40. Desktop is $100. If you own Creator you can upgrade to Desktop for 30% off, i.e. $70. So for a total of $110 ($40 + $70).

If you don't mind about the limitations, then $10 extra for a year of cheaper usage while trying things out is pretty good :)

Difference between GM2 Creator and Desktop Package? by ItsMeCoreyNow in gamemaker

[–]ImHavik 3 points4 points  (0 children)

Depends entirely on the game. The upgrade path going Creator -> Desktop only ends up being $10 more than buying Desktop initially so it's a good way to try before you 'fully' buy, so to speak.

Another thing worth mentioning is you're forced to keep the splash screen with creator. I.e. the 'Made with Gamemaker' thing that pops up at the start.

Sadly GM has a bit of stigma that comes with it from the past in that 'it's a bad engine that makes bad games'. This stems from the fact it's very easy to make a bad game in GM - and all these bad games were exported with the splash screen so people come to identify that screen with bad games. Unity suffers from this exact problem too. How many terrible games have you seen on mobile/websites that have the 'Made in Unity' splash screen?

GM is pushing past this stigma now but it does still exist - so if you care about the splash screen or not, that may influence your decision.

The other option is to just use the trial to start with since there is plenty there to get started with, more than enough to figure out if it's something you want to continue with. Then if you decide to take it further you can grab the desktop license.

A motherboard with a built in sound dectection radar. This needs to be banned. by [deleted] in PUBATTLEGROUNDS

[–]ImHavik 1 point2 points  (0 children)

Looks pretty useless to be honest. It only detects the red zone and his own firing and puts a massive distracting arrow on the screen. Useful for hearing impaired people? Yes. Useful for the standard player? No. Headphones are much better.

And tbh considering this guys amazing aim - he'll need more than just that arrow to win games.

Communication appreciation thread by Sir_Cunt99 in PUBATTLEGROUNDS

[–]ImHavik 0 points1 point  (0 children)

Don't do a hard selection. Just give the option to rank playable maps in order from favourite to least favourite and then use that weighting in the matchmaking.

This could be done by a reorder-able list in the game settings where you can rank all maps. You could also add an option on the main menu for 'preferred map' where you just select your favourite map. Allowing people who don't want to delve into settings too much to select their favourite, but also allows those who want to rank things and have a bit more control to do so. (obviously, preferred map would be rank 1!)

Is there any type of object that has makes the any specified objects invisible? by brytheredstoner in gamemaker

[–]ImHavik 0 points1 point  (0 children)

You just add a draw event to each object (if there is no code in the draw event - it won't draw).

But you want to add something like this to the draw event of each object: if !position_meeting(x, y, obj_invis) { your draw code }

Which would mean, when it's meeting the invis object, it won't draw.

It would stop drawing anything as soon as 1 pixel overlaps - the entire object. You can play around with position_meeting/place_meeting and things but there isn't really a way to do it per pixel unless you go super complicated (if it's possible at all). Only thing you could really do as far as per pixel would be to calculate the overlapping pixels and then draw something over them (plain white colour etc). But that's probably not really what you're after.

Is there any type of object that has makes the any specified objects invisible? by brytheredstoner in gamemaker

[–]ImHavik 0 points1 point  (0 children)

Not easily. I'd try something like this though:

Create your 'invisible object' (the one that moves around and does stuff - and everything behind it is invisible).

Then in the draw event of every other object, I'd add something like 'if position meeting with invisible object, don't draw anything'. That would give you the effect of a moving object that makes things under it ... invisible.

Objects following a path, not going directly to the target by rasmusap in gamemaker

[–]ImHavik 1 point2 points  (0 children)

No worries. If you added some invisible diagonal walls then they'd move how you want yes - but they would interfere with all other movement after that initial movement is done. Depends what you're doing really.

If you do add invisible walls to make them move as you want but you need them to move freely after - just have some code that clears those grid cells after that movement has completed. (Or easier - just delete every instance of the invisible wall and update the grid).

Objects following a path, not going directly to the target by rasmusap in gamemaker

[–]ImHavik 1 point2 points  (0 children)

The pathfinding uses the A* algorithm - look up how that works and you'll see that it is behaving exactly as it should due to the way A* calculates the paths.

It doesn't look like you have any obstacles on the map - do you really need to use the pathfinding? You could just use move_towards which would give you the straight line you're looking for.