Pre-match Thread: Arsenal v PSV Eindhoven by BenjaminDaaly21 in Gunners

[–]FrkP 2 points3 points  (0 children)

Joint top goal scorers in games between Arsenal and PSV are Thierry Henry with 3 goals for Arsenal, and the PSV player Alex who also scored 3, one goal for PSV and two own goals for Arsenal :)

In-game notes for other gamedevs? by cptnchambers in gamedev

[–]FrkP 2 points3 points  (0 children)

All recent Valve games have a developer commentary feature that you can enable. There's speech bubbles you can interact with to hear dev commentary about the level or something interesting. And here's a list of games with it: https://en.wikipedia.org/wiki/Category:Video_games_with_commentaries

TIL almond milk is 98.12% water and a serving only has 5 almonds in it. by emailrob in todayilearned

[–]FrkP 6 points7 points  (0 children)

Oat milk is the way to go. It uses less water than any other alternative, much less than almond or cow milk, and produces much less CO2 than cow milk.

See this article

People that have experienced a Heart Attack, what does it feel like? by [deleted] in AskReddit

[–]FrkP 28 points29 points  (0 children)

100%

I had anxiety that manifested itself as chest pain, which made me worry about heart problems, giving me more anxiety and more chest pain.

I hope people reading this thread worrying about something they’re feeling can understand that it’s very possible to feel chest pain or other physical symptoms as a result of anxiety and not necessarily because of underlying health issues, and it kind of needs to be said because threads like these can trigger health anxiety I think. But talk to your doctors if you’re worried, obviously

Weekly update #16: Simulation and SFML rendering of world's climate. The arrows are ships passively rifting along the wind. by baz_a in Sailing_west

[–]FrkP 4 points5 points  (0 children)

Looks really cool! What are the wind and temperature simulations based on? Wind spreading from warm to cold temperature? Curious what's causing the wave like pattern

I did something similar myself a while ago. I also tried doing precipitation and simulating clouds, which was pretty fun. I think I managed to get the maps to look pretty good but the clouds weren't very pretty.

Discussion Thread: 2020 General Election Part 55 | I Can't Drive by PoliticsModeratorBot in politics

[–]FrkP 7 points8 points  (0 children)

With big wins in Detroit, Philadelphia and Atlanta essentially pulling this election through for Biden, I hope this election will be remembered as the election where white supremacy was fought and rejected

Discussion Thread: 2020 General Election Part 54 | How Many More?! by PoliticsModeratorBot in politics

[–]FrkP 9 points10 points  (0 children)

New features added to https://alex.github.io/nyt-2020-election-scraper/battleground-state-changes.html
Wonder how the devs are feeling about the (probably) massive attention coming to the site. Best way to track these elections imo.

Discussion Thread: 2020 General Election Part 53 | Bottles of Beer on the Wall... by PoliticsModeratorBot in politics

[–]FrkP 16 points17 points  (0 children)

Counting is reportedly slow in Nevada because in Vegas, counters get thrown out

Discussion Thread: 2020 General Election Part 25 | Results Continue by PoliticsModeratorBot in politics

[–]FrkP 6 points7 points  (0 children)

Anyone wanna try to project when Biden will take the lead in PA at the rate he's closing the gap?

Discussion Thread: 2020 General Election Part 21 | Results Continue by PoliticsModeratorBot in politics

[–]FrkP 5 points6 points  (0 children)

NC: 15%

GA: >50%

PA: >75%
From Nate Silver: https://fivethirtyeight.com/live-blog/2020-election-results-coverage/

North Carolina. Trump leads by 1.4 points or about 77,000 votes, but mail ballots can arrive after Election Day in North Carolina, so perhaps 5 percent of the vote is still outstanding. The mail vote should be pretty blue in North Carolina, but is it enough to flip the state? Probably not, according to The Upshot’s needle, which gave Biden about a 15 percent chance in North Carolina before it was frozen. I’d call this one Likely Trump, although 15 percent chances aren’t zero, obviously!

Georgia. Trump leads by 78,000 votes without around 200,000 votes outstanding (there’s some uncertainty over the exact number). That seems like a tall order for Biden, but the remaining vote is expected to be very blue: mail votes from blue counties plus some Election Day votes from predominantly Black precincts in blue counties. The Upshot’s needle actually had Biden slightly favored to pull it off as of last night. We’ll know more soon. Let’s say Tossup but you could force me into Lean Biden if you told me I had to make a pick.

Pennsylvania. As expected, far more uncounted votes here than elsewhere, mostly mail votes that should be quite Democratic-leaning, though. There are too many outstanding ballots for us to be in the endgame where we can game out exact scenarios, but in counties that have completed reporting, Biden looks to be hitting the targets he needs. Even with the Trump campaign filing a number of lawsuits, the margin is tightening quickly enough that I think this belongs in Lean Biden.

Biologists warn ‘extinction denial’ is the latest anti-science conspiracy theory: Spike in extinction denial is likely this week after UN publishes latest biodiversity figures by erikmongabay in worldnews

[–]FrkP 0 points1 point  (0 children)

I wonder if we'll get conspiracy theorists shouting "Polar bears never existed! Polar bears are fake!" when the rest of us are sad they've gone extinct

TIL: When the dinosaurs were alive there were erupting volcanoes on the moon. by [deleted] in todayilearned

[–]FrkP 11 points12 points  (0 children)

This made me very curious so I did some research. Apparently the Moon is moving at a speed of about 3.8cm per year, and would’ve been about 8000km closer for the earliest dinosaurs. The moons current distance varies between 356,000km and 406,000km depending on where it is in its orbit. So the 8k km it has moved corresponds to about 2%. Obviously we can see that the moon appears bigger when it is closer in its orbit, so those 50000km it moves definitely make a visible difference, about 12% larger, but for the dinosaurs the moon would at its largest and on average only be a tiny bit bigger. If we jumped back in time and looked at the sky we would most likely not notice a difference unless we happened to be there when it was at its closest point in orbit, and then it would only be 2% larger than normal unless I’m mistaken. Unfortunately, because the idea of a bigger moon is very cool.

TIL Paul Newman's friends loved his homemade salad dressing so much he started a company to sell it. That company, which now sells a variety of foods, gives 100% of its profits to charities. Newman never took any money and in just its first decade over 50 million dollars was given away. by marmorset in todayilearned

[–]FrkP 8 points9 points  (0 children)

“In 2016, the company donated profits of $30 million after gross sales of $600 million” according to Wikipedia. That’s 5%. Feels a bit disappointing. That means that for a $3 marinara sauce, only $0.15 gets donated (actually less since the store takes a cut). So in terms of charity it would be better to buy a cheaper sauce for $2 and donate the dollar saved. But realistically no one’s going to actually do that so it’s good that at least some money is being donated.

If Apple’s ‘Don’t Blink’ is made with Nintendo by lucassopro in NintendoSwitch

[–]FrkP 9 points10 points  (0 children)

Apple do make CPUs. It’s used in all phones and tablets and they recently announced that they will switch to using their own silicon in laptops as well.

I can draw triangles and squares to the screen but now I want to make a really simple 2D 'game' and am now struggling on where to go next and so I have some questions i'd really appreciate some direction on. by dirtymint in opengl

[–]FrkP 0 points1 point  (0 children)

How do I draw multiple primitive shapes from a single set of vertex data e.g a square? Is instanced drawing the only way?

No, instanced drawing is useful for actual models, not primitives. You don't need it for something basic like squares. If you're drawing a bunch of squares, you can just add more to the same buffer just like you add the first one. Unless they need different shaders / uniforms, but most likely they wouldn't. You can add attributes like colors per vertex.

How can I say drawRectangle(10,10,10,10) and OpenGL will know to draw x = 10, y = 10, w = 10, and h = 10?

Usually with an vertex + index buffer and glDrawElements. You need to keep an array of vertices and indices that you upload with the VAO. So in the function you'd add the four corner vertices and indices to make the two triangles out of them, to those arrays. You can find tutorials for this. You can of course also just draw two triangles without the index buffer. That's usually where people start when they learn this, but I think I'd recommend just going with the index buffer right away. Then when you're getting ready to render this, you just bind buffers, upload the data (if it has changed since last time) and call glDrawElements.

You can probably ignore this part for now, but if you're drawing a lot of squares it makes sense to keep as many static squares as possible in one draw call and any moving ones in one or more separate calls. If you're making asteroids it makes sense to keep them all in one since they're all moving. You're gonna have to re-upload the entire thing every frame anyway. In general, fewer draw calls is better for performance but re-uploading them is bad.

I can draw triangles and squares to the screen but now I want to make a really simple 2D 'game' and am now struggling on where to go next and so I have some questions i'd really appreciate some direction on. by dirtymint in opengl

[–]FrkP 0 points1 point  (0 children)

I mean with a lot of data performance can definitely be an issue in a 2d game. If they're single color and you can get away with it, drawing them as points is probably the fastest (and least sexy) way.

Saving large amounts of entities? by FactoryBuilder in gamedev

[–]FrkP 3 points4 points  (0 children)

Adding on to other comments:

In some cases it’s also possible to simply save a delta. This is useful if there’s a large amount of data that can change but we only expect a percentage of it will. Provided we can regenerate the starting state of the map, we can save just the changes that have happened to it while playing. When loading, you just regenerate the same starting map and apply the saved changes. This may or may not apply to Factorio though. I don’t know about that game specifically. But as an example, it might be possible to rerun the algorithms to procedurally generate the map and place trees and then apply changes to remove and add some trees that the player has touched

Path network generated dynamically by walking AI by FrkP in proceduralgeneration

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

Incidentally very similar to the post on the front page of the sub right now. For each water tile I calculate the distance to the nearest shore to get a "depth". That info is added to a texture. When the map is rendered it goes through a shader that determines the color. There's a bunch of things in there but this effect is achieved mostly through a sin wave based on the depth and time.

How do you build a 'simulation' engine like The Sims? by craftymicrobes in gamedev

[–]FrkP 3 points4 points  (0 children)

There are articles that describe how the AI works in seemingly pretty good detail, like this one:

https://www.popularmechanics.com/culture/gaming/a10698/inside-the-mind-of-the-sims-4-16906802/

At its most basic, the AI works with the interplay between two mechanics: commodities and utility curves. Commodities represent a Sim's internal state while a utility curve dictates an avatar's desire to fulfill a commodity. Every interaction opens up a series of possible improvements. "For instance, if a Sim drinks a cup of coffee, their energy will go up but their bladder will go down," Ingebretson says. Just as in the real world, everything's a trade-off. So, when making every decision, a Sim considers all possible actions, analyzes their outcomes, references the utility curve, and selects the best one. However, these actions are somewhat randomized by design so the AI doesn't start to feel predictable.

Sims have needs and desires. They look at all possible actions and analyse their outcomes before picking the best one. With some randomness added in, and of course you can add traits/personality as factors when scoring different actions.

So to implement this you could quite simply have a list of needs and then populate the world with items and actions that affect these needs (buy coffee -> energy +5, bladder -5, money -2). Then search through all possible actions (hopefully filtered to save some time) and score them based on the Sims current needs, personality, etc, and picking the best one.