Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Pages: 1 [2] 3 4

Author Topic: SourceForge project  (Read 12644 times)

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #15 on: February 18, 2009, 06:33:23 PM »

Should be up to date now, let me know if the cmake scripts have any trouble with python.
Oh yeah, I forgot to put it in the guide but it needs Ogre too, but I think you already know that ;)
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: SourceForge project
« Reply #16 on: February 18, 2009, 08:45:03 PM »

Directions seem pretty good. There was one omission, the cmake step doesn't state to use the -G <target> and I was getting errors until I specified VC9 :)

Downloaded and building the last dependency right now (Ogre 1.6 branch). If I get things working, I can probably upload VC9 SP1 dependencies.

Looking at the project, seems a little light compared to what I recall. No sound, etc. Anyway, not a big deal, will be focusing on trying to use Port audio anyway.
Logged

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #17 on: February 19, 2009, 03:43:15 PM »

Oh yup, it is a bit lighter. I was taking the old project and gradually adding things in. I wanted to make sure everything fit together nicely with the rather new scripting. Also, I wasn't sure if we should abstract out the sound again or how the api for codecs should look. I can post the latest "old" code if you want me to. Btw, I think the latest "old code" is later than what was on the svn.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: SourceForge project
« Reply #18 on: February 19, 2009, 05:50:29 PM »

The codec abstraction can probably come back in. It would just be that, we could add ffmpeg as decoding everything except wav files (since, that is a snap and already completed). Still some work to do with 3D positioning, but I'm not needing that at the moment. And, we can look to adding support for that OpenAL Software port you mentioned before.

The script design, however, needs to change a bit. Mostly, I don't see scripts driving game logic/main loop anymore. Not sure if the current code is doing that or not.

I was able to compile the engine, but didn't get around to compiling the test app. I altered the project files (VC project files) to link against the static boost python libs (I hate having too many extra DLL's). And also noticed that the project files had many references for include/lib directories such like "C:\boost\" etc. I would really like to get everything we need as one download into one local directory (which I did with manually messing with VC projects not cmake). Much easier to build that way on windows. The only possible problem lib I can think of is Python itself... I've tried to distribute a project based on C++ and python before, and the best way I found was installing python.msi. If possible, I would really like to be able to avoid that, and have it install side-by-side. Though, not sure if python license permits that or if it is possible. I recall, the problems I faced before when just distributing python.dll was that it was then missing all the python modules. Not sure how to go about that... But, I think for an embedded game python distro, we wouldn't need many (any?) python modules not exposed  via our C++.
Logged

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #19 on: February 19, 2009, 08:35:47 PM »

Ah I forgot about some of those references in the CMake files, I'll clean those out. Right now, on windows there's no really easy way to find boost, but if we get everything in a directory, that should be no problem.

It seems the python license, PSF, is pretty open: http://www.python.org/psf/license/. We can distribute it and everything in binary form and there is no copy-left. Perhaps we could static-link it into boost. I think the python modules are stored in .pyd files, but perhaps we could compile some of the core ones in. Btw, I would really like to be able to modify a script while the engine is running and have it recompile :P

Right now, the main loop is a bit of a mess, I was experimenting with turning the loop into a "tasklet" and it seemed to work quite well. It just needs some integration with WGEManager, aswell as some scheduling code for tasklets. I found some really good resources on that from an eve online presentation and some opensource X-Com project, I'll post those soon. Basically, the loop in C++ pretends to be a tasklet by casting the function pointer to a PyObject*.

I agree with the codec abstraction too, but how do you feel about the SoundSystem abstraction? Would you want to just try OpenAlSoft and integrate PortAudio with it?, Or maybe a ASIO backend? I'm not quite sure how those two are tied together yet.

I'm really glad it compiled for ya. :D  I was a bit worried about the build process, since I had done most of it on Linux, but it doesn't seem too bad. I'll be sure to fix up the install documentation with some of suggestions you had.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: SourceForge project
« Reply #20 on: February 19, 2009, 09:01:54 PM »

The install process would have been easier if I left things in the same paths :D But, I already had a previous version of boost on my c drive and my Visual Studio include paths were pointing at that one instead of the local paths I created in the project (took me a few to figure that out)... Then, there seemed no easy way (at first) to compile in boost.python statically... Stupid headers pulling in the dll linker lib. Had to grep the source and find the proper define to 1) disable boost.python dll exports (declspec) and the link pragma. Anyway, I sorted that out and was able to link boost to the correct static lib. Some things are much easier on Linux for sure - apt-get boost-dev, apt-get python, etc and configure scripts just find them via pkg-config - quite nice... Until you want to distribute something in binary form anyway.

Anyway, as for the sound manager, I'm of two heads a) keep it for flexibility and to allow more sound system choices b) remove it and use a library directly. I think my time is short nowadays, so b sounds more reasonable.. focus on getting something working instead of making it work with everything :) So ywah, I think I agree we can remove it. Would be too hard to swap out later if needed as long as we create a small use wrapper/manager around portaudio that simplifies things and we are not directly using portaudio constructs everywhere.
Logged

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #21 on: February 20, 2009, 04:23:20 PM »

Just a note, I'm working on an AudioManager using PortAudio and the old Al SoundSystem code. I'll move the wav codec back in aswell, and as soon as the AudioManager plays sound, add a small demo of it.

Also, I'm going to change CMake to use a dependencies directory for windows. I'll also add an configuration option for those who don't want to use it, allowing them to manually enter in the paths of the dependencies.
Logged

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #22 on: February 20, 2009, 08:46:49 PM »

Quick Question: How does PortAudio handle multiple sounds? Do you use multiple streams? With Multiple Callbacks? Or do I need a rudimentary software mixer? I don't see too much info about it online, just a few posts about PortMixer and Audacity.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: SourceForge project
« Reply #23 on: February 20, 2009, 08:53:35 PM »

To be honest, I'm not quite sure - I haven't gotten there yet. Probably can do either - open multiple channels or you can mix channels in software yourself. One thing I'm not to sure of, is if portaudio supports multiple hardware channels at all. Needs more investigation.
Logged

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #24 on: February 20, 2009, 10:35:49 PM »

Ah ok, thanks. Well, I'll try doing multiple hardware channels once the directx sdk finishes downloading :P
Logged

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #25 on: February 20, 2009, 11:41:49 PM »

Cool, I've got some sound working.  :)

I'm using the default device right now, but the device iteration is working fine too.
Code: [Select]
00:27:01: Audio Device:Microsoft Sound Mapper - Input
Inputs: 2
Outputs: 0

00:27:01: Audio Device:SigmaTel Audio
Inputs: 2
Outputs: 0

00:27:01: Audio Device:Bluetooth Audio
Inputs: 1
Outputs: 0

00:27:01: Audio Device:Bluetooth High Quality Audio
Inputs: 2
Outputs: 0

00:27:01: Audio Device:Microsoft Sound Mapper - Output
Inputs: 0
Outputs: 2

00:27:01: Audio Device:SigmaTel Audio
Inputs: 0
Outputs: 2

00:27:01: Audio Device:Bluetooth Audio
Inputs: 0
Outputs: 1

00:27:01: Audio Device:Bluetooth High Quality Audio
Inputs: 0
Outputs: 2

00:27:01: Audio Device:Primary Sound Capture Driver
Inputs: 2
Outputs: 0

00:27:01: Audio Device:SigmaTel Audio
Inputs: 2
Outputs: 0

00:27:01: Audio Device:Bluetooth Audio
Inputs: 1
Outputs: 0

00:27:01: Audio Device:Bluetooth High Quality Audio
Inputs: 2
Outputs: 0

00:27:01: Audio Device:Primary Sound Driver
Inputs: 0
Outputs: 2

00:27:01: Audio Device:SigmaTel Audio
Inputs: 0
Outputs: 2

00:27:01: Audio Device:Bluetooth Audio
Inputs: 0
Outputs: 1

00:27:01: Audio Device:Bluetooth High Quality Audio
Inputs: 0
Outputs: 2

Never knew I had so many  :D
Though, the PortAudio callback isn't playing nice with the Ogre message pump. It's crashing a few seconds in with an access violation. I tried to debug but it gives me nothing. Did you ever run a loop alongside PortAudio? or do you have any ideas what might cause it?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: SourceForge project
« Reply #26 on: February 21, 2009, 08:19:42 AM »

I don't think Portaudio needs access to the windows message loop so don't know what kind of problems that would cause! You could try using the other backend (DirectSound) of portaudio... maybe there is something particular to the ASIO backend (assuming that is what you are using). I'll try running a message loop with my little test app.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: SourceForge project
« Reply #27 on: February 21, 2009, 08:36:56 AM »

If you have a small test demo that shows the error I can take a look. I added a message loop to the demo I was using that just continually calls peekmessage, translatemessage, dispatchmessage than sleeps 200ms and had no issues. Though, one thing I didn't have was a window - using a console app. I just can't imagine that making a difference.

Which backend were you using? The default is Windows Multimedia, you have to choose DirectSound manually (and build in ASIO support). What I did was to define (I mentioned the defines in the other thread) out everything but ASIO to just use that one (for now).
Logged

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #28 on: February 21, 2009, 10:27:40 AM »

I had been using WMME, but now I am using DirectSound and I am having the same problem. Thanks for trying out the message loop, it's nice to know it's not some sort of inherent problem with portaudio  :)
The problem is a bit strange, if I disable Ogre's FPS counting, the test sound plays until I click on the Ogre window. However, with the FPS counting on, it's immediate. I'm compiling a version of Ogre with debug symbols to try to figure out what's happening.
Logged

mysterycoder

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 447
    • View Profile
Re: SourceForge project
« Reply #29 on: February 21, 2009, 12:20:47 PM »

So strange... it doesn't even make it into the Ogre code. I'll post a small, reproducible case.
Logged
Pages: 1 [2] 3 4