Greetings, and some gooey love

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
Nistur
Prole
Posts: 2
Joined: Fri Mar 23, 2012 8:44 pm

Greetings, and some gooey love

Post by Nistur »

Alright, I will admit it, I'm a little immature when it comes to naming. I apologise.

Anyway, the first thing for me to do is to introduce myself. My name is Philipp Geyer, I'm a game developer, I work making iOS games. Right, that's the boring stuff over with. I've been fiddling with Love for a little while now, trying a couple of things and I'm very impressed.

One thing I've been looking at is the libraries for Love. In particular GUI libraries (as I've done a deal of GUI programming myself). This is where "Gooey" comes in. I've started working on a GUI library for Love. I will be the first to admit that it's nowhere near as complete as some of the existing solutions. It's also pretty shoddily written internally (I'm normally a C++ developer and this is my first "real" lua project). The reason I started this insane task instead of using something that already exists is quite simple. I am a useless artist. Now, I don't have to be an artist to implement GUI in a game, but usually what happens is that an artist gives a mockup, and then I spend hours upon hours setting up the layout, trying to get it pixel perfect. What I would prefer is to have some way for the artist to do the layout themselves.

The solution is either to convert an existing format that an artist can create (PSD?) or to write an editor. The first solution is a little awkward as it's awkward to get arbitrary data exported, especially if we want to allow a user to create their own element types. So that leaves the editor. It's a lot of work, but with the flexibility of lua, we can then also easily support custom elements, we just have to use the lua system io to load an element registry... thing into the editor.

Anyway, I have begun work on this. As I said, it's far from complete and it's not particularly well written. However, I've uploaded it to github. If anyone at all is interested in this, I would love (hehe) someone more experienced with love/lua to aid in this. Feel free to ask any questions.

Oh, I've also begun some work on localisation support. It loads localisation data from a csv file. :) Decided to call that "Amor" as it wasn't taken by anything else :P

https://github.com/nistur/love-gooey

I look forward to hearing what people think :)

EDIT: I realised that it seems a little like I'm trying to offload this project onto someone else. That's not true. I will continue working on it regardless, I was just opening it up to other people in case anyone was interested :)
User avatar
trubblegum
Party member
Posts: 192
Joined: Wed Feb 22, 2012 10:40 pm

Re: Greetings, and some gooey love

Post by trubblegum »

Hi, welcome, and the best of luck with your project.

Re lib naming : suggestive (and even downright rude) lib names seem to be not only the norm, but positively encouraged, so I imagine you're in good company :)

I've given some thought to writing an editor for my GUI lib (Gspot on github, below), but completing and documenting it have a higher priority, and I can't take too much time from other projects. However, I can't help wondering if it can actually be considered complete without the editor, since the purpose is to make GUI implementation as easy as possible.

Couple of comments / questions / suggestions / brain-farts, bearing in mind that I haven't looked at the code ..
- Sure seems like a lot of files. How easy would this be for the developer or artist to implement and include?
Given what you mentioned re confidence with Lua etc. :
- Lua is very easy to learn, and you will have no trouble once you get your feet wet - documenting is the hard part.
- Have you considered writing an editor for an existing lib?
Nistur
Prole
Posts: 2
Joined: Fri Mar 23, 2012 8:44 pm

Re: Greetings, and some gooey love

Post by Nistur »

Thanks for your reply. I've also recently noticed that 2 people are watching my github repository, which makes me think I should do some more work on it :P

I have to admit that I was a little worried about the lib name, but I figured "what the hell, it's asking for it" :D

I would say that your thoughts are pretty much spot on. I've now worked on 4 games at work, and several other attempts outside work. I've had the experience of a handful of UI systems. Some of them have been immaculately written and incredibly well documented, but only one had an editor. The editor was buggy as hell. It crashed randomly. It didn't allow for custom elements. If you gave it something even marginally wrong in the plaintext UI file, it would throw a hissyfit, often no error messages, just crash after a minute of hanging. Still, it was an improvement, much as artists couldn't technically use it because of the nuances, it made doing simple layouts much easier as you can visually see and compare to mockups. With a decent editor, you could cut out the mockups and give it directly to artists to do the layout. It's by no means necessary, if a programmer is sufficiently artistically minded, they might be doing the art themselves, in which case it usually doesn't matter if there's an editor or not.

With regard to the amount of files. I would hope that the only thing you need to include is gooey/gooey (although, I'm just learning how modules work properly, so that will hopefully become just gooey) I have yet to work out how to make the include paths relative inside the gooey module, but that's because I haven't looked into it yet. I mentioned that I also wrote a small localisation lib and included that. The reason for adding that (it's currently a requirement to use gooey) is that the gooey text parser splits on spaces. I can't, therefore, have labels with multi-word text in it currently. I thought, rather than spend an age writing a decent parser, I would just use single word localisation IDs and load the text from a csv. You can now replace Amor with another localisation system, if you desire, but eventually, I'll remove this dependency entirely.

The data files are currently split up for ease of reading. They're currently hand written (I may replace them with a binary serialised format when the editor's written, not sure) There's no reason why they couldn't be in one file but I'm planning on adding an "include" type command into the parser, so you don't have to manually load multiple data files in code. If the editor outputs plaintext, it will have one file for each UI screen/page and will hopefully group common (clonable?) elements in a separate file. If it's serialised, I don't see any reason why it would be separate files at all, but I haven't planned that so much yet.

Custom elements will be probably implemented in something like gooeyProject.lua, which will have functions like gooeyRegister() in them. The editor can then manually (using system IO rather than love) open this file and call gooeyRegister to add the custom elements to the editor, so it knows how to handle each element, and what things would be available to modifying.

Yes, that's a lot of files, but in general, all a developer needs to do is maintain the gooeyProject, include the gooey library (and amor), load a minimum of one .gooey file and do some basic hooking up (sending mouse actions for gooey for example). For an artist, they would have the editor, they would just open the project, which would automatically link in any .gooey files, so their workflow shouldn't be too difficult.

Now, moving off the first of your comments to the next one. I've found documentation to be a strange beast. It's usually the case that it's incredibly difficult to get started with, but once you start, it just flows out. I tend to work in spurts. I develop for a while, doing very little documentation, then spend the next session documenting what I've done. Technically it's better to do documentation while you go, but once I'm "in the zone" programming, trying to add documentation just feels jarring.

As an aside, I love how Lisp works, more languages should be self documenting. Might try and add something similar to the lua classes... hmmm

Finally, existing libs. I am very bad when it comes to this. There are two parts of me. One is very immature, wanting to write everything myself. One part says "if someone's already done the work, why do it again." I've been tending more towards the saner part recently, but I quite often get burnt. There are a great many great libraries out there to do more or less anything. They are very very rarely written with the same design that I would want to use. More often, they are (just about) flexible enough to use for my purposes. I've said that I've looked at other libraries. I have to admit that, much as I've looked at them, I don't know exactly how they work, so it might be possible to write an editor for them. My experience, however, shows that it's pretty difficult to create an editor for a UI system that's designed originally to be hand laid out, let alone code driven. I wouldn't have a clue where to begin with creating data for these libraries. Basically, it's far too much of a deep end for me to jump in, a new language, a new library and a new design. Making a basic UI system around my own design is easing me in more gently ;)

Wow, I've just realised the length of the essay I've just written. Apologies for the length. Thanks again for the reply and the thoughts, I hope I've been able to answer your questions.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests