World design tutorial

For developmental things relating to the graphics of the game.
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

O wow Your-mom! you made my day!

That someone went ahead 2 versions, and tryied to code a map using future features, that made me feel so special inside! You're my hero.

For the exact syntax, I wont make any guaranties. But if you look at the examples I've made to showcase the features http://guru3.sytes.net/viewtopic.php?t=1742 (search for the Funky HexaTRON map), you will notice that:
1. you need to define the segments, ie the part of the connectors that have a physical location, inside the field tag. The segments are independant of the walls and of the borders. But a segments can sit OVER a wall or a border.
2. The connector itself is defined outside of the field. The reason for this is that connectors will also be used to link fields together.
3. The "crossing" need better explaining. But for now, consider that if you where to stand on the first point of a segment, and look at the second point, it would be easy to agree on what is right and what is left of the segment. Uncrossed mean that the right side of a segment is associated with the right side of the other segment.


I think what you wanted to define is the following:

Code: Select all

...
               <field>
                    <axes number="4"/>
                    <border walled="false">
                        <point x="0" y="0" />
                        <point x="100" y="0" />
                        <point x="100" y="100" />
                        <point x="0" y="100" />
                        <point x="0" y="0" />
                   </border>                     
                   <segment label="east" >
<!-- goes north, so the inside of the square is on the left -->
                        <point x="100" y="0" />
                        <point x="100" y="100" />
                   </segment> 
                   <segment label="west" >
<!-- goes south, so the inside of the square is on the left from the start point -->
                        <point x="0" y="100" />
                        <point x="0" y="0" />
                   </segment> 
               </field>
               <connectors>
                       <connector first="west" second="east" /> 
               </connectors>
...
-ph
Canis meus id comedit.
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: [email protected]

Logic behind using walls for connectors?

Post by Luke-Jr »

Why would a wall be used for a connector? It makes more sense, IMO, to use a new XML element for this. Also, perhaps replacing `walled="false"' with `visible="false"' would be better?
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Re: Logic behind using walls for connectors?

Post by Lucifer »

Luke-Jr wrote:Why would a wall be used for a connector? It makes more sense, IMO, to use a new XML element for this. Also, perhaps replacing `walled="false"' with `visible="false"' would be better?
Seems like you should make a connector like an anchor in html.

Code: Select all

<a href="something">THIS IS HOW IT LOOKS ON SCREEN</a>
<a href="something"><img src="THIS IS HOW IT LOOKS ON SCREEN" /></a>
See what I mean? So the <connector> tag should be a wrapper around an element that'll be used to show it on-screen, like so:

Code: Select all

<connector first="west" second="east">
   <wall locationdescriptionetc />
</connector>

<connector first="west" second="east">
<!-- This connector has no visible manifestation -->
</connector>
Or something like that.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Re: Logic behind using walls for connectors?

Post by philippeqc »

Luke-Jr wrote:Why would a wall be used for a connector? It makes more sense, IMO, to use a new XML element for this.
There is another element, its the segment. The walls arent used for that.
Luke-Jr wrote: Also, perhaps replacing `walled="false"' with `visible="false"' would be better?
Nianiania! (thats a sound swedes do when hesitating!)

I see your point, but no. You are still thinking single field here. The way I see it, most of time, a field's edge (define by the border) will be connected to another's field edges. If there is any angle between them, it is "visible" by the change in light and orientation. If all is flat, then most likely you are facing many fields connected together to create a more complex shape. Either way, you wouldn't want to "see" them anymore than you want to see the polygones of a complex 3D shape. So you see, borders are just a new item that are needed for later capacities.

Because of what has been detailed before, the "grid" will only be drawn inside the border, and not outside of it, unlike the current engine that puts an invinite floor. This makes them "visible" also.

Now, the attribute name is "walled", as in wall. A map designer would want to indicate to the players that certain part of the border arent traversable, ie arent connected to anything else and will kill a player passing them, by putting a wall on them. This is a convenience to reduce the work of map designer, avoiding them to have to pass a second time over the coordinates to put a wall.

Now you might argue either of the following:
1) What about infinite sized grids? Infinite sized grid arent supported in this model, like they arent supported in classical aa.
2) But in the code sample you gave Your_Mom, you put a wall around the border, and then put connectors over it? Yes, I did that.. First because that was what Your-Mom was asking. Second, because that's how nasty I am.

-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:

Re: Logic behind using walls for connectors?

Post by philippeqc »

Lucifer wrote:Seems like you should make a connector like an anchor in html.
Yes, it would be more convenient like this. But sadly, much much more complex to implement. When using 2 segments, I know I can map 2 lines, even if they are of different size, by simple scaling. With anchors, an anchor could be put over a wall that has 2 or more segments. Also, with anchor, the anchor reading code need to be able to support a bunch load of different elements. You see, much much much more complex.

-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 »

oups, re-checked Your-mom's drawing. should be:

Code: Select all

...
               <field>
...
                   <segment label="east" >
<!-- goes north, so the inside of the square is on the left -->
                        <point x="80" y="20" />
                        <point x="80" y="80" />
                   </segment> 
                   <segment label="west" >
<!-- goes south, so the inside of the square is on the left from the start point -->
                        <point x="20" y="80" />
                        <point x="20" y="20" />
                   </segment> 
               </field>
               <connectors>
                       <connector first="west" second="east" /> 
               </connectors>
...
yeah, much better like this

-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 »

Following Your_Mom's comments, I've tried to improve the spawn points text. Somehow I'm always presenting the spawn point direction in the same way. Anyone care to improve on this:

Code: Select all

8. Spawn points
Spawn points are where cycles are first located on the map. At
game start, the game server will spread the players and AI among
the different spawn locations described. You should provide
sufficient spawn location for the number of players you entend to
play on your map.

Along with the location where the cycles will be placed, you
need to specify the starting direction of the cycle. This will
determine the direction that the cycle is facing when it appears. 

To specify this, two methods are offered:
Vector orientation:
In this method, you specify the direction as a vector, from (0, 0)
to (xdir, ydir). This will indicate the direction to be face by
the cycle.
Angle orientation:
In this method, you specify the direction as an angle. Degrees are
used for this.

Because Armagetron is a game where motion occurs on certain axes
only, starting direction should also be done on those axes. The
game will use the direction described to find the closest matching
axis. It is the direction of the choosen axis that is assigned to
an spawned cycle. The direction specified is only used as a
recommendation. 

A Spawn has six attributes. Only three to four are needed to
describe a Spawn. Two of them, x and y, are mandatory.
x= the x coordinate where the cycle is to be created 
y= the y coordinate where the cycle is to be created
xdir= the x coordinate of the recommended direction the cycle will face at
creation.
ydir= the y coordinate of the recommended direction the cycle will face at
creation.
angle= the recommended angle to orient the cycle

If the angle attribute is specified, xdir and ydir are
ignored. When no angle attribute is specified, both xdir and ydir
are needed.

Example 8.1:
       <Spawn x="-15.5" y="368.0608" xdir="0.5" ydir="-0.866"/>
       <Spawn x="-15.5" y="368.0608" angle="60"/>


Only the direction indicated is used. The size of the direction
described doesnt influence the start up speed or deplacement of a
cycle.

It is to be noted that specifying a direction of (0,0) is
undefined. Also, specifying spawn points outside the play area
that you defined is undefined and unsupported.

Also, I've realised that the Axes element would be better served with an Axis subelement rather than the Point element. Point in Axes are now deprecated, ie shouldn't be used anymore. They will be supported for some time, but no new Point should be set.
Axis support the same syntax as Point, and also the angle and lenght are available. Now, instead of defining directions with x and y, you can specify directly the angle in degrees. Used with the normalize="false" option of the Axes, the length attribute is used to scale the deplacement along the specified axis. Not specifiying the lenght, or setting the Axes attribute normalize to true have the same effect, making axis of size 1.

Now, I just dont know if I'll cheat and still call it 0.1, as 0.1 is still not really in use, or if it will be in the 0.1-experimental. But it should be default in 0.2 (again, if I dont have any new such ideas on the way).

-ph
Canis meus id comedit.
User avatar
Your_mom
Match Winner
Posts: 653
Joined: Sun Jun 06, 2004 1:45 am

Post by Your_mom »

quick question about spawn points how does it read who spawns where as in player with the most points spawns here, second most points here etc.

also zipped up some maps Heres a hint for one of the maps and a moviepack you might like with it :pacman: :sdot: :bdot: :sdot: :sdot: :sdot: :ghost: :sdot: :sdot:
Attachments
multimappack.zip
get ready to wait a while this file is HUGE
(2.81 KiB) Downloaded 418 times
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: [email protected]

Post by Luke-Jr »

Your_mom wrote:quick question about spawn points how does it read who spawns where as in player with the most points spawns here, second most points here etc.
Don't expect the answer to this to remain the same. Right now, it pretty much just assigns spawn points in order.

Your quaddents is buggy. The DTD is incorrect and the name has testname in it...
http://utopios.org/~luke-jr/programs/he ... /Your_mom/
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Your_mom wrote:also zipped up some maps Heres a hint for one of the maps and a moviepack you might like with it :pacman: :sdot: :bdot: :sdot: :sdot: :sdot: :ghost: :sdot: :sdot:
Maps like inaktek and HexaTRON are the kinds of maps I was dreaming about. Creative, original, using the new possibilities. And pacmapnew.xml abuses all of that! ;) Its so neat. Next time someone suggest to make a first person perspective pacman, I'll be able to say "Been there, done that, played armagetron on it". I raise my hat to you. And keep on abusing the system!

-ph
Canis meus id comedit.
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: [email protected]

Post by Luke-Jr »

philippeqc wrote:
Your_mom wrote:also zipped up some maps Heres a hint for one of the maps and a moviepack you might like with it :pacman: :sdot: :bdot: :sdot: :sdot: :sdot: :ghost: :sdot: :sdot:
Maps like inaktek and HexaTRON are the kinds of maps I was dreaming about. Creative, original, using the new possibilities. And pacmapnew.xml abuses all of that! ;) Its so neat. Next time someone suggest to make a first person perspective pacman, I'll be able to say "Been there, done that, played armagetron on it". I raise my hat to you. And keep on abusing the system!
Indeed. It has also inspired me to consider adding zone control to the map format. Imagine spawning winzones at pill locations... and maybe even death zones as ghosts-- but that would need zone movement...
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

Please add to the tutorial that you must put a version number in your map filename (map-version.xml). One of Your_mom's maps was not working and crashing my client, but my client was loading the version on my computer which happened to be the one that was not fixed (Your_mom had updated the map to work). :cry:
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

nemo: Yes, thanks for the pointer. Working so close with it makes me forget many details.

New section at the end of chapter 3:

Code: Select all

 It is to be noted that the prefered way of naming the file
containing your map should be in the following form:
<map name> + "-" + <version number> + ".xml". This has the
advantage of allowing for new versions to be propagated to all
clients. By changing the file name, and starting to use it on
servers, the resource manager will attempt to fetch the new
version of the map.

Example 3.2:
HexaTRON-0.4.2.xml

Example 3.3:
inaktek-.7.1.xml
The tutorial attached in the 1st post of this discussion has been updated for your convenience.

Thanks
Canis meus id comedit.
User avatar
Your_mom
Match Winner
Posts: 653
Joined: Sun Jun 06, 2004 1:45 am

Post by Your_mom »

heh my bad

also add that negative grid points are not allowed or something along those lines, when i tried negative grid points i had problems getting it to work at least luke jr told me that was the reason
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

your_mom: made bug # 1202665 on sourceforge for that.

-ph
Canis meus id comedit.
Post Reply