What defines a Game Library or Collection of Utilities

I’m sure everybody noticed the flood of “game libraries”. I just wanted to make a thread so that future posters will know whether their “game library” is worth posting.

Here are my guidelines for a game library, I hope other people will post theirs:

  • at least 6000 lines of code for a small one, and 20000 for a medium one
  • at least 6 packages for a small one, and 20 packages/subpackages for a medium one
  • actually saves the user more than 100-200 lines of code per class / package that uses it
  • encapsulates the entire game instance
  • well documented
  • limited external dependencies

Here are my guidelines for a utility collection:

  • actually saves the user more than 100-200 lines of code per class / package that uses it
  • well documented
  • easy to incorporate
  • limited external dependencies

CopyableCougar4

My classes don’t have 200 lines of code. Except the bad ones of course!

LOC is not a useful measure of anything.

A library doesn’t have to abstract everything away from the user. That’s what an “engine” is for.
A library is really just a collection of utilities that work together and help simplify one particular function (eg: graphics, networking, math).

A utility collection is quite broad, and can be smaller or bigger than a library (but usually smaller)
I’d classify it as a bunch of utilities that don’t work together, in contrast with the description of library above.

I would expect to be able to extract specific parts of a utility collection and still have them work, whereas a library usually requires everything together.

I probably phrased than incorrectly. My point was simply that libraries should do enough that they are worth using. Lines of code was a bad example. I just personally think that in order to publicly post a library or collection of utilities, it should be matured and do enough to be worth looking into or applying.

CopyableCougar4

There is a shared code board for random utilities. No need to make a collection.

That’s an even better reason to make a topic like this. For all the new people to know not to paste a 6 class jar file in WIP, but rather the Shared Code.

Also, if a moderator thinks this topic is a better fit for miscellaneous, then please move it as I would feel bad if this topic were in a board where it shouldn’t be.

After a discussion on IRC and a look at wikipedia I found a few things to note.

Library usually refers to a set of methods that abstract a particular functionality away. The library is only in use when a method is called, and should not be doing anything between calls, although it sometimes may need to store some state. (LWJGL is a library)

A framework usually controls the flow of the program, but uses behaviour defined by the caller. (LibGDX is a framework)

An engine is like another program running alongside yours, which you can send and receive data from to perform whatever functionality the engine provides. (JMonkeyEngine is an engine)

With these in mind, a utility collection appears to be a less integrated form of a library. The difference between them really depends on whether all the functionality works towards one specific purpose. (Or just general purpose, like a standard library)

Terminology aside I’d just say any kind of code/tool for general consumption needs to provide something unique, or do something better than any existing tool in some way. (Otherwise why not use the existing tools?)

I dunno, unless we’re trying to establish some rules about what people are allowed to post here, it’s all a bit of a moot point.

I guess I don’t see the point in trying to define what a library is or what a framework is, especially based on metrics like lines of code, documentation, or anything else really. It’s all a bit subjective anyway- if I have a small collection of utilities that I use and I want to bundle them up and call them a library, do I have to check here to make sure it has enough classes or lines of code? If they don’t fit these criteria, should I just keep my mouth shut?

Also, keep in mind that events like Ludum Dare require you to publicly declare your code base, even if it doesn’t fit your above criteria.

So debating about whether something is a library or a framework seems a bit pointless. Maybe a better debate is whether something is a useful tool, but even that’s subjective: different tools are useful to different people for different jobs.

I understand your frustration or lack of interest in other people posting things you view as trivial, but I also think it’s good that this place serves as a forum for discussing those kinds of projects. If you want to discourage people from posting small projects, then maybe post constructive criticism in those posts you view as not good enough?

But if we’re just talking about posts that shouldn’t be made, then I would vote to get rid of most “thinking about doing this… what do you guys think, how should I start” types of posts.

Good library solve only one problem and does it elegantly.

I made my own game engine because after looking around a lot I found that most Java game engine where very similar… If you wanted to render an image… You created an Image object and wrote image.draw() in the draw method (or something similar).

This can be good in some ways but I preferred the idea where you create an object, tell it what to do (through code) and then add it to the world. My game engine will just do everything in the background…

Sry if this is a bit off topic but I just wanted to explain why I thought mine was better… But I guess everybody has their own opinions…

In my opinion (keep in mind this is the guy who made SJGL), a library is something that makes programming simpler.

matanui159, what you describe is called a scene graph. See scene2d in libgdx.

People can and will share their 6 LOC of they want. People will also make terrible libraries. It can be a learning experience for them and is not something that needs to be discouraged.

When I need a library for some task, it is a huge pain to dig through a bunch of junk, narrow it down to a handful, and try each remaining one in depth. Usually they are all pretty bad, in different ways, but sometimes I get surprised and find something that is really great. We need people to share and to try making things that are great. Some of them will succeed eventually.

For coders of all experience levels, it is very easy to look at other people’s code and decide it is bad. It usually takes quite a bit of effort to understand the complexity of the problem and decide if the approach it takes to solve it is reasonable. When looking at something relatively complex, it’s much easier to decide the whole thing is poorly written junk. While that is often the case, making that decision incorrectly is a big mistake.

I agree that it is a good part of learning, and that it shouldn’t be discouraged.

I think the mistake happens when people go to share their libraries.

When your library is kept to yourself, you can break and refactor everything without worrying about it. And when you’re starting out, it’s inevitable that you’re going to have to redesign a few times. It’s a part of learning. If you’re expecting people to use it (regardless of whether anyone actually uses it or not), you have the responsibility to keep backwards-incompatible changes to a minimum.

Over the last two years, I’ve done a complete refactoring of my personal library about 3 times. Design ideas I thought were great at first turned out to be less so, and I learned many new things that made massive improvements to how I wrote games.

But I learned these new ideas from making games, which leads me onto the problem that most of the people making these libraries haven’t had very much experience making games. How can you expect to make a library when you don’t know what the library needs? Releasing a library is a massive distraction from making games, and probably won’t teach you that much either.

My advice to these people who are busy trying to make libraries: Don’t. Make games instead.
After a few projects you’ll find you have code that you keep reusing anyway. This is the stuff that you make libraries out of.

Sry I accidently appreciated the previous post… But it was still a good post…

EDIT: also, I find making engines very fun for some reason… I’ll be making games in them to see what I need… But generally I beleive I have more fun making the engine then making the game

[quote=“Nate,post:13,topic:51865”]
Unfortunately there’s so many libraries and packages and toolkits that potential users simply have to triage in this way. As writers of potential shared code we need to realize we’re competing with many, maybe thousands, of others for the attention of potential users. It’s no use blaming them for not having the patience to delve and see how great our code really is.

As it happens well laid-out code is a good indicator of well-though-out and well-written code, so it’s not unreasonable to make snap decisions. Slight digression, this is why I think the suggestion (in another thread) that IDEs should automatically standardise code format is a bad idea. It’s useful to be able to see at a glance that in all probability a bunch of code is not great, and proceed accordingly - either use it with more care, or just move on to the next candidate. Presentation shows attention to detail, and if nothing else, good programming requires attention to detail.

I’m looking at you, libgdx!!

Cas :slight_smile:

bad libraries generate problems which are fixed by good libraries.

Your engine won’t be “better” than major ones created by more experienced developers (some of them work in the gaming industry) for most of the developers. However, if you really think that you have something new to bring, maybe it will be better for the whole community to contribute to existing engines instead of creating a new one. I wrote my own engine and instead of wasting any time in maintaining it for years (it was globally a lot less capable than JMonkeyEngine), I have spent years in contributing to some major engines used by a lot more developers than my own one. I was humble enough to admit that my “creation” was worse than JMonkeyEngine, Ardor3D, Java 3D, …

Edit.: and nowadays, I have to maintain JogAmp’s Ardor3D Continuation alone :clue:

This boils down to an argument that’s much older than the one you’re currently having: the argument that more participants in a craft generates too much “noise”.

The same argument is made about art, or music: to find good art, you have to sift through a lot of crap, since pretty much anybody can pick up a pencil and call themselves an artist. This post is basically somebody complaining about inexperienced artists trying to get their art into art galleries, or inexperienced musicians uploading their videos to youtube.

But the thing is, it’s hard to say what qualifies as “good” art, just like it’s hard to come up with a set of rules that decide whether a library is “good” or not. And sometimes the best art comes from somebody nobody has ever heard of… just like some of the most popular technology came from people or companies that nobody hears of until they’re insanely popular.

So while I agree that sometimes posts in these forums can be frustratingly trivial, I think it would be more beneficial to offer your criticisms to the particular people you’re talking about, instead of some generalized “rules and regulations” post that none of the people you’re talking about are going to read.

Anyway, I think there is merit to the noise- it’s our job to sift through that noise to find what we think is good, just like it’s our job to sift through the noise to find games we enjoy playing, or art we enjoy, or music we like listening to. Telling novices to just not bother posting seems a little too harsh, imho.