Back to the Vavoom Forum Archives


Forum

[Implemented] Additions to opening_t structure

Fri, 19 Dec 2008 19:25:51

Crimson Wizard

Is it possible to add second ceiling/floor references to opening_t structure, so that it would contain floor/ceiling both before and after the crossed line? Purpose is following: I am trying to teach bots recognise slopes so that they will know that they can reach the higher floor by walking on them; this requires to check every floor along the trace line to find each slope on the way. As far as I understood that, opening may stometimes store a floor before crossed line, and sometimes the one after. This results in skipping some of the floors, so basically bots sometimes recognise a slope on their way and sometimes do not.
Sun, 21 Dec 2008 19:28:51

Janis Legzdinsh

What do you mean with "before and after"?
Sun, 21 Dec 2008 20:33:42

Crimson Wizard

Excuse me, I noticed I did not explain this fully. There's a procedure that runs PathTraverse and calls LineOpenings and FindOpening for each line thus to get the opening for a thing (bot in this case) to cross the line. So, at the moment opening returned has reference about only one floor, either the one before line or after the line. I suggest make it contain reference to both floors. Ofcourse, they shouldn't be counted as "the one after/before the line", but as back/forward (sectors).
Mon, 22 Dec 2008 18:11:14

Janis Legzdinsh

But why you need to know that? Isn't existing info sufficient?
Mon, 22 Dec 2008 19:23:32

Crimson Wizard

Well, that was I speaking about. I need to check every floor along the trace to know are there any slopes on the way, to tell bot he can raise/descend along the slope; otherwise bot may think some steps on the path are not passable (because of high floor for example). When using algorythm described above some floors are skipped. For example if there are sectors: ---------------------------------- 1 | 2 | 3 ---------------------------------- opening may have reference to floor in sector 1 when first line is crossed by traceline, and then reference to floor in sector 3 when second line is being crossed. So floor in sector 2 is never "mentioned".
Tue, 23 Dec 2008 18:54:31

Janis Legzdinsh

opening_t has bottom value and low floor height value which is enough to calculate step height.
Wed, 24 Dec 2008 11:57:28

Crimson Wizard

First of all, right, looks like I did not recognise that I can detect slope by comparing last visited floor height value and new floor values. If on map a slope seamlessly connects with next floor, both opening->bottom and lowfloor are equal and different from previous line height value, like
             /----------------  128
            /
-----------/  0
In this case first line will have bottom and lowfloor = 0.0, on second line they would be both 128.0. And this works <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->, so bot can easily understand there's a slope. On the other hand, there could be cases when this will not work. For example:
                      256
                      /|
                     / |
                 0  /  | 0
-------------------/   |------------------
In this case first line will have bottom and lowfloor both = 0.0; but for second line opening will have bottom = 256.0 and lowfloor = 0.0 isn't it so? Then, how do I determine, which one height is the height of the previous floor, and is there a slope? Maybe there is just something like this:
                                       256
                                  |----------------
                                  |
                     0          0 |
----------------|-----------------|
Wed, 24 Dec 2008 19:09:01

Janis Legzdinsh

If bottom and lowfloor are not the same, it means that there's a step/drop-off. To analyse more precisely you'll have to manually check each sector on the way.
Wed, 24 Dec 2008 19:38:22

Crimson Wizard

[quote="Janis Legzdinsh":24ev1kae]If bottom and lowfloor are not the same, it means that there's a step/drop-off. To analyse more precisely you'll have to manually check each sector on the way. Umm, yeah, that's how we did it earlier, before started to use openings; but that means I'll have to use a code copy from Vavoom engine (LineOpenings and FindOpening) not to process same things twice (because I still will have to find best opening anyway)... That's why I asked to add at least second floor reference; then it'd be possible to know which height is which by comparing new floor pointers with previous remembered ones.. or something like that.
Tue, 17 Feb 2009 19:38:19

Janis Legzdinsh

Added

Back to the Vavoom Forum Archives