param Z in coords is relative to level and NOT to screen.

hechelion

Member
Hi. Again with another bizarre issue.

I'm doing a level whose size is bigger than the screen, both on the X axis and on the Y axis.
And after some problems with the spawn coordinates, I discovered that:

The documentation say:
coords {x} {z} {a}

    ~Determines the x, z, and a positions on the screen where the entity will spawn.
    ~{x} and {z} are relative to the screen's current position, NOT the actual position in terms of the level itself.

But, after try with a height level double the screen height, I discovered that the param Z is relative to level and NOT to screen.

OS: Kubuntu-linux 64 bit.
Openbor version: I don't remember, but I compiled the last week.
 
You are probably missed this lines from the "coords" description:
~In case you're wondering, the BoR playing field is, in bbox format, 0 320 160 230. Unless, of course, you've changed the {min} and {max} values in LEVELS.txt with 'z'. You can also place enemies outside those ranges, but they'll try to return to the playing field if you do.
 
I don't see the relation (maybe I miss something). One thing is the playing field dimension and another are the coordinates for enemy spawn.

The problem is that one axis (the X) is relative to the screen but the other is not (the Y).
 
The relation is that the manual says all that about Z counts unless you setup something like this:
Code:
z 297 495
file	  data/levels/st1/st1.txt

By the way, on your first post you talked about Z and now about the Y. In case you don't know, Z have to do with the depth of the field and the Y(or a) have to do with the height. So they are 2 different things.
Now which one is giving you trouble and what is the trouble more specifically?
 
Maybe with image can help to understand the problem.


Click the image to enlarge.

I have 3 spawn in two diferent time of the level.
enemy_1 when the screen are in the position A
enemy_2 when the screen are in the position B
enemy_3 when the screen are in the position B

The 3 spawn have the same X position in coords (440) and the 3 are invoked in the same point of the SCREEN (not the level, the screen), beacause, the X is relative to screen point of reference.

Enemy_1 and Enemy_2 have the same second parameter for coords (250). But when Enemy_1 invoked inside the screen, Enemy_2 not.

If I changed the second parameter for the Enemy_3 from 250 to 560, then Enemy_3 are invoked inside the screen.

Resumen, First parameter for coords is relative to screen position (because change the screen position don't affect the invoke position). but the second parameter no. Why?

And, change the limite for the level (the "function" Z) change the walkable area, not the spawn coords. And I don't see the relation, because, when you have a spawn function, ALL the coordinates have to be relatives to the same point of reference.

PD: Excuse my poor english.

 
Well, with the depth of the field you have setup there with the "Z" command in levels.text, is bigger than your screen's dimensions. So in that case you can spawn entities offscreen in Z like in your image example and this is totally normal. This is also what the manual says on the two lines i have quoted above.

Okay, if you understand so far that this is how Z works in such cases, my question is what is your problem with that exactly? I mean, can't you just change the enemy_2  z coords from 250 to 560?

Enemy_1 and Enemy_2 have the same second parameter for coords (250). But when Enemy_1 invoked inside the screen, Enemy_2 not.
On that case this is why :
spawn Enemy_1
coords 440 250
at 100

spawn Enemy_2
coords 440 250
at 1568

They are both having different "at" setup. So it's again totally normal what is happening.
 
The problem is the documentation say "A", but the engine do "B".

when you read:
~Determines the x, z, and a positions on the screen where the entity will spawn.
~{x} and {z} are relative to the screen's current position, NOT the actual position in terms of the level itself.
you expect the spawn be always in the same position (with respect to the reference point) if you have the same coords value.

The problem is when you are new, you read the documentation, when the documentation is incorrect you spend a lot of time elucidating where is the error.

I wrote this post because, I am not sure if I misunderstood the documentation or if it is incorrect. But now I'm sure it's the second.
Thx for your time and your answers.




 
hechelion said:
The problem is the documentation say "A", but the engine do "B"..

Well again, NO! this is what YOU think.
The manual says A, and then IT SAYS B  for the case you are using the Z command in levels.txt just like you do!

You are just fail to understand this or you just don't want to understand this. Anyways, i can't explain this to you any better.

Aside all this generic discussion, if you need some more specific help on level spawns just post your specific issue.
 
Maggas I have the idea you don't undertand anything about my point.

Again, You are talking about the playing field dimention, not the point of reference for enemys.

Before you posting again, try this.
Create a new level and spawn an enemy inside the screen.
Run the game and save the screen.

Now, change the Z value in levels.txt.
Run again the game and save the screen,

Repet with different value for Z in levels.txt

Open all the screen, Surprise!!!!  The enemy invoke point on screen IS THE SAME FOR ALL screen save.
the Z command don't change the enemy spawn point, and that is a fact, not and opinion. at lest in build 5679.

I'm talking about de point of reference for the spawn coords, the documentatios IS incorrect.

PD: My test:
screen resolution: 480*272
level size: 792*280
enemy coords  400 200

test 1: z 50 268 160
test 2: z 190 268 160
test 3: z 220 268 160
 
hechelion said:
the Z command don't change the enemy spawn point, and that is a fact

Well, i never said it does. See, you just got me wrong.

hechelion said:
Now, change the Z value in levels.txt...

This is all i'm saying the whole time: once you change the Z value in levels.txt like your example, then  z spawn coords are relative to Z command(or in "level" in your words) and not to screen. Like you said. And this is what the manual says as well.

hechelion said:
Before you posting again, try this.
Create a new level and spawn an enemy inside the screen....

Before i posted i have tried and created this:




 
magggas said:
hechelion said:
the Z command don't change the enemy spawn point, and that is a fact

Well, i never said it does. See, you just got me wrong.

magggas said:
hechelion said:
Now, change the Z value in levels.txt...

This is all i'm saying the whole time: once you change the Z value in levels.txt like your example, then  z spawn coords are relative to Z command(or in "level" in your words) and not to screen as you said. And this is what the manual says as well.

Don't see the contradiction?
if and axis is relative to Z command, change the Z command (better use your words to avoid confusion) have to change the spawn point. If I add 10 pixel to Z command, then enemy have to spawn 10 pixel below the previus spawn point. this is how a reference point system work.
But at least in build 5679 don't. Change the Z command don't change the spawn position, therefore, it is not relative.

Maybe you are confused because Openbor moves the enemy if he is outside the playing field, and the playing field is defined by Z command, but that's a completely different thing because it happens AFTER the spawn. And you can notice it by taking advantage of the pause the game has when it starts a level.
Or maybe it works like you say in older versions, I don't know. But in the build 5679 don't.
 
I give up. Maybe someone else can explain/help better since i can't do it better with my English.
Good luck  :)
 
I think is a language problem, my english is not the better too and it's obvious we are not speak about the same thing.

But thank for your time and your answers.
 
coords {x} {z} {a}

    ~Determines the x, z, and a positions on the screen where the entity will spawn.
    ~{x} and {z} are relative to the screen's current position, NOT the actual position in terms of the level itself.

Ah sorry about that. We might have missed that. Only {x} which is relative to scroll position or screen's current position. {z} and {a} aren't affected by scroll position at all
 
hechelion said:
Thank very much Bloodbane.

Now that Bloodbane confimed to you as well that yes, only x is relative to screen, now you are magically okay with it while you were keeping complain about it before? Are you kidding me?
Well thank you for wasting my time  :)
 
@Magggas. I don't know what is your problem, in a early post I wrote this:

hechelion said:
The problem is the documentation say "A", but the engine do "B"...

...I wrote this post because, I am not sure if I misunderstood the documentation or if it is incorrect. But now I'm sure it's the second.
Maybe I did not say it well. The intention was to say:
When I wrote the first post, I was not sure.
When I wrote you that answer, I was sure of the error.

You keep saying the documentation are correct because... (Not the point to another argumentation when we both agreed that our English skills are not enough to give us an understanding correctly.).
I only try to explain my point, because I have the idea you never catching (my point)

And I agree with Bloodbane because he confirmed the same I say before, the documentation have an error.

My apologies if you feel you lost your time, it's not my intention.
 
It's okay, we are all friends here. So i apologise for my ton on some of my posts.
My intention was not to argue with you either.

The probleme with the manual in this case is not that it was wrong if you read all lines.  It just should have explain this better.
By the way Bloodbane missed these lines as well:
~In case you're wondering, the BoR playing field is, in bbox format, 0 320 160 230. Unless, of course, you've changed the {min} and {max} values in LEVELS.txt with 'z'. You can also place enemies outside those ranges, but they'll try to return to the playing field if you do.

So the manual says this..
Code:
 ~{x} and {z} are relative to the screen's current position, NOT the actual position in terms of the level itself.
.. for the case your level image is equal to 320x240. Which almost no one does anymore actually. And with the other two lines the manual means that if your level image and the wallkable area is bigger than your screen on z axis, then the z is not anymore relative to screen's current position.
So, the description is just hard to understand and confusing  actually.
 
@Magggas I'm glad to hear that, for my part never have bad intention.    ;)

@O Ilusionista, When I read the manual I found this
coords {x} {z} {a}

    ~Determines the x, z, and a positions on the screen where the entity will spawn.
    ~{x} and {z} are relative to the screen's current position, NOT the actual position in terms of the level itself.
I understood that both parameters were relative to the screen, but it is not, only the "{x}" is.
The parameter "{z}" is relative to the level not to the screen and I showed it, even, everyone can repet the same test and obtain the same result.

hechelion said:
Maybe with image can help to understand the problem.


Click the image to enlarge.

I have 3 spawn in two diferent time of the level.
enemy_1 when the screen are in the position A
enemy_2 when the screen are in the position B
enemy_3 when the screen are in the position B

The 3 spawn have the same X position in coords (440) and the 3 are invoked in the same point of the SCREEN (not the level, the screen), beacause, the X is relative to screen point of reference.

Enemy_1 and Enemy_2 have the same second parameter for coords (250). But when Enemy_1 invoked inside the screen, Enemy_2 not.

If I changed the second parameter for the Enemy_3 from 250 to 560, then Enemy_3 are invoked inside the screen.

Resumen, First parameter for coords is relative to screen position (because change the screen position don't affect the invoke position). but the second parameter no. Why?

And, change the limite for the level (the "function" Z) change the walkable area, not the spawn coords. And I don't see the relation, because, when you have a spawn function, ALL the coordinates have to be relatives to the same point of reference.

PD: Excuse my poor english.

Bloodbane say the same:
Bloodbane said:
coords {x} {z} {a}

    ~Determines the x, z, and a positions on the screen where the entity will spawn.
    ~{x} and {z} are relative to the screen's current position, NOT the actual position in terms of the level itself.

Ah sorry about that. We might have missed that. Only {x} which is relative to scroll position or screen's current position. {z} and {a} aren't affected by scroll position at all


@Magggas, on the other hand, says that the manual is correct and says that the "change" of behavior (for the parameter {z} ) is due to the fact that we use the Z command in level.txt, and quote this part from the manual:
In case you're wondering, the BoR playing field is, in bbox format, 0 320 160 230. Unless, of course, you've changed the {min} and {max} values in LEVELS.txt with 'z'. You can also place enemies outside those ranges, but they'll try to return to the playing field if you do.
But when I read this quote, I do not understand anything that could change the meaning of the first lines of the manual. In other word, the first line (my quote from manual) are incorrect.


At this point we are stuck in a discussion with Magggas.


---------------------------------------------------------------------------------------------------------------

magggas said:
So the manual says this..
Code:
 ~{x} and {z} are relative to the screen's current position, [b]NOT the actual position in terms of the level itself.[/b]
.. for the case your level image is equal to 320x240. Which almost no one does anymore actually. And with the other two lines the manual means that if your level image and the wallkable area is bigger than your screen on z axis, then the z is not anymore relative to screen's current position.
So, the description is just hard to understand and confusing  actually.

No Magggas, the manual does not say that.
See the imagen



when "Enemy_1" has to be invoke in the game, we have two possible values.

we can say "Enemy_1" it's 540 pixel from the left edge of the LEVEL.
we can say "Enemy_1" it's 440 pixel from the left edge of the SCREEN.

The manual is very clear about it. Used the value (440) because {x} is relative to SCREEN, don't used 540 because " NOT the actual position in terms of the level itself"


PD: When I say "discussion" not mean a bad thing, maybe the better word are "debate"?
 
Back
Top Bottom