« Forum Index < Platformers Board | DroidFreak36 |
HATPC Reborn Dev
Age: 30 Karma: 200 Posts: 491 Gender: Male Location: droidfreak36.com pm | email
|
I'm thinking of making a few changes to water physics in HATPC Reborn and I was wondering what you guys think of them and if you have any suggestions for other changes:
(1) Air pockets totally block water
In HATPC, air pockets don't completely prevent water from flowing into a tile, they just make the water stop at 2/8 full in that tile. I propose changing that so that water will not flow through air pocket tiles at all, so they act more like secret area does to water now.
(2) Water level only fills connected space
In HATPC, the water level tile fills all spaces below that point in the level. I propose changing it (or introducing an alternative water level tile) that fills only tiles that are connected to it. You'd be able to have multiple of these in your level so you could fill different chambers to different depths.
(3) 16 water levels per tile instead of 8
In keeping with HATPCR's faster tick rater, water taps would fill spaces much faster if they filled 1/8 of a tile per tick, so I think I'll increase the resolution of water levels to 16 levels per tile rather than 8. I think I'll be able to work out the animation kinks to make this look pretty good.
Quote: Rictory for Ralkyon!
HATPC Reborn home page | | canadianstickdeath |
Age: 35 Karma: 350 Posts: 2990 Gender: Male pm | email
|
I think air pockets probably look better when they do allow a bit of water into them? ... Except when you try to stack air pockets on top of one another. So perhaps what I would do is check if the tile below is an air pocket, and change whether a small amount of water is allowed in based on that.
Water levels should have an animated surface to the left of their placement. At the least I would change it to work like that rather than starting with the animated surface at where you place the water level. How do you plan to implement your idea? What about having water levels work the same as they do now, and adding the ability to have water taps run a certain amount before level start? Currently if you wanted to do something like this in HATPC you have to have them laggily break a bunch of water crates before they can get started on the level. And you could achieve a similar effect to what you're suggesting without having to change the mechanics too drastically.
I'm fine with 16 ticks as long as it doesn't cause taps to lag twice as hard as they currently do. :p
I would also want to fix the glitch where taps keep filling up through the walls after the room is totally full and they have nowhere else to go. Running taps in HATPC never really stop unless you send them off the top or bottom of the map. And I wonder if you could have the water trail left behind by a stopped tap dry up... | | DroidFreak36 |
HATPC Reborn Dev
Age: 30 Karma: 200 Posts: 491 Gender: Male Location: droidfreak36.com pm | email
|
"Water levels should have an animated surface to the left of their placement. At the least I would change it to work like that rather than starting with the animated surface at where you place the water level."
Well, yeah. Obviously that's a bug I won't be porting over.
As for how I plan to implement the water level idea, it's simple really, just have a recursive script fill the region, stopping when it hits walls/air pockets and when it would go above the desired height. I already have the code in place for it:
Code: scr_fill(i, j, fill_height):
if(global.water[argument[1], argument[2]] = 0)
{
if(argument[1] > argument[3])
{
global.water[argument[1], argument[2]] = 16
scr_fill(argument[1] - 1, argument[2], argument[3])
}
else
{
global.water[argument[1], argument[2]] = 8
}
scr_fill(argument[1] + 1, argument[2], argument[3])
scr_fill(argument[1], argument[2] - 1, argument[3])
scr_fill(argument[1], argument[2] + 1, argument[3])
}
That stops on walls and air pockets because they have global.water[i, j] set to -1 (not zero) and it doesn't repeat itself on the same tile multiple times because any tile that's already been filled has global.water[i, j] set to 8 or 16 (also not zero).
As for making water taps not lag and making them stop when they have nowhere to fill, that just depends on my implementation, but I'd say that I can do both.
As for making a tap dry up when it stops, I don't really see a situation where that would come up, because if a tap is stopped wouldn't it by definition have filled the entire level, leaving no space for water to flow? I mean, I can have stops actually stop if they run off of the level, but I don't want them to look like they've stopped unless the level is full.
Quote: Rictory for Ralkyon!
HATPC Reborn home page | | Yaya |
Age: 29 Karma: 747 Posts: 5367 Location: Ohio (US) pm | email
|
Would it be possible to make it impossible for Hannah to get stuck in terrain while swimming or jumping up into air pockets? That might be one of those things that sounds reasonable to me, but in actuality would be super difficult to implement, idk. Just throwing it out there.
COMING SOON: A giant meteor. Please.
Give me +karma. Give me +karma. | | canadianstickdeath |
Age: 35 Karma: 350 Posts: 2990 Gender: Male pm | email
|
"just have a recursive script fill the region, stopping when it hits walls/air pocket"
This still sounds exactly like a water tap that fills up to a certain point prior to level start. You're essentially making water levels work like taps, not exactly, but pretty close. So I think it could make more sense to keep water level as a water level and modify taps to suit that purpose instead. Maybe on a per-tap basis you could set whether it runs during the level or not, and how many ticks it should run prior to level start.
"As for making a tap dry up when it stops, I don't really see a situation where that would come up"
Break a water crate before breaking a water tap crate in a level that has a water tap crate. | | DroidFreak36 |
HATPC Reborn Dev
Age: 30 Karma: 200 Posts: 491 Gender: Male Location: droidfreak36.com pm | email
|
Quote: "As for making a tap dry up when it stops, I don't really see a situation where that would come up"
Break a water crate before breaking a water tap crate in a level that has a water tap crate.
Oh, right. I forgot about water crates. I'll see what I can do about that. Should be doable.
Quote: "just have a recursive script fill the region, stopping when it hits walls/air pocket"
This still sounds exactly like a water tap that fills up to a certain point prior to level start. You're essentially making water levels work like taps, not exactly, but pretty close. So I think it could make more sense to keep water level as a water level and modify taps to suit that purpose instead. Maybe on a per-tap basis you could set whether it runs during the level or not, and how many ticks it should run prior to level start.
That sounds to me like a really complicated way to do what I want to do in a simple way. And it's not really like running a water tap, because:
(1) This involved a lot less processing because the game iterates over every tile in the region once, not 8 or 16 times like a tap would, and the iterations are simpler as well. A poorly coded system for water taps would do as much processing as I'm doing to fill the whole region in every tick. Not that I'm planning to code them that badly, but you get the idea - water taps have to iterate over multiple tiles on every tick (or otherwise do fancy processing) to decide where to place the water, my fill script iterates once over every tile in the region and that's it. Trying to iterate over a large region instantaneously with a water tap would cause significantly more lag. Maybe not much, but a bit.
(2) Doing it that way requires taps to be placed filling bodies of water. If a level creator wants a body of water that doesn't have a tap placed above it, that method doesn't work.
If you have a problem with me replacing the vanilla water level tile, I can always implement a new tile that fills the connected region.
Quote: Would it be possible to make it impossible for Hannah to get stuck in terrain while swimming or jumping up into air pockets? That might be one of those things that sounds reasonable to me, but in actuality would be super difficult to implement, idk. Just throwing it out there.
I've done a pretty good job of preventing Hannah from clipping into walls thus far, and I plan to keep it that way.
Quote: Rictory for Ralkyon!
HATPC Reborn home page | | aych bee |
when i am king
Age: 104 Karma: 147 Posts: 1002 Gender: Female Location: you will be first against the wall pm | email
|
Dear Santa DroidFreak,
Please create a LAVA option for water with the hexcode of #FF0000
Yours sincerely,
A very good child
| | krotomo |
The Shepherd
Age: 23 Karma: 249 Posts: 4066 Gender: Male Location: My chair pm | email
|
Not gonna lie, lava would be pretty cool.
I agree with the idea of having two water level tiles, one that fills up a certain area and one that fills up the entire level. It allows for many more possibilities than only have one water level + water taps, but I would also like being able to fill the entire level without having to use several tiles. | | canadianstickdeath |
Age: 35 Karma: 350 Posts: 2990 Gender: Male pm | email
|
I would also like FF00FF death water, thanks. >_>
The vanilla water level is the only way to put water into a room which is already completely filled with other things.
The struggle of getting water taps to be exactly where you need them... Once you put something down, it's very difficult to make anything in the way of a significant change without screwing the whole level up. Maybe that being difficult is part of the 'fun' of making those kinds of levels idk. A way to prefill the stage a bit would have helped a bit with that I guess.
(Or maybe we should ditch all of these ideas and have a 2nd layer where you manually place the water exactly how you want it.) | | DroidFreak36 |
HATPC Reborn Dev
Age: 30 Karma: 200 Posts: 491 Gender: Male Location: droidfreak36.com pm | email
|
I have a better idea for implementing new water colors. I'll just allow the level creator to enter a hexcode in the form #FFFFFF and use solid pixels of that color for the water texture. That way you can have #FF0000, #FF00FF, and whatever other color you want. Making the lava/deathwater actually kill you would be a bit more complex, but I think I can create something using the $ syntax to make that an option.
Quote: Rictory for Ralkyon!
HATPC Reborn home page | | DroidFreak36 |
HATPC Reborn Dev
Age: 30 Karma: 200 Posts: 491 Gender: Male Location: droidfreak36.com pm | email
|
If I do make an option for water to kill you, should it kill you on touching it, or only on being submerged in it? The former would kill you if you're standing on a surface that has a layer of water in it, the later would only kill you if you're deep enough to start losing air. I might even implement both.
Quote: Rictory for Ralkyon!
HATPC Reborn home page | | canadianstickdeath |
Age: 35 Karma: 350 Posts: 2990 Gender: Male pm | email
|
Oh I'd like to be able to die to the lava falls, even.
HATIC drowns you quickly, but it's slow enough that you can jump along the surface and be fine. | | DroidFreak36 |
HATPC Reborn Dev
Age: 30 Karma: 200 Posts: 491 Gender: Male Location: droidfreak36.com pm | email
|
I'm not talking about fast drowning, I'm talking about instantaneous drowning. As soon as the air timer would start, you die.
As for lava falls killing you in contact death mode, I'll see what I can do about that. Water/lava falls are gonna have to be tracked separately from regular water so I'll have to have special code to detect when you touch them.
Quote: Rictory for Ralkyon!
HATPC Reborn home page | | DroidFreak36 |
HATPC Reborn Dev
Age: 30 Karma: 200 Posts: 491 Gender: Male Location: droidfreak36.com pm | email
|
Oh yeah, a couple of changes to swimming physics I'm planning on making as well (already in place with my current build):
(4) No speed boost from jumping while swimming. The base swim speed is now based on the speed you used to get by using that trick. BTW, the horizontal swim speed is 3px/t, compared to 2px/t crawling and 4px/t walking
(5) You are no longer able to jump while swimming unless your feet are on the ground. No more jump spamming for super fast ascend speeds. It didn't really make sense that you could jump with nothing to push off of. The base ascend speed has been increased, however, from the equivalent of less than 6px/t in HATPC (adjusted for tick speed) to 8px/t in HATPCR (equivalent to terminal velocity in air).
Quote: Rictory for Ralkyon!
HATPC Reborn home page | | soccerboy13542 |
~*~Soccer~*~
Karma: 450 Posts: 4466 Gender: Male Location: 1945 pm | email
|
Huh, I never noticed some of the weird mechanics like jumping in water and bouncing up when hitting a crate from the side. Just felt natural to the game.
'Livio' said: You know, I was thinking of getting an internship at Microsoft, but I'm not sure I want their lameness to rub off on me. | | canadianstickdeath |
Age: 35 Karma: 350 Posts: 2990 Gender: Male pm | email
|
"You are no longer able to jump while swimming unless your feet are on the ground."
How do you get out of the water? So you can jump while swimming as long as you're fairly close to the surface or something? IDK personally I don't think that was hurting anything. :p | | |
« Forum Index < Platformers BoardIn order to post in the forums, you must be logged into your account. Click here to login.
|