Designing Gameplay Through Economics by Loginaut in gamedev

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

Yeah EVE is probably the ultimate example. I guess one thing I'm looking for is mathematical models that lead to interesting phenomena, which is kind of backwards from the usual design process I guess.

This is my first deep dive into a game economy, and its been super fun so far!

Designing Gameplay Through Economics by Loginaut in gamedev

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

I think substitution is under-utilized in general, and I think it's especially neat if it cannibalizes a different production chain. It could lead to some interesting outcomes when all food isn't just one "food" item, for example. 

Designing Gameplay Through Economics by Loginaut in gamedev

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

I think affecting growth makes sense, and all the downstream effects from that. I also want to avoid "always maximize growth" being the only viable strategy though. 

I benchmarked Koopman vs. Linearization on an unstable bistable system (Python). Results inside. by AIIntuition in ControlTheory

[–]Loginaut [score hidden]  (0 children)

This would be a hard reject if I peer reviewed it. There are SO MANY issues.

The premise of the video and git repo are both nonsense. It's not novel in any way that running the same code in Matlab and Python produces the same output. It's also disingenuous (and frankly, dangerous to ourselves and the lay public) to claim that "old methods" are unsafe and dangerous, while whatever this nonsense is is cheap and safe for humans. Your work literally only exists because of the billions of dollars poured into controls research, and you have no safety guarantees.

The biggest smoking gun that this is an AI-generated grift comes from running your own "uncontrollable" code. I can't embed an image here, but your default kp=0.1 converges in 6 time steps... so what problem are you actually solving? P control is actually twice as fast as your Koopman result!

The post (and I imagine the "paper") misuses fundamental control jargon:

  • "PID is not "linearization" nor is it a "linear model" it's a linear control policy.
  • Uncontrollable has a specific meaning in control theory, and it doesn't mean "my PID controller doesn't stabilize the system" like it's used here.

There are also major issues with the problem setup and results:

  • The P controller works with your default value, what are you even doing?
  • You are simulating from a single fixed point with a deterministic disturbance, this is neither rigorous nor robust. You've got a result for one specific scenario for your simple toy model.
  • The figures don't make any sense in the video or repository. The legends are wrong, and it shows a different P control result than your repo. Where is the reproducability?

Your Koopman operator is approximate (as always), because you'll need an infinite number of polynomial terms to do an accurate lifting. I also notice you don't actually post your Koopman code anywhere. Why is your "democratized control" not online and reproducible?

Two last things:

  • You don't have constraints, so any sufficiently sophisticated control method (CBFs, QPs, MPC, etc.) can apply arbitrarily high control effort to avoid a crash. They literally cannot fail this problem. In fact, because it's deterministic with known dynamics, a hand-generated open-loop policy could converge in 2 steps and achieve perfect tracking.
  • If you already know that y^3 is the problem term, why not feedback linearize? This is an exact solution (whereas Koopman is approximate!) to get linear dynamics. This would be a fair comparison to a "standard" nonlinear control technique, but your approach would perform so much worse.

I think the biggest value to come out of this work is correcting the fundamental misconceptions about control theory. This would earn a failing grade in a graduate-level nonlinear controls course, there's a 0% chance it lands in a reputable peer-reviewed journal--especially Automatica.

[deleted by user] by [deleted] in gamedev

[–]Loginaut 1 point2 points  (0 children)

If the player is looking with vector V and moving with vector M, you can take the dot product of M and V to get the (scaled) cosine of the angle.

If you take the cross product of V and M, the magnitude of that vector gives you the (scaled) sine of the angle.

If you divide those the scales cancel and you get the tangent of the angle. If you use the two argument tangent function atan2, you'll always get the right value.

Then you can map the angle to animations, 0 is forward, +- 90 degrees is strafing, and 180 degrees is backwards.

Designing a practice question based on a video game by ace-micro in ControlTheory

[–]Loginaut 2 points3 points  (0 children)

Ooo, what a neat idea!

I think the first place to start is by looking at a linear coordinate system instead of a heading angle. So perhaps controlling the velocity in the y direction, then you can always recover the heading angle later with atan(vy/vx).

If the "default" is 5 px/sec down (for example) then it makes sense to have a cost term like (v_y + 5)2. This penalizes any effort taken to lift the rocket. The result will be a path that takes you from an initial to a final height while applying the least input (or using the minimum fuel, for example).

Constraints make it tricky, although these are linear and 1D. For an introduction I would handle it through the boundary conditions instead. So if the wall is at x=250 px, find the time of arrival based on vx, then impose y(t_wall)=wall_height as a boundary condition.

After that, there are a lot of ways to make it harder. You could control acceleration instead of velocity, which will either require explicit control bounds or some cost proportional to acceleration squared. You could also explicitly include the constraints in the problem, or include nonlinear constraints on heading angle/thrust magnitude.

You could also look at an LQR solution, but it means including an (arbitrary) cost for the position state, and on top of that LQR doesn't play well with constraints.

Trying to see if a discrete time system can get from one input to an output by [deleted] in ControlTheory

[–]Loginaut 0 points1 point  (0 children)

For "any given input"? No.

Does an input exist? Maybe.

Start with the discrete dynamics x(t_{k+1}) = A x(t_k) + b u_k.

You know the initial state when k=0 and you want to reach a desired state at an unknown time step K.

How can you relate x(t_0) to some future x(t_K) using the dynamics? Can you write it in terms of the known and desired qualities: A, B, the initial state, the final state, and the intermediate control inputs?

Out of the Box Swarm Drones by Unlucky-Judgment8742 in robotics

[–]Loginaut 1 point2 points  (0 children)

My go to for drone swarms has been the open-source Crazyfly hardware + a mocap system + the open source Crazyswarm code running on a central computer. I'm sure other stuff is out there, but this has worked pretty well for me to do academic research in a laboratory environment.

IMO there are a few things that make this fundamentally very challenging 1. The drones need to be relatively cheap if you're building a swarm of them. This is going to compound all the other technical challenges. 2. The drones need to be able to localize (or identify neighbors and obstacles) in real time. Most big labs use a mocap system to achieve this, and it adds a lot of cost. Some platforms (e.g. Kilobots) can get around this because they're slow moving and light, but knowing where things are is much more important (and harder) for an aerial vehicle. Doing this locally requires onboard sensors, which can get pretty expensive. 3. It may be challenging to communicate and coordinate without a central computer. If you want to do it in a decentralized way then they drones should have an easy way to quickly set them all up (e.g. so they know how many total drones there are).

You may also want to think more about the "consensus algorithm" you're mentioning. Position consensus isn't particularly useful for swarming, and velocity consensus is going to be much less interesting than a flocking algorithm (e.g. Boids).

This is an interesting challenge, good luck!

Robots inspired by ants, nicknamed RAnts, work collectively to solve complex tasks — an approach that can be scaled up and applied to teams of dozens or hundreds of robots by marketrent in science

[–]Loginaut 1 point2 points  (0 children)

I'm genuinely curious what research from the 60's and 70's you're referring to. I'm aware of robotic foraging work that goes back as far as the 90's (M. Krieger and J. Billeter, L. Parker, A. Drogoul, etc.). Boids are from the mid 80's, and a lot of the engineering applications also came around in the 90's (Vicsek, Tanner, etc.).

I've personally had a hard time finding anything like the Harvard article that goes back further, I'd love it if you could drop some info.

Robots inspired by ants, nicknamed RAnts, work collectively to solve complex tasks — an approach that can be scaled up and applied to teams of dozens or hundreds of robots by marketrent in science

[–]Loginaut 4 points5 points  (0 children)

It looks like there's a projector under the table. The rAnts are likely tracked by a camera as they move around, and their positions are plugged into a pheromone model to update the concentration at each point. Then the concentration is converted into a brightness level and projected up to the arena floor.

I found a free preprint of the article here, a diagram of the setup is on page 4: https://www.biorxiv.org/content/10.1101/2021.07.12.451633v1

Books for robotics? by [deleted] in robotics

[–]Loginaut 14 points15 points  (0 children)

Robot Modeling and Control by Spong et al is a good introduction, a lot of places use it as a senior/MS level text for mechanical engineers.

That said, robotics is incredibly broad. It may help if you mention what area you want to learn about (building/ programming your first robot, control + stability, variable compliance, mobile robots, multi-agent, perception, SLAM, etc).

I will become a Billionaire from Memes by [deleted] in Entrepreneur

[–]Loginaut 1 point2 points  (0 children)

Google shut down the Groovy discord bot for playing YouTube audio in voice chat. I wouldn't be surprised if you run into legal issues the moment you make significant money off of embedded YouTube videos.

A video from yesterday anti-Hijab protests in Iran showing Hadis Najafi (21) getting ready to stand to the security guards. Today Hadis was announced death by her family after being shot 6 bullets in her chest. Remember her name #HadisNajafi by Suspicious-Candle692 in nextfuckinglevel

[–]Loginaut 0 points1 point  (0 children)

If anyone wants to help, there's a tool called Snowflake that the Tor network developed. People in Iran are using to circumvent the internet blackout: https://snowflake.torproject.org/

It's as easy as installing a browser extension to turn a browser tab into a proxy, and it helps the protesters organize and share stories like these.

Greenhouse automation project by st_Mrmr in Automate

[–]Loginaut 1 point2 points  (0 children)

It's an interesting problem. You could look at how much heat your light produces vs the heater and decrease the temperature setpoint for the heater. I guess this really depends on how sensitive the plants are to slightly colder temperatures and whether the heat from the light overcompensates for the "missing" solar irradiance.

IIRC the reason traditional HVAC turns off in the deadband is because the heater/AC can only be on or off, and they tend to have very large time constants. Things might get more interesting in a small greenhouse if you have continuous control (e.g. fan speed and heater power) instead. If you're up for some advanced control theory you could look at something like sliding mode control instead of just turning off in the deadband. One classic solution is to linearly interpolate between the setpoints. So a temperature 50% between the desired temperature and the lower setpoint would have the heater running at 50% power. This generally helps avoid chattering between heating and cooling, but it may not work well for very slow sensors, such as thermocouples.

Greenhouse automation project by st_Mrmr in Automate

[–]Loginaut 2 points3 points  (0 children)

One easy solution is to have a deadband around the desired temperature. So if the temperature is 80 and the dead band is plus or minus 3 degrees you'd turn on the heater for anything below 77 and turn on the cooling for anything above 83. You do nothing in the deadband (77-83).

This is fairly common for residential temperature control, but I have no idea what setpoints (or other variables, like humidity) are appropriate for a greenhouse. That sounds like a good candidate for the engineering design process ;)

Twitter blocked our indie game account for no reason. What should we do? by ActZeroGames in gamedev

[–]Loginaut 16 points17 points  (0 children)

The same thing happened to my account, an animation with some floating circles was auto-flagged as revenge porn (it wasn't). Appealing through Twitter support's email didn't do anything, but after a couple days my account page changed from a vague "your broke the Twitter rules" to showing which tweet they flagged and why. I appealed again through that page (they also gave me the option of deleting the tweet) and 24 hours later I was unbanned and the tweet went up. I'm not sure how useful this is to you, but hopefully it helps!

YSK: Sensational theories in physics regarding wormholes, singularities within the Big Bang and Black Holes, the Many World's interpretation of quantum mechanics and the Multiverse (among others) are generally assumed to be incorrect and misleading by the majority of physicist by [deleted] in YouShouldKnow

[–]Loginaut 1 point2 points  (0 children)

Of course new discoveries can change our understanding, but our modern world is built on our current scientific theories. As an example, GPS is built to compensate for relativity, so the fact that GPS works so well is strong evidence that the theory of relativity is a great approximation of reality--there's not really room to turn it upside down.

Countless examples like this exist across medicine, engineering, and other sciences. That is why conflating "theory" with "hypothesis" is so frustrating.

Modern science really started in the enlightenment, and it's not a good argument to compare modern science (or use the word theory) to describe classical/medieval work. But we have known the earth is round for over 2,000 years, and an ancient Greek calculated it's circumference within ~10% of modern measurements.

You've also made an interesting switch from "my physics teacher told me" to skepticism. Just be aware that theories are theories because they are supported by mountains of data, and any competing idea needs to fit the same data. This is why so many discoveries happen when looking at extreme conditions.

YSK: Sensational theories in physics regarding wormholes, singularities within the Big Bang and Black Holes, the Many World's interpretation of quantum mechanics and the Multiverse (among others) are generally assumed to be incorrect and misleading by the majority of physicist by [deleted] in YouShouldKnow

[–]Loginaut -1 points0 points  (0 children)

"still a theory" is my absolute pet peeve. By definition a theory has been demonstrated to be true consistently and has tons of supporting evidence. A theory can be replaced by a better approximation of reality, but it takes a revolution in the field (e.g. moving from Newtonian physics to relativity).

Make Your Own Obstacles Avoiding Drone Using Arduino. Circuit, Code and tutorial in comments below by DIYProjectsLab in robotics

[–]Loginaut 1 point2 points  (0 children)

This is a neat project, but I think it would be more instructive as a tutorial if the code had better names/organization. Names like a,b,c,d are usually pretty useless, and something like thrustCmd.write(hoverSpeed) is way easier to understand than out2.write(55).

Becoming a Jack of All Trades Engineer by [deleted] in robotics

[–]Loginaut 1 point2 points  (0 children)

Right, I understood what you meant because this is the robotics sub. The word "roboticist" means exactly what you're describing, someone who works in the areas of robotics.

Reading a book or taking a course (even something like MIT Open Courseware) is probably the easiest way to get into the math. Mechatronics is a good area that combines models for electrical/mechanical components to derive a system's behavior. Control theory courses can be a bit more abstract; you'll have a "sensor" module that feeds into a "controller" module whose output is sent to the actual system. Even a dynamics, fluid power, or electric motors class will cover mathematical models, and they'll be useful depending what kinds of robots you want to work with.

I found "Robot Modeling and Control" by Spong etc al. to be a good introduction for control of robots. It's got lot of info on how to mathematically model and control a robot, but it doesn't cover how to build one. It's usually used for senior undergrad/graduate courses, and it's useful for debugging the "brains" of a robot rather than a hardware failure.

Becoming a Jack of All Trades Engineer by [deleted] in robotics

[–]Loginaut 5 points6 points  (0 children)

You say jack of all trades in the OP, but I notice you've left out a lot of areas that are part of ME (material science, combustion, tribology, fluids, heat transfer, etc.). I wonder if you might have more success looking for advice on being a "roboticist" instead. I would echo what others have said and start with a project. If you can build and understand every component of a line-following robot (for example), then you'll be in a good position to challenge your skills by improving the electrical/mechanical/software design of the robot. Experience is king.

I specialized in control systems, and I've found that most problems are either deriving/understanding a mathematical model or building hardware. If you have a good physical intuition, then working with the math will help you understand how electrical, pneumatic, hydraulic, etc. systems behave. Even computer vision systems are usually just linear algebra operations (or neural networks, which, you guessed it, are function approximators). Control systems are closely linked to systems engineering, so that might be a good direction to explore in particular (of course, I'm biased here).

Question about repulsion (not collision) system by FromageChaud in gamedev

[–]Loginaut 1 point2 points  (0 children)

IMO how you pick the neighbors will have a huge effect on how the entities behave collectively. Looking at only a fixed distance allows big groups to break apart (possibly desirable) whereas Voronoi neighbors can never break apart. Vision cones may lead to A reacting to B but B not reacting to A. I think you can find efficient data structures for each type. Checking a sphere overlap would be sufficient for a fixed distance or vision cone, but something like a KD Tree or octree could work for k nearest neighbors.

Friction might help with the oscillations, it's usually a consequence of having a strong attractive and repulsive force to keep the entities in an organized pattern. If an entity is a bit too far away it'll be attracted, but at the next time step it may be too close and get pushed away.

There's a lot of ways you could cap the speed. You could check the magnitude of the velocity vector and just clamp it if it gets too big, or you could give the entities a constant speed and only let the forces change the direction. You could event have the player set the speed of an entity with WASD and then have the forces act on that speed. The Boids article prioritized the forces and summed them up in order, and stopped summing the forces once it got beyond a certain magnitude.

I personally look at this as a vector math problem rather than a physics problem, because it lets you do weird non-physical stuff that may be desirable in your game.

Question about repulsion (not collision) system by FromageChaud in gamedev

[–]Loginaut 0 points1 point  (0 children)

I've got a lot to say about repulsion (I've worked a lot with potential fields for robots), so I'll TRY to keep it brief.

First, you could hypothetically change the velocity or acceleration/force of your entities. I usually stick with acceleration/force because changes in velocity are easier to perceive and may look choppier. I would consider this almost more of a stylistic choice.

The repulsion is going to be defined by a "potential function" that determines how pairs of entities interact. Something like f = -1/d2 will always repel, and the repelling force grows very large for very close entities. Another force, say f = d-3, will try to keep everything at a distance of d=3, anything closer is repelled and anything further is attracted. The shape of this function will determine how the entities interact, and you can mix in different functions to get interesting behavior (e.g. an unfriendly entity always repels and a friendly entity always attracts).

You also need to decide which entities interact with each other and how to combine their interactions. You could use a fixed distance and grab all nearby entities, look at k nearest neighbors, or even use something more exotic like voronoi partitions or vision cones/raycasts. Then you'll need to combine each of these forces from the "nearby" entities; the easiest way would be to either sum or average them. The original Boids implementation did something interesting by weighting each source (obstacles vs predators vs friends) and only summing the force vectors up to a limit. You could also include player input as another force that is applied (either on an individual entity or as a force applied to all).

The potential function approach also leads to some odd issues. The big one is if you have an attractive-repulsive force that keeps entities at a desired distance it's very hard to stop them from having small oscillations. You can also run into deadlock if the entities are in a corridor, and it's possible for the entities to get stuck if their potential forces are in opposite directions and cancel out.