Converting .dat, .spr to a sprite atlas.

Slavi Dodo

#define SLAVI32 _WIN32
Joined
Sep 9, 2015
Messages
619
Reaction score
316
The project is there
slavidodo/opentibiaunity-datspr-converter

NOTE: This is not compaitable with tibia 11, this is intended to be used in OTClient or UnityTibia..

Feel free to tweak it for faster processing..

PS: Since nobody has released the unity tibia so far (And i don't see any reason) I will do it myself, you can follow the project at github slavidodo/OpenTibia-Unity

I will not maintain it for long time, so get used to unity.

PS: The project is not yet published as it's missy and I need to refactor it then publish it.
 

Gesior.pl

Mega Noob&LOL 2012
Joined
Sep 18, 2007
Messages
1,975
Reaction score
876
Location
PLand
I worked on something similar (just to edit sprites easily). It should be implemented long time ago in OTClient. SPR and DAT files are 20 years old crap.

.spr to folder with .png images in OTClient + loading sprites from .png files:
[DISCUSSION] 128x128 pixels Tibia sprites with AI (neural network)
JSkalskiSBG/otclient

@Under Influence
I rewrote protocolgame.cpp, datparser and network (no RSA/xtea/adler yet, but you can disable them in OT server code) from OTClient to TypeScript using WebSockets.
Right now I'm working on Rule Violation channel for GMs 'on website' and then I will try to create 'cast viewer on website'.
Did you try to render images like tibia (32x32 px) and animate them in web browser? Is it smooth?
 

Under Influence

Intermediate OT User
Joined
Jul 27, 2009
Messages
49
Reaction score
36
I don't have time to try that since I am very busy working on my OTserver. But you can try to use them with PhaserJS, it should be able to handle them.
 

God Of Pain

Member
Joined
Aug 3, 2017
Messages
528
Reaction score
16
The project is there
slavidodo/opentibiaunity-datspr-converter

NOTE: This is not compaitable with tibia 11, this is intended to be used in OTClient or UnityTibia..

Feel free to tweak it for faster processing..

PS: Since nobody has released the unity tibia so far (And i don't see any reason) I will do it myself, you can follow the project at github slavidodo/OpenTibia-Unity

I will not maintain it for long time, so get used to unity.

PS: The project is not yet published as it's missy and I need to refactor it then publish it.
hi, what command I need use to run with cmd?




thanks and nice tool
 

Keal Atis

Active Member
Joined
Feb 1, 2017
Messages
124
Reaction score
45
It should be implemented long time ago in OTClient. SPR and DAT files are 20 years old crap.
What are the benefits of using atlas instead of the old format .spr and .dat format? It is faster?
 

Gesior.pl

Mega Noob&LOL 2012
Joined
Sep 18, 2007
Messages
1,975
Reaction score
876
Location
PLand
What are the benefits of using atlas instead of the old format .spr and .dat format? It is faster?
It would be hard to create any faster format as .dat and .spr are simpliest possible binary formats.
Problem is that dat/spr format specification changes between tibia versions and sprites must be 32x32 px.
It's not a problem when you develop one version of tibia ('official version' as Cipsoft does), but for OTS/OTClient where you got all tibia versions support it's a problem.

Other thing is that we got no development format for OTSes. If you want to test how looks little change in outfit in game client, you need to repack whole .spr file, not just replace on image in some folder.
 
OP
Slavi Dodo

Slavi Dodo

#define SLAVI32 _WIN32
Joined
Sep 9, 2015
Messages
619
Reaction score
316
Hello again,

It took me time to understand a lot of aspects of unity drawing, and to understand the semantics of flash client
Thus, there is already a very efficient drawer, (i have still followed the idea of drawing the whole map (18x14) instead of (15x11), then setting the UV of the resulted texture to match the preferred width.

PS: This version of OTU Client is built upon Shadowrealm's server protocol changes.
This it will be possible to play Shadowrealm within this client once it's alpha is released.

What these screenshots are showing:
1- Drawing the map correctly, objects heights, ...
2- Drawing outfits addons & colors (using a CG shader.. Hint color-masking & blending functions)
3- A diffused texture, thus using unity's lighting system
4- A responsive world UI (this is not fit to the screen as i am still researching how to do that)
5- Choosing whether the screen is pixelated or antialised (using the texture itself). The pixelated texture matches tibia's retro settings.
6- Animations working (both outfits & items)
7- Ability to screenshot the game or capture a video at maximum 60fps)

What is missing in the client?
1- Drawing Creature Status (name, health, mana, ...)
2- Light management (Light is working, but i have tested lights dynamically, i have created lights manually with correct intensity and colors for test purposes, thus we just need a manager to create/delete/modify spot/point light)
- Hint, there is a manager for every aspect of the game so the design works like that
GameManager
- WorldManager (map, tiles, effects, ..)
- LightManager
- CreaturesManager (creatures, local_player)
- AppearancesManager (protobuf appearances, appearance instances, ...)
- SpriteProvider (caching the sprites, textures, UVs, ..)
- ...<etc>...
3- The whole game ui - Inventory panels, skills, .... (There are very helpful prefabs so that creating those wouldn't take more than a few days)
4- Service protocols to maintain stats of players' sessions


Screenshots
<Smooth - Bilinear>


<Retro (Point filter - Non-Antiliasing)>
 
Last edited:

Under Influence

Intermediate OT User
Joined
Jul 27, 2009
Messages
49
Reaction score
36
I've been trying to use your program but it either gives a Unhandled DatAttribute [136] error in old versions of Tibia or in Tibia 1098 it gives an out of memory exception.
 
OP
Slavi Dodo

Slavi Dodo

#define SLAVI32 _WIN32
Joined
Sep 9, 2015
Messages
619
Reaction score
316
Hello,
long time no see, I've just published an update that marks the future of this small application.

It's now a lot faster, it used to take up to 30~40 minutes for 1098 files, now it takes exactly 160~165 seconds (2+ ~3 minutes).

You can find that commit there

Sincerely,
Slavi
 
Top