Fluid/Liquid objects

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Flumminator, Zomis

Post Reply
kjr
Posts: 12
Joined: Wed Dec 22, 2004 10:25 am

Fluid/Liquid objects

Post by kjr »

Make CE's able to act like a fluid: If something falls on it and stops, it will slip up while the other object slips below it. (They change places).
Also, the fluid falls when nothing is beneath it. The user can use the "move" attribute to decide if the fluid is able to slosh from side to side, or if they want to have it be gelatinous, they can configure it not to move, so it will stay perched on top of rocks, steel walls, etc.

Be careful that flluids don't switch with unmovable objects -- only things which can fall.
Since the fluid is doing the switching, bombs won't explode when falling underwater--they're only being switched down. (which makes sense)

This avoids the problem of two objects taking the same space (they switch instead).

Let the users design whether fluids are walkable, diggable, smashable, or whether they can fall at all (maybe some fluids just rise...) KISS principle.

** In addition, let some objects be "floatable" -- this is a bigger feature addition and should wait until fluids exist first (one step at a time). (IE the fluid wouldn't switch with objects that are not checked as being "floatable".
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

Interesting idea...

Something like a "water" element is planned for a long time, btw... But no results yet. ;-)
Guest

Post by Guest »

I attempted to do this with a custom element (change when touched by another element) but there were some bugs that made it unworkable. Unfortunately I can't post the level demo for this.

The main problem is that the closest trigger for the change is "touched by" element X, but that event only occurs when something moves to touch it, not when they start out next to each other. And to change that might break some levels. So this liquid effect might be best (and supporting graphics for it would be nice too, if that's at all possible: rather than just switching, you actually see the one object fall ...
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Anonymous wrote:Unfortunately I can't post the level demo for this.
Why not...? It would be nice to see...
Try uploading it here and post the link for it when it gets uploaded.

I think that there's another solution to your problem, I'm not sure... but I think so...
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> The main problem is that the closest trigger for the change is "touched by" element X, but that
> event only occurs when something moves to touch it, not when they start out next to each
> other.

Yep, right. This is something that's still missing. (Should be added as an extra function "check change conditions right after game starts".)
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Holger: But what about a CE that creates an element that is touched directly by another element...? I don't think the engine notifies on such either...

Hope you understand what I said :P
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

Yes, I understand what you mean -- yes, this can be seen as a problem. For each tile, there can be only one CE change per frame. So, if CE1 changes to CE2 directly beside CE3, and CE2 should change to CE4 when touching CE3, it won't change in this case, because it already changed in that same frame. This is a general problem -- the number of changes must be limited to prevent loops in CE changes, so I just decided to only allow one change per frame. But it would of course be possible to check for "touching" in the next frame again, but this would cause a lot of additional checks then, making the game engine significantly slower. (Think of the many checks that would be needed for each frame and each tile of a large, CE dominated level, containing a lot of change conditions and probably several change pages for each single CE. It is possible to optimize this using more RAM, but it's still a lot of additional calculation.)
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Holger wrote:For each tile, there can be only one CE change per frame. So, if CE1 changes to CE2 directly beside CE3, and CE2 should change to CE4 when touching CE3, it won't change in this case, because it already changed in that same frame.
Yes, exactly...
I was thinking if maybe kjr's problem would be solvable if setting CE3 to change extended target and replace CE2 with CE4.
Haven't seen the level though, so I'm not 100% sure.
Don Shadow

Post by Don Shadow »

I once tried also to make water... in Might of Elementals 1 and 2 but I failured by that. There were always some bugs in the CEs I couldn´t fix without destroying the whole "water".

Too bad. So the water became to "ice fire"...
Post Reply