Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server
You last visited: Today at 15:39

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Request] Edit .wld and Portal

Discussion on [Request] Edit .wld and Portal within the Shaiya Private Server forum part of the Shaiya category.

Reply
 
Old   #1
 
regvn's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 17
Received Thanks: 39
[Request] Edit .wld and Portal

[request to close]
regvn is offline  
Thanks
3 Users
Old 08/23/2013, 10:23   #2
 
AxelMac's Avatar
 
elite*gold: 0
Join Date: Aug 2012
Posts: 454
Received Thanks: 111
you do not need to change wld
AxelMac is offline  
Old 08/24/2013, 02:38   #3
 
castor4878's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 717
Received Thanks: 3,366
of course it's mandatory.

oh you mean "one can make an event without changing any wld file", that's true and of topic.

regvn, pls describe the type of portal you want to use (its appareance) and its location, I will make the change for you (and may be you wanna do it for a dark map as well).
castor4878 is offline  
Thanks
2 Users
Old 08/24/2013, 10:02   #4
 
castor4878's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 717
Received Thanks: 3,366
And « voila ».


regarding details:
- from your picts, the first portal is defined by a shape (the "Portal_Out.smod" file) and an effect (the 22nd in the world_a1.eft file); the second is only materialized by an effect (most of recent maps use these rifts-like portals).

- the portal definition can also include a named area that displays a name when the mouse is over it, I included one and set it to "Deep-Desert2", you can provide your own description with a new comment in the world/1.txt file with the tag number 66

Also note that I've used the "last but one" OS map that provides 2 portals to Cornwell's Ruins (the standard one, map 5 and the new -dread- relooked one (map 82)) - I didn't use the very last map with the 3 new portals to dungeon 55, 60 & 65+ in the middle of Keo.

regarding target of portal, the wld file contains a destination but only the one defined in the server sided 1.svmap file is relevant, you must edit your file and insert a new (#8) record.
(as an example, here is a valid def for all portals defined in the 1.wld file)

if the portal is linked to a mob / boss you will use an unique faction identifier bigger than 1000 (instead of the 1 listed above) and you will edit the map.ini file (edition of 1.svmap is still required).

have fun with your new map - original & creative idea are quite scarce.
Attached Files
File Type: zip 1.zip (2.85 MB, 2031 views)
castor4878 is offline  
Thanks
11 Users
Old 08/26/2013, 05:08   #5
 
castor4878's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 717
Received Thanks: 3,366
first ?... you should use shStdio 0.7.5+ which is NOT publically available, sorry.
castor4878 is offline  
Thanks
4 Users
Old 08/26/2013, 05:31   #6
 
elite*gold: 0
Join Date: Jul 2010
Posts: 523
Received Thanks: 523
Is the wld file 'packed' somehow? (dont know how to explain it)

I mean, I was trying to figure out the structure (data types lenght) and those stuff, to be able to hex insert new models in an existant wld. And that way, taking a map, deleting the buildings/shapes and adding other buildings, so it would be an 'original' map, diferent from the ones we're used to.

Does every wld (FLD) file have the same internal structure?
sominus is offline  
Thanks
1 User
Old 08/26/2013, 06:34   #7
 
castor4878's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 717
Received Thanks: 3,366
Quote:
Originally Posted by sominus View Post
Does every wld (FLD) file have the same internal structure?
Yes ... and nobody asked it so far, your post is (still) not such a request but at least it looks like
castor4878 is offline  
Thanks
3 Users
Old 08/26/2013, 20:14   #8
 
elite*gold: 0
Join Date: Jul 2010
Posts: 523
Received Thanks: 523
I've tried searching for 'patterns', counting bytes and so but, (If I got right) DUN files are made of 3d objects from the Entity folder, while FLD must also have topographic info somewhere inside the WLD file, and I have no idea how to seek where that data start and end (to separate the tophografic data, from the entities data). And of course I dont know how 'real' data types (e.g. coordinates 0.00) are stored in Hex.
sominus is offline  
Thanks
1 User
Old 08/27/2013, 00:08   #9
 
castor4878's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 717
Received Thanks: 3,366
ok, you are in the right way and your assumptions are correct.
The wld files start with an 32-bit identifier, 'DUN\0' for dungeon, 'FLD\0' for "field-map".
The sole difference between these 2 formats is the description of the global scene.

All data are little-endian encoded, they are wintel data (the previous idents were reversed).

All following integers and floats are read using little-endian encoding.
All floats are simple-precision floating values as per IEEE 754, with most of languages you simply read a float4 or read 4 bytes and cast the address of them to the address of a float4.

The file also contains string, they are - for the wld files - defined on 256 bytes, aligned at left of buffer (string starts at offset 0), they are not length prefixed, they are zero-terminated, all remaining bytes (until offset 255) are garbage random data. let's call such block a "String256".

For field-map, there is, as you assume, a topographic block, it starts with the map-size (int32), it is 1024 or 2048.
Then comes a map-height, meaning "something" that describes the height of the ground for each point of the mesh; I don't success to understand it (it the last unknown part) but its size is constant and is equate to 0x000C0C03 if size is 1024 and 0x00301803 if size is 2048.
These figures equate to: 0803h + 0C0400h and 0803h + 301000h = 0803h + 4 * 0C0400h.
(and a map with a side of 2048 is of course 4 times larger than one with a 1024 side)
the meaning of the header (0803h bytes) and the coding of "heights" is unknown. (so no way to build a new terrain).
May be someone fluent with maps generator softs can understand these data and/or gives advices based on common practices in this domain.

The FLD maps also contain some "texture-sound" couple (I didn't invest to get their purpose).
The block consists in:
- number of records: int32
- record:
String256 name of a tga file (of course actual file is a DDS)
float4 unknown (0x00000041 and 0x00008040 are frequent)
String256 name of a wav file

After that point the structure of FLD & DUN files are the same. Here are some additional information:

The first item is a String256, for FLD it's a .wtr file (water definition that defines apparently the "sea" under the map-height), for DUN it is a .dg file that defines the dungeon geometry (a new kind of stacks of layers, far most complicated than smod, and using yet another vertex formats).

Then come 7 blocks, each defines an array of smod files stored in a specific subfolder of "./Entity" (or world/dungeon) and an array of vertices (that defines where & how the shape is inserted).
All these blocks share the same format:
- number of strings to follow: int32
- n * String256, smod filename to be read from Building, Shape, Tree, Grass, Vani (x2), world/dungeon, Mani
- number of vertices to follow, int32
- vertices as:
- index of a smod, int32
- coords x1, y1, z1, float4
- coords x2, y2, z2, float4
- params k,m,n, float4

(the meaning of parameters depends of the block, for most of them it seems to be some orientation and azimut).

That is not the full structure but it should help you to go further in your coding.
castor4878 is offline  
Thanks
11 Users
Old 08/27/2013, 01:13   #10
 
elite*gold: 0
Join Date: Jul 2010
Posts: 523
Received Thanks: 523
float4, that's what I was looking for. I didn't understand how to convert them to decimal and reverse yet (I barely can use VB.net which isn't that good), but with all that info I'll have fun investigating what a wld is made of.

float4, that's what I was looking for. I didn't understand how to convert them to decimal and reverse yet (I barely can use VB.net which isn't that good), but with all that info I'll have fun investigating what a wld is made of.

Update:
I update this since it doesn't worth making a new thread about.

I've been doing some tests with python about the wld format (using the info Castor gave us).
I've used 35.wld for the test. (Apulune)

The terrain data starts at byte 8 and finish at byte C0C0A (has a lenght of C0C03).

It seems those bytes indicates point heights, but I don't know if they are Int or Float values.
I've tested using Int values, with a value of 38 (wich is just above the water level).

So, you replace that block of bytes (0x00000008 to 0x000C0C0A) and fill them with 26 (38 dec), and you get a flat terrain like this one:



Of course thats useless, since you still have to manually adjust the position of buildings, trees, rocks, etc

Another test I made was making a grayscale bitmap in photoshop (1024x1024), then hex edited that bitmap, and copied the byte values and pasted them in the terrain block data.

The result was this:



The levels are too rough make a playable terrain. But I asume the problem is that I don't know what kind of values goes there, int or float.

I still can't understand the wld format past the SMOD blocks. Theres a .wrt file, then a lot of data (may be vertex info), some .wav files, a few dds files (for Sky definition I think), and the file ends. And understanding that, would make posible to create an original .wld map from scratch.
I'm sure the guy who made shaiya-edit (python), would know better how to get this done. I'm just too noob at coding. And sadly Castor is gone.

Hope this helps anyone (still) interested in old SHaiya.
sominus is offline  
Thanks
2 Users
Old 07/15/2014, 16:25   #11
 
elite*gold: 0
Join Date: Jul 2010
Posts: 523
Received Thanks: 523
Add some little info on portals in WLD files:

Portals are defined close to the end of WLD files. After the last set of WAV files.

The structure is:

How many portals: Int32 (four bytes)

Portal location: X1 Y1 Z1 (3 float 4)
3dAttributes: X2 Y2 Z2 (3 float4)
Faction: Int32
Text: String256
Text2: String256
Destination Map: Int32
Destination Coord: X Y Z (3 float4)

Example with python using map 35.wld (the old EP5 35.wld, offset might change in the new EP)

Put 35.wld and this script on a folder then run it.

Code:
import struct
import re

wld = open('35.wld', 'rb')

wld.seek(0xC7EB7) #this offset might be different

print 'PORTALS\n'

count = struct.unpack('i', wld.read(4))
print 'Portal count:',count[0], '\n'

for s in range(0, count[0]):
	print '------------------------PORTAL #',s,'-------------------------------'
	xyz = struct.unpack('fff', wld.read(12)) #XYZ
	print 'X Y Z:', xyz

	xyz2 = struct.unpack('fff', wld.read(12)) #X2 Y2 Z2
	print 'X2 Y2 Z2: ', xyz2

	faction = struct.unpack('i', wld.read(4))[0] #faction ???
	print 'Faction ?: ', faction

	str1 = struct.unpack('256s', wld.read(256)) #string
	print 'String:', re.sub(r'\W+','',str1[0])
	str2 = struct.unpack('256s', wld.read(256)) #string2

	desti = struct.unpack('i', wld.read(4))[0] #destination map
	print 'Destination Map:', desti

	destxyz = struct.unpack('fff', wld.read(12)) #destination coord
	print 'Destination Coord: ', destxyz
You'll get something like this:
Code:
PORTALS
Portal count: 4 

------------------------PORTAL # 0 -------------------------------
X Y Z: (820.3662109375, 0.5869905948638916, 412.5534362792969)
X2 Y2 Z2:  (824.005126953125, 7.436989784240723, 416.49212646484375)
Faction ?:  0
String: 
Destination Map: 19
Destination Coord:  (517.8099975585938, 4.0, 1780.5699462890625)
------------------------PORTAL # 1 -------------------------------
and so on...
If you /bmove to 820 412 35 you'll see thats the portal next to a boat in apulune's coast, that teleports to AoL's map two (map id 19).

And you could do the inverse:

Code:
data = struct.pack('ffffffi256s256sifff',
		820.36,
		0.58,
		412.55,
		824.0,
		7.43,
		416.49,
		0,
		'Light Map 2',
		'',
		19,
		517.80,
		4,
		1780.56,
			)
And that will generate the binary data for editing a portal record


Of couse this is all for testing only.

I'm still searching a way to read a bitmap grayscale value and translate to a map height value in python. But sadly PIL and Numpy won't work on my Win7 x64, no matter what.

Some asked how to print to a file instead of console:


To run python scripts, save the code as 'mifile.py', and do 'python mifile.py' on a DOS windows
Or use Sublime Text, a free notepad-like code editor, pressing CTRL + B will run the code (of course you need python installed). Just take a look at those shaiya_edit python scripts posted here at epvp and you'll see how it works.

I've made a script to change a building/object/plant location in a map, but I find it useless, what I want is to insert/delete an object.
sominus is offline  
Thanks
13 Users
Old 07/15/2014, 17:11   #12
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
Good job on your discoveries, sominus, even though I doubt anyone will know what to do with it or even how to run your script. Good work !
nubness is offline  
Old 07/15/2014, 19:04   #13
 
elite*gold: 0
Join Date: May 2010
Posts: 14
Received Thanks: 11
Very good work there Sominus. Nice to see you worked hard at it for so long and came up with some great results from it all. Should be very useful to those wanting to edit / add their own portals, or to actually study / understand how the files are made up.
Isabele is offline  
Old 08/05/2014, 17:56   #14
 
elite*gold: 0
Join Date: Jul 2010
Posts: 523
Received Thanks: 523
So far I've been able to read

-Header
-Map Size
-TerrainData
-Entities: (Smod filenames + location coordinates. They include smod files and vani, mani. The last 2 are for animated entities.)
-EFT file and vertex (it includes coordinates where each effect will show in game.

After that, some maps have wav sounds, some others doesnt. And I dont know how to determine where to insert the next block (portals and named areas). So far all attemps just end up in DC (map read error).


And for topography data, it seems that values are in pairs (?).
This is from a terrain data:
Code:
22 24 B5 24 E9 24 4C 25 E5 25 AB 26 8E 27 72 28 26 29 9B 29
If you read them in pairs, look how every 2 values, they are close values:
eg. 24.....25.....26....

I've tried to read them as floats, but the resulting numbers made no sense.
My guess is the terrain is built up from basic triangles (as opossed to squares).

If you're fluent with C#+WPF you can use this tuto for rendering vertex. It also has an intro to 3D structures:



The point is, try to read the terrain data (in diferent ways/formats) so that WPF code would render the vertex.
I've tried but it was to **** slow on my comp.

PS: Would love some Castor hints about the structure past the .EFT section :P
sominus is offline  
Thanks
4 Users
Old 08/06/2014, 04:51   #15
 
castor4878's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 717
Received Thanks: 3,366
Hello,

Nice work Sominus; your tries regarding the map-height data are very interesting!
The topography demo in the WPF sample also gives some generic info, unfortunately not linked to deeper explanations that could help to understand the shaiya-cooking.

Regarding the .wld format, your info are correct; here is the whole structure of the WLD files (some so nice old plain C):


The first part is the "mesh" description, it includes all linked/included .smod files and their poistions; it could be a bit boring, for instance when the 81.wld lists more than 9000 blade of grass ... (see 81.desc.txt.zip, as a dongeon sample)

The secon part contains the "game-elements", the elements with which the player interacts, this includes portals, spawn, named areas and NPC.

These items are *NOT* used by the .wld file, the server, and only the server, defines actual portals, NPC or areas (from the .svmap file) and communicates these info to the client.
*But* it looks like (it's an esay assumption) that the .svmap files are generated from the .wld files, and we can imagine some authoring tools that allow visual insertion of NPC (and other) in the field.

Some years ago, we all paintfully looked for .svmap for each new published .wld ... the answer was there :'(
Now it can take a few seconds to load one and generate the second.
Attached Files
File Type: txt 35.desc.txt (43.1 KB, 138 views)
File Type: zip 81.desc.txt.zip (219.2 KB, 110 views)
File Type: txt world.txt (7.9 KB, 163 views)
castor4878 is offline  
Thanks
12 Users
Reply


Similar Threads Similar Threads
[C#] How to make a request to log into the Portal
03/15/2012 - DarkOrbit - 1 Replies
#closereq
My first edit ---> yin yang portal<---
08/05/2008 - CO2 Weapon, Armor, Effects & Interface edits - 18 Replies
this is my first edit .. a yin yang portal extract the file in c3-->effects HOPE U LIKE IT :) http://img174.imageshack.us/img174/757/46413335tr 7.th.jpg
[request] how to make any portal item to Crag Mine Field Portal
06/17/2008 - RF Online - 2 Replies
can any one make any portal item like, Armory 213 portal item, accretia HQ portal item to ->> crag mine field portal item.. it hard to go back to crag mine field when i got Disconnected from server..
Request for lvl 115 Backsword Edit and 100 Robe Edit
11/17/2007 - CO2 Weapon, Armor, Effects & Interface edits - 0 Replies
Hey Guys, Is there any chance someone could show me some cool edits of the lvl 100 and 115 Tao robes, and the 110 and 115 Backswords? Just post some screenies for me and upload them if you like :p They're gonna be on a large female though so make them sexy! :D :cool:



All times are GMT +1. The time now is 15:40.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.