Jump to content
  • Advertisement
Sign in to follow this  
Larax

Writing own libraries, useing pre-made free libraries or other solution...Please help

This topic is 4726 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello Lately my mind is filled up with only one question - should I make most of libraries on my own, or should I use pre-made ones, wbich I could use for free, or should I even think about using one of free 3D engines... First of all, I know that it is almost impossible for one person to write all libraries, like scripting or physics engine, and I already know that for such things I will use already made, free libraries. I'm thinking more about "small" libraries, for example a low-level winsocket interface [wrapper?], just to add some fucntions that would speed up writing network code and would be much nicer than writing whole thing in winsocket. Makeing such library wouldn't took a lot of time, but is there any sense of wasting time for such libraries, if there are pre-made free low-level network libraries, with features like reliable UDP system, portability and so on? Actually in that solution, the main problem for me is API, which isn't "comfortable" for me in 100% [cause everyone has other programming style..]. Solution for that could be writing an interface [or wrapper, I don't know how is it exactly called] for pre-made libraries, but again one question appears - is there any sense of that? This solution comes also with another idea, of makeing own game engine, that would be useing only pre-made libraries with my own interface, or would be made from both my own simple libraries and bigger pre-made libraries. But I don't know, if in that case it wouldn't be better to use one of free 3D Engines... This question is mainly aimed to people who are writing or already wrote a game and know what is better in developing a game. I have no idea what should I do now - start learning pre-made libraries/engines API, or should I start planning and makeing my own libraries or something else.. Big thanks for any help

Share this post


Link to post
Share on other sites
Advertisement
Larax,

Absolutely, without question you should become comfortable with using pre-made libraries. If you plan to enter the work-force in a computer science related field you can guarentee that you will spend a large amount of your time reading other people's code. The ability to quickly identify the utility of someone else's code as well as becoming comfortable with it is an essential skill that should be developed early.

At the same time, you should *almost* never re-invent the wheel. The ultimate goal of every software engineer is code reuse. Creating building-block like code fragments which can easily be pieced together to create something entirely unique.

In addition, the hardest task for most junior game developers is finishing their first game. My advice is do whatever necessary to finish that first game. Now, with that said, chances are good if you're needing network code, etc...you've either already completed a few games of your own, or you're getting WAAAY ahead of yourself.

Ultimately, you should never reach a point of needing to use other people's code until you've nearly built a library of your own during the course of other projects. if you're finding that shortly after beginning game development you're needing a lot of 3rd party support, you're probably moving too fast.

So in summary, try and use as much of other people's code as you can. Get comfortable with doing so. But if you're finding you're using a lot of other code and you're early in your experience as a game programmer, you probably need to scale back the complexity of your project so that you dont need to use any pre-written code.

Hope this is helpful!

Share this post


Link to post
Share on other sites
Thanks a lot for these advices, they're very helpful - I'm starting too understand the line between writing everything at my own [as you said, it's like reinventing wheel] and using too much of other code..

For sure I'm not an experienced game developer, but actually I made several "very" simple games, like network OX game. However I didn't used there any pre-made or made by me libraries, I just wrote everything from a scratch - input in WinAPI, network in plain WinSocket's and so on. But as I said, those games were really very small, and I can't imagine makeing a bigger project from scratch..

To improve and check my cuurent skills I've planned to make a more complex game, something like simple 3D multiplayer space shooter, but when I started thinking about which part of code should I write and where use pre-made libraries, I only got an headache - I would like to learn as much as I can, but on the other hand I would like to finish this game and don't waste time on writing unnecessary things, where I could just use free libraries.
As you wrote, I should use as much of someone code as I can, although I shouldn't use only pre-made libraries. So I would be thankful, if you could give me advice about which parts should I write by me, and for which of them should use pre-made library. To make it more clearly, these is list of needed "parts" [I hope I didn't missed anything]:

I/O, timers etc.
networking
3ds/ms3d models loader
maybe filesystem
OpenGL GUI

As I wrote in the beginning, I'm not an experienced game progammer and I hadn't made so far a complex game, so maybe the best solution to learn as much as I can in that project, would be creating everything from a scratch, without useing any libraries ?

Thanks for reply.



Share this post


Link to post
Share on other sites
Always use a third party library unless:

A: It doesn't suit your needs
or
B: It's license would prevent you from doing what you want to do with it.

Share this post


Link to post
Share on other sites
The correct answer to this question lies within yourself. I usually write my own wrappers, but then I always reuse them. If you find a library that does exactly what you want, I'd say to use it, but then you wouldn't learn about the inner workings of an engine so when you want to change genres, you'll have to learn another engine. I'm no expert programmer, but if you just want to write games, use as much as you can already written code from 3rd party engines. For me, I like to know everything behind the scenes, so I do my own wheels. Figure out what works best for you and go for it.

Share this post


Link to post
Share on other sites
Well, this is actually my problem - I would like to write all libraries on my own, but I know it is almost impossible and I will never finish any game in that way.. And of course my libraries woudln't be so good as pre-made, bug-free, portable and so on.. As jwash said, it's just a metter of getting comfortable with pre-made libraries and earlier or later I will be forced to use 3rd party libraries..

After all your advices, I think I will use 3rd libraries, but only if I will know how the "inner" mechanism works, if not than I will try to write my own, smaller and less complex.. Just to learn..

kburkhart84: but you write those wrappers over a 3rd part libraries [i.e a network wrapper over SDL_net/hawkNL/other or WinSock/other] ? and what with more "advanced" things like physics or script engine ? and what if a library does exactly what you want, but you don't like its API - do you write mentioned before wrapper or just use as it is ?

Share this post


Link to post
Share on other sites
Do you want to produce games, or do you want to learn about low-level goings on and write an engine?

If you want to write games you should use any existing libraries that suit your needs, and even consider using an existing engine if you can find one you're comfortable with that meets your needs.

Otherwise, go the other road and write your own - you'll learn more, and if you stick with it you'll end up with your own engine.

As jwalsh mentioned, if you're planning on becoming a professional programmer (games or otherwise) it's best that you at some point become comfortable with using existing libraries.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!