Forum



FloSoft am 22.12.2010 16:21 #6452

Großmeister
Xaser hat das WLD-Format schön zusammengestellt:

http://www.mindermeinung.net/WLD_reference.txt

---
mfg
Flo



FloSoft am 22.12.2010 16:22 #6453

Großmeister
zusätzlich gibt es noch unsere eigene Auflistung zu den Siedler Dateiformaten:

https://www.siedler25.org/formate/

---
mfg
Flo



jh am 02.01.2011 23:41 #6534


Zitat von FloSoft:

Xaser hat das WLD-Format schön zusammengestellt:

http://www.mindermeinung.net/WLD_reference.txt


Wow, sehr schön, sowas hab ich vor Jahren mal gesucht und nie gefunden!
Danke für die Doku, gleich mal lokal gesichert ;)

JH


LuckySoft am 12.01.2011 12:42 #6588


Hallo Zusammen,
habt Ihr vielleicht auch Informationen zu den *.pa Dateien aus Siedler 1. Ich konnte bereits die Start und Endbildschirmgrafiken extrahieren scheitere jedoch bei den Gebäuden und sonstigen Grafikobjekten. Vermutlich haben die hier eine Art kompimierung angewendet.
Ich habe bereits den Kollegen der das Remake programmiert angeschrieben (Link aus anderem Thread) hab aber noch keine Antwort. Vielleicht hat ja hier jmd. mehr informationen.
Danke!
Martin


FloSoft am 12.01.2011 13:11 #6589

Großmeister
hi, davon haben wir leider (noch) keine informationen
Wenn du diese erhälst, kannst du sie gerne zusammenstellen und hier posten, dann hat man mal eine komplette FAQ quasi für die Dateiformate

---
mfg
Flo



Xaser am 13.01.2011 17:39 #6592


Danke fuer das Lob :-).


Merri am 31.07.2011 18:56 #7743


Hello, a first time poster, and I can't speak German, but here I go:

Zitat von mindermeinung.net:
THIS ACCOUNT IS SUSPENDED !


Is the WLD reference still available somewhere? I'm interested mostly because otherwise I'd have to figure out every little detail by myself, or figure it out from RttR source code. I have a lot covered up already, but I lack information on many of the submaps.

---
Settlers II.net admin

Editiert von Merri am 31.07.2011 19:57

Xaser am 31.07.2011 19:07 #7744


Hi Merri,

sorry, the above domain is out of date, here is the new one:

http://www.le-softworks.com/WLD_reference.txt


Merri am 31.07.2011 19:08 #7745


Thanks! :)


Do you know what 0x80 means in texture blocks (2 & 3)? This bit exists atleast in AKARTE02.WLD / OMAP02.WLD

---
Settlers II.net admin

Editiert von Merri am 31.07.2011 19:10

Xaser am 31.07.2011 19:47 #7746


Thank you for this hint. I checked out and it seems, this is Steppe, 0x84 is steppe too. There are a lot of double entrys like 0x05, 0x06, 0x13 for water. In the nearly future i will take the time to test all possible hex-values to find out there meanings. I have updated the WLD_reference.txt.


Merri am 31.07.2011 20:10 #7747


My newly re-written WLD/SWD document is here, includes texture graphics & what can be built on the texture to make it convenient:
http://settlers2.net/cheats/world-map-file-format-wldswd/

I have only tested textures up to 20 (0x14), valid textures range from 0 ... 19. That means atleast the five lowest bits are reserved for texture values. Bit 0x20 could mean something, 0x40 = harbor, 0x80 = unknown. If 0x20 is not Savanna, then that means there is space for a lot more textures. I have not yet tried if it is possible to add more textures into the game, 17 (0x11) is a potential candidate for a new custom texture.

I'm interested on what is possible with both original game (in terms of modding), as well as RttR implementation so ideally one could make something that customizes the original game, but it would also work with RttR with no extra changes :)

---
Settlers II.net admin


Xaser am 31.07.2011 20:22 #7748


Looks nice. Did you find all this informations by yourself?

The texture values contains also informations about the borders. If you use higher hex-values you will see that there are some colore triangles (i think bluebyte used this to test if the gouraud shading works correctly) or mining-textures with snow-border.
You should complete this reference. If you take a look at the source code of the new editor from rttr you can find how the original editor calculates the values for buildings and for shading. Would be nice to put that in a complete reference.

Good idea to use unused values for new rttr features.


Merri am 31.07.2011 20:32 #7749


Yes, I've figured almost all of it by myself, a little bit of it may be from elsewhere (but there is very, very little information on WLD/SWD outside my site and RttR site). I will include the calculations, those are very helpful. I already drew the shading (block #13) logic on paper and will at some point do a nice graphical documentation.

The texture borders information is new to me, and I guess it should be tested on all terrains at some point. Winter World seems to have a different logic, because Water 0x06 has a snow texture border, while it does not have it as a Greenland texture.

---
Settlers II.net admin


Xaser am 31.07.2011 20:39 #7750


Ok, but i have no idea why you asked for a wld reference a few posts before if you already figured it out?
Also the building logic would be nice to see but i have no idea how to explain that simple so everyone can understand it :-D.

Check out this picture for the borders: http://www.le-softworks.com/editor_texturtest.bmp

I only have this picture, the map file is no longer available.

Editiert von Xaser am 31.07.2011 20:45

Merri am 31.07.2011 20:51 #7751


I don't know everything, like the building & shading calculations! :)

I did a map generator back around 2005 & 2006, at that time I wasn't yet comfortable with things such as bitmasking and I didn't figure out the calculations (and some other things), so all the maps had to be saved again with the Map Editor to be playable.

Now I'm working on an online tool for WLD/SWD, letting people download & upload maps and later on I'll eventually make an improved map generator/editor as well. I'm also thinking about the possibility to convert from/to Widelands map format. It seems simple enough, just needs a lot of care on how to handle the conversion.

---
Settlers II.net admin

Editiert von Merri am 31.07.2011 20:56

Xaser am 31.07.2011 20:59 #7752


A customizable random map generator would be great :-).


Merri am 02.08.2011 12:13 #7770


CMap::modifyBuild seems more complex than it needs to be. Or, atleast it could be written much shorter!

First you need a few bitwise constants:

Code:
TEXTYPE_IMPASSABLE = 0x01
TEXTYPE_FLAG = 0x02
TEXTYPE_BUILD = 0x04
TEXTYPE_MINE = 0x08
// TYPE_WATER = 0x14 (if we wanted to use same function to check for farmland & water...)


Then a texture type table:

Code:
TexType[TRIANGLE_TEXTURE_SAVANNA] = TEXTYPE_BUILD
TexType[TRIANGLE_TEXTURE_MINE1] = TEXTYPE_MINE
TexType[TRIANGLE_TEXTURE_SNOW] = TEXTYPE_IMPASSABLE
TexType[TRIANGLE_TEXTURE_SWAMP] = TEXTYPE_IMPASSABLE
TexType[TRIANGLE_TEXTURE_DESERT] = TEXTYPE_FLAG
TexType[TRIANGLE_TEXTURE_WATER] = TEXTYPE_IMPASSABLE
TexType[TRIANGLE_TEXTURE_WATER2] = TEXTYPE_BUILD
TexType[TRIANGLE_TEXTURE_DESERT2] = TEXTYPE_FLAG
TexType[TRIANGLE_TEXTURE_MEADOW1] = TEXTYPE_BUILD
TexType[TRIANGLE_TEXTURE_MEADOW2] = TEXTYPE_BUILD
... and so on ...



Then we can check the first six textures directly around the vertex point:

Code:
// this very much in a pseudo code style
Bits = TexType[ Map->Vertex[FirstTexture] ]
Bits |= TexType[ Map->Vertex[SecondTexture] ]
Bits |= TexType[ Map->Vertex[ThirdTexture] ]
Bits |= TexType[ Map->Vertex[FourthTexture] ]
Bits |= TexType[ Map->Vertex[FifthTexture] ]
Bits |= TexType[ Map->Vertex[SixthTexture] ]


Now this sets bits active for each type that is present.

Code:
// if impassable bit is set then it overrides everything!
If (Bits & TEXTYPE_IMPASSABLE) = TEXTYPE_IMPASSABLE Then
    // no need for more processing!
    Return 0x00
ElseIf Bits = TEXTYPE_BUILD Then
    // this position only contains textures we can build on
ElseIf Bits = TEXTYPE_MINE Then
    // this position only contains textures where we can build mines
Else
    // no need for more processing, this position can only have a flag!
    // ie. mixed non-impassable textures or TEXTYPE_FLAG only
    Return 0x01
End If


This bit of pseudo code here does not account for heights, objects and other rules yet, but you get the idea: it results in a shorter code which would probably even execute much faster :)

---
Settlers II.net admin

Editiert von Merri am 02.08.2011 12:18

Xaser am 02.08.2011 12:32 #7771


It not only "SEEMS" to be longer than it needs, in fact it "IS" longer than it needs :-D. I did this step by step. I looked what happens when i increase or decrease a vertex in original editor and what happens if i change textures around a vertex and rebuilt what i saw step by step. I'm absolutely sure that the bluebyte programmers choosed the hex-values this way that they only need a few lines of code to calculate the buildings, some kind of bitmasking, modulo calcultaion and other math things. That's why the original editor works this fast. (for example there are multiple hex-values for the same things, flags have 0x01 and 0x09 and so on, trees have more values too)

You're right, the code would be a bit faster if the code were a bit shorter, but a few if-else lesser makes no difference for a 2GHz+ cpu :-D.
But it would be nice to make this modifyBuild more elegant :-).
So if you want to change it, so feel free to do it, test it and if it works, i add it to the code :-).

Editiert von Xaser am 02.08.2011 17:11

Merri am 02.08.2011 12:58 #7772


I'll implement PHP and/or JavaScript versions first, it'll probably take me some time to get that far - not at home the end of this week :)

---
Settlers II.net admin


Xaser am 02.08.2011 14:03 #7773


I'm not sure what you wanna do but beware of rendering a map in browser or let the visitor change the map directly in browser (some kind of "online-editor"), i think that were a direct violation of the copyright. Apart from this to realise such kind of online-editor i think the new revolutionary API "Native Client" from Google would be much better.

Editiert von Xaser am 02.08.2011 17:11

Merri am 02.08.2011 15:01 #7774


That would depend on what you mean. I know I can't use the game's own graphics as that would be troublesome. As for maps made by others, that is a tricky question. I am already planning on minor modification of the uploaded files to remove "bugs" from the maps (such as inaccessible fishing spot behind snow/swamp => Fisherman always 0% and no warning message). Editing existing maps would probably need some kind of a permission to edit -system, as well as eventually removal of maps if some authors don't want their maps hosted.

---
Settlers II.net admin


Xaser am 02.08.2011 15:09 #7775


Maps made by others are copyrighted by bluebyte too, but bluebyte allowed to upload and copy this user-maps like other game inventors do it (battlefield maps, counter strike maps and so on). But the graphics from the tileset and the WLD file format are property of bluebyte. To render the map in browser, whether it's an original or custom map) would mean to use the tileset (and maybe the gouraud-shading values) of the original game to show the visitor of your website the map. This is more than an ingame screenshot and therefore not legal, cause every user without the original settlers 2 cd can see and use it.

Editiert von Xaser am 02.08.2011 15:10

Merri am 02.08.2011 16:32 #7776


I'm not going to render a map using the game's graphics. I am adding a user registration mechanism, ie. must be logged in (downloading maps does not require registration, submitting maps do). The Settlers II CD is not a requirement, you can buy the game from GOG.com and have a digital version only. There is also no way I can be 100% sure somebody really owns the game, so that leaves the responsibility to the user. I can't ask user to upload his copy of the game (to verify), because that would be illegal. RttR can't detect legality of user's copy of a game either.

I also don't understand the concept of a map file having a Blue Byte copyright. I understand it for maps submitted with the game, but any map created by someone... If I write a document in Microsoft Word and save it, Microsoft does not have rights to the file created. If I'd write a program that creates Microsoft Word compatible files, well, there is no problem.

As for editing an existing map, I think that is perfectly fine as long as the service does not automatically share any re-edited map. This would force user to upload the map again on their own, which would then mean the user would be clearly responsible for what he is sending, ie. has made sure he has a permission from the original author. However, my priority is on map generator, but some level of editor feature is needed for better player placement.

Finally, I'm not making any money from this. Blue Byte allowed people to make money on commercial tools, which required similar level of file manipulation. I haven't seen legal action against ObjektEdit, kartengenerator and so on. So I don't see how any legal issues would come up.

---
Settlers II.net admin

Editiert von Merri am 02.08.2011 16:35

Xaser am 02.08.2011 17:10 #7777


Saying "Settler 2 CD" i only mean the user must have the files legally.
You're right, you can't be 100% sure that everbody has the game legally, that's the reason why you may not deliver files that are copyrighted by bluebyte, the only exception are self-/user-made maps.
RTTR has no need to verify if the user has original settler 2 cause it don't delivers any original files.
About maps: the file format of the maps (wld) in fact is copyrighted (cause developed) by bluebyte. The appearence of the map is yours' but you put it in a proprietary file format. This is legal, cause bluebyte wants you to make your own maps.
No matter if you want to make money with that or not. Also i never said that legal issues want come up, i only wanted to say that if you are going to use original graphics to display a map or some of the editor tools in the browser, it's no longer legal.

It were nice to here what you wanna do? A web-based editor or something else? So you should know that this would be a lot of work and you have to think about if anybody would use that. And for newer rttr maps with size up to 1024x1024 the wld files have a size of 10Mb and more so uploading this to your site to modify anything will take a long time for much users.


Merri am 02.08.2011 18:08 #7778


Compression works fine for 10 MB SWD/WLD files, adding a support for uploading ZIP, GZ and possibly other formats would easily solve the filesize problem :)


What I'm working with now:
1) World Map Database (download & upload user created maps)
- Keeps track of map sources (where the map was originally uploaded to, who made the map etc).
- Sort maps by size, resources, players, number of harbors, total landmass etc.
- The service would automatically correct issues that may cause issues during game.
- Download as a World Campaign map or as a regular map (allow pre-setting leaders, including human player!)
- Eventually add possibility to review/comment maps.

What I'll do after that:
2) Map Generator (available in the same World Map Database)
- For this I need to know every detail about the maps I can, so I can write 100% correct SWD/WLD files.
- Generate "classic" Map Generator 0.91 style maps (rather "flat" maps with great variety).
- Develop a new kind of map generation code for better handling of mountains and elevation.
- Automatic player placement.
- Automatic resource management based on given settings: balancing of all resources per player.
- Automatic object placement: placement of forest & stone in such a way that makes things easier or harder for certain player to access.
- This means the generator needs to be aware of how "easy" each player's position is.

Which leads to:
3) Map Editor
- Allow further manipulation and fine tuning of generated maps.

And finally:
4) Mission & Campaign Editor
- Creation of single missions.
- Automatic functions such as protect harbors from AI.
- Support for multiple languages.
- Custom graphics (LST support, allow PNG uploads & downloads for entirely new files).
- Issue: a lot of files need to be replaced (MISS###.WLD, MIS_####.RTX, MIS_####.ENG, ONGAME.ENG, MIS#BOBS.LST, MISSION.DAT...)


It is a lot of work, but I already know a great deal about the game's technical details, and it is nice to have silly hobby projects.

---
Settlers II.net admin

Editiert von Merri am 02.08.2011 18:11

Merri am 02.08.2011 18:28 #7780


Back on the actual topic... in MISS200.WLD there are some trees in the northside of the map that a Woodcutter can't access. Have you spent any time identifying what makes woodcutter to leave them alone? Mostly the trees on the edge of a mountain and coast. They seem like trees that a woodcutter would normally chop.

---
Settlers II.net admin


Xaser am 02.08.2011 18:36 #7781


To compress the map before uploading is an annoying extra step ;-), but better than nothing.

About the other stuff: Well, so there is no problem with the copyright. The holy discussion was senseless :-D.
A map generator is a good idea.

Map Editor: Ok, then we have the third editor :-D.

You should know that "a lot of work" is not enough to describe this. The map editor will take 1 to 2 years to work fully compatible to the original with no extras and a mission/campaign editor maybe will take another year or more. This time were better invested by improving the actual editor for rttr. It is far advanced but still needs a lot of work. Furthermore it's better to make ONE tool with all that functionality.
Programmers that are able to help this project are rare so it makes absolutely no sense to start several parallel projects.

Woodcutter: Sorry, no idea, maybe one of the rttr developers can help.

Editiert von Xaser am 02.08.2011 18:38

Xaser am 02.08.2011 18:47 #7782


I took another look in your wld-reference and saw that you've added the shading calculation, very nice :-). If sometimes this document is complete it will be the best reference of all. I also saw in the credits that you are Vesa Piittinen :-). A few times i took a look at your PlainWLD.html document that helped me. I never thought you will work on settlers 2 things again but nice to have you here. But as i said, it were nice to work together on one project.


Merri am 02.08.2011 19:03 #7783


I wonder how old that HTML page would be, sounds like a file name I wouldn't have used :) But it is nice to know something I've done has been useful!

I'll consider if I want to spend time on setting up C++ and learning it more, so that I could spare some time. I did write a game in C, but that is now over ten years ago. I can read C code, but writing it may be a slightly different story. Luckily PHP syntax is very close, and mastering three very different kind of languages does help a lot with other ones :)

---
Settlers II.net admin


Xaser am 02.08.2011 19:16 #7784


Yeah that's right, after i learned C, C++, PHP and PERL i must see that such things like javascript are no problem anymore :-D.

The PlainWLD is your's, directly from your website and down the document there is a signature "By Vesa Piittinen, 1998 � 2009" :-).
Therefore in my WLD_reference.txt your name is in the credits.

About C and C++: Did i misunderstand you? I thought you want to make a map editor and a mission/campaign editor? A random map generator is possible in PHP or any other language, but which language would you choose for the map editor? I thought we are talking about C++.


Merri am 02.08.2011 19:31 #7785


Nope, online, meaning PHP on server side, JavaScript on client side. Map generation and editing would be mostly client side stuff, but stuff such as validation & map data generation requires PHP.

New JavaScript engines in browsers are much faster than the old ones used to be, which helps in calculation heavy tasks such as "intelligent" map generation.


Edit!
The good thing about browsers is that creating a working interface for a browser is faster than doing the same in C++ (I'm also technically very good at HTML & CSS so that helps a lot).

---
Settlers II.net admin

Editiert von Merri am 02.08.2011 19:42

Xaser am 02.08.2011 19:41 #7786


LoL, i know what PHP and Javascript is ;-). But i thought we are talking about "real" editing the map, like in the original editor, so rendering of the map is needed to do this useful. And to make something like rendering with javascript is old web 2.0 stuff :-D. For such things native code is better like Googles Chrome browser supports it. But unfortunately it's in an early development stage. I hope the other browser inventors will implement this in their own browsers. It's annoying that javascript is nearly the only client-side programming language. The native client will support much languages (in compiled form).
So what do you mean with "map editor"?


Merri am 02.08.2011 20:01 #7787


Editor would have a simplified view: no textures (possibly just solid avarage color of original texture's), shading would be simple, heights wouldn't be as visible to keep detailed editing easy. But these are just far-away thoughts at this point. It would be quite different.

For now I can just do these pretty images :)


I think online editor has some good potential as it is easier to share with others and see the activity.

Also, once done for one game it may also prove to be possible to expand on other games with similar style of maps, especially the map generator code. But that is something to be thought about later on.

---
Settlers II.net admin

Editiert von Merri am 02.08.2011 20:01

Xaser am 02.08.2011 20:44 #7788


Ok, i had a different imagination on what you want to do. Nice picture, FloSoft did this too with PHP and the GOUx.DAT files, but it seems he hasn't it implemented yet in the board here. Do you use the GOU files and the shading values too?


Merri am 02.08.2011 22:03 #7789


Yeah, although I've implemented a customized palette scheme as well. You can also notice the image is smoother than the regular 8-bit images. I think I'm going for full true color and drop GOU#.DAT for these, but I'll do that later on. For now I'm pleased with the quality of this code :)

---
Settlers II.net admin


FloSoft am 03.08.2011 11:53 #7801

Großmeister
Hi,

I already had started one "php-world-image-writer":

https://code.launchpad.net/~flosoft/s25rttr/s2map-php

perhaps you can improve it ;-)

---
mfg
Flo



Merri am 03.08.2011 12:57 #7802


Is there a single download link somewhere or do I have to download each file one-by-one?

---
Settlers II.net admin


Xaser am 03.08.2011 13:45 #7804


You can download the files one by one or you can use the tool called "bazaar" to get all files. After starting bazaar you need to type "lp:~flosoft/s25rttr/s2map-php" in the bazaar command line. If you have problems with that, tell us and we will help :-).


Merri am 09.08.2011 19:38 #7841


Thoughts about custom map file format for RttR (and also a summary of the biggest missing pieces for full understanding of the WLD/SWD format)

---
Settlers II.net admin

Editiert von FloSoft am 09.08.2011 22:01

Spike am 11.08.2011 01:22 #7847

Im Ruhestand
As I see here happens a lot  ;)

---



Xaser am 11.08.2011 10:23 #7849


Good ideas i must say. You're about the backwards compatibility for large maps. I thought about a little tip-text or something else that tells the user of the editor if the actually made map is compatible with original settlers 2 or will only work in rttr.
I think we should do a To-Do-List so that we have something that we can work on. I think in the next time i will also try to add opengl support for the editor (sounds like a lot of work).


Xaser am 11.08.2011 10:39 #7850


I saw in your new WLD reference that road information is missing. It's decrypted, you can see it in my wld reference (actualised, http://www.le-softworks.com/WLD_reference.txt). I would like too see it in your reference cause if it's finished one day (with building calculations and some other unknown stuff) I WANT A COPY OF THAT :-D.


Merri am 11.08.2011 10:54 #7851


I'm not that far yet, I'm getting interested on roads only after I have other (for me, more important) things covered :)

Buildings algorithm will come after I have written a working code for it that calculates the exact same results against ALL existing map files I have :D


Simplest way to "fix" backwards compatibility issues is that all maps that are not explicitly compatible with the original game would be saved using a different extension, like RWD (RttR World) :) Extension for my suggested format that includes campaign support could be like RCF (RttR Campaign File). But that is still far ahead in the future... but I guess FANpaign & 2NDpaign could be converted to a new format as an experiment to get working samples, and they'd give a good amount of experience on what needs to be covered by the files.

---
Settlers II.net admin

Editiert von Merri am 11.08.2011 11:00

Xaser am 11.08.2011 10:57 #7852


Hmmm, i also not quite sure if my code calculates the exact same results like original settlers 2, but how to test it? I had to compare the original file and the file opened and saved with rttr-editor in hex-editor....
Let me know if you find a failure :-).


Merri am 11.08.2011 11:01 #7853


Write code that opens a file, does calculation into a new table and then compare the tables :)

Also, I edited my last message.

---
Settlers II.net admin


Xaser am 11.08.2011 11:09 #7854


RWD sounds goog :-).

"Write code that opens a file, does calculation into a new table and then compare the tables :)" ----> oh....that's......WORK :-D. But yes, i should do something like that. You're right, it's still far in the future but i think i could happen if we work all together.


Merri am 11.08.2011 13:32 #7856


I'm also figuring out all this stuff and I'm pretty quick if I just have the time :) Most often I'm too tired after a day of work, and over half of my weekends are reserved for other things... lets just say "social life" which sounds nice and clean! And my social life never involves alcohol, just to make that clear.

---
Settlers II.net admin


Xaser am 12.08.2011 09:17 #7865


Good resolution to not involve alcohol :-), that's also my opinion, cause i need all of my brain cells and i can't abandon on one of those :-D.
I know what you mean.....to decrypt file formats in the few hours of free time is sometimes hard. I will do my best to come forward with the editor and build in new ideas.


LuckySoft am 04.09.2011 19:00 #8397


Hallo,
ich hatte vor einiger Zeit nach den Siedler I Dateiformaten gefragt. Jon Lund Steffensen hatte einen recht interessanten Prototypen zum alten S1 erstellt und nun seinen Sourcecode veröffentlicht.
Hier die Links:

http://jonls.dk/2010/06/settlers-1-remake/
https://github.com/jonls/freeserf

Ist vielleicht ja auch was für eure "Hauptnachrichten" um das ganze bekannter zu machen ... vielleicht findet sich ja ein fähiger Programmierer
____________________________________________
Hi!,
quite a time ago I asked for the file format reference of serf city aka settlers 1. Jon Lund Steffensen made an interesting settlers 1 remake prototype. He recently released the sourcecode.
Here are the links:

http://jonls.dk/2010/06/settlers-1-remake/
https://github.com/jonls/freeserf

Editiert von LuckySoft am 04.09.2011 19:12

Spike am 04.09.2011 19:50 #8398

Im Ruhestand
Ja, ich kenn die tolle seite, schade, dass da nichts mehr passiert :S

edit:ach erst vor kurzem public gegangen der code^^

---


Editiert von Spike am 04.09.2011 23:21

CrazyL am 20.10.2014 11:38 #12938


I've just read the information on RTX-files on settlers2.net to solve some problems with mission-events. While it's got all the information about the RTX-header, there's next to nothing concerning mission-events beginning with !MET_... on that page and anywhere else in the web...

By trial and error I guess I've figured out most of the parameters of !MET_...-events. If you're interested (I know the last post is years old) I can send you my results. I'd just upload it as a text-file, but that's not possible.

Last but not least: Big thanks to Merri for such an extensive, well-organised and nice-to-read page on all (technical) stuff you might ever want to know about The Settlers 2 :)

P.S.: If anybody knows what that parameter following the message-index refers to in most !MET_-events, please tell me!

Editiert von CrazyL am 20.10.2014 12:04

qUiXui am 20.10.2014 18:34 #12939


I have never taken a closer look at those files, but then again they are of very limited use for RTTR. Implementing the single player campaign would require building our own event system anyway, so we dont need to understand all the parameters for the original event system, and the important ones are not too hard to figure out.


daisho am 06.05.2019 11:54 #15230


Habe das zwar wegen der History Edition (Qualität ist dort anscheinend leider ein Fremdwort) im Ubi-Forum gepostet, es könnte
allerdings ein recht interessante Information für Neulinge sein die die S2 Sounds aus dem Original exportieren möchten:

---

Hi,

ich habe gestern ein wenig mit der gold edition von GoG herumgespielt und via LST entpacker tool von den RTTR Machern die .WAV sounds
entpackt.
Leider musste ich diese noch manuell via Hex-Editor editieren da das Tool leider keinen ordentlichen WAVE header schreibt.

Wen es technisch interessiert:

Ein typisches WAV file generiert via dem lstpacker.exe tool generiert einen Header wie z.B.:
(die fragezeichen werden in einem hex editor üblicherweise anders, z.B. als Punkte, angezeigt)

Code:

03 27 00 00 52 49 46 46 FB 26 00 00 57 41 56 45    '��RIFFû&��WAVE
66 6D 74 20 10 00 00 00 01 00 01 00 44 AC 00 00    fmt �����D¬��
44 AC 00 00 02 00 10 00 64 61 74 61 D7 26 00 00    D¬����data×&��
7F 80 7F 81 80 80 80 80 80 80 80 80 80 80 80 80    €€€€€€€€€€€€€

Um die WAV files zu reparieren musste ich die ersten 4 bytes entfernen (ein WAVE header beginnt mit "RIFF", siehe
http://soundfile.sapp.org/doc/WaveFormat/),
die Angaben zu Sample-, Byte und Bit/Sample-Rate passen ebenfalls nicht und würden nur ein file ergeben das "rauscht".

Repariert (nach Vorgaben von http://settlers2.net/documentation/lst-file-format/, "WAV files are 8-bit mono 11025 Hz PCM files without
WAV header.") sähe der neue Header dann so aus:

Code:

52 49 46 46 FB 26 00 00 57 41 56 45 66 6D 74 20    RIFFû&��WAVEfmt
10 00 00 00 01 00 01 00 11 2B 00 00 11 2B 00 00    �����+��+��
01 00 08 00 64 61 74 61 D7 26 00 00 7F 80 7F 81    ��data×&��€
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80    €€€€€€€€€€€€€€€€


Nur soviel dazu wie man die Original-Sounds wieder bekommt sollte man bereits eine andere Siedler 2 Version sein Eigen nennen.
Nebenbei ... manche der vorhandenen Sound-Files klingen anders als die Originale - ich vermute das ist so gewollt? (sehr stark merkte
ich das z.B. bei der Eule)


Wie auch immer, Ubi's Siedler 2 History Edition hat die Sound-Fx-Files umbenannt (die lstpacker.exe erzeugt .WAV Dateien mit der
Bezeichnung startend mit 51.wav).
In der History-Edition beginnen diese mit 0001.wav. Meine Vermutung ist dass einfach 50 abgezogen wurde quer durch die Bank (sieht
zumindest auf den ersten Blick so aus).

D.h. die 51.wav aus der lstpacker.exe wäre dann die 0001.wav.

Ja, manche Files fehlen in der Liste. Es gibt z.B. keine 0010.wav, die gab es aber auch im Original schon nicht.
WAV files die in der History Edition fehlen sind lt. Merge beider Ordner (Name bereits angepasst für History Edition, Original Name
wäre demnach Nummer +50):

0051.wav (im Original also 101.wav) - klingt wie Schmiedehammer oder Schwerschlag
0052.wav - klingt wie das Klopfen auf einen Stein
0054.wav - klingt wie der Sterbe-Schrei von Soldaten
0057.wav - Yippie der Geologen! (das war einer der ersten Sounds die mir abgegangen sind)
0058.wav - kein Sound (quasi leer, auch lt. Hex-Editor)
0059.wav - kurzer Ton (schwer zu beschreiben, hört sich wie ein falscher Klick aus einer Windows-Theme an)
0060.wav - Fanfare, ev. "Mission geschafft" Sound?

Die History Edition hat allerdings noch die WAV files:
00SCHWE1.WAV und 00SCHWE2.WAV, nicht sicher wo diese eingesetzt werden.



Jetzt das Gute: Man kann die fehlenden exportieren und reparierten Sounds aus dem Original einfach mit dem geänderten Dateinamen
0051.wav etc. in den thesettlers2DATAsound Ordner kopieren und diese (zumindest das "Yippie!" klappte in einem kurzen Test) werden
dann auch abgespielt wie es scheint.

Das schlechte: Ich kann die Sounds nicht einfach irgendwo als ZIP uploaden da ich mich sonst angreifbar mache wegen Urheberrecht etc.,
daher lasse ich das.

Aber meiner Meinung nach sollte ein Patch oder zumindest eine Aussage ala "wir wollten diese Sounds nicht im Spiel haben, deswegen
haben wir sie weggelassen" (wobei ich das für die Sieges-Fanfare oder Sterbe-Sounds nicht nachvollziehen kann > deswegen denke ich die
wurden einfach vergessen beim Kopieren) mittlerweile vorhanden sein.
Ich habe das Ganze jetzt ohne Vorwissen von S2 und deren Datenstruktur in einer halben Stunde zusammengebastelt ... die Leute hier
warten seit Monate auf einen Patch der vermutlich nie kommen wird weil alle Resourcen abgezogen wurden -_-

---

Ich hoffe ich falle damit nicht gleich in Ungnade hier, aber die Info wie man die WAV exportieren und "reparieren" kann (das lstpacker
tool hat mir leider falsche WAVE-Header geschrieben) ist sicherlich interessant für Modder. :)


FloSoft am 06.05.2019 20:46 #15233

Großmeister
Hi,

Zitat:

das lstpacker tool hat mir leider falsche WAVE-Header geschrieben


imho waren das die "original" enthaltenen. Kann mich aber gerade auch täuschen und es ist einfach ein Bug im lstpacker. Darf gerne repariert werden (Code zum Tool gibt es auf github in libsiedler2)

Ja, die History-Edition hat wohl "bereinigte" files - deswegen kann man diese leider auch aktuell nicht für RttR nutzen. Gerne darf sich da mal einer hinsetzen und ein "konvertierscript" definieren (aka Exceltabelle Neuer Dateiindex -> Alter Dateiindex)

---
mfg
Flo



Flamefire am 09.05.2019 18:38 #15237


Das lstpacker tool ist bereits repariert ;)
Müsste einfach selbst compiliert werden damit man die neuste Version hat. Hab gerade den Code überprüft und der schreibt einen validen WAVE header

---
Github: https://github.com/Flamefire


FloSoft am 13.05.2019 07:52 #15238

Großmeister
ja evtl sollten wir eine neue version bereitstellen - oder ins normale RttR Paket mit aufnehmen?

---
mfg
Flo



Flamefire am 14.05.2019 09:16 #15239


Stellen wir das irgendwo überhaupt bereit? Ist eigentlich "nur" ein tool, was man sich selbst compilen kann.

"Ins normale RttR Paket" == "mit dem Spiel releasen"? Dann dagegen. Der normale Nutzer braucht das nicht. Können aber gern ein extra release machen und/oder github releases dafür verwenden

---
Github: https://github.com/Flamefire