Making the (battle) UI more flexible

For discussion of the code running behind the game

Moderator: Staff

ManweSulimo2004
Newbie
Posts: 6
Joined: Tue Dec 04, 2007 8:16 pm

Making the (battle) UI more flexible

Postby ManweSulimo2004 » Fri Jul 22, 2011 7:55 pm

After a recent post of mine (The Battle System - Some Thoughts on Interface and Usability) I checked out the latest snapshot of Allacrost and fiddled with the battle UI a bit. Unfortunately it was rather tedious because the position of every (?) element is hardcoded and needs adjusting seperately. So instead of being able to move the character status view to the top of the screen I had to adjust the position of the name label, the HP label, HP bar, SP label, SP bar and their frames... individually. This system makes working with the UI a bit of a pain and discourages trying out new layouts. I think using something like containers might help. This would make it possible to group elements together and move them around much more easily. Something like this:

Image

(should be self explanatory)

From a code point of view it shouldn't be hard to implement. There would probably have to be a base renderable class (not sure if you've already something like this) and all the GUI elements, including the container class, would be derived from it. The container would then simply manage a list of renderables and should enable endless nesting of containers inside containers that way.

Another idea for making the interface more flexible - but I think is secondary for now - would be to make it customisable through config files. But yeah, that's an idea for later.

So, do you think this would be a valuable thing to work on or would it simply be a waste of time? I could start messing with the code and see what happens if you're interested.
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Making the (battle) UI more flexible

Postby Roots » Sat Jul 23, 2011 5:18 am

We already have a container-like system that you described with our native gui classes (gui objects can be "owned" by a window, and moving the window moves the entire set of objects owned by it). These elements, however, are not "true" GUI elements by rather just a collections of images (including the text, which is a type of image in our system). You can still achieve this effect with images by having an "absolute" position and then having all of the images have relative position. First you use "VideoManager->Move(x, y);" to set the absolute position, then you do "VideoManager->MoveRelative(dx, dy);" for each image location. In fact, I thought this was how that lower status menu was mostly done.


I don't think its a waste of time to fiddle with making the UI drawing more flexible, but I do think its a low priority issue for us right now. But if you want to fiddle around with it and come up with something that you think is better, go for it.


In the past when I've played around with the battle interface, I did so not in the code but in GIMP. Here's an old thread where I did just that and created a wide variety of different designs which we discussed: viewtopic.php?f=21&t=997 . I usually find it easier to make a UI draft in GIMP than it is to actually modify the code, because you usually have to modify/compile/check several times before you get what you want. But I do sometimes modify the code to get a draft, but I usually only do that when I'm only changing a single element and I know that it will be simple to do.
Image
ManweSulimo2004
Newbie
Posts: 6
Joined: Tue Dec 04, 2007 8:16 pm

Re: Making the (battle) UI more flexible

Postby ManweSulimo2004 » Sun Jul 24, 2011 6:55 pm

You're right, "VideoManager->Move(x, y)" and "VideoManager->MoveRelative(x, y)" should be enough to do the trick. I'll try altering the layout and see if what it feels like.

Also: Thanks for the link to the GUI discussion thread. I'll definitely read through that.

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 4 guests