Converting .dat, .spr to a sprite atlas.

Slavi Dodo

#define SLAVI32 _WIN32
Joined
Sep 9, 2015
Messages
615
Best answers
1
Likes
296
#1
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
Premium User
Joined
Sep 18, 2007
Messages
1,967
Best answers
17
Likes
858
Location
PLand
#4
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?
 
Joined
Jul 27, 2009
Messages
42
Best answers
0
Likes
28
#5
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.
 

Slavi Dodo

#define SLAVI32 _WIN32
Joined
Sep 9, 2015
Messages
615
Best answers
1
Likes
296
#6
A video on getting started with the UI
// More videos will be published soon..

(I don't know what happened to the video but the quality suddenly decreased to 360)
I made sure to upload the video on 1080p




 
Joined
Aug 3, 2017
Messages
528
Best answers
7
Likes
16
#10
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
 

Gesior.pl

Mega Noob&LOL 2012
Premium User
Joined
Sep 18, 2007
Messages
1,967
Best answers
17
Likes
858
Location
PLand
#12
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.
 

Slavi Dodo

#define SLAVI32 _WIN32
Joined
Sep 9, 2015
Messages
615
Best answers
1
Likes
296
#13
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:
Joined
Jul 27, 2009
Messages
42
Best answers
0
Likes
28
#15
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.
 

Vizjus

Banned User
Joined
Nov 13, 2018
Messages
179
Best answers
0
Likes
42
#16
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.
get the latest object builder sources and edit it out for the new versions
 
Top