Z Coordinates ...

Discussions on various DOL development features

Moderator: Support Team

Re: Z Coordinates ...

Postby Nydirac » Wed Nov 09, 2016 4:32 pm

Ops last piece missing:
on the Zone.cs INSIDE the constructor
after
Code: Select all
public Zone(Region region, ushort id, string desc, int xoff, int yoff, int width, int height, ushort zoneskinID, bool isDivingEnabled, int waterlevel, bool islava, int xpBonus, int rpBonus, int bpBonus, int coinBonus, byte realm) { m_Region = region; m_ID = id; m_Description = desc; m_XOffset = xoff; m_YOffset = yoff; m_Width = width; m_Height = height; m_zoneSkinID = zoneskinID; m_waterlevel = waterlevel; m_isDivingEnabled = isDivingEnabled; m_isLava = islava; m_bonusXP = xpBonus; m_bonusRP = rpBonus; m_bonusBP = bpBonus; m_bonusCoin = coinBonus; // initialise subzone objects and counters m_subZoneElements = new SubNodeElement[SUBZONE_NBR][]; m_initialized = false; m_realm = (eRealm)realm;
Put the loading code:
Code: Select all
// Nydirac 09/11/2016 // Load terrain and offset files for calculating Z // TODO: if needed load water map // factors loading.... // Yeah better to create some field on the db but i cant bother now... Its pretty simple to do string sectorpath = GameServer.Instance.Configuration.RootDirectory + "\\ServerFiles\\dat" + id.ToString("000") + "\\sector.dat"; if (File.Exists(sectorpath)) { TextReader reader = File.OpenText(sectorpath); string line; while ((line = reader.ReadLine()) != null) { line = line.ToLower(); if (line.Contains("scalefactor")) { m_scalefactor = byte.Parse(line.Replace("scalefactor", "").Replace("=", "").Trim()); // separate replace of = because of inconsistency of spaces... not worth the time to use regex if (m_offsetfactor != 0) //Dont need to parse ALL the file, its ugly but meh break; } if (line.Contains("offsetfactor")) { m_offsetfactor = byte.Parse(line.Replace("offsetfactor", "").Replace("=", "").Trim()); if (m_scalefactor != 0) //Dont need to parse ALL the file, its ugly but meh break; } } } // Offset loading... string offsetpath = GameServer.Instance.Configuration.RootDirectory + "\\ServerFiles\\dat" + id.ToString("000") + "\\offset.pcx"; if (File.Exists(offsetpath)) { System.Drawing.Bitmap offsetbmap = PCXFile.getBitmap(offsetpath); byte[,] zoff = new byte[256, 256]; for (int y = 0; y < 255; y++) { for (int x = 0; x < 255; x++) { zoff[x, y] = offsetbmap.GetPixel(x, y).R; } } m_zoneOffset = zoff; } // Offset loading... string terrainpath = GameServer.Instance.Configuration.RootDirectory + "\\ServerFiles\\dat" + id.ToString("000") + "\\terrain.pcx"; if (File.Exists(terrainpath)) { System.Drawing.Bitmap terrainbmap = PCXFile.getBitmap(terrainpath); byte[,] zterr = new byte[256, 256]; for (int y = 0; y < 255; y++) { for (int x = 0; x < 255; x++) { zterr[x, y] = terrainbmap.GetPixel(x, y).R; } } m_zoneTerrain = zterr; } if (m_offsetfactor != 0 && m_scalefactor != 0 && m_zoneTerrain != null && m_zoneOffset != null) // Z System components needed m_zActive = true;
User avatar
Nydirac
Inactive Staff Member
 
Posts: 31
Joined: Sun Sep 21, 2003 6:11 pm
Website: http://www.promiseshard.com/

Re: Z Coordinates ...

Postby Graveen » Thu Nov 10, 2016 2:10 pm

Excellent Nydirac ! Thank you VM !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Z Coordinates ...

Postby Nydirac » Thu Nov 10, 2016 3:32 pm

I might have removed the attachment of the script by mistake, here you go for the simple test script:

Code: Select all
// Author: Nydirac // Date: 09/11/2016 // using System; using DOL.GS; using DOL.GS.PacketHandler; using DOL.Language; namespace DOL.GS.Commands { [CmdAttribute( "&getz", ePrivLevel.GM, "/getz *target* (self or other)")] public class getzCommandHandler : AbstractCommandHandler, ICommandHandler { public void OnCommand(GameClient client, string[] args) { GameObject obj = null; if(client.Player != null) { if (client.Player.TargetObject != null) obj = client.Player.TargetObject; else obj = client.Player; } if (obj != null) { if (obj.CurrentZone.zActive) client.Out.SendMessage(string.Format("Server calulated Z [{3}] for the Object {5} [X: {0} Y: {1} Object's Z: {4}) ZoneID: {2}]", obj.X, obj.Y, obj.CurrentZone.ID, obj.CurrentZone.getZ(obj.X, obj.Y), obj.Z, obj.ToString()), eChatType.CT_Help, eChatLoc.CL_SystemWindow); else client.Out.SendMessage("Data for calculating Z not present!", eChatType.CT_Help, eChatLoc.CL_SystemWindow); } } } }
User avatar
Nydirac
Inactive Staff Member
 
Posts: 31
Joined: Sun Sep 21, 2003 6:11 pm
Website: http://www.promiseshard.com/

Re: Z Coordinates ...

Postby elcotek » Thu Nov 10, 2016 6:04 pm

very interesting, Hug :wink:
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Z Coordinates ...

Postby Nydirac » Fri Nov 18, 2016 8:36 pm

While i have the old code on the PC... any other "big" thing missing from the server? What is missing?
And anyone has a simple/decent updated database for development purpose?

By the way: anyone has any idea if the lack of players is a temporary thing or if daoc is going to be completely abandoned? Just to know if this searching around is worth something :)


PS: I know some shards have custom maps, the editor is open source/available or is kept private? Thanks!
User avatar
Nydirac
Inactive Staff Member
 
Posts: 31
Joined: Sun Sep 21, 2003 6:11 pm
Website: http://www.promiseshard.com/

Re: Z Coordinates ...

Postby Graveen » Fri Nov 18, 2016 9:01 pm

Hello Nydirac,

It worths a pull request on Github... Thank you.

I don't believe the lack of player is temporary.. i think there is room for 2 or 3 shards, but no more. DAoC live is around 1k in prime time. Anyway, this is interesting to keep dol up to date.

DOL Pub DB 3.0 alpha should be enough.

No shard is actually contributing anymore. Either in code base or tools, it's a desert :D
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Z Coordinates ...

Postby Nydirac » Sat Nov 19, 2016 5:18 pm

Hello Graveen! I'm a little unsure if you're suggesting i do a pull request to add the z calculation code or if you're suggesting i do the pull to put other things :D
Honestly i have NO idea whatsoever about the things which are still missing so i don't know HOW to contribute (and from what you have said IF its worth contributing at all :?)
Still i have an attack of nostalgia and i'm seriously considering putting some work on DOL. Maybe implmeneting a basic pathfinding for the mobs? a public map editor? Some tweaks on the game? not sure if something which is different from the official game is going to be worth something to someone... but I haven't played on a original server in MANY years and i have no idea of what is the official state..

The DOL Pub DB 3.0 alpha is not compatible with the last master branch of DOL (i have started the conversion but its a pain in the XXX lol), some field on the database have changed and not knowing the new DB logic its going to take some hours of searching around.

Its a pity DAOC has degenerated to this state, i always though it was more estetically appeasing of WOW (who still has a huge member base) and has more depth but i guess i was wrong :(
User avatar
Nydirac
Inactive Staff Member
 
Posts: 31
Joined: Sun Sep 21, 2003 6:11 pm
Website: http://www.promiseshard.com/

Re: Z Coordinates ...

Postby Leodagan » Sun Nov 20, 2016 8:40 am

DAoC is changing a lot with Broadsword taking back support from Mythic...

The Latest patch notes are full of changes that will need a lot of customization

Light Tank now have different Combat Stances, Casters have some basic utility whatever Specialization they choose (no more specs without nuke...), Crowd Control Mechanisms have been re-balanced and new CC are implemented (Slow as unbreakable Snare etc...), Run Speed Buff are now all like Bard/Minstrel/Skald version changing the default "core classes" to go RvR !

Latest patch completely changed the utility of Pet Classes, raising Pet Level to full player Level or even above, distributing skills around each specs and no more "Pet Enhancing Specs" but each spec has different skills to enhance pets, Spiritmaster, Enchanter, Cabalist are now really different from classic or even catacombs DAoC...

Necromancer is no more a summoning class but a shape shifter class that can have Tank role, Nuke role or Debuff role... (and one spec is an enhanced summoner), Warlock is completely modified too reducing it's damage output at beginning of fight but having curses that greatly raise its damage output in longer fights

Stats caps and buff caps are changed too, having a higher overall stats number which has impact on how Support Class are played to reduce passive buff bot play style and use more in-combat short timed high effective buffs


Honestly it's not really about making decisions or contributing to the public DB or updating some spellhandler to implement specific mechanisms, there is really a HUGE AMOUNT of work to try to reach the same state as official Latest "Broadsword" DAoC !


----

For DOL improvement there are a number of problems too...

A lot of Tools or Databases around this Old game are not receiving upgrade to match the fast pace of the current updates, Charplan is not updated anymore, Realm Abilities Calculator and similar tools are really outdated !

For my part I don't have any more Fan-Sourced reliable Data, I was relying a lot on these sources to gather data around skills values and skill tree, but the official player base is getting really low to even maintain those tools, that mean I would need to play on official servers to gather the data myself, and mostly create these databases anew or even build similar tools !


Software like DAoC Portal and Connect.exe are really hard to upgrade, we have lost most of people who knows how these works and who have skills to improve them, we're technically still stuck to DAoC game.dll 1.109 if we want to keep shard easy to connect to !

I could go on with other examples of Code/Data resources that can't match current DAoC status...

----

For Client Side Z-Coordinates, I've been working on some library for long time now, and have trouble understanding ALL game files, Terrain Region like Nydirac Contributions are the "easy part", but there are still Dungeon geometry, water geometry, Keep and Tower geometry which need more customization to work flawlessly.


I've been trying to implement Pathfinding for months and it's really hard to come with every use case, and I try to keep DOL working even without Client Files for shard admin that can't have all the Memory needed to load asset for their server.


Here are some links :

https://github.com/dol-leodagan/DaocClientLib (Client Library to extract zone files)
https://github.com/dol-leodagan/DOLShar ... gion-water (Proof of Concept to use Water Map for diving)
https://github.com/dol-leodagan/niflib.net (Library to load DAOC 3D Mesh)

This is still really experimental, and I lack time and help to work more seriously on these !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Z Coordinates ...

Postby Nydirac » Sun Nov 20, 2016 9:36 am

Hi Leodagan! very informative post, like i said earlier i'm a little outdated so i really have no idea of what is needed right now.
I'm happy to hear there is a chance of things going better for DAOC! From what you're saying i think the following things need to be made:

1: Reverse engineer the new game.dll to find out the new protection systems used by Daoc.... i MIGHT be able to help with this, i have very vague memory of the initial work done and i think i can contact someone (if they still monitor the same email adresses...) who MIGHT have some of the original source code... many MIGHT :)
2: Finda source of updated informations about the official implementation of the game.
3: Do a new (or update) generic tool for managing the gameserver resources (Mob creation, spells, styles, quests, etcetc)
4: Help you with the 3d library to do a good pathfiniding implementation. (Uthgard has done some pathing? anyone know if its a full featured thing or a simplistic implementation?)


You're right my part for the z calculation was the easy part ( in fact it work only on the pure "2D" regions, all the dungeons are excluded...) but it was the thing i already had done when i was developing for Promise Shard in late 2006.... its a 10 year old thing! I have almost no experience on 3d modeling but i might be able to help if you have something to task me with :)

Could you explain to me what you're doing with the "water map for diving", i have no idea of what it is :) I used the water.pcx for using it to check movement for mobs in 2006 (if someone is interested the parser i posted some days extract the file) but i think you're implying something more....
User avatar
Nydirac
Inactive Staff Member
 
Posts: 31
Joined: Sun Sep 21, 2003 6:11 pm
Website: http://www.promiseshard.com/

Re: Z Coordinates ...

Postby Leodagan » Sun Nov 20, 2016 10:05 am

for the Water map it's a current limitation of DOL supporting only one Z-Value for global region water height...

Using the Water Map I can exclude area which are not "rivers" from checking the Region Water Height and prevent triggering Diving script when there is terrain lower than water (mobs not switching to Swimming animation, player not having their drowning bar displaying etc...), there is also some region with different water area at different heights (Muspelheim with multiple Lava pool...) this can be resolved with the Water Map, and lastly Dungeons have specific Water Area that are 3D area and I still can't understand how they are located in client world, I made some tests around ToA sunken dungeons and a single Z-Value for Water won't make it !


For Uthgard I had some discussion about their Pathfinding implementation, and they rely on Classic DAoC when diving wasn't enabled !

So they only use 2 dimension navigation mesh with some customization to enable Ladders and Doors, it's already a great achievement, but for anything above ToA version we'll need to handle underwater positions as well, and for new Frontiers Keep we'll need to handle dynamic navigation mesh when Keep are moved around or destroyed by siege weapon !


For game.dll I would really love that we could handle encryption instead of disabling it to make it work with shards, but I can't wrap my head around where the "public key" of the Shard should be inserted ! We also lack the updated libraries to handle custom DAoC RSA and RC4 implementation but there are still public outdated sources available to start from...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Z Coordinates ...

Postby Nydirac » Sun Nov 20, 2016 11:21 am

If i remember correctly the reason the encryption was disabled was the need to modify the client to enable it (big taboo back then, now i see the shard have no problem distribuiting modified files...) or knowing the correct official public key... not happening :) so it was decided to simply not use it... i THINK its possible to enable it (i have to sub to the official server e do some packet sniffing and looking around the game.dll code to be sure) but then we need to give a modified copy of some files (i presume the game.dll) or a new loader who will modify the memory of the game...

Anyone has done osme research about the new game.dll? its know if its a problem of different packets or a new forced encryption? I remember the trick they used "encrypting" at version around 1.68 using a simple bit to bit oeprator (OR) with the version number on the whole packets... maybe they have done something similar now?

I have looked at your project: I'm impressed! i see you have the map generation already done and you have already done the navmesh! What do you need to finish it?

Question: i see in the DaocClientLib code you have a whole section for craft data... are you saying all the info for the recipes are hardcoded on the client? i thought only the "name" and id of the recipe was present :shock:
User avatar
Nydirac
Inactive Staff Member
 
Posts: 31
Joined: Sun Sep 21, 2003 6:11 pm
Website: http://www.promiseshard.com/

Re: Z Coordinates ...

Postby Leodagan » Sun Nov 20, 2016 12:21 pm

To my knowledge there is no real trouble with newer game.dll except some packet changes are not implemented and some of them (like tooltips or ) need in-depth change to the DOL Core.

The public key is a matter of reverse engineering client and finding correct method to either replace it in memory or in file, but like you said it can easily get into a "taboo" area with client modding and weakening client security (not giving too much help for people building radars or sniffers...), I won't be surprised if Graveen still ask us to keep this kind of discussion more private ;)

My project is not really finished, it's a bit slow to put all files together, I don't have any mechanics to rebuild full region only zone for now, it's linked with SharpNav which is a Navmesh library but I don't know how to tune it for now and add obstacle like doors and ladders...

I still have to make decisions for keeping the data "in-memory" or using effective "lazy-loading" to reduce stress on Shards because it's going to be CPU and Memory Intensive !

I'm not sure about some accuracy of the map generation, like I said terrains are pretty easy and will only need dumb offset and scaling, but for dungeons / cities I have trouble with mirrored meshes, there is a lot of matrix transformation involved and except the "visual result" I can't tell how this will match server engine location exactly.

Craft Data was the initial project of this Client Library, it's a C# implementation of DAOC-TB "Book of Crafts" which actually read the binary client asset to build the craft list, so I can confirm, all Item Name, Recipe ID, and Ingredient Display with amount is completely hard coded in client files.

By the way there have been huge change to craft on official, reducing the need of base material for recipes (like Clothing Leather needed for Reinforced Armors etc...), changing the requirements and progression of Siege Crafting, modifying some spellcraft gem value and imbue cap, adding new stats to "legendary" items...

As these are hardcoded I suspect a lot of Shards distribute their own Craft Patch (probably just a rollback to an earlier game file) or have completely broken recipes...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Z Coordinates ...

Postby elcotek » Sun Nov 20, 2016 4:14 pm

The Dol project need a static version to work on,

We can't follow every patch from live, this will only slow down the project and hinder the support by users.

I personaly don't understand why dol follows the new patch versions from live, there was to mutch changes and not all will or can follow and change every item or spell or functions to newer versions.

Why not use one stable base like 1.109 and let the custimize, and fix first all outstanding bugs and missing functions and complete the db to this version state ?
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Z Coordinates ...

Postby Nydirac » Sun Nov 20, 2016 5:51 pm

I will see if i can help somehow on your project but i have a lot of catchup to do :)

for the new game.dll it seem the dolloader fail to patch it... are you sure you're capable of running it without problem? (i tried with the 1.122 version). Anyway I started to decompile the dolloader.exe just in case... it was packed with UPX and protected, if you want an unpacked version just say so and i will PM it :) (its still going to be a pain in the ass to generate the high level code but the asm file is good!).
Do you know if the creators of the connect.exe file (from daocportal) are still around? maybe its easier that way! (the file is super obfuscated :/)
User avatar
Nydirac
Inactive Staff Member
 
Posts: 31
Joined: Sun Sep 21, 2003 6:11 pm
Website: http://www.promiseshard.com/

Re: Z Coordinates ...

Postby Graveen » Sun Nov 20, 2016 9:06 pm

Yop Mydirac, PM'ing you ;)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” DOL Development Discussion

Who is online

Users browsing this forum: No registered users and 1 guest