Graphical Equipment Breakage?
🦀 Ella
·
Not sure if this would be possible but it could make a fun project for someone.
Is it possible to update the inventory graphic for items based on their current durability, such as plate armor looking more and more beaten up with each level of durability lost?
If this is possible and anyone is willing to take on the coding side, I’d love to work on the graphics. I’ve been learning to make assets for Meridian and this would be an awesome project to practice on.
At this point, I’m only thinking about inventory icons because that would be most practical. It would be neat to see it update on the player model too but that’s definitely not a priority and would be a massive undertaking if it’s even possible
Discussion 178
Sign in to join the discussion.
Awesome idea! Since there are text descriptions of health of item, it shouldn’t be a huge problem since there are icons for FUBAR items, right?
Yeah, I think so! I just don’t know enough about how it might work on the coding side. Toko said he was going to look into it, I’m looking forward to what he finds!
I was thinking about this because I went in to load the ghost with a bunch of arrows and it broke almost right away
Would’ve been nice to glance at the icon in the inventory window and see that was to the point of breaking
Another awesome idea.
I’m testing out maces because they are simple.
It looks like under the
\resource\graphics\folder there are the.bbgfiles for all the graphics in the game.I’m reading the manual (again) to better understand how this works. Let me know if this aligns with what you understand.
To make a graphic you load
.bmpfiles into intomakebgf.exealong with a.bbgtext file. The.bbgfile will contain information about what part of the resulting.bgffile to use for what variableexample with
mace.bbgIt looks like if it’s group 1 - then that shows the
macdrp.bmpsection because the mace is on the ground. But if it’s a broken mace in your inventory then it would be using group 2 i.e.macbro.bmpSo it sounds like I would need to make new “groups” and you would need to make graphics for those group states, and then we would need to refer to those in the code. To say oh when the mace is
well wornusewell-worn-mace.bmpin the inventoryYes, that’s more or less how it works. There is a BGF editor program floating around out on the interwebs. I can find the link for you if you need it, it will help you understand what you’re looking at there better. I know how to export/import and edit bmp/bgf files but have no idea how any of it works on the coding side.
https://github.com/cyberjunk/meridian59-dotnet/wiki/Meridian59.BgfEditor
I’ve done some fun stuff with it like edit existing assets to create some new stuff like this staff and crossbow. Making new inventory icons should be pretty easy.
Attachment not imported from Discord: crossbow-1.bmp, crossbow-0.bmp
Here’s what you’re looking at in the bgf file as the program interprets it– to add more I’d just need to create more frames and groups, and then I presume you call those somehow with coding magic.
Group 1 is the regular mace icon and group 2 is the broken one. Group 3 is what you see on the icon when you right-click it. There’s probably stuff in the code somewhere calling for those numbers?
That is helpful.
In
mace.kodbasically information about maces, I see thisThe way things are in M59 is they inherit from other things. So at the start of
mace.kodit saysMace is WeaponSo
Maceinherits fromWeaponand
Weaponinherits fromPassiveItemwhich inherits from
Itemwhich inherits from
ObjectBut I’m not clear on where I need to put in a new “group” or how to reference it exactly. I’ll tinker around.
Well. At least we know how it works from the graphics side. I think we will need to add in some “groups” somehow. Looking into it.
I can create one with an image in a bgf file and send it if you give me a bit.
I think it’s in
item.kodWe could try making a group 4 for maces that has the spikey part glowing a color or something, and I could set that to max health. Just to see. So then we say if piHits (how many hitpoints are left on the mace) 90% + then send
AddPacketfrom the server to clientgroup 4.And then it should reference group4 I guess.
Attachment not imported from Discord: mace.bgf
Well that was fast
There you go, that should have a group 4.
I edited the image pretty haphazardly lol figure that could pass as a temporary “well worn” state.
Okay sure I’ll try and get it to work. The way the animation logic is above, it basically looks at “is it broken” or piHits >0 and not the 70% 50% of the description string. But for now I can just say if it’s over 100 hp or something show group 4
well, uh, sort of
although I haven’t figured out how to fix it in the inventory window itself. When you look at it, it shows up right (like above) but in the inventory it looks like a normal mace.
closer though
Oh, hmm.. that looks like the icon from the 3 group.
Unless the image is just oriented differently in game than it is in the editor..
Yeah I think it’s a coding issue. But least it shows up in one place. I will check it out, and do another revision
Ohhhh… it says viGround_group = 1 in what you copied earlier, so group 1 is what it looks like on the ground, I thought that was the inventory icon.
The image from group 3 is the one I should have edited.
It works now
Oh neat 😄
So there’s two place we need to update in the code
SendLookAnimation()is when you “look” at the object with the descriptionand
SendInventoryAnimation()is the graphic in the actual inventory windowWriting this down because I’ll forget it in 5 minutes
So I updated
mace.kodwith both and that seemed to work.So I guess for any item needing a custom graphic we will need the
item.bgf+ adding to themessages(functions) for those 2 functions in[whatever].kodYou could actually differentiate between perfectly pristine and mended pristine now hehe
sparkles or something fancy for the most perfect of items
Oh that’s a good idea, I hadn’t thought of that.
Overlays could be interesting too, because you can apply those upstream to like
item.kodand say, red circle if it’s broken to ANY item, and yellow if it’s almost broken maybe. idk. I’m not a UI/UX personLike the yellow select thing is the only overlay I’m aware of, when you equip an item. But you could do others
Here are the 6 item states that are available:
I’m guessing
excis excellentI want to try making a full set.. But I’m wondering exactly how full a full set should be. Like do we need/want a different graphic for every possible condition?
Yeah maybe just excellent and medium perhaps, and use the existing broken and normal ones?
You’re going to sign up for a mountain of work, the players will scream my plate has health values, what about my x,y,z, ESSUN!
😄
when 10 hits from breaking would be nice with sound warning. And i wish we had frame color on magic items
I was thinking at one time of something really subtle, like a square in a corner like green for optimal, yellow warning, red almost dead or something idk.
Does anyone know all the descriptions off the top of their head or can pull them out of the code? I wanna try to make the graphic match the description.
I think, you should bite the bullet and join us in VScode/ GitHub land
It isn’t too bad, just mildly confusing at the start, but then you can look up anything you need at a moment’s notice
Probably 😛 My only coding experience is a little visual basic in like 2006 😄
that would be nice
A sound would be nice, like I don’t know what exactly but “watch out” or “this thing is about to blow!”
small things, but BIG for us builders
some sound or mirror that breaks 😉
Hektic’s video on getting set up isn’t bad, I wanted to scream when I started using Git/GitHub because of how weird it felt, but we can help you.
It’s basically clone the repo, have a GitHub account, and you can start. I think you have a GitHub already.
I do yeah, somebody asked me to post a (uhh what’s the word? pull?) on there for a fix they coded.
poll?
If you do a PR (pull request) it means you are asking the repository owner (Zaphod) to pull your code into his repository - aka include it in the Meridian59 codebase. There is oftentimes debate in a PR and it might be rejected which is always sad for the author.
Ah okay, yeah that’s what it was. Dunno why but he asked me to post it.
I would guess either he wants you to help author or fix the pull request, or comment on it somehow. Maybe to give feedback.
Sometimes they get canceled and then resubmitted. When I did the inventory sort PR it got so huge with so many changes it was impossible to understand what was happening, and so I closed it and resubmitted it (clean) without all the comments and discussions and changes.
The other benefit if you can build the code locally is you can see how it looks right away in the client and make changes. For example this mace change, looks good in the description window but in the inventory box it’s hard to tell if it’s broken or just used. So might need to revisit the graphics really quickly and iterate.
Yes, it would definitely be handy for that. What I’ve been doing so far is replacing existing stuff with my edits and loading into 101 and running around with them. Fun fact, the server doesn’t care at all about the bgf files, you can make every monster in the game look like clowns if you want to.
That said this is all awesome. 🙂
Geez, that is a minor security issue. I could make all the monsters humongous so I could more easily hit them (like the krippa)
Like the staff I made is an edited Lute, I just replaced the graphic with the existing frame/group/positioning data and my character is actually holding a lute as far as the server’s concerened, but it looks like my staff.
Would that actually work? 😮
I think so? Maybe. Just have one monster.kod thats as huge a box as possible, then just afk swing all day.
There is logic to make sure your positions are close, but beyond that I think it is whether you see the graphic in your window.
Huge if true 😮
The other part to be ware of is, is whether this makes sense to Zaphod. It really sucks if you go too far out and then it gets shot down without checking with him first. The code may be a bigger factor (getting it in the right way) than the graphics. It will increase the size of the game but I don’t think by much.
I think if ther’es just one upstream logic change to items (check and see if there’s these image states, and if so use them) it shouldn’t be too drastic.
Maybe we can try making one set and present it to him then go from there (if there’s a there to go to)
Yes exactly I think that’s best. Because there is sometimes “ideation fatigue” too - where there’s a billion ideas but having an actual PR with the work put in is so powerful and more actionable.
You can pick one item and we can try it.
I put this together this afternoon if you’d like to try it.
1 = Default, shines with smooth perfection
5 = This knight’s shield is marred by a deep gouge but otherwise is in fine condition.
6 = This knight’s shield is deeply scarred from battle but still functional.
7 = Well worn
Attachment not imported from Discord: mtlshld.bgf
Great! I will try later this afternoon.
I still have to do the inventory part (vs this “look” part) but this part looks good
I have a feeling the inventory part will be much harder to see
I think we should have some identifier or graphic for
shield_condition_excakashines with smooth perfectionNot sure how that would look, maybe a simple overlay. The
shield_condition_exc_mendedgraphic could also have a patch somewhere on it.Some people might want to discern a flawless item vs a previously repaired item
slaps hood of used knight’s shield at used shield dealer
Here’s how it looks in the inventory. Pristine on left with decreasing durability states until broken on the right.
The 6 states.
That’s awesome 😄 Looks like the black in the gouges is a little strong in the smaller inventory version. I can make that look better if I lighten them up a bit.
It sort of looks like it’s an intentional crusader like pattern when small. Not bad just interesting.
How do these look in the inventory window? Just lightened them, if it still looks crusadery I’ll change the pattern of the gouges.
Attachment not imported from Discord: mtlshld.bgf
I can see it, looks like it could be some kinda funky knight’s helmet too like [T]
For a first start, that is some beautiful work
Both of you guys
That is nice of you to say. I’m just implementing Essun’s art. It is great to have a collaborative PR born from the community ideas discord.
Promise I’ll set up a test environment if we do more than this one set so you don’t have to keep doing this ❤️
Sure I will take a loot in a little bit and paste them.
I’m still figuring out the best way to handle state changes. Like when the item goes between states it should update the image immediately. And ideally we set up that logic for all items along with a filter somehow for if it doesn’t have the graphics.
Once I have that code working right we can submit this as a PR.
Im not sure if you want to take a crack at the player perspective shield graphics and the view of other players graphics. It would be a lot of work. But for the initial PR we can stick with the inventory graphics only.
Yeah, that’s what I was thinking. Inventory graphics are easiest and most practical to update. It would become a multi-year project if we did the player model graphics too, there’s a ton of work that goes into that because you have to have a graphic for every possible angle for every state.
POV graphics would probably be what we’d want to do next if anything.
Inventory Updated Shields
Thanks, I think that looks better. You?
Yes, looks good. I feel like it still looks like it has an intentional pattern when small but you can much more easily identify the various states.
I was thinking maybe a message per the comment a ways back of “your shield is about to crack” if it’s HP is only 10 or something.
Eventually a sound too? This type of work leads to so much scope creep because it’s provocative, but in a good way
I will try and figure out the code stuff now.
It’s good, I’m just rambling.
One question I have is will these be compatible with colored items? Like what happens if you color the initial shield blue and then it degrades? Do you get a blue degraded one?
Good point. I think the way it works is to translate the colors to a different palette. It should show a blue degraded one but I don’t know what color the damaged colors would be. I guess it would depend on what the translation delta is.
Yeah, that might be something I need to be careful with as I make these.
Ugh from what I can tell the color will show up from the 3rd person vue (someone looking at you or in your player description) but won’t update in the inventory or look object windows
I guess that’s something to work around somehow throws in the pile of things to address
Uh oh.. good luck!
Toko and Essun: nice work so far on this. I have a related request: I want shrouded items to have the yellow highlight when equipped turn gray. This we can do without new art for all the shroudable items. I was unable to figure out how to do this myself. Thanks!
colored frame or background for diffrent things would be epic
While the graphics is super nice. If it’s easier to just color code the background for health of weapon, I think that would work amazingly as well!
Me too, I’m all for anything that lets me be lazier 😄
I do wonder if the selection overlay can just be made to translate colors based on item heath.
Green healthy yellow medium red low etc. might be simple
Currently it’s always yellow
Or maybe you mean some kind of other overlay like a square outline over all items (even those unequipped) that changes color. It could get overwhelming if there’s a lot of different items with health notifications.
I meant what you were thinking the first time. Just different colors for the yellow selection background that already exists
I think your idea of using the yellow thingy would be best, then it could just show the health of currently equipped items and wouldn’t get overwhelming that way.
Here’s a test with the shield taking damage. It is in the lower right hand corner.
Attachment not imported from Discord: meridian_8XZotmhLg5.gif
This is awesome! But what have you done to my beloved Cor Noth?
Yooo
That’s awesome!
I had to add a check for mend, because mend only cares if the item is broken, perfect, or mendable. So when it got mended before the graphic wouldn’t update.
Anyway mend works and updates the inventory graphic properly now.
It does make mend a bit more satisfying when you can see it do the repair.
Colored items seem to work now
I’m ready to submit a PR for this knights shield. If you like you can submit a separate PR for the graphics file. I can help with that if needed. Or I can include the graphics file in my PR.
I’ll approve this PR in exchange for a green shield.
Oh awesome, great work @Toko!
By the way, how do I color items with my admin powers? I’m gonna want to test that myself in the future.
To change an item’s color
piHitsandpiHits_init)piItem_flagsvalueIntegerand type in a numerical valueThese I believe are from
kod\include\blakston.khdBut the values in that file are hex format. So you can use a web based hex to binary converter for color combinations
Or here are some that I’ve used for testing that I know. Color names are mine, not official by any means.
seaweed green=83sky blue=22crimson red=33To have the item “refresh” the easiest way is to log out and in again really quickly.
Type ‘reset#’ in the chat bar (not admin window) and enter to reset screen
Made some for Neru armor.
Here’s a BGF if you want to try your code on another item @Toko.
Attachment not imported from Discord: nerudamr.bgf
Ugh unfortunately it looks like that .kod file for nerudite armor is formatted differently than the knight’s shield. I can test this out, but I’m feeling like maybe we can try and submit the PR for the knight’s shield today or soon, so we can get feedback from Zaphod. Do you have the
.bmpand.bbgfiles for the knight’s shield? If so I can submit the PR and see what he says.I do! But am not home at the moment, I’ll send them as soon as I get the chance!
I tried to copy your code over to neruarmr.kodand do it myself but it isn’t working, I think I’m missing a step somewhere.
I just broke my blinding hammer on a tusked skeleton. Odin assured me that they’re not rare, bless the Gods! But either way I was thinking about the effort being made here and appreciate the attempt. Lookin good - especially considering I was not sure what it would take to add new graphical features that keep to the spirit of the style and age.
Just curious, any reason why there weren’t any mods made to that section in the breast area on the right side. I was scrolling through the different damage states and noticed that section never changes over time.
Whatcha mean? The slopey bit?
I kinda like letting pieces of it survive, but if that’s distracting I can do something with that piece.
No, it looks good
Just curious, it’s an artistic choice sounds like
In the original totally broken one, that crack I’ve shown starting in lower-left of the well worn version splits all the way up and across that bit, but otherwise it looks fairly in tact.
Meridian 59 showing it on the actual character would be amazing. I’d wear nearly worn stuff all the time just for that Goku battle torn look xD.
The soldier shield would be the only clean piece of equipment on me xD
It would be awesome, but I don’t think I’m up to that challenge. Just look at how many edits that requires for neru armor alone. I’d have to edit each of these 3 times.
It would take me a lifetime just to do gauntlets. The gauntlet graphics are intense. Arm graphics generally are.. just think about how many different positions arms in Meridian can potentially be in, and then remember they need to be seen from different angles in all of those possible positions.
There’s a separate image for every single position from every angle both with and without gauntlets.
Remember what you’ve seen here the next time you see someone dancing, especially if they’re wearing gauntlets. Sooooo much work went into those arm and body movements.
😮
Got it, thank you!!
I think the only way it would be feasible to change the 3rd person graphics would be use blender or some other 3d modeling tool. I talked to someone who did that, and they had a script that would have the blender “camera” take all the appropriate camera angles.
Even then it would be a ton of work. But at least if you got it once with a script and one model, then you could take as many “photos” or pictures of the object from whatever angle.
I’m a good 3d modeler although I use a non-tradtional sweet of tools. I actually use solidworks but have gotten very good at surface editing and design of organic shapes. If there is a small project that requires a 3d model I could probably accomplish the task. I hesitate to offer though because one thing people don’t understand about CAD is how time consuming it can become. I’ve spent 40 hours on a single part file numerous times.
I’d want the work to be for some new content I think and not a rework of existing content. I’m not sure I could promise anything though - I’ve never used blender but the camera idea for animations makes a lot of sense to me.
I don’t know much about it either. And you are right about the scope creep + effort. Since M59 is open source volunteering, probably best to stick to things that aren’t too enormous. Here’s a youtube video (not mine) showing how someone used blender to create a new Meridian monster. https://www.youtube.com/watch?v=ttVGYhM-gZ8
looking forward to seeing his thoughts on this one. This has been a great example of productive colaboration
I think this is a cool change too, good idea by Essun. My first collaboration 🙂
@Toko
Attachment not imported from Discord: mtlshld-11.bmp, mtlshld-9.bmp, mtlshld-10.bmp
Not sure about a .bbg file, I’ve never done anything with those?
Thanks, I’m reading the documentation now. In Chapter 4 section 3 they talk about
makebgf.exeand that is used to create the.bgffiles. The.bbgfiles are arguments to be passed into the executable to create the output.bgfI’ve never done this before. But here’s the
.bbgfor the knight’s shield before your changes. I need to read through this.The documentation is in the repository under
manual\Meridian 59 Manual.pdfI don’t know if that tool you are using generates
.bbgfiles that would be awesome if it did.I don’t think that it does.. I can tell what’s going on with those numbers though, so I think I know what would need to be added to it?
Should just need the 3 .bmp names [0, 0] following each, and then I think 1 10, 1 11, 1 12 at the bottom.
The part I don’t get is the original art isn’t in the repo. I guess Zaphod must have it somewhere, separate from the GitHub repo.
I think we can try what you are describing.
I think probably the “9” at the top needs changed to “12” too. I think that’s referring to number of .bmp files.
And the “4” after the .bmps probably needs to be 7?
I think we can use that tool to extract the bmps and try and build it with makebgf to ensure the final bgf is built right. Along with your modifications to bbg. I will try in a bit.
I had to ask Zaphod a clarifying question on how he wants the graphics submitted. We will see what he says.
Made an alternate set of knight’s shield degradations, I like these a bit better. Dunno if we’re still doing this but figured I’d redo them anyway for fun 😄
Attachment not imported from Discord: mtlshld-9.bmp, mtlshld-10.bmp, mtlshld-11.bmp
Those new knight shield graphics look amazing
I will try and clean up my branch and make the neru armor stuff work, so even if we park it, people can use it to test or whatever.
Those new ones look really good, I like that the color is kind of neutral for the damage, so that if the shield is a different color it will look predictably like damage.
To update this thread with the current state of this idea of graphical equipment breakage:
There was concern raised about a “consistent reality” - meaning we would want all items to show breakage or none. If some show wear but others don’t it is not desirable.
So if we changed everything to include wear, then that might be accepted, but otherwise on a per item basis, it won’t.
I understand the need for internal consistency. Can we pivot to using the background color (changing the yellow halo) of equipped items instead? This alone would be a huge quality of life improvement.
I do think that would be best if it’s possible.. My other concern with this has been the potential for it to get overwhelming for players (i.e. holding like 12 of the same item all at different levels of degradation) but using the halo would make it only relevant to currently equiped items, which would be useful and not nearly as intrusive.
Heh
I imagine this being a huge undertaking for one volunteer
But I def admire the effort and whatever decision is made
Exactly my point - the creation of all these .bgf files will be time consuming compared to using XLat to adjust the color of the halo
Some ideas / musing
Ideally we should make the changes in Blakod / the server over all else.
So for example with this question of “how can I see wear” I started thinking of a solution this way
Just sharing where my mind is going, not saying this is right.