Using Libraries

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Raylin
Prole
Posts: 30
Joined: Thu Dec 30, 2010 8:48 am
Location: Chicago
Contact:

Using Libraries

Post by Raylin »

Just a random thought here.

Does anyone here dislike using libraries or code that they didn't write themselves in their games?
I always feel that when I do this, I rely too much on said library and if something happens, the entire game could be all for naught.
What do you guys think?
User avatar
dreadkillz
Party member
Posts: 223
Joined: Sun Mar 04, 2012 2:04 pm
Location: USA

Re: Using Libraries

Post by dreadkillz »

This is an age old question in programming. There have been earlier discussions about this:

viewtopic.php?f=4&t=8608&p=53181#p53181
viewtopic.php?f=3&t=9826&p=60279&hilit= ... ies#p60279
http://c2.com/cgi/wiki?NotInventedHere

I personally enjoy using libraries as long as they have good documentations and examples, especially for more more complex tasks such ask tile handling, collision, animations etc. Sometimes, I like to read its internal working and see if I can improve upon it rather than building the same thing from scratch (unless its really poor code, I'll try to make my own version).

If it hasn't been done yet, you could also be the nice guy and share your work so other people can improve upon it. But really, if you have a lot of free time, go right ahead and try to do things on your own.
User avatar
slime
Solid Snayke
Posts: 3159
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Using Libraries

Post by slime »

Raylin wrote:Just a random thought here.

Does anyone here dislike using libraries or code that they didn't write themselves in their games?
I always feel that when I do this, I rely too much on said library and if something happens, the entire game could be all for naught.
What do you guys think?
Why are you using this, then? https://bitbucket.org/rude/love/src/a66afb2d4fd0/src

:P
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Using Libraries

Post by coffee »

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Using Libraries

Post by Robin »

Not finishing a project because of a library you used does not happen very often. Not finishing a project because you try to do too much yourself is, however.
Help us help you: attach a .love.
User avatar
mickeyjm
Party member
Posts: 237
Joined: Thu Dec 29, 2011 11:41 am

Re: Using Libraries

Post by mickeyjm »

Peronally I always make my own libraries wherever possible because otherwise I feel the game isnt really entirely mine
Your screen is very zoomed in...
SFX
Prole
Posts: 9
Joined: Tue Jul 03, 2012 4:56 pm
Contact:

Re: Using Libraries

Post by SFX »

I can understand the desire to write and use your own stuff. However, the more time I spend writing libraries, the less time I spend making games. This is part of the reason I'm using LÖVE instead of C++ with SFML.
Where's my big, fat hammock time?
I should pimp my neglected game dev blog.
User avatar
Larsii30
Party member
Posts: 267
Joined: Sun Sep 11, 2011 9:36 am
Location: Germany

Re: Using Libraries

Post by Larsii30 »

Personally I only use some basic libs like AnAL and some of the HUMP libs (Class, Gamestate).
Most of the other libs didn't handle things like I would like to use them so I write "simple" libs like gui / collision / fade / text libs on my own.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Using Libraries

Post by Inny »

Given the nature of Lua where the entire global state is your responsibility, more or less, I feel like some of the more traditional library design styles, i.e., the multiple file and multiple directory module, are too imposing. Most of the Lua community seems geared more towards a one-useful-function or one-useful-file style. It's no surprise that module function was deprecated and the Return Local Module style is starting to become very common. But that's not to say that some of the larger Libraries are shunned because they have too many files. Penlight certainly sees a lot of traction.

If I had to make a recommendation, and see it take on a large community role, I would say that Library makers should design their libs to be ripped apart function by function and used as the app and game programmers see fit. Fortunately, most code written in Lua is zlib or mit licensed, so we can in fact do this kind of thing. Just, well, expect it. Kikito's middleclass follows this mentality. Though if I had to make one change, it should probably be upgraded to the return local module style, rather than changing anything in _G.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Using Libraries

Post by kikito »

Inny wrote:Though if I had to make one change, it should probably be upgraded to the return local module style, rather than changing anything in _G.
Funny that you mention that. It's totally on my TODO list for middleclass v3.0 (which I plan to release at some point this year).
When I write def I mean function.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest