FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

freelist, some questions

 
Post new topic   Reply to topic     Forum Index -> Yage
View previous topic :: View next topic  
Author Message
Cyborg16



Joined: 28 Apr 2007
Posts: 39

PostPosted: Sat Apr 28, 2007 2:01 pm    Post subject: freelist, some questions Reply with quote

Hi,

I've got a few Q's for you:
    Does this project have anything to do with yake? is it a migration to the D language? (mostly curious, if you don't mind...)
    What libraries have you used? as far as I've seen, only derelict, but I haven't looked through everything. yake uses openscenegraph iirc, did you decide to avoid using this or other scene graphs in yage because of it's complexity (I've certainly had headaches trying to work out OSG), or is it unavailable for D (I haven't worked out how importing C libraries works yet)?

I'm mostly asking because I've got similar project ideas... I've got a moderate amount of C++ code (of very varying quality), but I've decided to move to D.

btw I looked through a bit of your code and saw what the freelist module does. You could probably improve it by using custom allocator and deallocator functions, so the instances can be constucted normally with new and removed with delete and CTORs/DTORs will still run, and then using a static destructor to remove any instances still needing deallocation on program termination. Have a look at http://www.digitalmars.com/d/class.html - some really useful features by the look of it.
EDIT - oops, looks like you already tried this. Should have looked further before posting I guess.
Back to top
View user's profile Send private message Send e-mail
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Sun Apr 29, 2007 11:44 am    Post subject: Reply with quote

I'd actually never heard of yake until this post. Yage is pretty much from scratch, except the libraries linked to via Derelict (sdl, OpenGL, OpenAL, and oggvorbis). I looked briefly at openscenegraph about a year after starting yage (first time I'd heard of it), but by then my own scenegraph code was well on its way. I don't know of any D bindings for it but probably wouldn't be hard to create.

I believe I overriding new and delete on freelist only to benchmark and find that for some reason that method was slower. I don't think that freelist is used much, since I've refactored my 3d math classes to use structs instead of classes.

Unfortunately, I've had less time lately to work on Yage than before, so development is going a little slower. Writing a game engine has been my dream for 10 years now though, so it's definitely not something I'll ever give up on.
Back to top
View user's profile Send private message
Cyborg16



Joined: 28 Apr 2007
Posts: 39

PostPosted: Mon Apr 30, 2007 4:10 am    Post subject: Reply with quote

Ok, cool. yake was just something I stumbled across before... possibly with slightly different design goals to your project though, I think they were intending on avoiding rewriting code that libraries already existed for.

I was wondering why freelist was necessary - creating and destroying lots of classes. Didn't think of vector, quaternion, matrix, classes though.

I'm currently revising for my finals (or should be!) in maths BSc. Should be free in about 6 weeks though - I've been planning on keeping my summer free for a lot of coding.

I've also been trying to build a game engine - most of what I've got so far is an advanced input controller, some basic physics and code to control objects, and some quaternion maths in C++ (I've learned as I've gone, so rewritten some code as I've found better ways of doing things, etc). I've always wanted to make it very flexible - for instance allowing both FPS control and RTS-style control, instead of specialising in one style like a lot of engines.

I'm most interested in writing the physics code, and I've got some good ideas for a GUI. I might have more of a look at your code later, if you've got similar goals and would be interested in working on this project with me.

It looks like you've done a lot on writing a scene graph already - that's something I'm less interested in coding, which is why I've been trying to implement OSG in to my current code lately. I don't like it much though - can't understand why a lot of it is done the way it is, and the documentation is aweful.
Back to top
View user's profile Send private message Send e-mail
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Mon Apr 30, 2007 10:01 am    Post subject: Reply with quote

I would like to retain copyright of any contributions to Yage, but that doesn't mean I'm not also interested in collaboration. If you want to collaborate with me on some user-interface, physics code, or something else, I'm definitely open to the idea. And if there's something in Yage you want to use, and need more control than what the LGPL can give you (as my code is licensed), and you've written something I can use, I'd love to trade.

I guess we can just retain copyright over our own versions of whatever we share/build together. And sorry if I'm a bit pedantic when it comes to copyright issues.

Contact me on IM if you want to talk about this more. I'm also on msn messenger via eric (at-symbol) d512 (dot) com
Back to top
View user's profile Send private message
Cyborg16



Joined: 28 Apr 2007
Posts: 39

PostPosted: Tue May 01, 2007 3:00 am    Post subject: Reply with quote

Thanks. I'm not so bothered about license/copyright so long as it's open source and freely available. If I contribute anything to your project I'm happy for you to retain the copyright.
EDIT: Actually, I'm not so sure about that now. But I am happy to put code under an open source license such as the LGPL... just not so sure what the copyright means.

I'm not decided that I want to work on your project, but I'll probably have a closer look at the source at some point, and if we've got similar goals it might make some sense to work together.
Back to top
View user's profile Send private message Send e-mail
Cyborg16



Joined: 28 Apr 2007
Posts: 39

PostPosted: Mon Jul 09, 2007 8:52 am    Post subject: Reply with quote

btw was the point of your freelist class to avoid spending time initialising variables? Apparently using new/delete still does this: http://www.digitalmars.com/d/memory.html#newdelete
What you might want is void initialisation (see the bottom of http://www.digitalmars.com/d/declaration.html).

btw I'm just starting to get back to programming. Need to remember what I was doing... anyway I'm working on a file IO library atm.
Back to top
View user's profile Send private message Send e-mail
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Mon Jul 09, 2007 11:09 am    Post subject: Reply with quote

The point of freelist isn't to avoid initialization, it's to avoid reallocation which is much slower than initialization. I benchmarked use of freelist vs the standard new/delete and it was tens of times faster. However, for safest use, freelist's allocate() and free() really need to be synchronized, and that cuts a fair amount of the performance.

As for your previous question about copyright... Copyright is a way of saying who owns the code, and the license is something the owner adds to say what others can do with the code. Everything you create is automatically copyrighted by you unless you relinquish that copyright to someone else. However, your work doesn't have a license until you assign one to it. Yage will probably always be LGPL, but I'd like the option of also selling closed-source licenses in the future, hence my desire to retain copyright.
Back to top
View user's profile Send private message
Cyborg16



Joined: 28 Apr 2007
Posts: 39

PostPosted: Tue Jul 10, 2007 3:19 am    Post subject: Reply with quote

Well I'd like to retain copyright to my own code, unless we both do a code swap and have copyright to each others' code or something like that. But for now I don't know how much we'll end up combining code.. I don't really have a lot just yet anyway.

btw Isn't releasing yage under the LGPL counter-inducive to someone buying a licence since they can already do pretty-much anything they want with it anyway? Wouldn't it make sense to either dual-license with a more restrictive licence or release under a permissive licence (ie switch from LGPL to GPL when you switch to a dual-licence model or similar)?
Back to top
View user's profile Send private message Send e-mail
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Tue Jul 10, 2007 11:14 am    Post subject: Reply with quote

I'd sell someone a custom license only if the terms of the LGPL weren't acceptable to them--say they wanted to modify the game engine code and not release the source. And I only want to keep copyright of the code in Yage itself, if anyone wants to keep copyright of their own version (outside of yage) of the code they contribute, that's perfectly fine with me.

My ultimate goal is to make a free game engine, but I want to leave the door open to make money off of it someday (while still keeping it free). And that would just ultimately allow me to spend more time improving yage, instead of working on other projects that are more profitable but less fun.
Back to top
View user's profile Send private message
Cyborg16



Joined: 28 Apr 2007
Posts: 39

PostPosted: Wed Aug 01, 2007 5:13 am    Post subject: Reply with quote

Yeah I see what you mean, but I don't expect you'd make a lot of money from the project if it's available under the LGPL anyway, because it can just be used as a library --- for example several commercial games available for linux use SDL under the LGPL.

Releasing under the GPL and at a later date dual-licensing (as used for QT) looks like it makes more sense.

Anyway so much for the slightly pointless and completely off-topic conversation Wink
Back to top
View user's profile Send private message Send e-mail
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Thu Aug 02, 2007 11:41 am    Post subject: Reply with quote

If I ever decide to get serious about Yage generating profit, I'll consider the GPL. But for now it's just fun and I'd like for others to easily benefit.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Yage All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group