GLBasic forum

Main forum => GLBasic - en => Topic started by: Falstaff on 2011-Sep-22

Title: How are you guys handling menu type GUIs in your games?
Post by: Falstaff on 2011-Sep-22
So far my game's prototype just consists of the core gameplay experience, which I've been having fun tweaking and adding to. Now I'm thinking of adding an overall "game state", for managing things like the main menu / options / game mode selection, etc. I'll also be needing to implement a decent GUI to do this. I'm curious what sort of approach you guys have found easiest to work with in your games.

Some questions I have are: how do you manage the different buttons or 'hot spots' in the screen..? I noticed something about a lib called "DDGUI", and have started reviewing the docs. Is this what you guys use?  For example for a level select screen, we could have several places on the background that are clickable. Also if it matters my main target is going to be android/iphone.

Thanks!
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: MrTAToad on 2011-Sep-22
I use DDgui.  IMGui is good, but needs an on-screen keyboard added...
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: bigtunacan on 2011-Sep-22
GLBasic has 2 GUI APIs, DDGUI and an implementation of TKinter.
I've played with both a little and got the impression that DDGUI is more mature.  That said, I feel both are more suited to a traditional window type app rather than games.  In my case I am using DDGUI for a level editor, not in any of my games.

I havent tried this yet, but there is a post here for an immediate mode GUI more targeted for in game menus.

http://www.glbasic.com/forum/index.php?topic=5431.0

Personally, I tend to roll my own for in game, a simple system which is all most games need can be completed in a couple of days.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: bigtunacan on 2011-Sep-22
@MrTaToad,

Any chance you could post a pic?
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: MrTAToad on 2011-Sep-22
Post a pic of what ?
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: bigtunacan on 2011-Sep-22
From one of your in game interfaces. I was just wondering if you were using standard look and feel, or overriding with custom graphics, etc. No biggie either way.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: MrTAToad on 2011-Sep-22
Its all standard stuff - I dont change the look and feel of DDgui :)



[attachment deleted by admin]
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: ampos on 2011-Sep-22
I noticed that DDGui is a ugly interface, not suited for games, at least.

Most of my projects use just buttons.

I have a function createbutton()

Code (glbasic) Select
function createbutton: id,text$,x,y,w,h
   strecthsprite spr_button,x,y,w,h
   cprint(text$,x+(w/2),y)                    //prints text centered
   createzone(id,x,y,w,h)                    //check my zones lib for hotspot creations
endfunction


And here a example of my button/interface

Buttons:

http://www.glbasic.com/forum/index.php?action=dlattach;topic=6711.0;attach=3750
http://www.glbasic.com/forum/index.php?action=dlattach;topic=6711.0;attach=3752

Sliders:

http://cdn.downloads.palm.com/public/9078/es/images/4/L/04.jpg

If you need keyboard input, you have also a lib IMPUT for virtual keyboard on all devices. Just redraw the sprite image if you want.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: bigtunacan on 2011-Sep-22
@ampos  very nice.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Falstaff on 2011-Sep-22
Thanks for the suggestions! I liked the features of DDGUI but wasn't sure if it'd be worth the effort to try to re-skin the look.. I don't really need much from the interface specifically, probably mostly just different sprites representing buttons for the various menus. I was already considering rolling my own minimalistic code.

I'll also look into that IM GUI.

Ampos do you have a link for your zones lib you mentioned? Sounds really neat :)

edit: found (http://www.glbasic.com/forum/index.php?topic=5186.0) it!
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Ian Price on 2011-Sep-22
I hate all the GUI interfaces, so I always use my own, specially created for each and every game that needs one. One size NEVER fits all. I really hate iOS games that use the iOS GUI menus - they stand out unnecessarily, taking you out of that game "zone."
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: MrTAToad on 2011-Sep-22
I use DDgui so that text will fit properly for the different languages that I usually support...
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Crivens on 2011-Sep-22
Yeah, I just roll my own. Pre-defined interfaces always look generic and stand out a mile (a bit like in the old days when someone released a game using inbuilt fonts and mouse pointers in STOS and the like).

Cheers
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Kitty Hello on 2011-Sep-22
DDGui is not ugly. You can change the looks totally with the callbacks. Also, you can add user defined widgets (current method with prototypes can do this even easier now!!)
See the attached image for some standard DDgui stuff.

I really don't understand why you don't like DDgui all. I put so much effort into it and everyone complains but I heard no reasons that I can grab and change.

[attachment deleted by admin]
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: MrTAToad on 2011-Sep-22
I like it :) :good:
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Ian Price on 2011-Sep-22
I stated my reasons above - I don't hate DDGUI (it's great at what it does) - I just hate the majority of GUIs in games.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Crivens on 2011-Sep-22
QuoteI stated my reasons above - I don't hate DDGUI (it's great at what it does) - I just hate the majority of GUIs in games
Yeah, pretty much what he said.

It's not bad at all, and for business apps is probably the way to go to keep conformity between your apps. But not so good for games. I should re-phrase. What I mean is that for mobile games (which I am more interested in) then a Windows type look and feel doesn't quite feel right, even if you can do a lot tweeking to the looks. It's a bit like how iPaqs failed against iPhones. Make DDGUI look and feel (and I mean that inertia type movement on scrolling, scroll bars, date/time roll bar etc) much more like an iPhone GUI and that would be great.

Cheers
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Ruidesco on 2011-Sep-22
I might be wrong, but by reading this thread the whole complaint seems to sum up to "I want DDGUI to be skinnable so I can modify its looks to suit the mood of my game".
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Crivens on 2011-Sep-22
Not quite. Most decent GUIs tend to have something a bit more cute about them (and it's hard to define what). My current one for example is made up of Apple style buttons which fly towards you then zoom away when pressed. So I guess a list of animations would be nice. But I can't imagine something that generic can be made to be everything to everyone. Sometimes you just don't know how you want a game GUI to look until you have the whole game going. It just doesn't look or act correctly. Something very like Windows 98/XP (IMHO) doesn't really look right on a mobile device.

A good example I saw recently is a snake game which used 3D textured spheres for a menu, and you swiped left and right to rotate the spheres around a planet. Looked brilliant, was quite simple to code really, and fitted the game exactly. But I probably wouldn't use it on my game.

Cheers
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Ian Price on 2011-Sep-22
If you want to see a really, really bad (originally) paid for GUI system then look at MaxGUI for BlitzMax. Fecking awful. It's slow, unwieldy and totally user-unfriendly (I created my own GUI system for BlitzMax which did exactly what I wanted, in a fraction of the time I spent wrestling with MaxGUI to do something simple). DDGUI is none of that and was yet another nail in BlitzMax's coffin as far as I was concerned.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Kitty Hello on 2011-Sep-22
DDgui is far for being a perfect GUI and it's not looking "native" on anything. That's the biggest downside IMO. Also, the touchscreens won't really like the scrolllbar I put in. Might have to fix that one day. So far, you're better of keeping dialogs so they do not have a scrollbar for touch devices.

The only real awesome benefit of DDgui is, that it's written in GLBasic and thus runs on all platforms supported. You can make a GUI program on a GP2X and without much hassle it pretty much scales if you choose the right font.

A native GUI (Win, Lin, Mac) is one of my long time dreams, because it would push GLBasic in another target audience sector. It's pretty on top of my TODO, so don't expect many new platforms next year :)





Title: Re: How are you guys handling menu type GUIs in your games?
Post by: bigtunacan on 2011-Sep-22
@Gernot,

Pretty much what everyone else said.  I'm using DDGUI currently for "I <3 T&A" (my upcoming level editor).  It is great as far as window style GUIs go.  You are supporting some great core functionality, it is cross platform, supports touch screens, all real good stuff.  I agree with you that having "native" feel would help you gain traction with a different audience.  I'm personally not interested in doing trad apps in my free time; I would just as soon stick to something I enjoy; so games it is.

For my level editing tool DDGUI is definitely the right choice.  For my games though I'm typically just throwing on some clickable/touchable/slideable pictures and then adding some cool effects appropriate to the game.  Maybe they fade in, or shoot in from the side of the screen, maybe they pulsate, maybe the button is attached to a SFX; whatever works.  It is always pretty custom to the particular game; so I just write something fresh and light weight for that type of stuff. 

This is in no way a put down of DDGUI; you've really done an excellent job with that and with GLBasic as a whole; that's why I bought it!  Keep up the great work!
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Slydog on 2011-Sep-22
I prefer to make my own GUI.
That way it does what you need exactly, and you understand how it works and can make quick changes and updates.

However it may not be easy.  I've probably spent 300+ hours on mine, mainly because I'm so picky!
The main feature I wanted was to make sure it used polyvectors, plus drew the entire GUI at one time to minimize draw calls.
(My entire gui takes 2 draw calls, one for the GUI and one for the fonts).
And it had to be fully skinable!

It is mainly a gaming GUI, for portable devices.
I made my own kinetic (flick) scrolling (see 'glow' screen below), like on an iPhone, very tricky stuff!
Plus my version of left / right pages, easier but still difficult.

I would release it for everybody except that it basically uses my entire library for sprites, files, vectors, etc.
I may one day make it more stand-alone, but that may take a while.

Here's a couple of screens, both using the same code but different skins:

[attachment deleted by admin]
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Minion on 2011-Sep-22
Ive not really used DDgui, so I cant really complain. But the thing that put me off using it was the fact that it did look so generic. I think it really should be skinable, if its going to be used in games (and choice of font). The other thing is can it be scaleable ? Ive only seen one game on my phone use it (Spots) and it was so small that I could barely see it, and what with me having big stubby fingers, I kept pressing the wrong buttons.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: MrTAToad on 2011-Sep-22
You've got to set it for a nice vertical size for phones - probably could have increased it somewhat for Spots, although no-one ever mentioned it in the reviews...
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Minion on 2011-Sep-22
Quote from: MrTAToad on 2011-Sep-22
You've got to set it for a nice vertical size for phones - probably could have increased it somewhat for Spots, although no-one ever mentioned it in the reviews...

One thing I did try with spots, not sure if youve been told about it, but I changed the resolution it was using from 480x800 to 800x480 (just for a laugh to see what would happen). Now it only displays the top left corner of the screen strectch to fill the screen, so now I can no longer access the options to change it back ;( Must dig into it at some point and find where you svae the settings so i can delete it and start afresh.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: MrTAToad on 2011-Sep-22
No idea where it would on webOS unfortuately...
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Ian Price on 2011-Sep-22
Min's using Android, not webOS.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: Kitty Hello on 2011-Sep-23
DDgui can use any font you select. If you don't hard-code widget sizes, the gui will scale to the font. There's also a global varaible to specify the minimum size for each widget, so you don't end up with 16x16 buttons on a retina display.
Skinning sounds nice. I will provide a set of skinned widgets with the new user-widget functionallity.

For games a more animated gui that fits the theme is worth a lot. TimeGeeks e.g. uses a gui that matches the theme nicely.
Title: Re: How are you guys handling menu type GUIs in your games?
Post by: monono on 2011-Sep-23
I think DDgui is just perfect, if you need a slightly more complex GUI and you need it fast (for example an editor or a game like a RTS Game with many options). For the "small" games I usually see made with GLB, especially the mobile games, a custom GUI for a few options is not that hard to make. DDgui in the standard design, just doesn´t have the look and feel of a simple arcade game.