EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Tools (https://www.eqemulator.org/forums/forumdisplay.php?f=593)
-   -   EQG Zone Importer (https://www.eqemulator.org/forums/showthread.php?t=38384)

Zaela_S 06-13-2014 11:04 PM

EQG Zone Importer
 
By request-ish. A simple program for importing custom models and editing data for EQG-based zones.

Download link. Also on github.

http://i.imgur.com/haRYvg8.png

http://i.imgur.com/vI53d88.png

Zones are imported from the Wavefront .obj format. Instructions are mostly the same as for the EQG Weapon Model Importer.

Namely, from your 3D modelling program (such as Blender) you'll want to export to .obj with these options or equivalents:

* Apply Modifiers
* Include Edges
* Write Normals
* Include UVs
* Write Materials
* Triangulate Faces
* Objects as OBJ Objects

However, unlike with weapon models, zone models stick closely to the in-game coordinate system. So you'll want to export with positive Z as the Up direction.


This tool may have bugs etc etc. Some improvements could also be made if there is any interest. Currently it can only view data for zones using some of the earlier EQG formats (which is what this tool imports custom zones as). Also, it would probably be nice to survey existing "regions" in various zones to see what the options there are -- the "type" of region seems to depend on the region's name (e.g. "AWT_water" presumably makes the region count as water). The effects of individual bits in the per-triangle flags is also unknown -- if anyone figures some of them out, I'll add labels and make it possible to mass-edit triangle flags somehow.

Zaela_S 06-14-2014 06:29 AM

Just wanted to confirm something I'd been wondering about: namely, whether the client cares if a particular zone is loaded from an S3D or an EQG.

It doesn't. Creating a "gfaydark.eqg" and importing a zone model to it was enough to make the game load that over the gfaydark.s3d files. So, hopefully, there won't be any reason to bother with the old, terrible formats as far as zones are concerned.

edit: added the ability to make empty EQG files to the tool in order to facilitate that.

One mild annoyance is that the zone's _chr.s3d file won't be loaded by default if the main geometry is loaded from an .eqg file instead. But I imagine you could get around that via the _chr.txt file just fine.

Zaela_S 06-14-2014 11:59 PM

Quote:

Originally Posted by Zaela_S (Post 231217)
Just wanted to confirm something I'd been wondering about: namely, whether the client cares if a particular zone is loaded from an S3D or an EQG.

It doesn't. Creating a "gfaydark.eqg" and importing a zone model to it was enough to make the game load that over the gfaydark.s3d files.

So long as I'm talking to myself here, I suspect the same would be true of NPC models, at least the non-built-in-global ones. Will be interesting to see if I get around to making an animated model importer.

Kingly_Krab 06-15-2014 12:02 AM

Quote:

Originally Posted by Zaela_S (Post 231240)
So long as I'm talking to myself here, I suspect the same would be true of NPC models, at least the non-built-in-global ones. Will be interesting to see if I get around to making an animated model importer.

That would be cool, once people start making use of these tools we'll start seeing much more custom stuff and this will open a new world of ideas and content to people.

Akkadius 06-15-2014 02:29 AM

Once again Zaela, you're going to be talking to yourself at first. For most people its just seeing before believing.

You're doing remarkable work.

Weldarr 06-15-2014 06:52 AM

Quote:

Originally Posted by Zaela_S (Post 231240)
So long as I'm talking to myself here, I suspect the same would be true of NPC models, at least the non-built-in-global ones. Will be interesting to see if I get around to making an animated model importer.


Zaela, you can definitely do this with the older graphic animations. I have been able to manually overwrite older graphics using the same identifier.

http://i.imgur.com/rLtEEEd.png

http://i.imgur.com/6jivaT1.png

Both of these use the old akheva identifiers (akf, akm) and were manually edited to use the newer EQLive akhevan graphics (identifiers; ahm, ahf). Also an interesting thing about some older models, is that many actually have male, female and neutral model types but only one or two of them have a graphic associated with them. (Old Akhevan Identifers: akf, akm, akn)

This is the model identifier list that I pulled from EQGraphicsDX9.dll for Titanium Client (other clients will have more on their respective lists):

Code:

HUM.HUF.KRB.FRY.CWR.ZMM.ZMF.MNR.EVE.SNK.SHL.MYG.KOR.GGY.FGP.DRC.DCM.DCF.CRL.CRH.ORK.CWG.FNG.KBD.WWF.FGT.SHD.LSQ.LSP.SEG.ASM.LVR.DRS.DRE.ANS.SPQ.TAR.PMA.SDR.MDR.BAS.LDR.KRN.GBN.DKE.DVS.CDR.MES.RKP.CNP.PRT.CRS.MAP.DBP.ROB.DBX.MNT.DDV.DSF.FRD.DMA.DDM.CHM.FRA.DSG.SCU.MUR.CLV.TGO.TLN.ISE.ISB.IWB.ILB.IFC.IBR.IHU.ICY.ILA.IEC.IWH.TTB.TMB.TAC.TWF.TGL.BON.CPT.R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HPF.HPM.OPF.OPM.DPF.DPM.GPF.GPM.TSF.TSM.FBF.FBM.TBF.TBM.REF.REN.REM.TPF.TPN.TPM.GSF.GSN.GSM.AKF.AKN.AKM.SDM.SHM.HSF.HSN.HSM.VPF.VPM.GMF.GMN.WAL.VRM.SIF.SIN.SIM.DRF.DRM.IVF.IVM.CEF.CEN.CEM.GEF.GEM.GDF.GDM.GFF.GFM.MIF.MIM.DVF.DVM.VSF.VSM.KAN.GAR.HLF.HLM.CLN.LIM.EGF.EGM.NGF.NGM.FPF.FPM.PIM.SPI.TEF.TEN.FAF.FAM.BRF.BRM.BGF.ZOF.ZOM.HHF.HHM.AVI.GOF.WOF.WOL.WOM.QCF.QCN.QCM.BEA.GOB.GNN.DRA.SHP.LAUNCHM.LAUNCH..DWF.DWM.OGF.OGM.ELF.ELM.BAF.BAM.DAF.DAM.HOF.HOM.HIF.HIM.HAF.HAM.ERF.ERM.IKM.KEF.KEM.FRM.PRE.SHIP....BOAT....PPOINT..MINIPOM200
Thing to note: the list counts down from KRB as the first real graphic as Race #475

I would assume it to be possible to add a dll hook/inject in that would allow us to make our own identifiers, but that is beyond my expertise level and something that I have never honestly tried. Maybe someone with a bit more knowledge on that front could look into it.

- Vaion
The Hidden Forest

Zaela_S 06-15-2014 11:39 AM

Quote:

Originally Posted by Weldarr (Post 231251)
Zaela, you can definitely do this with the older graphic animations. I have been able to manually overwrite older graphics using the same identifier.

Makes sense.

Quote:

Originally Posted by Weldarr (Post 231251)
I would assume it to be possible to add a dll hook/inject in that would allow us to make our own identifiers, but that is beyond my expertise level and something that I have never honestly tried. Maybe someone with a bit more knowledge on that front could look into it.

Saw someone do this just the other day! Beyond me too, though... Probably a bit heavy-duty for general use anyway.


Anywho: added region types to this tool since they had apparently been figured out already.

Akkadius 06-15-2014 04:01 PM

Secrets has quite a bit of dll injection experience.

Secrets 06-15-2014 06:52 PM

There's a part of the eqgame.exe that deals with exactly what you are trying to do.

The identifier for NPCs, as you have noted in your disassembly, can be a string that identifies a specific model and its parts.

For example, HUM refers to human male models. So in disassembly, we have pseudocode that looks like this in the class constructor:

Code:

  CRaceGenderInfoManager::AddRaceGender(pCRaceGenderInfoManager, 1, 0, "HUM", 4, 522);
 CRaceGenderInfoManager::AddRaceGender(pCRaceGenderInfoManager, 1, 1, "HUF", 4, 522);

*The first parameter is the global instance of CRaceGenderInfoManager.
*The second parameter is the ID of the race.
*The third parameter determines the gender (0, 1, 2) of the NPC. The fourth is a bitmask that tells the client what the latest model file format will be for this NPC. I'm unsure of its purpose but all EQG formats have 8 as the bitmask. Basically, it's for animations in some way.
*The fifth parameter is optional and contains fallback race animations in case those listed for the model fail to load. For Humans and some other races, it is 522 (Drakkin) for the fallback animations.

You can find the class constructor in the UF/SoD client by searching for "SHIP" and it's the only reference of the string "SHIP" in the defined strings list in IDA.

The animations are linked to the base model, and as such there's no way to load them from the client I believe. The animation data is stored in the wld file for S3Ds.

Yes, it is possible to add VoA+ models to the UF client. You'd just copy the lines from disassembly to a DLL to add the NPC models from the later clients.
Hook CRaceGenderInfoManager::CRaceGenderInfoManager() (the constructor that adds the races) and after it's done constructing, add in the races you'd like while using the instance returned from the thisptr.

Hope that gives some insight.

Zaela_S 06-15-2014 09:50 PM

Thanks. Knew most of that at this point, actually. It's the "how to do dll injection 101" part that is beyond me ;p

Not really relevant (yet?) anyway. I can't see myself making any injection patcher type thing.

Zaela_S 06-16-2014 08:45 AM

Added a small utility to convert S3D-based zones into EQG-based zones. Not at all complete -- just handles the main geometry at the moment, not things like placed objects, texture transparency masking, vertex lighting, etc...

Not terribly useful and easily the Feature Most Likely to Crash, but I mostly just wanted to put gfay underwater for a minute:

http://i.imgur.com/sRPIRWA.png

http://i.imgur.com/B2WXSPE.png

Underwater rain is a bit surreal. Making all of Kelethin into a slippy-slidey ice region would be fun too, but obviously harder to show.

I've decided that if I ever do try to make a zone, it'll be an epic tower climb where at least one floor is made of lava.

Secrets 06-16-2014 04:10 PM

Quote:

Originally Posted by Zaela_S (Post 231282)
Added a small utility to convert S3D-based zones into EQG-based zones. Not at all complete -- just handles the main geometry at the moment, not things like placed objects, texture transparency masking, vertex lighting, etc...

Not terribly useful and easily the Feature Most Likely to Crash, but I mostly just wanted to put gfay underwater for a minute:

http://i.imgur.com/sRPIRWA.png

http://i.imgur.com/B2WXSPE.png

Underwater rain is a bit surreal. Making all of Kelethin into a slippy-slidey ice region would be fun too, but obviously harder to show.

I've decided that if I ever do try to make a zone, it'll be an epic tower climb where at least one floor is made of lava.

/that/ is fucking amazing rofl

Packet 06-16-2014 06:31 PM

Thank you for the help Zaela. Much appreciated. :)

Just to show what I am working on, this is my latest work in building a moba-style server. The layout & concept was inspired by League of Legends and will resemble it as much as legally possible. This has not been imported yet however I'll be trying my best to work this in as the cornerstone zone for matches. I've put roughly 22 hours into this map so far.

- The beginning of the geometry & texture mapping.
http://xonos.net/test/moba_ss1.bmp

- Got some shiny rocks and a tree!
http://xonos.net/zone/ss2.png

- Getting closer to finishing.
http://xonos.net/zone/ss3.png
-
http://xonos.net/zone/ss4.png
-
http://xonos.net/zone/ss5.png


More shots on the next post.

Packet 06-16-2014 06:32 PM

http://xonos.net/zone/ss6.png
-
http://xonos.net/zone/ss7.png
-
http://xonos.net/zone/ss8.png
-
http://xonos.net/zone/ss9.png

KLS 06-16-2014 07:01 PM

I wondered why you were asking me about how EQG Regions worked the other day, I didn't know it would be to drown the elves.


All times are GMT -4. The time now is 04:00 PM.

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