Page 1 of 1

Relative elements

Posted: Sun Jul 16, 2006 6:33 pm
by Tomi
Note: The change I suggest is pretty big, so it might wait to other version.

When creating CEs, there are often groups of really similar elements that have very few differences (for example, only change value, or the element it'll change to). Applying those small changes is often very boring and it's also my main reason why I need some sort of CE scripting. It would be very useful to have some mechanism to support such similar elements.

Often, those small changes are in element-boxes (the widgets where you can set some element). I'd like a relative way to set them, like "self+3". I'll use a Ghost from Pacman as an example:
GHOST 1
Element changes to self+1 when player collects power pill
--- (self+1 is always corresponding GHOST X - EDIBLE)
Element changes to self+4 when touched by player
--- (self+4 is always corresponding GHOST X - GOTCHA!)
Element disappears after CBP* of wave done!
Element disappears after CBP of maze blocker (pre-floodfill)
Element changes to self+4 after CBP 2 of "you die collisions"

Now, when you copy this element to GHOST 2 slot, it'll automatically use GHOST 2 - EDIBLE and GHOST 2 - GOTCHA!, thus saving level author from a lot of work.

Gee, this will surely be extremely hard to implement, but pleeease make it, it's sooo useful!!!

* - change by page

Posted: Wed Jul 19, 2006 5:17 pm
by Tomi
Was this post missed?

Posted: Wed Jul 19, 2006 6:45 pm
by Holger
> Was this post missed?

Indeed! :-o

This post was never displayed as new to me, I think. :-o

The idea is very interesting! (Also one of these "die-hard level designer" ideas... ;-) ).

And as far as I can see, maybe this idea is very simple to implement -- you just use these "relative elements" in the editor (and level file), and before the game starts, they are all replaced by their "real" counterparts.

You probably won't need many of them anyway -- I could imagine that "self - 8", "self - 7", ... , "self - 1", "self", "self + 1", "self + 2", ... , "self + 8" would be more than sufficient. (The element "self", which was suggested in another idea, would then be a by-product of this idea.)

Posted: Wed Jul 19, 2006 7:33 pm
by Tomi
Maybe this could be an "advanced option" that can be enabled only in setup too. (Idea: make "advanced editing" setup page which contains those advanced options and an explanatory text "see also http:/www.artsoft.org/rocksndiamonds/faq.html" or something like that.) (The slash was skipped intentionally, so phpBB won't make a clickable URL from it.)

Posted: Sat Aug 05, 2006 8:53 pm
by Holger
> Gee, this will surely be extremely hard to implement, but pleeease make
> it, it's sooo useful!!!

Just added this -- in fact, most time was needed to draw the graphics for these new "reference elements" (what you called "pseudo elements"). They behave just as you intended them to work. I think they could be very useful if you make a few similar objects made of some similar custom elements. Also the "self" reference element (which was already suggested by Alan) works very nicely!

It will all be in 3.2.1, coming soon... :-)

Still have to fix that EMC tape bug, though (but after the Snake Bite debugging session, I had to to something creative and productive, that's why I added these nice new elements today :-) ).

Posted: Sun Aug 06, 2006 6:15 pm
by Tomi
BTW, how do they behave if you put them directly in the playfield? (For example, "element triggering change" acts like normal wall.)

Posted: Sun Aug 06, 2006 6:23 pm
by Francesco
None of those special elements should be placed directly on the map.
Eventually, they should act as just they do now - that is, nothing, just like a wall ;)

Posted: Sun Aug 06, 2006 6:55 pm
by Tomi
I know that they shouldn't, and as such they should lose their special properties, but it wouldn't be good if the game crashed when you put them there, or something like that, so I question it anyway, to be sure Holger doesn't forget about cases like that.

Posted: Sun Aug 06, 2006 8:54 pm
by Francesco
Yes, four eyes see more things than two eyes do, in effect.

Posted: Mon Aug 07, 2006 5:54 pm
by Holger
Yep, good point. Indeed, these elements should not be placed in the playfield, and if done anyway, they should behave just as "elements without properties", which are default, plain, destructible walls.

Should already work fine that way, and shouldn't cause any bad behaviour in the game engine (unless somebody reports it)... :-)