Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 09:35:43 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsProject Rain World
Pages: 1 ... 180 181 [182] 183 184 ... 367
Print
Author Topic: Project Rain World  (Read 1446482 times)
Nico May
Level 0
***



View Profile WWW
« Reply #3620 on: April 25, 2015, 04:50:52 PM »

Hey Joar, would you be willing to describe some of the physics involved in stuff like the tails and dangling parts of vultures and such, I haven't learned enough math yet to get to things rotating around points with gravity or anything like that, but I'm starting to want to try some stuff in my games, and google is being unhelpful. Found the simple pendulum formula, which I can at least read, if not fully understand how it works, but I'm not sure what you use. (you probably use that for the ropes at least, if so, could you explain it to me as you would a baby? I'd appreciate that;))

If you're busy that's totally understandable,
Nico
Logged

Christian
Level 10
*****



View Profile WWW
« Reply #3621 on: April 25, 2015, 05:05:49 PM »

So I had mentioned the devlog in another forum earlier today and that got mw browsing the earlier pages again. It's incredible how far the game has come and how consistent the game has stayed over the past three years. Like you had Canopy rooms already all the way back in 2012

Logged

Visit Indie Game Enthusiast or follow me @IG_Enthusiast to learn about the best new and upcoming indie games!
Woodledude
Level 0
***

What does this text field do?


View Profile
« Reply #3622 on: April 26, 2015, 12:26:11 AM »

I visit this devlog more than Youtube now.

No regrets! Hand Clap Grin
Logged

Fledgling game designer. Be prepared for walls of text with little coherency and much rambling. Thank you for your time, and tell me what you think.
jamesprimate
Level 10
*****


wave emoji


View Profile WWW
« Reply #3623 on: April 26, 2015, 03:49:48 AM »

@rainworldisawesome and tortiseandcrow: yesss thanks for the support! these 2 posts pretty much exactly sum up my feelings on the subject  Hand Metal Right

So I had mentioned the devlog in another forum earlier today and that got mw browsing the earlier pages again. It's incredible how far the game has come and how consistent the game has stayed over the past three years. Like you had Canopy rooms already all the way back in 2012



ill take this as a huge compliment! the reason for this is that pretty much all of the regions/rooms/etc were either directly inspired by or extrapolated from Joar's levels in the first alpha. He would do a room or two with a distinct look and gameplay mechanic (say the sky islands/chimney canopy look there, with the "small platforms separated by pipes and fall death" mechanic)  then move on to something else 2 rooms later. I took the most compelling ones of those little micro-regions and fleshed them out, picking apart all the ways that specific combination of game elements could be exploited, then built the larger "region" narrative to support that and give it some context.

For instance that room you posted above from the alpha exists in the current Sky Islands region. I saw that room as the top-most part of a large antennae structure, so its modified a little to fit that concept:


but then got to flesh out all the cool inbetween stuff to get to that point:


The larger scale world-building was essentially the same thing, taking these already strong looks / mechanics and hashing out what each implied about the greater world: "if this sky islands region is up in the air, whats below it? whats to the right? what is holding it up? why is it there?" etc., and then working to put it into some sort of cohesive whole. The ideal being a world map that explores all these various mechanics and does so in an exciting, comprehensible fashion.

So far so good! The only problem is knowing exactly when to quit the extrapolation engine and say "yep this is enough!" Tongue
Logged

JLJac
Level 10
*****



View Profile
« Reply #3624 on: April 27, 2015, 12:27:06 AM »

Incidentally, I just finished reading an section in a book that discusses the way maps work from an ethnographic perspective. When you're a local, the landscape is this mesh of lived experience, emotional memories, that sort of thing. A map abstracts from that lived experience to provide you with a view from elsewhere, both literally (maps are projections of the landscape from above) and culturally (locals don't need maps). Experientially and culturally speaking, a map is a tool to allow you to access an unfamiliar space without having to become familiar with it. If you do become familiar with a space via a map, your experience is mediated by the map's abstraction. The map comes to define (and thus distort, because abstraction is by definition a selective representation) the territory it describes, rather than letting the territory directly inform your experience.

So there you go. Be a local! Ethnographic theory has your back.

A really interesting read! Agreed on all points!

Hey Joar, would you be willing to describe some of the physics involved in stuff like the tails and dangling parts of vultures and such, I haven't learned enough math yet to get to things rotating around points with gravity or anything like that, but I'm starting to want to try some stuff in my games, and google is being unhelpful. Found the simple pendulum formula, which I can at least read, if not fully understand how it works, but I'm not sure what you use. (you probably use that for the ropes at least, if so, could you explain it to me as you would a baby? I'd appreciate that;))

If you're busy that's totally understandable,
Nico

The magic trick used for everything creature physics related in this game comes down to a couple of lines of code. Let's take a look:

Code:
public class Chunk{
   public Vector2 pos;
   public Vector2 vel;

   public Chunk(Vector2 initPos){
      pos = initPos;
      vel = new Vector2(0f, 0f);
   }

   //Called every frame
   public void Update(){
      pos += vel;//Apply velocity to position
      vel *= 0.98f;//Air friction
      vel.y -= 0.8f;//Gravity, with Unity's (non?)inverted y-axis. If you're using something else, flip it.
      if (pos.y < 20f){// Putting a simple floor in the simulation space so the chunks don't fall off screen when you try it ;)
         pos.y = 20f;
         vel.y = 0f;
      }
   }

}

This here is a class representing some physical object, or rather part of a physical object. I'll call it a Chunk. As you have a game with stuff that's moving around on the screen and is affected by gravity, I take it you know what's going on in this code  Hand Thumbs Up Right

Now, the magic trick! First a simplified example:

Code:
public void ConnectChunks(Chunk A, Chunk B){
   float wantedDist = 10f;
   float currentDist = Vector2.Distance(A.pos, B.pos);

   Vector2 dir = (B.pos - A.pos).normalized;

   A.pos -= (wantedDist - currentDist) * dir * 0.5f;
   A.vel -= (wantedDist - currentDist) * dir * 0.5f;
   B.pos += (wantedDist - currentDist) * dir * 0.5f;
   B.vel += (wantedDist - currentDist) * dir * 0.5f;
}

Explanaition - we want the chunks to be 10 units apart. If they are further away from each other, we pull them together by the distance needed. If they're closer, we push them away from each other.

(Small side note, I think the "(B.pos - A.pos).normalized" is correct, but it could be the other way around, haha! Try both and see what works, if you get stuff twitching out and disappearing from the screen, you have it in the wrong order.)

Ok, so let's step it up a notch. Notice that *0.5f? That means both chunks are affected equally. If we affect A more than B by the movement, it will appear as if B is heavier. Say that you add a mass parameter to the chunk class, you can do this:

Code:
public void ConnectChunks(Chunk A, Chunk B){
   float wantedDist = 10f;
   float currentDist = Vector2.Distance(A.pos, B.pos);
   float elasticity = 0.8f;
   float massFac = A.mass/(A.mass+B.mass);

   Vector2 dir = (B.pos - A.pos).normalized;

   A.pos -= (wantedDist - currentDist) * dir * (1f - massFac) * elasticity;
   A.vel -= (wantedDist - currentDist) * dir * (1f - massFac) * elasticity;
   B.pos += (wantedDist - currentDist) * dir * massFac * elasticity;
   B.vel += (wantedDist - currentDist) * dir * massFac * elasticity;
}

If A weights 1000 units, and B weights 2 units, we get a massFac of 1000 / (1000 + 2) = 0.998. If you look at the code, you'll see that this means that A will be moved pretty much not at all, and B will do almost the entire movement. This is why it takes 700 leeches to drown a vulture in rain world  Cheesy

Oh and I threw elasticity in there as well, but that's pretty straightforward.

I give zero guarantee that this is anywhere in the same galaxy cluster as approximating real physics, but it does what I want. I've heard that this technique is called "atomic bond physics" (in Swedish, don't know about English) and that makes a lot of sense, but I haven't seen it utilized much elsewhere, which is a shame seeing how it's so simple and effective.

Of course you can make it so that one of the Chunks is not affected at all, while the other do all the moving. Actually this is a good place to start - have one chunk, and lock the other connection to the mouse position, and you get a little swingy thingy to play with. In my game the creatures have a set of body chunks that affect each other, and then they have a cosmetic layer on top of that which is just connected to these, but can't pull at them - effectually a massFac of 1.0f. This means that when the creature is offscreen I can just drop the cosmetic layer (or "skin" as I've come to call it) and the actual game object will still behave the same.

A tail or tentacle in RW is a bunch of these that are connected to each other in succession.

This stuff locks two chunks to each other. If you want to turn it into a (wonky) collision physics engine, you just need to add "if (currentDist < wantedDist)" and the chunks won't pull at each other, only push at each other if they're actually overlapping.

Everything in my game is just variations and elaborations on this theme! Though honestly not very big elaborations, the majority of it is just straight up this here code. Good luck  Smiley Hand Thumbs Up Right
Logged
Woodledude
Level 0
***

What does this text field do?


View Profile
« Reply #3625 on: April 27, 2015, 12:54:02 AM »

-snip-

The magic trick used for everything creature physics related in this game comes down to a couple of lines of code. Let's take a look:

-snip-

Explanaition - we want the chunks to be 10 units apart. If they are further away from each other, we pull them together by the distance needed. If they're closer, we push them away from each other.

-snip-

So theoretically, could you modify this kind of physics simulation to hold two objects at a certain distance and position relative to each other, then change said position to move them relative to each other? I'm mostly just curious because I once had an idea that I wanted something like that for.
Logged

Fledgling game designer. Be prepared for walls of text with little coherency and much rambling. Thank you for your time, and tell me what you think.
Paul
Level 1
*


View Profile
« Reply #3626 on: April 27, 2015, 01:02:13 AM »

This is why it takes 700 leeches to drown a vulture in rain world

Evil laugh

Thanks for the breakdown, cool to see the what's behind these types of interlocking systems. Very clever too!
« Last Edit: April 28, 2015, 07:36:29 AM by Paul » Logged
oahda
Level 10
*****



View Profile
« Reply #3627 on: April 27, 2015, 01:05:13 AM »

Seeing latest message by Paul I accidentally read "Project Ron Paul".

Sequel material?
Logged

JLJac
Level 10
*****



View Profile
« Reply #3628 on: April 27, 2015, 11:16:20 AM »

Haha yes, consider it announced.

So theoretically, could you modify this kind of physics simulation to hold two objects at a certain distance and position relative to each other, then change said position to move them relative to each other? I'm mostly just curious because I once had an idea that I wanted something like that for.
Actually not even that, just a distance. To boil the entire thing one to one sentence "two points are locked at a distance" ~ that's all  Shrug

Update 418
Started skinning this little fella! Always the most fun part of my work, as the colored squares suddenly take on personality. Hope to have something to show you tomorrow!

Logged
Nico May
Level 0
***



View Profile WWW
« Reply #3629 on: April 27, 2015, 02:21:42 PM »

Really cool stuff Joar, thanks(: I'll do a proper read through tonight but looks more straight forward then I expected, last couple days I did a bunch of googling and learned about the pendulum physics formula, made a really basic chain out of a ton of linked pendulums, it's wonkey and looks bad but it almost works, and I learned a lot doing so. It also stretched my current math knowledge too which was good(:

Thanks for the in depth explanation, (:
Nico
Logged

Christian
Level 10
*****



View Profile WWW
« Reply #3630 on: April 27, 2015, 02:37:27 PM »

Haha yes, consider it announced.

So theoretically, could you modify this kind of physics simulation to hold two objects at a certain distance and position relative to each other, then change said position to move them relative to each other? I'm mostly just curious because I once had an idea that I wanted something like that for.
Actually not even that, just a distance. To boil the entire thing one to one sentence "two points are locked at a distance" ~ that's all  Shrug

Update 418
Started skinning this little fella! Always the most fun part of my work, as the colored squares suddenly take on personality. Hope to have something to show you tomorrow!

Aw, looks cute. Although, the shape of the head and such reminds me a bit of the slugcat pups.
Logged

Visit Indie Game Enthusiast or follow me @IG_Enthusiast to learn about the best new and upcoming indie games!
RainWorldIsAwesome
Level 0
**

Rain


View Profile
« Reply #3631 on: April 27, 2015, 03:52:49 PM »

So from a level design view I was wondering if those weird neon characters that looked somewhat japanese are gonna be in this version of the game as well, I really liked em'
Logged

Felius Limax
Venator Lacertae
Nico May
Level 0
***



View Profile WWW
« Reply #3632 on: April 27, 2015, 05:03:28 PM »

If A weights 1000 units, and B weights 2 units, we get a massFac of 1000 / (1000 + 2) = 0.998. If you look at the code, you'll see that this means that A will be moved pretty much not at all, and B will do almost the entire movement. This is why it takes 700 leeches to drown a vulture in rain world  Cheesy

Wait, does that mean that when creatures grab other creatures you literally just connect their chunks? that's super cool (or you could just be generalizing, if so nvm). Also just got home and properly read it, all very simple and well explained, thank you immensely! And apologies if my earlier response sounded weird in any way, I always find I come accross differently when trying to type on a phone lol. My serious concern at this point, now that you've given me the power, is how to avoid infringing on you when our games already share similar ascetics, and I can't help but use this new knowledge for something. You may have to be firm, if so I will respect it;)
Logged

compostface
Level 0
***



View Profile WWW
« Reply #3633 on: April 27, 2015, 07:13:45 PM »

Hmm... I have a hard time imagining something like that actually being a problem, Nico.  I'm not worried.
There is no way you/we could accidentally replicate the amount of work that has gone into Rain World.  Even if we were trying it wouldn't happen.  Our aesthetic is also similar as to a bunch of other games, as Rain World is in turn similar to other games.  

It's just the nature of making things while having an internet connection and eyes in your head.

edit// Plus our game just being very young, we should let it grow and explore without worry at this point. It's still a baby :p

edit, edit//Plus Rain World being just that much more interesting /shrug
« Last Edit: April 27, 2015, 08:02:10 PM by compostface » Logged

Nico May
Level 0
***



View Profile WWW
« Reply #3634 on: April 27, 2015, 07:49:09 PM »

Hmm... I have a hard time imagining something like that actually being a problem, Nico.  I'm not worried.
There is no way you/we could accidentally replicate the amount of work that has gone into Rain World.  Even if we were trying it wouldn't happen.  Our aesthetic is also similar as similar to a bunch of other games, as Rain World is in turn similar to other games. 

It's just the nature of making things while having an internet connection and eyes in your head.

edit// Plus our game just being very young, we should let it grow and explore without worry at this point :p

edit, edit//Plus Rain World being just that much more interesting /shrug

Heh, I should be more clear, not really worried, it'd take me decades to come close to rainworld;) anyway end of side discussion, keep up the amazing work Joar and James!

Nico
Logged

JLJac
Level 10
*****



View Profile
« Reply #3635 on: April 27, 2015, 10:08:58 PM »

@RainWorldIsAwesome, yes, most certainly!

@NicoM, yep a creature grabbing another creature is just a temporary connection between chunks!

@NicoM and compostface, go right ahead, the world is big enough for both of us Smiley Also, I actually don't think our games are that similar, you guys certainly have your own style. Rain World basically started out as an attempt to rip off Lyle in Cube Sector, but took its own turns. If you have some sort of artistic urge you can't really truly rip something off, you'll always make it your own and that makes ripping off a really good starting point! Another big inspiration for me is Tsutomu Nihei's stuff, such as BLAME and Biomega, you should definitely check that out if you haven't - I think it might actually be even more relevant to you guys' project than it has ended up being to this one. This is the best part of the internet, inspiration and ideas flowing all over the place!
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #3636 on: April 28, 2015, 06:19:22 AM »

NIHEI ... wooo, great taste
TO be frank I was also thinking a lot about "another world"/"out of this world" by Eric Chahi
Logged

JLJac
Level 10
*****



View Profile
« Reply #3637 on: April 28, 2015, 01:13:31 PM »

Update 419

A first look at the lantern mice!

Entering lantern mode:



Startled:



Full panic scurrying!

Logged
jamesprimate
Level 10
*****


wave emoji


View Profile WWW
« Reply #3638 on: April 28, 2015, 01:18:30 PM »

OMFG
Logged

lululuprimal
Level 0
**



View Profile WWW
« Reply #3639 on: April 28, 2015, 01:20:05 PM »

So cute!  Love the scampering mice!!!
Logged

Lydia Primate
[email protected]
Game music composer, singer, songwriter, performer
https://soundcloud.com/lydiaprimate1
Pages: 1 ... 180 181 [182] 183 184 ... 367
Print
Jump to:  

Theme orange-lt created by panic