Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1065703 Posts in 43481 Topics- by 35501 Members - Latest Member: glitchg

November 22, 2014, 06:09:16 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)The happy programmer room
Pages: 1 ... 167 168 [169] 170 171 ... 197
Print
Author Topic: The happy programmer room  (Read 364567 times)
kamac
Level 10
*****


Notorious posts editor


View Profile Email
« Reply #3360 on: May 08, 2013, 05:29:24 AM »

So that doesn't block the main thread, but the task queue calls the second lambda on the main thread when the first lambda (load) is complete on whatever worker thread picked it up?

Will

exactly Wizard

And.. and what is hiding within worker->queueTask function Epileptic?
Logged

Nothing to do here
_Tommo_
Level 8
***


frn frn frn


View Profile WWW
« Reply #3361 on: May 08, 2013, 05:33:04 AM »

So how do you decide when to interrupt the main thread? Does the thread manager thing get ticked, and save up all the main thread lambdas to call then?

W

Yep. I'm using a game engine so I didn't need to make it too generic, the BackgroundQueue just queues the callbacks to execute in another queue, and when the main thread calls "_fireCompletedCallbacks" it fires all the callbacks in it.
It is executed before input and game logic so you can decide what to do the same frame it finishes, aaand that's it :D

Actually the code is pretty simple, you can see that here and here Smiley

PS: I didn't need to have a threadpool, so the queue is single-threaded right now. Ideally there should be n worker threads that wait on the queue "stealing" the tasks.

EDIT: it was simple to do, so now it actually spawns a threadpool that is configurable or has a thread for each core the CPU declares (so 8 with an 4x2 HT i7).
It is a bit of a waste to spawn 8 threads that might never be used but... I don't think it is a relevant waste at all if they are always sleeping.
« Last Edit: May 08, 2013, 12:16:05 PM by _Tommo_ » Logged

Quarry
Level 10
*****



View Profile WWW
« Reply #3362 on: May 08, 2013, 12:48:08 PM »

http://dlang.org/

Can't contain my feelings about this
Logged

 
kamac
Level 10
*****


Notorious posts editor


View Profile Email
« Reply #3363 on: May 08, 2013, 01:24:34 PM »

http://dlang.org/

Can't contain my feelings about this

What's so weird about D? Tired
Logged

Nothing to do here
Klaim
Level 10
*****



View Profile WWW
« Reply #3364 on: May 08, 2013, 02:54:03 PM »

I guess that's because there have been a D language conference recently and one of the sponsors are Remedy Games who are working on games using D and made a presentation about that. I can't wait to see the video.

D is theorically more interesting to game developers than C++ (in my opinion), but still have some problems before being a clear alternative (like lack of implementation stability, lack of language stability, lack of plateform portability -not sure anymore about this one-, lack of clear and precise documentation).
Still it's very interesting to follow, even when you're not interested in it.
Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
kamac
Level 10
*****


Notorious posts editor


View Profile Email
« Reply #3365 on: May 08, 2013, 03:24:47 PM »

What I've always hated about those higher-level languages was lack of pointers. They indeed sometimes are a pain in the ass, but gosh, they're so useful at the same time!

Hmph. Mostly when wanting to pass a variable to function, so that the function can modify it..
Logged

Nothing to do here
Klaim
Level 10
*****



View Profile WWW
« Reply #3366 on: May 08, 2013, 04:09:23 PM »

What I've always hated about those higher-level languages was lack of pointers. They indeed sometimes are a pain in the ass, but gosh, they're so useful at the same time!

D occupy the same use-space than C++: it DOES have pointers...

It also have a way to deactivate pointer arithmetic in specific functions, if you want to make the compiler allow only "safe" code. But that's not the default.
Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
Geti
Level 10
*****



View Profile WWW
« Reply #3367 on: May 09, 2013, 02:13:37 AM »

All this talk about D makes me wish Go had better solutions for making games.
Love the syntax, love the implementation of concurrency, love the fact that I had the implicit interfaces idea and someone implemented it for me; hate the obtuse interface to C libs, can't find a good real time output solution (graphics, sound, etc) - and the C interface being lousy means sdl and the like are annoying to wrap.

Anyone found something good for that, or no?
Logged

Quarry
Level 10
*****



View Profile WWW
« Reply #3368 on: May 09, 2013, 08:52:11 AM »

Go also has another problem, the garbage collection. If you don't manage your memory well the stop-the-world GC might be very bad for you

I'm really hoping that D gets more mature. It looks really amazing so far and the gxx implementations are working very fast
Logged

 
Klaim
Level 10
*****



View Profile WWW
« Reply #3369 on: May 09, 2013, 11:07:38 AM »

From what I understand, Go is really focused on making web application on server-side, it don't really care on the more constrained contexts that C++ and D targets. Rust is another promising language but I don't know enough to compare it with D.
Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
Quarry
Level 10
*****



View Profile WWW
« Reply #3370 on: May 09, 2013, 11:30:41 AM »

As far as I have experienced D can theoretically do anything. I love these new languages but as they are new they are often incomplete and "immature"

I just looked into Rust and it looks pretty amazing, I'm planning on trying that
Logged

 
Pishtaco
Level 10
*****



View Profile WWW
« Reply #3371 on: May 09, 2013, 11:47:46 AM »

I guess that's because there have been a D language conference recently and one of the sponsors are Remedy Games who are working on games using D and made a presentation about that. I can't wait to see the video.

D is theorically more interesting to game developers than C++ (in my opinion), but still have some problems before being a clear alternative (like lack of implementation stability, lack of language stability, lack of plateform portability -not sure anymore about this one-, lack of clear and precise documentation).
Still it's very interesting to follow, even when you're not interested in it.

I made a medium-sized game in D (Venus Patrol in my sig). I chose it because I felt that the game called for learning something like C++, but that the syntax and baggage of C++ (header files etc.) was too much unnecessary hassle, and D would be nicer to use. I still think the language is nice, but I ran into the issues Klaim mentions - eg. two incompatible standard libraries, or my game using D1 while things are now being developed for D2, etc. Another problem I had is that the documentation tends to assume that the user is already a wiz at C++.

I started another project a year or two ago using the framework I had built for my game, but eventually felt that I was being forced to reinvent the wheel too much, and that I had no hope of dealing with portability issues myself, so switched to Unity and C#.
Logged

Klaim
Level 10
*****



View Profile WWW
« Reply #3372 on: May 09, 2013, 12:52:27 PM »

Pishtaco thanks for the feedback! Could you precise when (the year) you did use D for the projects? I believe the D1 vs D2 issue is now fixed as almost nobody works on D1 and D2 now has a clearly established (but not finished I think) standard library.
Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
Pishtaco
Level 10
*****



View Profile WWW
« Reply #3373 on: May 09, 2013, 01:15:50 PM »

Pishtaco thanks for the feedback! Could you precise when (the year) you did use D for the projects? I believe the D1 vs D2 issue is now fixed as almost nobody works on D1 and D2 now has a clearly established (but not finished I think) standard library.

I think most of the work on Venus Patrol was in 2010, in D1 with Tango. I started using D again for the other project in 2012. At this point more stuff did seem to be for D2, with I think a different library (although I don't remember exactly), so one of my worries was that the things I used in my framework would no longer be supported. Or rather, that it would require a lot of mental effort to disentangle what was going on with them and what I would need to do.
Logged

Klaim
Level 10
*****



View Profile WWW
« Reply #3374 on: May 09, 2013, 02:03:27 PM »

I see. You used OpenGL directly for graphics? What about inputs?
My biggest worry about trying a project with D is that there don't seem to be game-oriented libraries like an input library and a graphic engine library (like Ogre).

Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
rivon
Level 10
*****



View Profile
« Reply #3375 on: May 09, 2013, 02:29:29 PM »

According to Wikipedia, D can use C code just fine -> you can use CSFML, SDL and pretty much any other C libraries or C++ libs with C wrappers.
Logged
Klaim
Level 10
*****



View Profile WWW
« Reply #3376 on: May 09, 2013, 02:48:38 PM »

Yeah, that's scary.


More seriously, I'm talking about 3D libraries, and ones that benefit from D's RAII.
Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
thekill473
Level 0
***


View Profile Email
« Reply #3377 on: May 09, 2013, 09:34:04 PM »

Finally got derived entities to serialize, deserialize and load properly. It took me a while to figure out due to type casting problems and XML not recognizing derived types across libraries.  Toast LeftApoplecticToast Right
Logged
Pishtaco
Level 10
*****



View Profile WWW
« Reply #3378 on: May 09, 2013, 10:17:28 PM »

I see. You used OpenGL directly for graphics? What about inputs?
My biggest worry about trying a project with D is that there don't seem to be game-oriented libraries like an input library and a graphic engine library (like Ogre).

I used straight openGL for the graphics (the only 3d objects in the world are a few planes and a cloudscape), SDL for input, loading graphics and music, ODE for physics, OpenAL for sound. There's a wrapper (?) called Derelict which makes all these libraries available in D. I used somebody else's code for font-rendering. I felt the lack of a fuller game library more in the second project, particularly for UI stuff.
Logged

Klaim
Level 10
*****



View Profile WWW
« Reply #3379 on: May 10, 2013, 12:24:03 AM »

I see. You used OpenGL directly for graphics? What about inputs?
My biggest worry about trying a project with D is that there don't seem to be game-oriented libraries like an input library and a graphic engine library (like Ogre).

I used straight openGL for the graphics (the only 3d objects in the world are a few planes and a cloudscape), SDL for input, loading graphics and music, ODE for physics, OpenAL for sound. There's a wrapper (?) called Derelict which makes all these libraries available in D. I used somebody else's code for font-rendering. I felt the lack of a fuller game library more in the second project, particularly for UI stuff.

Ok so it's still not easy to make most games with it.
I guess we'll have to wait for someone to make libraries or have time to make full game engines from games they made with D.
I wish I could do that but I really cannot spend time on this these days.
Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
Pages: 1 ... 167 168 [169] 170 171 ... 197
Print
Jump to:  

Theme orange-lt created by panic