-
You won't get me...
[Dev] Work with smas
Well im trying to get em work, but i dont have experiece with such files (disassembling would be easier for me). So does anyone wanna work with me to create/edit smas? What ive noticed so far is that the whole smas are almost full of 00 and CD bytes (hex).Maybe its some kind of map?
Edit: I found that the last bytes of the sma are 100% about spawns. And i suspect the main part of the sma has nothing important apart from the shops.
Last edited by PanKJ; 28-12-10 at 08:05 PM.
-
-
Enthusiast
Re: [Dev] Work with smas
Judging from the size of the sma compared to its maps, I got two guesses for you:
1. The sma files are map files(dat) merged together with a simple text file that contains all the spawn details with a custom header.
It is sort of like the obj model files we have in the game. Search CMP SCO
2. The sma files are null files made to the size of the respective map and then merged as stated above with spawn details like using the questloader. cfgs are zipped with a key into a tex file
As for your urge to disassemble I'd recommend the fieldserver to start with since it loads the sma and you can do it like ep3 preserver
I am sure you would have thought this out already. But you never know what you would overlook in these sort of situations!!!
-
You won't get me...
Re: [Dev] Work with smas
Well the npc server reads em as well. But its difficult to find binary format in disassmbly. However test this out: open the sma (with hex editor or even notepad, itll do) of a town (no mob spawns) and compare it with one where there are spawns (lets say rey). Then go to the end of the files. The difference is noticable. Also in 2009 server upgrade files i found sma about: ssb, bl, robenia. And in the end of the file you can see mob names! So its for sure concerning the spawns. Also do you remember the tool hrxlux showed? I opened the same file and in the end i found the same spawn names. Btw the smas are really empty (nulls, CD bytes and not-so-ranom bytes from times to times).
So i confirmed my theory, the "main" part of smas is about shops and warp index. I got corona castle work just by using the 2004.sma (copied and renamed to 2006.sma only) and obviously having made an entry in the db. The only problem is i cant use shops and take off. If someone wants to work together youre welcome but you gotta know what youre doing.
Proof:
Last edited by PanKJ; 29-12-10 at 02:19 PM.
-
Don't.
Re: [Dev] Work with smas
Hmmm.. that interface.. *giggles*
-
Enthusiast
Re: [Dev] Work with smas
Ritta for the win eh Giga?
I tried this earlier but my client crashed, guess it was my fault for using the flysis client lol I think I should upgrade to ace online client
-
You won't get me...
Re: [Dev] Work with smas
Lol what client i use isnt the point. The point is to make a sma editor tool. Do you have any ideas? So far as i said ive found that the spawn are in the last bytes of the sma, theres a header and the main part which consists mostly of nulls and CD bytes.
-
Don't.
Re: [Dev] Work with smas
I realized how identical all the smas look near the end with notepad but haven't been able to do anything with them. The most I did that sort of worked was taking random smas and renaming them to pandea map ones just so the map would load and be enterable, to act as a dummy. IIRC Bark sma was the most universal.
-
You won't get me...
Re: [Dev] Work with smas
Umm, actually this way you copy the spawns as well (this should happen at least). Do you have bark mobs spawning in pandea?
-
Don't.
Re: [Dev] Work with smas
Some maps did but they were flying through everything, some maps didn't, and some maps still refused to run as in let me in the map.
-
You won't get me...
Re: [Dev] Work with smas
For a start id suggest removing the spawns with a hex editor (find maps without spawns, go to the end of the file and youll get what i mean). Btw did you try any of the ep3 smas we have already (ssb, bl, robenia). Sorry, id do it myself but im trying to make the ga tool atm (it has to connect to the preserver and i dont know the protocol so im searching some old threads about it).
-
Don't.
Re: [Dev] Work with smas
No cause I don't have them or even seen them, and this being done with a EP 2 server.
-
You won't get me...
Re: [Dev] Work with smas
Check out filterheadz 2009 stuff. There are some nice and useful things in there.
-
You won't get me...
Re: [Dev] Work with smas
So i have some progress (if i can call this progress dammit). The size of the sma files (excluding spawns) depens on the map dimension (meaning 128x128 or 256x256). The 128x128 are 1245208 bytes long. The last 4 bytes (big-endian - most significant byte is the last) indicate whether and how many spawns will follow. That is, 00000000 (hex) would mean no spawns whereas 28000000 (hex) would mean that 40 spawns are following. The same is for 256x256 maps, but the standard length without spawns is 4980760 bytes (the last 4 bytes are about spawns that follow etc). Now decrease 24 bytes from both small and large sma lenghts and take into consideration that a 256x256 map is 4 (not 2) times the 128x128 map. I think thats something.
Update:
SMA format: 20 bytes header. The following 76 bytes are the main pattern; they are repeated 65536 times in large smas (65536=256*256) or 16384 times in the small smas (16384=128*128). The next byte after this pattern is the number of spawns that will follow. All maps are 256x256 apart from rakion, petra's cave and the conference rooms. Check the image below:

There is a mistake here, just shift blue green and orange selections one byte right and its ok. Note that the bytes are in big-endian.
So its like: 40 bytes the spawn name, 4 bytes the mob unique, 8 bytes the spawn coordinates, 4 bytes the max and res count, 2 bytes the respawn time and 2 the last bytes which i forgot when i made this image are the spawn type.
Apparently im about to make a spawn editor xD. Pls check whether my xor tool work so that ill know how to make this sma editor work as well.
2nd Update:
As you will have noticed if you examined the smas main part there are some bytes changing near a "CD" byte surrounded by nulls. Well, i figured out that this happens in all maps apart from the mission maps. Also, in 2 of the 3 the ep3 smas provided
the "CD" bytes are replaced by nulls (i think ive mentioned that before).
Ps: Sorry for double posting but i had to bump this.
Last edited by PanKJ; 04-01-11 at 11:18 PM.