Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411572 Posts in 69386 Topics- by 58444 Members - Latest Member: darkcitien

May 04, 2024, 09:13:37 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsLeilani's Island
Pages: 1 ... 27 28 [29] 30 31 ... 67
Print
Author Topic: Leilani's Island  (Read 412315 times)
Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #560 on: June 06, 2017, 04:41:51 AM »

Hey !
this game is high on my "want to play list"!
I was wondering: how do you make the levels ? have you programmed a level editor ?
One of the thing that keep me on Unity is the fear of the lack of tool.

Thanks! For level editing I used Tiled, which was recently updated to version 1.0. It's a great level editor for 2D tile-based games.

I wrote a little about how I make use of the editor here.
Logged

qMopey
Level 6
*


View Profile WWW
« Reply #561 on: June 06, 2017, 01:08:29 PM »

What do you use to load Tiled output? Do you do any kind of conversions after loading?
Logged
Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #562 on: June 08, 2017, 04:13:48 AM »

What do you use to load Tiled output? Do you do any kind of conversions after loading?

The Tiled map files are XML so I use an xml parser (tinyxml I think) and just read all of the info that I need out of the file.

I do some kinds of conversions on the data, for example I have a systems where I can paint a single tile in the editor and the game will automatically replace it with walls / floor / ceilings as appropriate.
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #563 on: June 11, 2017, 07:16:01 AM »

Aloha everyone! Now the festival is all over, it's time to get back to normal with a proper devlog.

Firstly let's look at...

Work Schedule

Where I divide my tasks into months to try and give myself something to focus on.

MonthTaskDescriptionOutcome
NovemberGameplay mechanicsSuccess
DecemberLevel designSuccess
JanuaryAudio monthSuccess
FebruaryGameplay mechanicsPartial Success
MarchCharacter monthLeilani's animations and antagonist designFail. Continued mechanics instead.
AprilLevel designSuccess
MayTheming monthWork on backgrounds, tilesets, foliage.Partial - worked on some of this as part of the NGF prep.
JuneLevel design
JulyTechnical monthSprite packing, optimisations, etc.
AugustMap monthFirst bit of work on the overworld map!

It was a shame not to get into the character stuff in March, but other than that things are going ok. And all the polish, bug fixes and playtesting I did in May in preparation for the festival was well worth the time spent.

We're part way into June and I haven't started any level design yet. After focusing on the festival for quite a while I'm eager to get back into all aspects of the game. I think for the rest of the month I'm going to focus on new mechanics, new theming, and level design, for a single new level. It'll do me good to see some new things go into the game rather than just putting more levels together using the existing mechanics.

Moving Platform Improvements

So, for the new level I'd like to focus it around some moving platforms. The game has technically supported moving platforms for a while (example from 2015) but they've always been a little wonky, especially when moving horizontally.

I added this big test block that moves sideways and ironed out some issues. Wall-sliding and wall-jumping were very fiddly, and there were some weird things going on with Leilani's velocity that made her unresponsive when she was standing still while the wall pushed her. Now it's working pretty well!



One thing you may notice here is that when Leilani jumps, she's stationary relative to the world, not relative to the block. Since I didn't press forward on the controller, Leilani ends up falling off the back of the platform after a couple of jumps.

By adding the platform's velocity to Leilani's when she stops standing on it, she continues moving to the right in the air, so she more naturally keeps up with the block.



From what I can remember, in recent Mario games I think this kind of realistic way of inheriting the platform's velocity is turned on or off for individual platforms, depending on what kind of platform it is. I would have to go back and play the games to double check. But, I have both behaviours available to me now, so I can use whichever works best.

The velocity inheritance works for enemies too, so you can bounce this enemy around the platform quite reliably without it just falling off the back.



And the velocity inheritance makes jumps like this easier; no more difficult than jumping between two stationary platforms.



Next time I hope to show the gameplay mechanic that I plan on including in the new level I'm working on.

Thanks for reading!
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #564 on: June 11, 2017, 10:07:12 AM »

I did a little research on New Super Mario Bros 2's moving platforms. Here's a really low quality video.





It seems like in general, large slow moving platforms that the player is supposed to ride on for a while have the velocity inheritance property. Smaller moving platforms and blocks don't have it - maybe since they are changing speed so often it would feel weird, or maybe it makes it easier to time your jumps off these small moving platforms.
Logged

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #565 on: June 11, 2017, 10:27:25 AM »

This is the kind of detail I like reading about in devlogs. Good job!
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #566 on: June 12, 2017, 02:14:12 AM »

Moving platforms and platform games. I'm surprised there aren't more blog-posts about that out there, actually, it's a really tricky problem I think
Logged
io3 creations
Level 10
*****



View Profile WWW
« Reply #567 on: June 12, 2017, 11:42:29 AM »

Coffee
Quote
The game fared very well in terms of stability

Oh god, I can imagine the stress... single developer, no Q&A team to help you out
A great developer is a one-man Q&A team. Smiley
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #568 on: June 12, 2017, 01:04:40 PM »

Moving platforms and platform games. I'm surprised there aren't more blog-posts about that out there, actually, it's a really tricky problem I think

Yeah, it's very interesting! In fact I felt inspired to go into more detail about how my system works. It's not perfect, and what I've written here is probably an oversimplification of the little niggles and edge cases of my code, but on the whole this is how the platforms basically work.

Platform Parenting

When Leilani (or any other object) lands on a platform, the platform entity becomes her parent. As the parent, the platform is always updated before Leilani is, so when Leilani updates the platform has already done its movement for that frame.

When Leilani is stationary on a platform, her velocity is actually zero, even though relative to the rest of the game world she is moving. This is so the movement code can work the same both on platforms and on solid ground - if the player stops pressing buttons, Leilani decelerates to zero velocity, which means she's standing still relative to what she's standing on.

So when Leilani's entity updates, let's say her xVelocity is 5.0, and the timeStep (length of the frame) is 0.016. The Leilani entity will move to the right by (xVelocity * timeStep), which is 0.08. But, the parent platform moved a distance of 0.05 this frame (remember the parent platform is guaranteed to have been updated by this point) - this gets added to Leilani's movement too. So in total she will move a distance of 0.13.

Leilani's collisions are then handled as normal, using her total movement this frame, so the platform could carry Leilani into a wall or a platform and she'll collide with it correctly.

   

Parenting and Velocity Inheritance Examples

Let's look at a couple of examples, using debug info to see velocities!



Here we can see orange boxes which outline each entity. (Ignore the jiggly box hovering around Leilani, this entity handles the bubble sprite for the water powerup.) The yellow line drawn down the middle of Leilani's box indicates when she is standing on the platform, at this point the platform is her parent object.

1. Initial she's standing still. Her velocity is zero.
2. She jumps - so the platform is no longer her parent. At the moment of jumping she inherits the platform's velocity of 1.88, so she moves at the same speed through the air. In this game there's no automatic mid-air deceleration.
3. She lands on the platform again. At the moment of contact, the platform's velocity is taken away from hers - resulting in her returning to zero.
4. She can run at max speed (5.00) on the platform.
5. When she runs off the edge, she loses contact with the platform, and once again inherits the platform's velocity. Now she's moving at 6.88, faster than normal!
6. Once she lands on the floor, she can't maintain the running speed, and decelerates back to 5.00.
7. I let go of the controls, she decelerates to 0.



This example features some rolling!

1. Max rolling speed is 7.50.
2. When Leilani rolls into a wall, she slides down it. Notice at this point the horizontal yellow line indicates that the platform is her parent, but she's colliding with the side of it, not standing on top of it. For most purposes this doesn't make any difference to standing on top of a platform; the relative velocity and movement works the same.
3. While sliding her xVelocity is 1.0, this is just to ensure that she stays safely stuck to the wall.
4. She jumps off the wall. Normally this would set her velocity to -7.50, her maximum rolling speed. However, the platform's velocity of 1.88 is taken off, so she travels more slowly.
5. She slides down the opposite wall, then jumps off again. This time, yep, she travels faster because of the velocity inherited from the platform on the left. New speed is 9.38.
6. She lands on top of the platform on the right. Her velocity reduces to 7.50, the normal max rolling speed, because that's the speed she's moving relative to the platforms.
7. Finally she inherits velocity again when leaving the platform and lands on the floor. This time, because she's rolling, she can maintain a higher-than-maximum speed. One of the advantages of rolling Smiley

So when Leilani inherits velocity from a platform, or loses velocity when landing on a platform, she's not actually moving any faster or slower - it's more like it's converting between world-relative and platform-relative velocity.
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #569 on: June 13, 2017, 01:57:49 AM »

That sounds like a good way to get intuitive "momentum" without frustrating the players Coffee

And exploiting moving platforms to roll faster than the usual maximum speed will be a lot of fun, I think you should keep that in Smiley
Logged
Photon
Level 4
****


View Profile
« Reply #570 on: June 13, 2017, 11:36:47 AM »


A little late on this one, but I was catching up on the devblog and I just wanted to say how amazing this cliffside theme looks. It fits the whole island motif really well and is just all around great to look at. Nice work with the clouds too.
Logged
io3 creations
Level 10
*****



View Profile WWW
« Reply #571 on: June 13, 2017, 02:17:45 PM »

It's interesting to see your approach to handling the moving platform.  Reminds me of some of my attempts at handling collisions ... up to the point when there were more edge cases that I was interested in dealing with and changed to box2d. Grin

Interestingly, while probably not the best way, using friction to keep stationary characters "stuck" to platform worked.

But as I'm looking into 3d platforms and other criteria, that approach won't work (plus according to a few answers on Unity forums, the friction approach doesn't seen to work anyways).  Based on your idea, I was thinking of actually parenting the character to the moving platform.  However, if the platform is scaled, then the character will also inherit those scale values.  Might not be an issue for now but I still prefer a general approach - especially if other characters are on the platform or grabbing on to the side of the platform.
Logged

TheGrandHero
Level 1
*



View Profile WWW
« Reply #572 on: June 14, 2017, 04:01:22 AM »

Based on your idea, I was thinking of actually parenting the character to the moving platform.  However, if the platform is scaled, then the character will also inherit those scale values.

Have the character inherit the parent platform's position and rotation, but not its scale.
Logged

io3 creations
Level 10
*****



View Profile WWW
« Reply #573 on: June 14, 2017, 10:27:35 AM »

Based on your idea, I was thinking of actually parenting the character to the moving platform.  However, if the platform is scaled, then the character will also inherit those scale values.

Have the character inherit the parent platform's position and rotation, but not its scale.
Is there a way to do that in Unity with a single line of code?  I mean, by parenting I was referring to:
Code:
object2.transform.parent = object1.transform;  
I haven't seen a way to disable scale inheritance that way. 

Of course, the only alternative is to "inherit" the position and rotation in each frame.
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #574 on: June 14, 2017, 12:40:32 PM »

A little late on this one, but I was catching up on the devblog and I just wanted to say how amazing this cliffside theme looks. It fits the whole island motif really well and is just all around great to look at. Nice work with the clouds too.

Thank you Smiley

Interestingly, while probably not the best way, using friction to keep stationary characters "stuck" to platform worked.

But as I'm looking into 3d platforms and other criteria, that approach won't work (plus according to a few answers on Unity forums, the friction approach doesn't seen to work anyways).

Friction seems like a sensible solution as of course friction is what would keep you on a moving object in real life. Although I don't have a lot of experience with 3D physics, so I don't know how reliable using friction would be for stuff like this. How come people say using friction doesn't work?

Based on your idea, I was thinking of actually parenting the character to the moving platform.  However, if the platform is scaled, then the character will also inherit those scale values.

Yeah my version of "parenting" in my code is a pretty loose concept (it basically just controls update order and relative movement) so I don't have any issues with accidentally inheriting things that way.

My Unity knowledge is very limited. If the platform's visual model needs to be scaled, could you put that model on a child object of the main platform object and then scale that child? Then the scale wouldn't affect the platform's other children.
Logged

io3 creations
Level 10
*****



View Profile WWW
« Reply #575 on: June 14, 2017, 01:20:26 PM »

Yeah my version of "parenting" in my code is a pretty loose concept (it basically just controls update order and relative movement) so I don't have any issues with accidentally inheriting things that way.

My Unity knowledge is very limited. If the platform's visual model needs to be scaled, could you put that model on a child object of the main platform object and then scale that child? Then the scale wouldn't affect the platform's other children.
Yes, that's the recommended answer here: http://answers.unity3d.com/questions/12083/how-to-get-a-character-to-move-with-a-moving-platf.html

But I wonder if that approach would work well for a 3d platformer with rotating platforms since now character's movement would be relative to the platform's coordinate system and not the world.  Will test it later to see.
Logged

Louard
Level 2
**


View Profile WWW
« Reply #576 on: June 16, 2017, 08:47:02 PM »

Yeah my version of "parenting" in my code is a pretty loose concept (it basically just controls update order and relative movement) so I don't have any issues with accidentally inheriting things that way.

My Unity knowledge is very limited. If the platform's visual model needs to be scaled, could you put that model on a child object of the main platform object and then scale that child? Then the scale wouldn't affect the platform's other children.
Yes, that's the recommended answer here: http://answers.unity3d.com/questions/12083/how-to-get-a-character-to-move-with-a-moving-platf.html

But I wonder if that approach would work well for a 3d platformer with rotating platforms since now character's movement would be relative to the platform's coordinate system and not the world.  Will test it later to see.

Indeed, parenting to a rotating platform would, likely, be bad news. Probably best to mimic parenting in your own code. I use the old Character Motor script in Suzy Cube and it handles most tricky collision situations quite well. It has its downsides too, so I'm not 100% sure I would recommend it, but it could be a good learning tool for handling that tricky stuff like moving platforms, slopes etc.
Logged

-Louard
louardongames.blogspot.com
Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #577 on: June 17, 2017, 01:14:58 PM »

I said last week that I'd start putting together a level using a new mechanic. That didn't happen, I was still too excited about the moving platform improvements and decided to make some more! The systems I've worked on will go a long way to providing some variety throughout the game.

Paths

The first thing I added was paths. In Tiled I now have a "Paths" layer. Any shapes that I add to that layer (the left hand side of the image below) get loaded into the game as paths (visible in the game's debug view in the right hand side of the image).



You may notice that the rotated ellipse was the wrong size and shape after being loaded into the game... I've fixed that already. Smiley

Putting Objects on Paths

I next added the ability for any game object to be put on a path:



This image shows some of the different animation options I currently have for the path movement. Starting from the bottom:
  • Linear looping
  • Linear ping-pong
  • Smooth ping-pong
  • Linear looping, with start and end pauses
  • Smooth ping-pong, with start and end pauses
  • Linear loop, only using part of the path (useful for using a segment of a circular path)

It seems like most game objects are happy to be locked to a path. Here's a fun experiment:



Tile Chunks

Finally, I did a big refactor of my tile map code which allows me to easily handle loading, drawing and collision for additional tile maps. So in the editor I have a new tile layer called "Chunks" and I draw some tiles on it. Then I draw a box around it... and the tiles inside the box get turned into a separate tile map, and attached to a game object.

Here's an image of my first tile chunk. It's just a random shape. But it moves along the path and the collisions work pretty well! (I have a few bugs to iron out though).



Everything combined

I spent some time testing out various capabilities of the new systems...



Really excited to have all this up and running! I think I can make use of these systems to create more level variety without needing a large amount of hand made features specific to each level. And it should also be useful for creating fun little bonus rooms and things hidden in the levels.

Thanks for reading Coffee
Logged

Ashedragon
Level 2
**



View Profile WWW
« Reply #578 on: June 17, 2017, 04:08:02 PM »

That looks absolutely incredible! I'm even more excited now.
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #579 on: June 20, 2017, 06:25:25 AM »

I said last week that I'd start putting together a level using a new mechanic. That didn't happen, I was still too excited about the moving platform improvements and decided to make some more! The systems I've worked on will go a long way to providing some variety throughout the game.

Paths

The first thing I added was paths. In Tiled I now have a "Paths" layer. Any shapes that I add to that layer (the left hand side of the image below) get loaded into the game as paths (visible in the game's debug view in the right hand side of the image).



You may notice that the rotated ellipse was the wrong size and shape after being loaded into the game... I've fixed that already. Smiley

Putting Objects on Paths

I next added the ability for any game object to be put on a path:



This image shows some of the different animation options I currently have for the path movement. Starting from the bottom:
  • Linear looping
  • Linear ping-pong
  • Smooth ping-pong
  • Linear looping, with start and end pauses
  • Smooth ping-pong, with start and end pauses
  • Linear loop, only using part of the path (useful for using a segment of a circular path)

It seems like most game objects are happy to be locked to a path. Here's a fun experiment:



Tile Chunks

Finally, I did a big refactor of my tile map code which allows me to easily handle loading, drawing and collision for additional tile maps. So in the editor I have a new tile layer called "Chunks" and I draw some tiles on it. Then I draw a box around it... and the tiles inside the box get turned into a separate tile map, and attached to a game object.

Here's an image of my first tile chunk. It's just a random shape. But it moves along the path and the collisions work pretty well! (I have a few bugs to iron out though).



Everything combined

I spent some time testing out various capabilities of the new systems...



Really excited to have all this up and running! I think I can make use of these systems to create more level variety without needing a large amount of hand made features specific to each level. And it should also be useful for creating fun little bonus rooms and things hidden in the levels.

Thanks for reading Coffee
That looks absolutely incredible! I'm even more excited now.

So uh... after releasing Leilani's Island, are you going to release Leilani Maker, a platform-making tool that will spawn a crazy community of Kaizo Leilani levels? Tongue

EDIT: Pagination, quoted last two posts so they won't disappear
Logged
Pages: 1 ... 27 28 [29] 30 31 ... 67
Print
Jump to:  

Theme orange-lt created by panic