Transparency + Extended Sprites in Otclient

bored

Banned User
Joined
Jan 18, 2018
Messages
3
Best answers
0
Reaction score
1
I couldn't find any solid information on this forum regarding transparency or extended for sprites in otclient just a couple of mentions of what to add but no actual tutorial. I went to tibiaking and found a tutorial but of course in wasn't in english. This was posted some time in 2014 but I am sure it will work with a more current client.

This is a rough translation for the extended settings along with some additional information on transparency.

This tutorial is intended to teach you how to configure the main tools to increase the limit.

Compiling Extended Files:

1. Open your "spr" and "dat" files in Object Builder.
2. Compile the files with the extended option selected.
extended.png
Note: Once compiled extended, the extended option should always be selected both when opening and compiling.

Configuring the ItemEditor:

1. Open the itemEditor, go to File / Preferences
2. Click Browse and choose where your "Dat" and "Spr" Files are located.
3. Check the Extend Option

Configuring OTClient:

1. Open the things.lua file found in modules / game_things
2. Add this line of code to the load function:
C++:
function load()
  local version = g_game.getClientVersion()
  g_game.enableFeature(GameSpritesU32) -- To extended the sprites
  g_game.enableFeature(GameSpritesAlphaChannel) -- To enable transparency
  local datPath, sprPath
3. Find this method in src/client/game.cpp
C++:
void Game::setProtocolVersion(int version)
Place this inside the method to enable alpha in sprites and compile the otclient.
C++:
enableFeature(Otc::GameSpritesAlphaChannel);
4. Add a copy of the extended dat and spr files in the data / things folder.

Remere's Map Editor:

Unfortunately RME does not support extended files.
The most feasible solution is to add a version 9.60 next to your client version and compile the files as 9.60 especially to RME.

The RME version must be 2.2 or higher.

- Compile in your version for use in the client and in the ItemEditor.
- Compile in version 9.60 in a separate folder to use in RME.

Adding the version:

1. Go to the RME installation folder and open the clients.xml file, found in the data folder.
2. Search for your client's tag and add a line to version 9.6
HTML:
<client name="8.60" otb="8.60" visible="true" data_directory="860">
   <otbm version="3"/>
   <extensions from="8.20 - 8.31"/>
   <data datversion="8.6" sprversion="7.0" dat="0x4C2C7993" spr="0x4C220594"/>
   <data datversion="8.6" sprversion="7.0" dat="0x4C6A4CBC" spr="0x4C63F145"/>
   <data datversion="9.6" sprversion="9.6" dat="0x4FFA74CC" spr="0x4FFA74F9"/> <! - Extended Version ->
</client>
3. Compile your files into a separate folder with version 9.60.
export.png

4. In the version used, configure RME to the folder where the compiled files are located as 9.60
rme.png

Common questions:

Q: What is the new sprites limit after being extended?
A: 4,294,967,295

Q: After compiling extended, can it be used in the Cip client?
A: No! It would be necessary to modify the client so that it can read the files.

Q: Can I use the dat editor to modify the files later?
A: ObjectBuilder is a dat / spr editor, but if you want to use another editor, it is unlikely to work. It does not hurt to try

Credits:
Code:
EdMignari e sua Equipe
 

BahamutxD

Jack of all trades, master of none
Joined
Jun 8, 2009
Messages
568
Best answers
12
Reaction score
180
Location
Spain
Tryed this for transparency

and only got this. Can't see the floor below except for the stairs sqm.




Added a second ladder

 
Last edited:

bayview

Banned User
Joined
Jan 25, 2018
Messages
612
Best answers
25
Reaction score
288
Tryed this for transparency

and only got this. Can't see the floor below except for the stairs sqm.




Added a second ladder

Hey thanks for the feedback :)

Try the transparent tiles on a higher level and see if you can see the ground level (7)..
I believe both the client and the server prevent viewing levels 8+ from 7 - 0. & higher levels from 8-15.
This feature is really just meant to give transparency to the tile and does not modify the default layer visibility settings.
 
Last edited:

BahamutxD

Jack of all trades, master of none
Joined
Jun 8, 2009
Messages
568
Best answers
12
Reaction score
180
Location
Spain
Hey thanks for the feedback :)

Try the transparent tiles on a higher level and see if you can see the ground level (7)..
I believe both the client and the server prevent viewing levels 8+ from 7 - 0. & higher levels from 8-15.
This feature is really just meant to give transparency to the tile and does not modify the default layer visibility settings.
Doesn't work, its actually doing the same undergroud. As you say this feature works perfectly fine, just that server is not sending that grounds to the client (although I don't quite understand why you can see the walls..)

I've looked into TFS sources trying to find parts of code related to underground view limits (+- 2 floors), sending more Z tiles to the client (actually flatlanders tutorial for increased view helped here) and the removal of floor 7 to 8 view limitation (black tiles if not mapped)

But.. this task is way too big for my little c++ knowledge. As I keep learning will keep trying but for now there is not much I can do.
 

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
567
Best answers
10
Reaction score
66
There was somewhere how to fix this.

Editing the tutorial about RME you can also add .otfi file to .spr .dat with content:
Code:
DatSpr
extended: true
transparency: true
frame-durations: false
frame-groups: false
And you won't have to compile spr/dat to other version
 

GOD Half

Intermediate OT User
Joined
May 9, 2010
Messages
179
Best answers
0
Reaction score
13
Hello guys, I've merged version 8.54 with 10.98. I did some tricks using ClientConverter to succeed. Ok, everything very well, I used the ItemEditor to generate the items.otb and everything is very beautiful. I'm even leaving the Tibia.otfi file in the folders where the .dat and .spr files are, course.

But when I was almost overflowing with happiness, behold, this error appears to me:


I came to find out the reason and I found a possible size limit. Ok, I made the change of this tutorial and the error continues. Note in the image below that the files are identical, the same Signature for both .dat and .spr:


For to see how .spr and .dat are working, see how it opens without error in RME:


So, has anyone managed to merge the old versions with the latest and succeeded?
Thank's
 
Last edited:

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
567
Best answers
10
Reaction score
66
In RME to see transparency I think its need deeper changes
 

GOD Half

Intermediate OT User
Joined
May 9, 2010
Messages
179
Best answers
0
Reaction score
13
Hello guys, I've merged version 8.54 with 10.98. I did some tricks using ClientConverter to succeed. Ok, everything very well, I used the ItemEditor to generate the items.otb and everything is very beautiful. I'm even leaving the Tibia.otfi file in the folders where the .dat and .spr files are, course.

But when I was almost overflowing with happiness, behold, this error appears to me:


I came to find out the reason and I found a possible size limit. Ok, I made the change of this tutorial and the error continues. Note in the image below that the files are identical, the same Signature for both .dat and .spr:


For to see how .spr and .dat are working, see how it opens without error in RME:


So, has anyone managed to merge the old versions with the latest and succeeded?
Thank's
BUMP someone? Please!
 

Shawak

Legendary OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
you are using otclient which is open-source, check what makes the dat file being unable to load

edubart/otclient

edit: or atleast start reading the exception details in the log
 

GOD Half

Intermediate OT User
Joined
May 9, 2010
Messages
179
Best answers
0
Reaction score
13
you are using otclient which is open-source, check what makes the dat file being unable to load

edubart/otclient

edit: or atleast start reading the exception details in the log
Can u help?
HTML:
== application started at Jun 21 2018 19:53:52
OTClient 0.6.3 rev 0 (devel) built on Jun 21 2018 for arch x86
Loaded module 'corelib'
Loaded module 'game_things'
Loaded module 'gamelib'
Loaded module 'client'
Loaded module 'client_styles'
Locale 'pl' is missing 1 translations.
["Total Price:"] = "",
Locale 'pt' is missing 19 translations.
["Account Status:"] = "",
["Action:"] = "",
["Amount:"] = "",
["Balance:"] = "",
["Comment:"] = "",
["Don't stretch/shrink Game Window"] = "",
["Find:"] = "",
["Name:"] = "",
["Offer Type:"] = "",
["Piece Price:"] = "",
["Position:"] = "",
["Price:"] = "",
["Reason:"] = "",
["Search:"] = "",
["Statement:"] = "",
["Total Price:"] = "",
["Weight:"] = "",
["Your Capacity:"] = "",
["Your Money:"] = "",
Using configured locale: en
Loaded module 'client_locales'
Loaded module 'client_topmenu'
Loaded module 'client_background'
Loaded module 'client_options'
Loaded module 'client_entergame'
Loaded module 'client_terminal'
Loaded module 'client_modulemanager'
Loaded module 'client_serverlist'
Loaded module 'client_stats'
Loaded module 'game_interface'
Loaded module 'game_hotkeys'
Loaded module 'game_questlog'
Loaded module 'game_textmessage'
Loaded module 'game_console'
Loaded module 'game_outfit'
Loaded module 'game_healthinfo'
Loaded module 'game_skills'
Loaded module 'game_inventory'
Loaded module 'game_combatcontrols'
Loaded module 'game_containers'
Loaded module 'game_viplist'
Loaded module 'game_battle'
Loaded module 'game_minimap'
Loaded module 'game_npctrade'
Loaded module 'game_textwindow'
Loaded module 'game_playertrade'
Loaded module 'game_bugreport'
Loaded module 'game_playerdeath'
Loaded module 'game_playermount'
Loaded module 'game_ruleviolation'
Loaded module 'game_market'
Loaded module 'game_spelllist'
Loaded module 'game_cooldown'
Loaded module 'game_modaldialog'
Loaded module 'game_unjustifiedpoints'
Startup done :]
ERROR: Failed to read dat '/things/1098/Tibia.dat': corrupt data (id: 3, category: 1, count: 255, lastAttr: 0)'
Exiting application..
 

Slavi Dodo

#define SLAVI32 _WIN32
Staff member
Board Moderator
Content Editor
Joined
Sep 9, 2015
Messages
676
Best answers
11
Reaction score
502
Just to know, the corrupt data doesn't really clarify the problem.
For me to fix that problem with OTC i had to check how the .dat was saved in object builder.
It may be adding attributes that are not readable by otc so it just causes some error.

The best solution is to check the source of your object builder.

I don't remember that all 10.98 attributes are all parsed by OTC so make sure of that.
 

GOD Half

Intermediate OT User
Joined
May 9, 2010
Messages
179
Best answers
0
Reaction score
13
Just to know, the corrupt data doesn't really clarify the problem.
For me to fix that problem with OTC i had to check how the .dat was saved in object builder.
It may be adding attributes that are not readable by otc so it just causes some error.

The best solution is to check the source of your object builder.

I don't remember that all 10.98 attributes are all parsed by OTC so make sure of that.
Hi, I found the error similar to the one it presents when I try to open 10.98 in Object Builder 0.4.5. Watch:


OTC:
HTML:
Startup done :]
ERROR: Failed to read dat '/things/1098/Tibia.dat': corrupt data (id: 3, category: 1, count: 255, lastAttr: 0)'
Exiting application..
 

Slavi Dodo

#define SLAVI32 _WIN32
Staff member
Board Moderator
Content Editor
Joined
Sep 9, 2015
Messages
676
Best answers
11
Reaction score
502
Your new object builder is adding a new attribute (or changing an old one). Probably wrapping? As I mentioned earlier. Check how your object builder is generating the new .dat
 

GOD Half

Intermediate OT User
Joined
May 9, 2010
Messages
179
Best answers
0
Reaction score
13
Your new object builder is adding a new attribute (or changing an old one). Probably wrapping? As I mentioned earlier. Check how your object builder is generating the new .dat
Hi again, I'm in a battle to try compile the OB. This check should be done in the compilation files, right? If it's, I think I'll have to leave it for another time because I can't compile the OB to test any changes. :\
 

Slavi Dodo

#define SLAVI32 _WIN32
Staff member
Board Moderator
Content Editor
Joined
Sep 9, 2015
Messages
676
Best answers
11
Reaction score
502
You don't need to compile it since you already have a compiled version. You need just to check the dat architecture.
 

GOD Half

Intermediate OT User
Joined
May 9, 2010
Messages
179
Best answers
0
Reaction score
13
You don't need to compile it since you already have a compiled version. You need just to check the dat architecture.
Can you teach me to check the architecture? I've been trying to view in editor and this appears. LOL :confused:
 

Slavi Dodo

#define SLAVI32 _WIN32
Staff member
Board Moderator
Content Editor
Joined
Sep 9, 2015
Messages
676
Best answers
11
Reaction score
502
This is a example of writing props for 10.10+ . Keep in mind it may me different than yours since you are using a 10.98 version.

ottools/ObjectBuilder
 

xinsanex

Well-Known Member
Joined
Jan 1, 2013
Messages
25
Best answers
0
Reaction score
3
i managed to add the transparency + extended, everything seemed fine but... whenever i add new looktypes , from looktype 550+ and up, they didn't display in-game :( , every looktype past position 550(in outfits) appears like a "void" tile :/ looktypeproblem.png
 
Top