Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2008, 03:09 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default 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.
Reply With Quote
  #2  
Old 06-14-2008, 03:17 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

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!
Reply With Quote
  #3  
Old 06-14-2008, 03:42 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Angelox View Post
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.
Reply With Quote
  #4  
Old 06-14-2008, 03:58 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

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.
Reply With Quote
  #5  
Old 06-21-2008, 03:10 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

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 View Post

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
Reply With Quote
  #6  
Old 06-21-2008, 03:50 PM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

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.
__________________
Maybe I should try making one of these servers...

Last edited by Scorpious2k; 06-21-2008 at 11:54 PM..
Reply With Quote
  #7  
Old 06-21-2008, 04:12 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Scorpious2k View Post
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.
Reply With Quote
  #8  
Old 06-22-2008, 08:25 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

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();
Reply With Quote
  #9  
Old 06-22-2008, 11:16 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

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.
Reply With Quote
  #10  
Old 06-22-2008, 12:03 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

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.
Reply With Quote
  #11  
Old 06-22-2008, 12:22 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Quote:
Originally Posted by Derision View Post
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
Reply With Quote
  #12  
Old 06-22-2008, 12:31 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

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.
Reply With Quote
  #13  
Old 06-29-2008, 08:20 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

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.



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



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.



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.



You can test by trying to cast a spell on a mob in the ruins that you cannot see.
Reply With Quote
  #14  
Old 06-29-2008, 02:05 PM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

This is ver cool. Thank you! It would be nice to get people involved in building an official "azone.ini", eh?
Reply With Quote
  #15  
Old 08-02-2008, 03:04 PM
Flare83
Sarnak
 
Join Date: Aug 2008
Location: usa
Posts: 43
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:30 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3