• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Changing from 32 pixels to 128 pixels

Flatlander

Species Developer
Joined
Feb 17, 2009
Messages
2,461
Solutions
3
Reaction score
1,356
Location
Texas
I have been making countless changes to TFS and OTClient and RME Map Editor.

My Problem:
While messing around with Health Bars (Very Frustratingly I might add) I found it nearly impossible to "update" them. My plan is to add Health, Shield, Barriers, Mana, Stamina, Exhaust, etc all as options that you can turn on or off for the OTClient to show above (or around) your character.

But with the current graphics it is impossible to make them look good.

Solution:
My plan is to upgrade otclient and tibia.spr to use 128x128 pixel tiles instead of 32x32.
Honestly I have no idea how to do this yet, but it shouldn't be impossible.
This way, even if on screen everything looks EXACTLY the same, it would allow for more options when making small graphics appear.

(I stole this image from another post that I found while searching to see if anyone else attempted this)
See the difference in available space when moving from 32 to 128 pixels.
3eepx.png


Planned Steps:
  1. I guess my first job would be creating a tibia.spr that uses 128 pixels tiles Or making a sprite sheet that otclient will read instead of the tibia.spr file.
  2. The second job would be making it so otclient can read that new spr file.

If anyone has any tips on how to manage the tibia.spr file or where in otclient it reads the tibia.spr file let me know.
 
OTClient is not nearly my area of expertise, but I could (almost with certainty) say that you don't need to go as far as to adjusting the ever regular 32x32 tile scheme to a bigger size to achieve what you want.
I suppose you could make your additional stats appear around your character in relation to character's name position or something like that.
 
You can even use images to draw for your new interface stuff.
Just look at how the skull / shields are drawn, I doubt that you need to move to 128px to make a good interface.
 
Fair Enough, I will look into that.

There may come a time when I would like to update the graphics.
But procrastinating is one of my strongest personality traits so I'll look into your ways.


I guess I could place a picture on top of each rectangle. And use alpha rectangles to "Erase" pictures partially.
I'll try it out and post my results.
 
I have been trying multiple different Health Bar Images and Image Sizes.
It is still very limiting having such a small amount of pixels to work with, and I'm scared of blocking too much of the screen.

I also noticed the Health Bars are effected by Lighting (which I guess makes sense), but this also causes problems.

I have custom lighting in my current server, where entering certain cities, caves, areas, or certain quests will change the world-light color and brightness for the player. Because of this it makes it very hard to make health bars that are always visible.
Example:
If I have a colored health bar, and the worldlight is another color, the health bar blends into a new color, but if I also have a shield bar with that same new color, they look almost exactly the same.
 
I have been thinking.
Wouldn't it be extremely easy to make OTclient use 128 pixels per tile?
It already has the ability to stretch sprites to any size.
So couldn't we just stretch the 32 pixel sprites of tibia.spr to 128 pixels per tile?

I have my mind set on this, I really want 128 pixels per tile...
 
I have been thinking.
Wouldn't it be extremely easy to make OTclient use 128 pixels per tile?
It already has the ability to stretch sprites to any size.
So couldn't we just stretch the 32 pixel sprites of tibia.spr to 128 pixels per tile?

I have my mind set on this, I really want 128 pixels per tile...
Would be amazing if you could get this to work ^^
Good Luck.
 
Would be amazing if you could get this to work ^^
Good Luck.

It is a goal of mine.
128 pixel graphics compared to 32 pixels is such a huge difference. And I'm not sure if it would cause any performance changes at all to the client.
 
OTC shows for default 15x11 tiles on its mapview. For example, my 1920x1080 resolution.
Mapview will keep aspect ratio and we can't forget about the chat, so the final tile size for me would be something like 64x64. (11*64=704 + ~300 pixels for chat would fill my screen)
Using 32x32 textures, i'd see tiles stretched.
Using your 128x128 textures, i'd see tiles shrunken.
Talking about programming, this is not a hard thing to do. Just create textures with those sizes, anyway tiles will be resized to fit user's screen. Mapview will do this work for you.
So, 64x64 would be more than enough for you.

Talking about your problem, how the hell do you think this is a solution?
Your health bars would be images placed on top of mapview, hire a designer to do that for you.
You won't have more space to place your healthbars using 32x32 or 128x128 sprites.
Imagine a guy with 1024x768 resolution, shrunken your 128x128 tiles, that'd be horrible.
At the other hand, imagine a guy with 1920x1080 resolution stretching 32x32 tiles, it's also horrible. (btw I never maximize otclient)

I guess this gave you the idea that 64x64 would be just perfect, but it's not.
How are you planning create ~65000 sprites or ~14000 'things' with bigger resolution?
Stretching them at photoshop would give a better result, as it uses better quality (but way slower) resizing algorithms.
But anyway it wont give you a good result as a complete remake would.

Concluding, changing base tile size from 32x32 to 128x128 or whatever won't change the size you have to place your healthbars, it'll just change the quality of mapview.
Focus on your problem and forget about changing tile size.
I'd hire a UI designer to create something beautiful for me.
 
OTC shows for default 15x11 tiles on its mapview. For example, my 1920x1080 resolution.
Mapview will keep aspect ratio and we can't forget about the chat, so the final tile size for me would be something like 64x64. (11*64=704 + ~300 pixels for chat would fill my screen)
Using 32x32 textures, i'd see tiles stretched.
Using your 128x128 textures, i'd see tiles shrunken.
Talking about programming, this is not a hard thing to do. Just create textures with those sizes, anyway tiles will be resized to fit user's screen. Mapview will do this work for you.
So, 64x64 would be more than enough for you.

Talking about your problem, how the hell do you think this is a solution?
Your health bars would be images placed on top of mapview, hire a designer to do that for you.
You won't have more space to place your healthbars using 32x32 or 128x128 sprites.
Imagine a guy with 1024x768 resolution, shrunken your 128x128 tiles, that'd be horrible.
At the other hand, imagine a guy with 1920x1080 resolution stretching 32x32 tiles, it's also horrible. (btw I never maximize otclient)

I guess this gave you the idea that 64x64 would be just perfect, but it's not.
How are you planning create ~65000 sprites or ~14000 'things' with bigger resolution?
Stretching them at photoshop would give a better result, as it uses better quality (but way slower) resizing algorithms.
But anyway it wont give you a good result as a complete remake would.

Concluding, changing base tile size from 32x32 to 128x128 or whatever won't change the size you have to place your healthbars, it'll just change the quality of mapview.
Focus on your problem and forget about changing tile size.
I'd hire a UI designer to create something beautiful for me.

Ok "Smart Guy".
I have yet to see a single person play tibia with "Do not stretch or shrink map" checked. That is the "True resolution" of tibia.
(480x352)
If I upgrade to 128 pixel tiles The new screen resolution would be
(1920x1408)

Yes shrinking that would reduce pixels, but guess what!? It maximizes the amount of pixels we are allowed to use.
I'll use a graphics example for you: Lets say I am making my health bars (Both the same exact size to your monitor)
Here we go, two health bars exactly the same size, but one using more pixels
(this is on a 128 pixel square, the bottom one is drawn with 32 pixel and stretched)

vmxgkl.png


I would say the top one looks much better? Even though they are the same size?
More pixels is always better, always, never once will it ever be worse artistically to have more pixels.
But thanks for your useless rant Mr Baxnie.
 
Flatlander, have you tried drawing the information/pictures that you need next to your character in a similar fashion to how the game draws skulls/party eblems/etc. next to the character? I think that might be the solution to your problem, like I said before, I don't feel there's a need to change something so core-deep such as the tile size to achieve what you want.
 
Flatlander, have you tried drawing the information/pictures that you need next to your character in a similar fashion to how the game draws skulls/party eblems/etc. next to the character? I think that might be the solution to your problem, like I said before, I don't feel there's a need to change something so core-deep such as the tile size to achieve what you want.

I have, I have temporary health bars in.
But you have to remember, it isn't JUST "Health bars" I need displayed on screen. I'm making a custom version of TFS that has high functionality so future OT Developers can make more exciting servers.

One of the features is going to be the option to have many different "bars" you can add without source edits. And then choose whether or not to display them below characters.

Currently I have the options for: Health, Mana, Shield, Barrier, Stamina, Soul, and Capacity.

Yes it is would be ridiculous to have all these turned on at the same time. But I found trouble trying to make even 3 of these show up and make it look good.

I ended up with this:
2n7pfz9.png


Green is Health, Grey is Shield, Orange is Barrier (it covers the base of your health bar)

This is 8 pixels tall, mainly because to make each color look "good" you need at least 3 pixels to make a gradient. Then you need a black border so it doesn't blend into the background.

With more pixels, the black border would take up less screen space, and so would the gradient. Plus it would look much sharper and give more room for design choices.
 
I see.
Well I suggested only what I had on the top of my mind, if you feel like the solution you're looking for can't be achieved this way then yeah, I guess you'd have to change something. I mean, the size of those bars is completely irrelevant (regarding OTC), you can make them 500x500 if you want, that doesn't matter - but I suppose it would look bad if the bars were taking up a lot of space above the character, you wouldn't even be able to see the game screen. I'm also planning to add bar display configuration on Necronia, but i'll keep the bars looking rather simple to avoid problems such as these. You could do the same to fix your problem.
 
I see.
Well I suggested only what I had on the top of my mind, if you feel like the solution you're looking for can't be achieved this way then yeah, I guess you'd have to change something. I mean, the size of those bars is completely irrelevant (regarding OTC), you can make them 500x500 if you want, that doesn't matter - but I suppose it would look bad if the bars were taking up a lot of space above the character, you wouldn't even be able to see the game screen. I'm also planning to add bar display configuration on Necronia, but i'll keep the bars looking rather simple to avoid problems such as these. You could do the same to fix your problem.

Yea my original plan was to keep the normal bars (otclient uses 2 rectangles, black background with colored foreground) as it's default healthbar.

So my first idea was to just copy that, and put additional health bars below it. (each bar would be 3 pixels tall)
But doing this, Health + Barrier + Shield would end up 9 pixels if they touched, and a huge 11 pixels if you spaced them(already bigger than the above bar I created)

Not to mention adding in Mana and Stamina. (which I personally don't want on any of my servers, but functionality is key when designing something for the masses)

I also messed around with Vertical and Horizontal Bars, but I felt Bars that are Vertical look weird.

By the way I am looking forward to see what is done with Necronia :). I always support highly-custom projects.
 
Last edited:
Yea my original plan was to keep the normal bars (otclient uses 2 rectangles, black background with colored foreground) as it's default healthbar.

So my first idea was to just copy that, and put additional health bars below it. (each bar would be 3 pixels tall)
But doing this, Health + Barrier + Shield would end up 9 pixels if they touched, and a huge 11 pixels if you spaced them(already bigger than the above bar I created)

Not to mention adding in Mana and Stamina. (which I personally don't want on any of my servers, but functionality is key when designing something for the masses)

I also messed around with Vertical and Horizontal Bars, but I felt Bars that are Vertical look weird.

By the way I am looking forward to see what is done with Necronia :). I always support highly-custom projects.

In that scenario, even tho they might look weird at first, vertical bars are the only thing that can make your design completely work 'cause, as you said, 4-5 stacked bars on top of character's head would look really bad. But then again, if players were able to pick which bars they want opened and were able to position them where they want (top of head, left of char, right of char) then it would be somewhat a viable solution.

I just posted this on the necronia thread, some nice edits to the OTC UI, even edited the bars, but these are the ones in the Health window, not the ones on the game screen :/
 
I just need to make it so people can edit the on-screen bars outside of the source, which I'll do by this weekend.

PS: Your artwork looks great.
 
I still dont get how it gives you more space.. The mapview almost covers the whole screen right now, because the 32x32 sprites are resized.
If you use 128x128 tiles they will shrink to fit the screen and you won't have any more space.
 
I think only one bar fucks the screen, i have add 3 bars to player screen and this is horribly... i removed all bars and make new module for see informations of enemy, i think it's better which have some bars drawed in screen.
 
I still dont get how it gives you more space.. The mapview almost covers the whole screen right now, because the 32x32 sprites are resized.
If you use 128x128 tiles they will shrink to fit the screen and you won't have any more space.

Again, reference my picture:

vmxgkl.png


One is 128 pixels, one is 32 pixels stretched out to 128. They both take up the same space, but one has many more pixels available to draw on.

Actually... give me one moment and I'll show you HOW EXACTLY it would help me IN the otclient.
 
I still dont get how it gives you more space.. The mapview almost covers the whole screen right now, because the 32x32 sprites are resized.
If you use 128x128 tiles they will shrink to fit the screen and you won't have any more space.
I don't get it either.
It'll only change the quality of mapview, not its real size.

I just need to make it so people can edit the on-screen bars outside of the source, which I'll do by this weekend.

PS: Your artwork looks great.

This was a planned change ages ago.
Healthbar/skulls would be widgets made with lua/otui files.
Positioning them could be done using that position anchors, that are used on uiminimap (centerInPosition).
Or every creature could have a UIWidgetPtr variable that's draw in 'drawInformation' function.

Oh, 'drawInformation' is called outside framebuffer. It won't be resized like mapview is.
 
Back
Top