View Single Post
Old 06-19-2014, 06:23 PM   #8
camlorn
Member
 
Join Date: Aug 2011
Posts: 144
camlorn is on a distinguished road
Re: Flexible base code for a beginning coder

My personal suggestions from having failed to write a mud and, in the progress plus other stuff, moved on to writing 3D audio mixers and other esoterica-avoid C. I just had to refactor my 2000+ line project to C++ because C is really really horrid at giving you tools for manual memory management in complicated cases. I unfortunately must have the performance of C++ (I'm doing 2 128-point convolutions per sound source for a 3d audio mixer and hope to get it on phones). What I mean by this is that C and C++ do not provide garbage collection, which is invaluable for any programmer-let alone new ones (advanced devs: I am intensionally avoiding a discussion of shared_ptr as that brings its own complexities to the table). Coffeemud is probably the place to start for you: you know Java. My prejudice against Java aside, stick with what you know. Disregarding my own advice, because I'm now a Python fanatic: There are also a few codebases in Python : evennia comes to mind, though I don't know if that's being used in production. I really like Python these days: you don't worry about memory, and there's lots of "magic" tools that the developers of your libraries have to make life easier on you [1]. Python can be learned by someone familiar with programming in a couple hours. If you find a game you really like, using their codebase is an option, but there's a 99% chance you get to learn about life without the garbage collector. Finally, do not make the mistake of rolling your own: you can, you will spend a year, and you won't rival what's already out there [2].

1: I don't believe in magic everywhere. Things like __getattr__ and descriptors, however, make databases a breeze. And debugging (want to log all property accesses to a certain type of object? 5 lines. Want to get notifications when an object changes? you can do that in __setattr__ really simply; bring in blinker for extra productivity, implement things that look like built-in containers, all easy in Python). The magic is not for you so much as those writing the pieces you use to get things done, but there are things you can do in Python that you can do in few other languages. When you need them, you're glad to have them.
2: There are valid reasons to do so anyway. Fun comes to mind. So does doing something so out there that it literally can't be done on a framework we already have public access to, i.e. something similar to Godwars2. But for the most part, don't. Especially if you want a game.
camlorn is offline   Reply With Quote