World design tutorial

For developmental things relating to the graphics of the game.
User avatar
Lucifer
Project Developer & Local Moonshiner
Posts: 8610
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

It matters, Jon, because I've seen coordinate systems on computers that put the origin at the top-left corner, the bottom-right, and pretty much anywhere else. ANd if I'm making a map with text on the map, I don't want to have a disagreement with where the origin is cause my letters to be rendered as a mirror image instead.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden

User avatar
Jonathan
A Brave Victim
Posts: 3392
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Then you didn't ask what you want. What you really want is the direction of the axes. When looking down from the z axis:

Code: Select all

      +y
       ^
       |
-x <---+---> +x
       |
       v
      -y
The origin doesn't matter at all.
ˌɑrməˈɡɛˌtrɑn

User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

For the spawn points section in the tutorial you give two examples, one using xdir and ydir and the other using an angle. The two give different results.
tutorial wrote:<Spawn x="5" y="0" angle="60" />
<Spawn x="5" y="0" xdir="0.5" ydir="-0.866"/>

Code: Select all

atan2(-0.866,0.5) * (180/PI) = -59.9992722191726
atan2(0.866,0.5) * (180/PI) = 59.9992722191726
You want positive 0.866, or negative 60 degrees.

User avatar
SuPeRTaRD
Round Winner
Posts: 300
Joined: Fri Nov 05, 2004 11:53 pm
Location: bedlam
Contact:

Post by SuPeRTaRD »

i think the ability to make maps & latest surge of interest in it is great

thanks for opening up another chapter in this wonderful game we like to edit

8)

dunno if this will be usefull to anyoen but me, but heres a 50x50 pixel grid with the spaces numbered & the axis & degrees marked.

thx lucifer for the cool graphpaper program
Attachments
50sqgrid.jpg
Last edited by SuPeRTaRD on Tue Oct 11, 2005 4:35 am, edited 1 time in total.

User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Mostly for SuperTard that has been struggly hard in front of an outdated tutorial, and for everybody else curious, the first post of this discussion has the very latest version. You will finally understand why ObstacleWall are not as high as regular Walls. It uses the proper dtd reference in its examples!

enjoy

-ph
Canis meus id comedit.

User avatar
SuPeRTaRD
Round Winner
Posts: 300
Joined: Fri Nov 05, 2004 11:53 pm
Location: bedlam
Contact:

Post by SuPeRTaRD »

ObstacleWall: The obstacle Wall behaves exactly like the Wall element,
except for a new attribute, the height. This allows you to define
obstacles in your arena that will not be of rim height. The height of
the Walls are client defined, either a low rim (most of the time on
slower computer) or a high rim (faster computer with accelerated
graphics). With ObstacleWall, you can fully control the height of
walls. It is now possible to define obstacles that will not limit the
visibility inside your arena. For comparison purpose, the height of a
trace is of 1.0, and the height of a low rim is of 4.0. For better
performance on most clients, ObstacleWall higher than 4.0 should be
kept to a minimal.
height= The height to assign to this ObstacleWall. If this parameter is
absent, a default of 1.5 is used.

there is no example i see in the tute that shows the syntax for obstacle wall height adjustment

the hight= goes towards the end of the statement?
i've never scripted .xml or .html or anyhthing b4 an actual example of the syntax as used in a line, helps me alot

8)


also:
But you could decide to make motion along the height occur at ten time the
rate, so it would take a player the same time to cover the height of
the arena than to cover the length, giving it an "Alice in Wonderland"
feeling (see example 6.2.1). This feeling could be exaggerated even more
by making traveling along the longest distance occur in half the time
that travel along the shortest distance. To do this, you could double
the size of the Axis set in the previous example (see example
6.2.2). Now, even thou one dimension of the rectangle is 10 time the
other, travel along this longer dimension occur at a much higher rate,
compressing this dimension in the player's mind.

Example 6.2.1 Rectangle of equal travel time
<Axes number="4" normalize="false">
<Axis x="0" y="10"/>
<Axis x="1" y="0"/>
<Axis x="0" y="-10"/>
<Axis x="-1" y="0"/>
</Axes>
<Wall>
<Point x="0" y="0"/>
<Point x="100" y="0"/>
<Point x="100" y="1000"/>
<Point x="0" y="1000"/>
<Point x="0" y="0"/>
</Wall>
^is that feature supported in 2.8 b2 ? i was telling somone we could make maps that warp time like that ^ & they were saying dont be so sure, that may be a future feature he was writing about..

cuz that sure sounds nifty neato.. for playing around with.. might could make a map like that thats actually laid out where it's fun

User avatar
Jonathan
A Brave Victim
Posts: 3392
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

SuPeRTaRD wrote:there is no example i see in the tute that shows the syntax for obstacle wall height adjustment
The attributes of <Point x="120" y="121"> are x and y. So what would a height attribute of ObstacleWall look like?
ˌɑrməˈɡɛˌtrɑn

User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Code: Select all

<ObstacleWall height="3.7">
      <Point x="1" y="1"/>
      <Point x="3" y="3"/>
      <Point x="9" y="1"/>
</ObstacleWall>
Just like the Wall. Ommiting height default it to 1.5.

Everything in the tutorial is fully supported. The only part that is false is the appendix relating to the naming of resources. Please ignore it until a later version.

For your information.
Equidistant axes (ie a full number such as 3,4,5,6,...) are supported in the game since before the maps.
User defined axes (like in the example you gave) are there since maps exist ;). I guess ithey must be hard to understand, as you'd be the first one to use them.

-ph
Canis meus id comedit.

User avatar
Jonathan
A Brave Victim
Posts: 3392
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

philippeqc wrote:I guess ithey must be hard to understand, as you'd be the first one to use them.
Try Your_mom's 5ptstar. The fixed version of course.
ˌɑrməˈɡɛˌtrɑn

User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Canis meus id comedit.

User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

According to the DTD, this is valid--

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE World SYSTEM "map-0.1.dtd">
<World version="0.1">

<Map name="MapTest" version="1.0" author="nemostultae" category="">
  <Field>
    <Spawn x="50" y="50" xdir="0" ydir="1" />
    <Wall>
      <Point x="100" y="0" />
    </Wall>
  </Field>
</Map>
</World>
How do you have a wall with one point? I tested it out, and the round countdown goes off, and after that the round immediately ends. But I get great fps (600) 8)

User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

nemostultae wrote:According to the DTD, this is valid--

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE World SYSTEM "map-0.1.dtd">
<World version="0.1">

<Map name="MapTest" version="1.0" author="nemostultae" category="">
  <Field>
    <Spawn x="50" y="50" xdir="0" ydir="1" />
    <Wall>
      <Point x="100" y="0" />
    </Wall>
  </Field>
</Map>
</World>
How do you have a wall with one point? I tested it out, and the round countdown goes off, and after that the round immediately ends. But I get great fps (600) 8)
Simple answer: DTD is a first line of defense, not an absolute silver bullet.

In the DTD, the rules allow for detection such as "0 or 1" "at least one" "any number of" but never "4 or more".

Also, nothing would prevent you from making a square rim out of 4 walls, instead of a continous one, so there is not way to detect what is a valid declaration. Like you pointed out, you could stick a one point wall and call it an arena. And it plays. It plays good also. turn on mirroring for all details, drop the sky and crank all the other details, set one more spawn point, and play agains a bot. The feeling is very special ;)

The fields will truly start to exist when I'll get the eBorders working. This will be a real, hard, unbreakable, nothing-can-exist-outside-off barrier. Putting a wall on it will be left to the designer's choice. No, the DTD wont stop you from defining an eBorder with less that 3 points, but the parser will not generate any field with less than 3, because the other ones wont exist.

-ph

o and the anser for restorePos would be "it depends what was the intent / supposed to be specified". So only Luke-Jr can answer this.
Canis meus id comedit.

User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

oups, I misread you! Sorry.

Let me fix back the code.

-ph
Canis meus id comedit.

User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

there is some sort of automatic boundary detection. it checks all the coordinates of walls, grabs the maximums and minimums, and then set a box slightly bigger around it. if your out of the box, auto-death. your spawn is far enough from the point defined for that. even if they where close enough, it would be a 20x 20 box centered on the wall point.

if you'd want an open field, try the following in the mean while:

Code: Select all

<!DOCTYPE World SYSTEM "map-0.1.dtd">
<World version="0.1">

<Map name="MapTest" version="1.0" author="nemostultae" category="">
  <Field>
    <Spawn x="50" y="50" xdir="0" ydir="1" />
    <Wall>
      <Point x="-30000" y="-30000" />
      <Point x="-30000" y="-30001" />
    </Wall>
    <Wall>
      <Point x="30000" y="30000" />
      <Point x="30000" y="30001" />
    </Wall>
  </Field>
</Map>
</World>


I'll have to investigate this more.

-ph
Canis meus id comedit.

User avatar
Z-Man
God & Project Admin
Posts: 11406
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

philippeqc wrote:I'll have to investigate this more.
Umm, that's mine. The rendering code needs some coordinates to render the floor, that's why the values are collected. While I was at it, I reinstalled the old logic for clamping the camera and game object movement that formerly used the rim walls directly (the stuff we deactivated when the maps were introduced). Feel free to add an "infinitize" function that makes the bounding rectangle huge without placing walls.

Post Reply