EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Adding Placeable objects to azone generated map files (https://www.eqemulator.org/forums/showthread.php?t=25464)

Derision 06-14-2008 03:09 PM

Adding Placeable objects to azone generated map files
 
An issue with the maps generated by azone at present is that they do not include
placeable objects.

Many placeable objects are inconsequential for LOS, e.g. trees, boulders, wall decorations,
however there are some large/important objects that are classed as 'placeable', e.g. some bridges
and buildings.

For example, the buildings in Potranquility (bank etc). If you fear a mob in those buildings
they will just run straight through the walls, and some of the bankers are sunk up into their
neck in the ground because as far as LOS/BestZ is concerned, the buildings don't exist.

I have spent the last couple of days adding the ability to azone to include placeable objects in
the map files.

While it is not ready to release yet, mainly because you currently have to edit the source to
specify the id numbers of the placeable models you want included, here is a potranquility map
for people to test with (this includes the geometry for the walls and floors of the buildings
I referred to above (and that is the only extra thing it includes, i.e. no trees etc).

http://www.rama.demon.co.uk/potranquility.rar

If you fear in mob in the buildings before and after dropping this into your Maps directory,
you will see the difference. You can also try casting on a mob inside the building while you
are outside (with the old map it will let you, even though you can't see your target).

If anyone has any zones where they are desperate for certain placeable objects to be included,
(S3D or EQG) let me know and I'll see if I can cook you up a map with those objects included.

Angelox 06-14-2008 03:17 PM

Toxxulia Forest (tox) has that problem; npcs in the buildings there are waist-deep in the floor, would be great to see that fixed.

Thanks for you fixes!

Derision 06-14-2008 03:42 PM

Quote:

Originally Posted by Angelox (Post 150625)
Toxxulia Forest (tox) has that problem; npcs in the buildings there are waist-deep in the floor, would be great to see that fixed.

Here you go, try this one:

http://www.rama.demon.co.uk/tox.rar

It includes the geometry for three extra models (I threw the bridge in as a bonus :) )

HUT4_DMSPRITEDEF
ERHOUSE_DMSPRITEDEF
TBRIDGE_DMSPRITEDEF

I tested one building before and after and it seemed to have done the trick.

If anyone has any more requests, I likely won't get to them until tomorrow.

Angelox 06-14-2008 03:58 PM

Thanks again - I'll be testing shortly, before you go, I was wanting to give you something else to think about which may be related to your work; The boats.
Only one of them is not fall through , the rest are , the most needed ship is the SirensBane (butcher > freeporte boat), and it is totally transparent. We actually have a fully functional system for boats to run on schedule dynamic zone or not. but really can't use it to its best or properly, unless we can get a boat thats not so large as the one we have now.
I'm about to make a detailed post on how we did this, but really, the SirensBane is very needed - it appears in many zones, and fits the areas perfectly.

Derision 06-21-2008 03:10 PM

This is a reply to Scorp from another thread where the subject of azone was brought up. Thought I would put the reply here rather than cluttering up the other thread, or starting a new one.

Quote:

Originally Posted by Scorpious2k (Post 151068)

I hope you are including the code that makes it work under windows too.

Also as a future enhancement, we should see if we can get it to identify PvP areas like it does water. Then we could add code that makes those areas work. This probably deserves it's own thread in the appropriate forum area.

Yes, the new azone and also awater compile under windows. (awater has no new functionality, at present).

Regarding the PVP areas, I just logged into the old arena zone, and also went to the PVP arena in Freeport.

If you issue the #bestz command in the pvp part of the arena zone, it tells you you are in water. Likewise, in the pvp arena in Freeport, it tells you that you are in an unknown area, so it seems that these pvp areas are defined as special, but just not being handled correctly. I'll look into it some more.

Given that I can only pull out the special areas from S3Ds, and not EQGs. What other S3D zones have pvp areas (and where abouts in the zone are they) ?

Thanks

Scorpious2k 06-21-2008 03:50 PM

Halas has one, and this may help: OpenZone can create them.

I have a zone I made with one, and can give you the file.

Because, OZ will successfully create the area (recognized by the client) you might want to either look at the OZ source or (probably quicker) ask Windcatcher about it.

EDIT...

My thought on this subject, btw, is that once we can identify the area and if a player and/or target is in it, we can add code to where it checks to see if attack is allowed against another player and allow/deny it depending on if they are in it.

Probably with a rule so the serverOp can turn it on or off. This would actually be a pretty simple add-on once we can determine the PvP area and a client's position in or out of it.

Derision 06-21-2008 04:12 PM

Quote:

Originally Posted by Scorpious2k (Post 151074)
you might want to either look at the OZ source or (probably quicker) ask Windcatcher about it.

I looked at the OpenZone source (which has helped me a lot in the past while
working with S3Ds) and also Windcatcher's WLD format document, and
the PVP areas should be defined in the S3D with a name beginning 'DRP_ZONE':

Quote:



0x29 — Region Flag — PLAIN

Notes
This fragment lets you flag certain regions (as defined by 0x22 BSP Region fragments) in a particular way.
The flagging is done by setting the name of this fragment to a particular “magic” value.
The possible values are:

WT_ZONE........................................... .....Flag all regions in the list as underwater regions.
LA_ZONE........................................... ......Flag all regions in the list as lava regions.
DRP_ZONE.......................................... ....Flag all regions in the list as PvP regions.
DRNTP##########_ZONE.............Flag all regions in the list as zone point regions.

The ####’s are actually numbers and hyphens that somehow tell the client the zone destination.
This method of setting zone points may or may not be obsolete.

Derision 06-22-2008 08:25 AM

I got the PVP areas figured out correctly. There are PVP areas in the following zones:

Arena, Cabwest, citymist, freportw, Kael, mischiefplane, neriaka, neriakb, paineel, qeynos, sseru, thurgadina

I could't find one in Halas. There is an area called 'The Pit Of Doom' which looks a bit like a mini-arena, but
there is nothing in the S3D file to flag it as such, and I don't get the client message when I go in there.

My ISP is doing maintenance which means my webspace is down at the moment, but when it comes back up I will post
the water maps for the zones above with the PVP areas tagged correctly.

I also wrote a patch for the server to detect the PVP areas (bool WaterMap::InPVPArea) and added some output into
the #bestz command to show whether you were in a PVP area or not, however it still requires someone to modify the
attack code to call InPVPArea to perform the check. (I'll let someone else do that).

Here is the zone patch. I'll post the maps later when my webspace is back up. The modified version of awater to
produce the .wtr maps tagged with PVP areas will come with my modified azone when that is done and tested.

Code:

diff -u --recursive /tmp/EQEmu-0.7.0-1115/zone/command.cpp ./command.cpp
--- /tmp/EQEmu-0.7.0-1115/zone/command.cpp        2008-06-19 13:49:00.000000000 +0100
+++ ./command.cpp        2008-06-22 12:25:18.000000000 +0100
@@ -6455,13 +6455,15 @@
                        RegionType = zone->watermap->BSPReturnRegionType(1,  c->GetTarget()->GetX(), c->GetTarget()->GetY(), z);
                        c->Message(0,"InWater returns %d", zone->watermap->InWater(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z));
                        c->Message(0,"InLava returns %d", zone->watermap->InLava(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z));
+                        c->Message(0,"InPVPArea returns %d", zone->watermap->InPVPArea(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z));
                                                                         
                }
                else {
                        z=c->GetZ();
                        RegionType = zone->watermap->BSPReturnRegionType(1, c->GetX(), c->GetY(),z);
                        c->Message(0,"InWater returns %d", zone->watermap->InWater(c->GetX(), c->GetY(), z));
-                                        c->Message(0,"InLava returns %d", zone->watermap->InLava(c->GetX(), c->GetY(), z));
+                        c->Message(0,"InLava returns %d", zone->watermap->InLava(c->GetX(), c->GetY(), z));
+                        c->Message(0,"InPVPArea returns %d", zone->watermap->InPVPArea(c->GetX(), c->GetY(), z));
       
                }
       
@@ -6469,6 +6471,10 @@
                        case RegionTypeNormal:        { c->Message(0,"There is nothing special about the region you are in!"); break; }
                        case RegionTypeWater:        { c->Message(0,"You/your target are in Water."); break; }
                        case RegionTypeLava:        { c->Message(0,"You/your target are in Lava."); break; }
+                        case RegionTypePVP:        { c->Message(0,"You/your target are in a PVP area."); break; }
+                        case RegionTypeSlime:        { c->Message(0,"You/your target are in a Slime area."); break; }
+                        case RegionTypeIce:        { c->Message(0,"You/your target are in an Ice area."); break; }
+                        case RegionTypeVWater:        { c->Message(0,"You/your target are in a VWATER area."); break; }
                        default:  c->Message(0,"You/your target are in an unknown region type.");
                }
        }
diff -u --recursive /tmp/EQEmu-0.7.0-1115/zone/watermap.cpp ./watermap.cpp
--- /tmp/EQEmu-0.7.0-1115/zone/watermap.cpp        2008-01-14 02:42:37.000000000 +0000
+++ ./watermap.cpp        2008-06-22 12:22:12.000000000 +0100
@@ -99,6 +99,12 @@
        return(BSPReturnRegionType(1, y, x, z) == RegionTypeLava);
 }
 
+bool WaterMap::InPVPArea(float y, float x, float z) const {
+        if(BSP_Root == NULL) {
+                return false;
+        }
+        return(BSPReturnRegionType(1, y, x, z) == RegionTypePVP);
+}
 
 WaterMap* WaterMap::LoadWaterMapfile(const char* in_zonename, const char *directory) {
        FILE *fp;
diff -u --recursive /tmp/EQEmu-0.7.0-1115/zone/watermap.h ./watermap.h
--- /tmp/EQEmu-0.7.0-1115/zone/watermap.h        2008-01-14 02:42:37.000000000 +0000
+++ ./watermap.h        2008-06-22 12:21:19.000000000 +0100
@@ -30,15 +30,21 @@
 } ZBSP_Node;
 #pragma pack()
 
+
 typedef enum {
        RegionTypeUnsupported = -2,
        RegionTypeUntagged = -1,
        RegionTypeNormal = 0,
        RegionTypeWater = 1,
        RegionTypeLava = 2,
-        RegionTypeZoneLine = 3
+        RegionTypeZoneLine = 3,
+        RegionTypePVP = 4,
+        RegionTypeSlime  = 5,
+        RegionTypeIce = 6,
+        RegionTypeVWater =7
 } WaterRegionType;
 
+
 class WaterMap {
 
 public:
@@ -46,6 +52,7 @@
        WaterRegionType BSPReturnRegionType(long node_number, float y, float x, float z) const;
        bool InWater(float y, float x, float z) const;
        bool InLava(float y, float x, float z) const;
+        bool InPVPArea(float y, float x, float z) const;
 
        WaterMap();
        ~WaterMap();


Derision 06-22-2008 11:16 AM

Here are the 'Water' maps for the zones I mentioned in the previous post with the PVP regions tagged (1.4MB):

http://www.rama.demon.co.uk/pvpmaps.tar.gz

The directory in the tar file is called pvpmaps but that is just a temp directory I put them in while creating the archive.

Once you have extracted them, drop them in your Maps directory where the other .wtr files are.

Derision 06-22-2008 12:03 PM

I had a look at what would be involved to use this to enable PVP combat in the PVP areas, and it looks to be simpler than I thought, i.e. just change the existing GetPVP() function:

Code:

--- /tmp/EQEmu-0.7.0-1115/zone/client.h 2008-06-15 00:07:57.000000000 +0100
+++ client.h    2008-06-22 16:50:45.000000000 +0100
@@ -36,6 +36,7 @@
 #include "mob.h"
 #include "npc.h"
 #include "zone.h"
+#include "watermap.h"
 #include "AA.h"
 #include "../common/seperator.h"
 #include "../common/Item.h"
@@ -275,7 +276,7 @@
        void    SetGM(bool toggle);
        void    SetPVP(bool toggle);

-      inline bool    GetPVP()        const { return zone->GetZoneID() == 77 ? true : m_pp.pvp; }
+      inline bool    GetPVP()        const { return zone->watermap->InPVPArea(x_pos, y_pos, z_pos) ? true : m_pp.pvp; }
        inline bool    GetGM()        const { return (bool) m_pp.gm; }

        inline void    SetBaseClass(uint32 i) { m_pp.class_=i; }

Previously this would let you PVP anywhere in zone 77 (arena), but with this change it will only allow it in the central PVP area.

Angelox 06-22-2008 12:22 PM

Quote:

Originally Posted by Derision (Post 151133)
Here are the 'Water' maps for the zones I mentioned in the previous post with the PVP regions tagged (1.4MB):

http://www.rama.demon.co.uk/pvpmaps.tar.gz

The directory in the tar file is called pvpmaps but that is just a temp directory I put them in while creating the archive.

Once you have extracted them, drop them in your Maps directory where the other .wtr files are.

I'll put these maps on Rathe forums downloads also

Derision 06-22-2008 12:31 PM

The previous patch to GetPVP didn't check if there was a watermap loaded for a zone and will crash the zone if there isn't. This should work better:

Code:

--- /tmp/EQEmu-0.7.0-1115/zone/client.h 2008-06-15 00:07:57.000000000 +0100
+++ client.h    2008-06-22 17:18:17.000000000 +0100
@@ -36,6 +36,7 @@
 #include "mob.h"
 #include "npc.h"
 #include "zone.h"
+#include "watermap.h"
 #include "AA.h"
 #include "../common/seperator.h"
 #include "../common/Item.h"
@@ -275,7 +276,8 @@
        void    SetGM(bool toggle);
        void    SetPVP(bool toggle);

-      inline bool    GetPVP()        const { return zone->GetZoneID() == 77 ? true : m_pp.pvp; }
+      inline bool    GetPVP()        const { if(zone->watermap != NULL) return zone->watermap->InPVPArea(x_pos, y_pos, z_pos) ? true : m_pp.pvp;
+                                              else return  m_pp.pvp; }
        inline bool    GetGM()        const { return (bool) m_pp.gm; }

        inline void    SetBaseClass(uint32 i) { m_pp.class_=i; }

and thanks for hosting the files Angelox.

Derision 06-29-2008 08:20 AM

Here is azone2 (as I call it), along with a new version of awater that includes PVP
regions in the .wtr files. I've also included two other utilities called listobj
and glmodelviewer that I'll get to in a moment.

Source: www.rama.demon.co.uk/azone2/azone2.rar

Windows Executables: www.rama.demon.co.uk/azone2/az2exes.rar

The source includes .vcproj and an .sln file for Visual C++ Express 2008.

The source needs to be unzipped into the utils directory of your EQEmu source
tree, e.g. into EQEmu-0.7.0-1118/utils/azone2.

I've not included diffs as I replaced the S3D and EQG loaders with later versions
from OpenEQ that I had made some fixes to and included support for loading models, and the patch would be quite large.

Copy the executables into the same directory as your .S3D and .EQG files. To include
placeable objects for S3Ds, the _obj.s3d files must also be present.

Some newer EQGs have a .ZON file as a separate file in the filesystem rather than
inside the EQG. In these cases, the .ZON file must also be present along with the
EQG.

Azone2 provides support for including placeable objects in your .map files.

Here I will give a short tutorial on why you might want to use it.

Take this view of lakeofillomen.

http://www.rama.demon.co.uk/azone2/loio-tex.jpg

Those ruins are placeable objects, this is what the .map file thinks the scene looks like:

http://www.rama.demon.co.uk/azone2/loio-noplac-map.jpg

If we want to include those buildings in the .map, we need to know
their model numbers. We could use listobj:

listobj lakeofillomen

Some models have meaningful names, but not so in the case of these buildings,
so we will use glmodelviewer instead.

From a command prompt (Windows only):

glmodelviewer lakeofillomen

Use the + and - keys to cycle through the models until you find one that
looks like what you are after.

http://www.rama.demon.co.uk/azone2/loio-mviewer.jpg

It turns out that the buildings use models 49,50,51,52,53,54,55,56 and 57.

In the same directory as azone2 and our s3d/eqgs, we also need to put a file
called azone.ini. This tells azone2 what models to include in the .map

Code:

# Include huts, houses dock and bridge from tox
tox.s3d,7,17,20,26
# Include two bridges from Tutorialb
tutorialb.eqg,17,47
# Include prison, ramp and a couple of towers in Anguish
anguish.eqg,5,7,8,119
# Include ruined buildings in LOIO
lakeofillomen.s3d,49,50,51,52,53,54,55,56,57
# Include bridges in thundercrest
thundercrest.eqg,14,51

So, once we have added the line for lakeofillomen.s3d, we run azone2.

Code:


azone2 lakeofillomen

AZONE2: EQEmu .MAP file generator with placeable object support.
There are 406935 vertices and 135645 faces.
Processing azone.ini for placeable models.
azone.ini entry found for this zone. Including 9 models.
Including Placeable Object  326 using model  50 (KURH200_DMSPRITEDEF).
Including Placeable Object  327 using model  49 (KURH100B_DMSPRITEDEF).
Including Placeable Object  330 using model  50 (KURH200_DMSPRITEDEF).
Including Placeable Object  331 using model  49 (KURH100B_DMSPRITEDEF).
Including Placeable Object  473 using model  52 (KURH300A_DMSPRITEDEF).
Including Placeable Object 1475 using model  52 (KURH300A_DMSPRITEDEF).
Including Placeable Object 1476 using model  56 (KURH600B_DMSPRITEDEF).
Including Placeable Object 1477 using model  54 (KURH400C_DMSPRITEDEF).
Including Placeable Object 1503 using model  52 (KURH300A_DMSPRITEDEF).
Including Placeable Object 1504 using model  55 (KURH501A_DMSPRITEDEF).
Including Placeable Object 1505 using model  53 (KURH400B_DMSPRITEDEF).
Including Placeable Object 1788 using model  57 (KURH600BR_DMSPRITEDEF).
Including Placeable Object 1789 using model  51 (KURH300_DMSPRITEDEF).
Including Placeable Object 1790 using model  54 (KURH400C_DMSPRITEDEF).
Including Placeable Object 1791 using model  55 (KURH501A_DMSPRITEDEF).
Including Placeable Object 1792 using model  53 (KURH400B_DMSPRITEDEF).
Including Placeable Object 1793 using model  52 (KURH300A_DMSPRITEDEF).
After processing placeable objects, there are 426633 vertices and 142211 faces.
Bounding box: -7650.19 < x < 5026.62, -4153.97 < y < 7221.72
Building quadtree.
Done building quad tree...
Match counters: 1115234 easy in, 3053018 easy out, 55536 hard in, 0 hard out.
Writing map file.
Map header: Version: 0x01000000. 142211 faces, 6487 nodes, 239090 facelists
Done writing map (8.12MB).

Copy the .map over to your server Maps directory. Now it looks like this.

http://www.rama.demon.co.uk/azone2/loio-buildings.jpg

You can test by trying to cast a spell on a mob in the ruins that you cannot see.

John Adams 06-29-2008 02:05 PM

This is ver cool. Thank you! It would be nice to get people involved in building an official "azone.ini", eh?

Flare83 08-02-2008 03:04 PM

very nice work Derision. Anyone working on a new map pack with models included?

cavedude 08-02-2008 04:22 PM

Quote:

Originally Posted by Flare83 (Post 153653)
very nice work Derision. Anyone working on a new map pack with models included?

I was meaning to start, but since each map needs to be manually created, it would take a while. Anybody care to help? We could divide and conquer.

Angelox 08-02-2008 09:40 PM

Here's Skyfire map

Angelox 08-03-2008 01:13 PM

Here's Frontier Mountains and GFaydark Maps.

Derision; Im having problems with eastwastes , it does not dump all the placed-object info. I saw where objects 1-15 were, there then jumped to 2077-2015. For example I can see CRYSCAVETEL202 as an object, but it's not in the LISTOBJ dump.

Derision 08-03-2008 01:29 PM

Quote:

Originally Posted by Angelox (Post 153706)
Im having problems with eastwastes , it does not dump all the placed-object info. I saw where objects 1-15 were, there then jumped to 2077-2015. For example I can see CRYSCAVETEL202 as an object, but it's not in the LISTOBJ dump.

I see what you mean. I'll take a look at it at some point during the week.

KLS 08-03-2008 07:21 PM

An unusual amount of -1 model entries for eastwastes. I've been going through them alphabetically... slowly... I dare someone to take a look at bloodfields, it made me cry and not with any amount of joy. =(

Angelox 08-03-2008 08:17 PM

There's another problem I noticed too, Skyfire has a lot of 'moonwalkers' (npc's get stuck and go a few steps back then forward a few, never get anywhere). I noticed at first in the entrance to Veeshan. Thought maybe it was the map , but the azone2 fix doesn't help. Then I started seeing this moonwalking bug all over the zone, with many npcs. If you can slow or freeze the frame rate , you'll see the mob gets stuck waist-deep in the ground where this is happening (the moonwalking is just an illusion). Skyfire Map I made is so gigantic because I detailed a lot of objects in hopes it would help some. But the most needed objects that are what cause the problem are not in the S3d files , they are on the Skyfire.wld files. I haven't checked any other zones, I Imagine the more irregular the terrain, the more prone to moonwalking. I saw some moonwalking in FM and really haven't check more zones - But Skyfire would be the zone to work this bug out.
In FM(Frontier Mts), most mobs walked fine, with the new fix (Dersion fix for 'BestZ Calculation for aggroed mobs), most the giants travel flawlessly over the big mountains, but once in a while you bump into a MJ fan (moonwalker). I think the 'BestZ Calculation' fixed a lot more than expected.

Derision 08-04-2008 01:45 PM

Quote:

Originally Posted by Angelox (Post 153706)
Derision; Im having problems with eastwastes , it does not dump all the placed-object info. I saw where objects 1-15 were, there then jumped to 2077-2015. For example I can see CRYSCAVETEL202 as an object, but it's not in the LISTOBJ dump.

I altered the code to print out the names of the objects it couldn't find the model for. In eastwastes, there are 2054:

Code:

$ ./listobj eastwastes | grep "not found" | wc -l
2054

Of those 2054 objects, they all use 1 of 3 models:

Code:

$ ./listobj eastwastes | grep "not found" | sort | uniq -c

      1 Model ELECTMONU200_DMSPRITEDEF not found
  1006 Model ICETREE200_DMSPRITEDEF not found
  1047 Model ICETREE203_DMSPRITEDEF not found

So all of them bar 1 are trees. I am guessing they use an animated model fragment that the .wld loader doesn't handle.

I checked all the other .s3ds, and the placeable objects with missing models generally seem to be trees, grass, flames, waterfalls, etc (all things that are likely animated), so this doesn't bother me too much, as I think they are generally the kind of objects that you wouldn't want to include in LOS anyway.

As for CRYSCAVETELE202, it is possible that the object mesh exists in the S3D, but was never actually placed in the zone by the designer, which is why LISTOBJ doesn't list it, as no objects use that model.

And KLS, I thought your comment about bloodfields meant there were loads of objects missing for that zone too, but I guess it is just the opposite :)

Angelox 08-04-2008 02:00 PM

Ok well, I guess what already was dumped has the houses and what not - did you have time to take a look at skyfire? I'm wondering why so many mobs there don't path properly

Derision 08-04-2008 02:54 PM

Quote:

Originally Posted by Angelox (Post 153778)
Ok well, I guess what already was dumped has the houses and what not - did you have time to take a look at skyfire? I'm wondering why so many mobs there don't path properly

I saw the two at the VP entrance, but I couldn't find any others. If you could give me a list of some other mobs affected (target, #wpinfo and give me the grid numbers), I'll look into is some more.

Angelox 08-16-2008 12:02 PM

Here's a couple more; Crushbone and Najena Maps.
I'm doing maps and posting them as I do other work, not really gonna go all out and do them all at once, but I'll get there eventually - and share the ones I do get done with you all.

Flare83 08-26-2008 09:16 AM

Kael Maps
 
Here are kael maps.

kael.tar.gz

Angelox 09-05-2008 07:02 PM

Derision ;
I think I start to see a pattern in a problem -
BtW a good way to test things is with the bots, they basically make the same mistakes the Mobs do when theres a bugged area.
In Crushbone , inside the castle in the first big room where Darish spawns, there a big Table- that was a good place to camp mobs from, but any pull gets near the table and they fall through the floor and get waist deep. In Unrest building where Undead barkeep spawns, when you pull him, he tries run through the bar, and falls through the floor to the level below, then starts attacking you through the floor.
Seems when there's an object in the building like a bar, or a table, they get bugged and mobs fall though. I also noticed the bots getting caught up inside the walls in unrest building and stuck, I had to summon them out.
In the top floor, where the undead knight spawns, i set up camp and went to pull a mob from the next floor down: Big mistake! none came up the stairs, they came under the floor and attacked, eventually killed me - it was a train and the bots won't respond unless they have line of sight. Seems like there's still something missing in the maps, something that needs to be added to the azone and will solve all these problems at once. I have made new maps and still the problem remains. I made a new Unrest map with all the items incuded, still no dice.

Angelox 09-06-2008 11:21 AM

Tell me if you still want locs and I'll get them and post here.

Leere 09-06-2008 04:16 PM

I'm not sure if this is the right place for this, but since it seems to be applicable to the topic at hand...

I've been playing around with loading the various data files for the newer zones. (All the .EQG ones.) The following is a refinement of the information from both OpenEQ and also what Derision has kindly provided with his azone patches. The EQTZ format isn't fully worked out yet, but maybe someone here can finish those last pieces.

Please forgive the repeating of already known information.

(Note: When I use 'int' as an indicator for data below, I'm using it in the sense of a 32 bit entity. Using long or one of the *int_32 types, probably would be more accurate, but I've been spending too much time with java source code lately, so int has just crept up to being equated with the 32-bit incarnation. -- And please forgive the pascal esque pseudo-code, I hope it isn't too confusing.)


ZON

There are two flavors of this file. The first started to show up with the Omens of War expansion, when the EQGs were first introduced. The second I find first used for Prophecy of Ro outdoor zones. They are distinguished by the 4 byte magic string at the start.

EQGZ indicates the first format, while EQTZ indicates the second.

Format One:

The file header has already been pretty well covered.
Code:

4 bytes - magic string, indicating the format, always EQGZ
DWORD - Version (Observed ones, 1 and 2, see below for differences)
DWORD - hashsize (The size of the block of \0 terminated strings, that provide all names)
DWORD - meshcount
DWORD - objcount
DWORD - unk_count
DWORD - lightcount

Next we have the list of strings. A block of hashsize bytes.

Following that, a block of meshcount DWORDs. They are references into the namehash, each indicating a mesh that is part of the zone. Everything else that wants a mesh references this list.

The next part is what we really care about, the list of placed objects. There are objcount of these entries, and here is also the only difference I could find between versions 1 and 2.

Code:

Object format:
1 DWORD - Reference to the meshlist, for which mesh to use for the Object.
1 DWORD - Reference into the namehash, for a name for the Object.
3 DWORDs - Interpreted as floats, the location of the object. This is seen absolute.
3 DWORDs - Floats again, the rotation of the object. Entries are in radians.
1 DWORD - A float the scale of the object.

The following is only present is if the ZON is version 2.
DWORD - count
count*DWORDS

As a note, if the mesh referenced is actually a .ter, and not a .mod, then the location and rotation info has to be ignored. At least, it had to be for my tests to look right. If anyone can find a better way to handle that, I'd be more than happy.

The version 2 block seems to be some kind of coloring info, or something like that. Certainly no geometry we need to care about.

Next we have the unknown. Each of these are 40 bytes long. (Seemingly an int followed by 9 floats. Zone lines, teleporters, something like that at a guess.)

Finally, we have the light entries. Each of these is 36 bytes long. (1 int for a name reference, 8 floats for parameters. Not that it really matters for our needs.)


Format Two:
These are newline separated lines of XML-styled parameters only. The entire format is human readable, and has to be parsed as such.

The first line holds a 'P' and nothing else. The other parameters are MINLNG, MAXLNG, MINLAT, MAXLAT, QUADSPERTILE, UNITSPERVERT, ...

The only ones that we really need to generate a map file, are QUADSPERTILE and UNITSPERVERT.

The NAME property has always been identical to the name of the ZON file, which is NOT always equal to the name of the EQG. There is a .DAT in the EQG with the name indicated by it, and that holds the primary geometry info. (In particular, it's a height-map, split into tiles, made up out of quads.)


TER

MOD and TER files are largely identical. The only thing that a MOD file has, that the TER lacks, is the possibility to include a skeleton for model animation.

The format is already well enough handled by azone, and as such I'll just limit myself to some observations.

There is no BSP tree, or anything else really usefull for splitting up the zone in here. The intent seems to have been to provide big chunks of polygons sharing the same material, and just feeding that to the GPU. (Those chunks I've found so far seemed to be 200 or 400 polygons each. Maybe that can be translated into a quadtree or something else, but I haven't looked that closely yet.)

The Material Block
I've seen a reference to the data in here in another thread. If the information has already been found out since, I missed it.

For each of the parameters, of a material, there is a block of 3 DWORDs.

The first is a reference to the namehash of the file, the second a selector, and the third the data, interpreted as indicated by the second.

0 - As a float (values for parameters)
2 - Reference into the name hash (usually seen for texture names)
3 - As an int (usually color info)


The file ending. Version 1 and Version 3 end after any potential skeleton info. Version 2 ends on a DWORD, that is used as a flag. If it's 0, the file ends with that, for non-zero, there are vertex_count*8 bytes following. (Two floats per triangle, at a guess, a secondary texture coordinate pair, which version 3 pulls up into the vertex structure itself.)

My limited forrays into the meaning of the group parameter, for the polygon list, had some matches between materials using a water shader and -1 for the group (I think that is what azone calls it anyway, the non-material parameter anyway, that has a flag field vibe for me), but that's highly likely to be wrong.

So far, the existence of some 100k+ polygons for the TER entries has made my eyes want to bleed and refuse to even try to just try and match up material info to group info. Sadly, it's going to be the only place where info useable for water maps is going to be found, if it's found.


DAT

The format for the terrain files. I haven't really managed to display these yet, but they are at least parsing correctly.

From the ZON file, two parameters are needed to generate any kind of worthwhile terrain. QUADSPERTILE, to load the height values correctly, and UNITSPERVERT, to create an actual quad grid.

The format now. First the quasi header. I don't really have a clue what any of the first four entries means, but the fifth is the only thing needed to parse the file.

Code:

Header:
3 DWORDs - Three ints, that make no sense.
ASCIIZ String - One \0 terminated string. (/me mourns the nice namehash block)
DWORD - tile_count

Only tile_count is really helpful, since there are that many tile entries following now. The String in the header always had a .dds file, so perhaps it's about a kind of horizon, or something... I have no idea, anyway.

For the tiles below, some helpful variables.

quadcount = QUADSPERTILE ^ 2
vertcount = (QUADSPERTILE + 1) ^ 2

The quadcount is the number of actual quads within in a tile, and the vercount how many vertices we need to create those.

Code:

Tile format:
DWORD - LNG of the tile (longitude?) Stored with 100000 representing 0
DWORD - LAT (latitude?) See LNG for format
DWORD - unknown (some flags maybe? They showed no pattern.)

vercount * DWORDs - Height field of floats. The missing z values, for the quads
vercount * DWORDs - Color info for the verts? Something like that.
vercount * DWORDs - Something looking like color info again
quadcount * BYTE - At a guess, how the quad has to be split into triangles.
DWORD - float
DWORD - unk

if unk == 0x1 || unk == 0x2 then
  BYTE - flag

  if flag > 0 then
    4 DWORDs - Which seem to be floats
  end

  DWORD - float
else
  unk seems to be interpreted as a float in this case.
end

DWORD - layercount

layer # 0 (always present)
ASCIIZ string (name points to one of the ECO files in the EQG)

for layer = 1 to layercount-1 do
  ASCIIZ String - name of ECO for layer
  DWORD size
  size * size BYTEs (overlay map? coordinate system is confusing)
end

Parameter block (placed objects, split into 4 types)

DWORD - count#1
for i=1 to count#1 do
  ASCIIZ String - MOD name (or LOD file)
  ASCIIZ String - References an ECO file by name (just the name, no .eco)
  DWORD - LNG (identical format to the one at the start of the tile)
  DWORD - LAT
  3 DWORDs - (floats) Loc (relative to the tile)
  3 DWORDs - (floats) Rotation (in degrees)
  3 DWORDs - (floats) Scale
  BYTE - always was 0xFF
end

DWORD - count#2
for i=1 to count#2 do
  ASCIIZ String - File reference
  DWORD
  ASCIIZ String
  DWORD - LNG
  DWORD - LAT
  3 DWORDs - (floats) Loc (relative)
  3 DWORDs - (floats) rot (in degrees)
  3 DWORDs - (floats) scale
  3 DWORDs - (floats) Some kind of size?
end

DWORD - count#3
for i=1 to count#3 do
  ASCIIZ String
  ASCIIZ String
  BYTE
  DWORD - LNG
  DWORD - LAT
  3 DWORDs - (floats) Loc (relative)
  3 DWORDs - (floats) rot
  3 DWORDs - (floats) scale
  DWORD - (float) ?
end

DWORD - count#4
for i=1 to count#4 do
  ASCIIZ String
  DWORD - LNG
  DWORD - LAT
  3 DWORDs - (floats) loc (relative to tile)
  3 DWORDs - (floats) rot (in degrees)
  3 DWORDs - (floats) scale
  DWORD - (float) ?
end

The count#4 entries seemed to hold big zone geometry, like bridges, buildings and the likes. The count#2 entries looked to be about water.

The z coordinates of the objects all seemed to be relative to where on the tile the x,y pair places them. (Many 0.0s)


Since they are referenced in the DAT.

ECO - clear text, XML-esque style, defines the materials
LOD - Level of Detail, clear text, with range indications and MOD files to use then.
TOG - Some kind of model grouping, valdeholm uses these, but no idea how to find the references just yet.


I think that about sums up what I've found out about the EQTZ format. Hopefully it is of some help for the map generation project.

Derision 09-07-2008 06:17 AM

Quote:

Originally Posted by Angelox (Post 155309)
In Unrest building where Undead barkeep spawns, when you pull him, he tries run through the bar, and falls through the floor to the level below

I have code that may fix this. Essentially it changes the way FindBestZ works to a) detect if the mobs position is under the world/inside geometry and b) find all valid Z positions for the current X/Y (by valid, I mean surfaces that are upward facing and not 'under the world' and returns the closest Z.

It adds a bit more runtime overhead. For each possible Z position it casts a ray upwards. If the ray hits a face, it then checks if it is the back or front side of a polygon. E.g. if you were inside a building it would hit the front side of a downward facing poly that makes up the ceiling, so you are not under the world. If you were waist deep in the bar in unrest, the ray would hit the back side of the poly making up the top of the bar, and so you would be classed as under the world and the code would move you to the top of the bar (assuming that is 'nearer' than the floor below).

It absolutely depends on the server having Azone2 generated map files. The reason for this is that the stock azone builds EQG maps with the vertices ordered the opposite way round to S3D maps, basically meaning the 'under the world' test that works for S3D maps, returns the opposite result for EQG maps.

I'll do some more work on it one of these days.

Derision 09-07-2008 06:36 AM

In the case of Unrest and the Undead Barkeep, you can 'fix' this by altering the rule Map:FixPathingZMaxDeltaMoving from the default of 20.0 to 12.0. The reason this works is because the difference in height between the floor of the bar room and the room below is around 13.0.

I can't recall why I chose 20.0. It was probably arbitrary, but you should keep an eye out to see if this re-introduces hopping in other zones if you make this tweak.

Angelox 09-07-2008 06:39 AM

Can I build a new set of 'default' azone2 maps without the Placeable objects (other than ones already done), and continue adding the Placeable objects?
Or do you need the maps to be complete with the objects?

EDIT: I made the change 'Map:FixPathingZMaxDeltaMoving from the default of 20.0 to 12.0' and will post latter on today how that worked.

Derision 09-07-2008 06:52 AM

Quote:

Originally Posted by Angelox (Post 155399)
Can I build a new set of 'default' azone2 maps without the Placeable objects (other than ones already done), and continue adding the Placeable objects?
Or do you need the maps to be complete with the objects?

It doesn't matter whether there are objects or not. If there are objects and a mob tries to path through them, the code I am talking about would potentially give them a Z value on top of the object, unless the object was hollow, like a table, in which case it would keep them at floor level. I guess it would be possible to add some logic to try and detect things like tables, e.g. if there is a valid Z value <=3 units above the mob, then it's probably something like a table, so move them up to that level.

So, you can build a new set of default azone2 maps.

Angelox 09-07-2008 07:17 AM

Quote:

Originally Posted by Derision (Post 155400)
It doesn't matter whether there are objects or not. If there are objects and a mob tries to path through them, the code I am talking about would potentially give them a Z value on top of the object, unless the object was hollow, like a table, in which case it would keep them at floor level. I guess it would be possible to add some logic to try and detect things like tables, e.g. if there is a valid Z value <=3 units above the mob, then it's probably something like a table, so move them up to that level.

So, you can build a new set of default azone2 maps.

I'll get to work on the new azone2 maps and try have it all done today. Is the original azone2 still the valid code I should use? just to make sure something newer passed me by

Derision 09-07-2008 07:20 AM

Quote:

Originally Posted by Angelox (Post 155401)
Is the original azone2 still the valid code I should use? just to make sure something newer passed me by

Yes, I've not made any changes to it since the original post.

Angelox 09-07-2008 08:16 AM

Quote:

Originally Posted by Derision (Post 155398)
In the case of Unrest and the Undead Barkeep, you can 'fix' this by altering the rule Map:FixPathingZMaxDeltaMoving from the default of 20.0 to 12.0. The reason this works is because the difference in height between the floor of the bar room and the room below is around 13.0.

I can't recall why I chose 20.0. It was probably arbitrary, but you should keep an eye out to see if this re-introduces hopping in other zones if you make this tweak.

This worked fine, I pulled stuff from floor 1 to the top and the all followed as they should, nothing came and attacked from below. The Unrest bartender will not fall through anymore, no matter how he follows from behind the bar.
I also went to the original sky hopping test-zone (Lake of Ill Omen) and there still was no sky hopping.
Anyways, I'll keep watching as I play see what else might happen.

Angelox 09-07-2008 05:28 PM

These are all Azone2 converted Map files.
Just to be sure nothing got broke during transfer, you should have a total of 459 files in the package (watermaps included).
None of the files on the package have placeable objects added, as the batch I made would not deal with the ini file properly (kept mixing all the objects to all the maps), not to mention all the work involved in converting them - I have to keep on making those out as I can
What I did was rename my old maps to MapsOLD , and started a new Maps directory with these new maps. Then I replaced the maps with placed objects
A few maps may not work right, namely Lavastorm and Nektulos , because these were done with the eqg file present.
If so, post here and I'll make non-eqg ones.

Angelox 09-25-2008 01:27 PM

Derision;
No matter what map I use here, the Mobs stand under the huts instead of in them.
They used to stand in them

here's the updated hollowshade map

Derision 09-25-2008 01:48 PM

Quote:

Originally Posted by Angelox (Post 156894)
Derision;
No matter what map I use here, the Mobs stand under the huts instead of in them.
They used to stand in them

I think you found a bug. The aspect ratio of the huts in Hollowshade looks wrong in OpenEQ (using the same file loader routines as in Azone2). I'll look into it at some point, but it won't be for a while.

Angelox 09-25-2008 01:57 PM

Quote:

Originally Posted by Derision (Post 156895)
I think you found a bug. The aspect ratio of the huts in Hollowshade looks wrong in OpenEQ (using the same file loader routines as in Azone2). I'll look into it at some point, but it won't be for a while.

Any idea on how I can bring it back to how it was? I tried the original azone hollowshade map, and that had same results.


All times are GMT -4. The time now is 12:49 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.