Jump to content

Making a Mistborn Video Game in Unity – Physics & Math of Allomancy


Artemos

Recommended Posts

The problem is with the coins, not the buildings.

Pushing on coins in general is very slippery. Unity hates fast moving objects, so pushing off of them is going to be hard until I make them "stickier" while being pushed or increase their friction.

Link to comment
Share on other sites

Huh... after playing around a bit. I think I do actually like the e^-r factor and no ANF a lot, but maybe that's just me. Feels good, though some of that may be just a matter of scale. Biggest downside of no ANF seems to be the lack of a sudden change when something becomes "anchored", as you said.

I honestly feel like the e^-v factor might be a perfect addition. First, it would solve that issue with no ANF, as it's designed to basically. I'm wondering if it might coincidentally help you with the mass issues. I don't have a problem with the 16th root fix, but the velocity factor would effectively put a cap on velocity. You can only get moving so fast by pushing on a massive anchor before your force is minuscule. I suppose this alone isn't entirely true to the books, because without mass downplayed to some degree you'd still be experiencing ridiculous accelerations for that instant.

The biggest concern would be how things work out where you have some relative velocity and still want to be able to Push/Pull effectively. For something like Pushing a coin away, it shouldn't be very noticeable. Soon it is moving so fast that lack of additional acceleration isn't remarkable. But I can imagine cases where it could maybe be an issue? Like if you're flying past a window and want to grab it and hang on. Depending how the balance works out, this might be hard to do. Difficult to say, though I'd love to see the results when you have a chance to try it out next week. :)

Edit: Might be cool to put an optional info display. Things like current altitude and velocity. Target mass and distance, etc.

Link to comment
Share on other sites

8 hours ago, Jofwu said:

The biggest concern would be how things work out where you have some relative velocity and still want to be able to Push/Pull effectively. For something like Pushing a coin away, it shouldn't be very noticeable. Soon it is moving so fast that lack of additional acceleration isn't remarkable. But I can imagine cases where it could maybe be an issue? Like if you're flying past a window and want to grab it and hang on. Depending how the balance works out, this might be hard to do. Difficult to say, though I'd love to see the results when you have a chance to try it out next week. :)

Edit: Might be cool to put an optional info display. Things like current altitude and velocity. Target mass and distance, etc.

That's a big problem with the idea. It's doesn't feel very based in natural physics for the pushes to be weaker or stronger if you're flying past a window, or your target is flying past you.

Maybe I'll make the "velocity" used in that formula actually be the component of the velocity parallel to the force of the Push. That would solve the "flying by" issue.

The optional info display is a very good idea.

Link to comment
Share on other sites

@Artemos, I haven't demo'd this thing yet (you bet I will when I can) but I have to give a tip of the hat for your thorough work here!  I've been working on a closed environment simulator/control system in my spare time for years (huge space dork), and I think I need to take a page out of your book and pick a facet and run with it to get started because your progress makes me feel ashamed of my lack thereof.  I VERY much look forward to digging into the math when I get home, though there are clearly others here way more knowledgeable about physics than I and I probably won't be of much help there.

Link to comment
Share on other sites

1 hour ago, StarrFall said:

@Artemos, I haven't demo'd this thing yet (you bet I will when I can) but I have to give a tip of the hat for your thorough work here!  I've been working on a closed environment simulator/control system in my spare time for years (huge space dork), and I think I need to take a page out of your book and pick a facet and run with it to get started because your progress makes me feel ashamed of my lack thereof.  I VERY much look forward to digging into the math when I get home, though there are clearly others here way more knowledgeable about physics than I and I probably won't be of much help there

Thank you! And you can certainly be of help by playing the game, experimenting with the physics settings, and telling me what Just Feels Right. It's one thing to argue about what crazy formulas allomancy really uses and another to learn what is the most fun and intuitive to play. Feel free to ask any questions or pose any suggestions.

@Jofwu I implemented the force-velocity relationship we discussed earlier. Essentially, the Allomantic Force is calculated, then a percentage of that is removed using the e^-v factor. The velocity used in the formula is actually only the velocity component parallel to the Allomantic Force. That way the allomancer won't have any trouble pulling on windows while they fly by or grabbing a coin flying past them. It makes sense, relativity-wise.

I feel pretty neutral on it currently. The only difference I've seen so far between this strategy and the Allomantic Normal Force is that coins thrown downward usually provide 0N of force until they hit the ground, which is the desired effect. Also, this strategy subtracts from the original Allomantic Force (because it's multiplying the AF by a factor between 0 and 1), whereas the ANF adds to the original AF (because it's adding a normal force to the AF). This is easily remedied by changing a constant factor to the whole formula.

Link to comment
Share on other sites

A few random comments.

I tried out the gamepad and it worked pretty well, but I think it would be nice if you could control burn rate (or at least put a cap?) some other way. The triggers are too sensitive to get any control over that and it's practically impossible to see "blue targets". Also, I tend to think it would make more sense for Jump to be A or Y. X feels unintuitive. I imagine A, with X for coins, would work well.

Even on mouse/keyboard, where you can set burn rate causing your target lines to highlight more, it's hard to make out the blue ones. Maybe it would be best to use green for selected targets? (alongside red) So blue for all non-selected targets and then green/red for things targeted. That would be a lot easier to distinguish I think.

I played with the new velocity setting and it seemed about right to me, but I spent too much time getting used to the gamepad controls (and I'm still not very good regardless) so I don't have strong opinions concerning gameplay yet. :)

Link to comment
Share on other sites

8 hours ago, Jofwu said:

A few random comments.

I tried out the gamepad and it worked pretty well, but I think it would be nice if you could control burn rate (or at least put a cap?) some other way. The triggers are too sensitive to get any control over that and it's practically impossible to see "blue targets". Also, I tend to think it would make more sense for Jump to be A or Y. X feels unintuitive. I imagine A, with X for coins, would work well.

Even on mouse/keyboard, where you can set burn rate causing your target lines to highlight more, it's hard to make out the blue ones. Maybe it would be best to use green for selected targets? (alongside red) So blue for all non-selected targets and then green/red for things targeted. That would be a lot easier to distinguish I think.

I played with the new velocity setting and it seemed about right to me, but I spent too much time getting used to the gamepad controls (and I'm still not very good regardless) so I don't have strong opinions concerning gameplay yet. :)

Burn rate cap on the triggers is on the to-do list.

I agree with your button choices. Now jump's on A, and throw-coin is on X. You can still throw a coin while holding down jump, which was important for making quick jumps.

Green & red for pulls and pushes is a good idea. I don't like how green fits into the aesthetic of Mistborn, though, so I may reconsider it.

I thought of something interesting for the e^-v strategy:

  • If a coin is flying away from the target, then pushes on it are weaker because its velocity is so high. In other words, something is subtracted from the original Allomantic Force.
  • What if a coin is flying towards the Allomancer? Allomancy involves a lot of symmetry and opposite forces, so I'd guess that a target with a high velocity towards the allomancer would give them a stronger push against it. Something is added to the original Allomantic Force.

When you plug velocity into the e^-v equation, the direction of the velocity vector relative to the Allomantic Force is lost. It makes sense to me to keep the sign of the velocity (relative to the AF) in the net force.

Effectively, if someone is flying at you, and you push on them, your push is much stronger. That just feels right, doesn't it? If someone is flying away from you, and you push on them, your push is much weaker. I'll add everything I'm discussing as options in the settings.

Still, one issue I have with this strategy is that it breaks the idea of having the force of the push on both the Allomancer and target being equal. If Force is a function of Velocity, and the target may be moving faster than the Allomancer, then the forces on the two will not be equal. The ANF gets around this by defining itself with only external forces - the Allomantic Force is the same for both the Allomancer and target, but if something externally pushes on either of them, they both feel that.

One problem I've discovered with the ANF is that (without adding limits) it can be negative relative to the Allomantic Force, decreasing the net force rather than increasing it. If you pull on a ball that is rolling away from you, friction and air resistance will accelerate the ball towards you. Because this drag and air resistance is pointed towards the Allomancer, the ANF would act like a push on the Allomancer. At high speeds, this friction and air resistance would be stronger than your pull, and actually knock you backwards while you tried to pull. I don't know if it's a hallmark of terrible programming or great programming. Regardless, limiting the ANF to the range of 0 to the AF sense to me, since it's supposed to be a reactionary force to the AF - just like the Normal Force due to Gravity in real life can be a range from 0 to gravity.

In general, friction, air resistance, and gravity provide ANFs to some degree in every push and pull.

There's a lot of bugs in the current build, but here's a short video of the past few days' progress.

 

In the new UI that hovers over targets, the label immediately below the target is the net force, while the two labels below that are the Allomantic Force and Allomantic Normal Force on that target, respectively. With the e^-v factor enabled, the ANF label is instead replaced with the portion of the force that is lost/gained due to the e^-v factor. Though this you'll be able to see how the ANF and e^-v factor individually contribute to the net force.

 

Link to comment
Share on other sites

17 hours ago, Artemos said:

Green & red

Definitely doesn't have to be green. Just would be nice if it was more distinct from all the other blue lines when burn rate is low.

17 hours ago, Artemos said:

I thought of something interesting for the e^-v strategy

That's a neat idea! I'm not sure it fits with the book well, because I imagine the case where a coin pushed against the wall giving you a sudden jerk holds for pulling as well. If you pulled a coin and it got stuck at something along the way to you then you get a jerk. But in this case, it sounds like the magnitude of the force would drop?

17 hours ago, Artemos said:

If Force is a function of Velocity, and the target may be moving faster than the Allomancer, then the forces on the two will not be equal.

I don't follow. It's not velocity relative to the ground, but relative to one another. Relative velocity should be the same for both.

17 hours ago, Artemos said:

new UI

Looks great! Might be nice to show the mass of an object that's in focus? This all looks really helpful, and it will be nice to see those force numbers.

Link to comment
Share on other sites

1 hour ago, Jofwu said:

That's a neat idea! I'm not sure it fits with the book well, because I imagine the case where a coin pushed against the wall giving you a sudden jerk holds for pulling as well. If you pulled a coin and it got stuck at something along the way to you then you get a jerk. But in this case, it sounds like the magnitude of the force would drop?

Very true. I like your original idea better.

1 hour ago, Jofwu said:

I don't follow. It's not velocity relative to the ground, but relative to one another. Relative velocity should be the same for both.

I was always referring to absolute velocity, not relative velocity. Using relative velocity would indeed give the target and Allomancer the same force. However, if we use relative velocity, then every push and pull that moves the Allomancer would make the target seem like it is unanchored, since the relative velocity between the two would not be zero. Nevertheless, this may be the desired effect.

1 hour ago, Jofwu said:

Looks great! Might be nice to show the mass of an object that's in focus? This all looks really helpful, and it will be nice to see those force numbers.

That's a really good idea.

Link to comment
Share on other sites

  • 1 year later...

Yeah, I made a follow-up post a year ago here. I haven't released any updates since the last one but I've been slowly working on it during the school year, and I got a lot done during my free time before starting my summer job. Here's a (WIP) shot of Luthadel during the night:

Spoiler

Capture.thumb.PNG.57f55f97c90ebd247ea52155f4676c95.PNG

I'm curious to see what you can make in Unreal. There's a lot things with Unity I don't like and I wonder if Unreal's much friendlier. Not likely to actually switch over, though.

Link to comment
Share on other sites

In my understanding of the differences between Unity and Unreal, it tends to come down to personal preferences.

I started my project with an fps in mind, and mostly push/pulling metal. So far, you control the powers with the mouse buttons, one for pushing, one for pulling, so no dynamic strength atm, and you can only control one target at a time. But. After having found a target, you lock onto that target and can turn around, looking for the next one, while still pushing, which is neat. I think next step is getting the math right and your calculations will be a great help!

Maybe I should just start a thread of my own to discuss that project... I'll also post a video on what I have there, if you're interested.

Here's the thread:

 

Edited by Spinn
Added link to project
Link to comment
Share on other sites

I think nearly all the math I'm using today is in this post, with some elaborations and simulations in the newer post I linked. If you've got questions or comments let us know.

Making your own post is a good idea since this is kind of a necro at this point. Definitely post a video.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...