Jump to content

Vulcan

Members
  • Posts

    92
  • Joined

  • Last visited

Everything posted by Vulcan

  1. After some debugging I found that changing from Sync(false) to Sync(true) then the problem goes away. But should I force users to use VSync? Or is there a better way for those who get higher 60 FPS ?
  2. Have anyone experienced that the player is vibrating after turning when using SetInput() ? How do I fix this issue? In App->Start(): ... // Create the player entity = Pivot::Create(); entity->SetPosition(Vec3(0.0f, 0.0f, 0.0f)); entity->SetRotation(Vec3(0.0f, 0.0f, 0.0f)); entity->SetMass(1.0f); entity->SetPhysicsMode(Entity::CharacterPhysics); // Load model model = Model::Load("Models/Characters/Barbarian/barbarian.mdl"); model->SetParent(entity); ... App->Loop(): ... // Calculate new angle float angle = 0.0f; float a = entity->GetRotation().y; float b = (window->KeyDown(Key::D2) - window->KeyDown(Key::D1)) * 10.0f; //turn speed angle = a + b; // Turn player but this causes vibration looking effect. Hmm?? // Look at the edge of the sword after stopped turning. entity->SetInput(angle, 0.0f); ...
  3. You probably want to look at this: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitygetkeyvalue-r773
  4. Vulcan

    VideoPlayer

    I want to share with the community a video player that I have been tinkering with lately. Hopefully this will be useful for someone. I wish I could have got the audio streaming to work because the ogg-file has both video and audio data. But instead I made it load a wav-file. Issues I know about: Memory leak (please help with this issue) No sound streaming (must have separate wav-file) Not yet tested if transparency works Note: Click on the upper-middle button to download zip-file. https://drive.google.com/file/d/0B1zs1aY8SN3nSm9ObjFaSmtCX28/edit?usp=sharing Does anyone know if this could use lua bindings to make it work with lua too?
  5. How do I stop the sound? I can not find any Stop(). Sound* sound; sound = Sound::Load(wav_file); sound->Play();
  6. A complete referance manual (pdf version?). For instance Sound class has some features undocumented, and the Shader class is missing examples. Having a complete referance manual would make my life a lot easier. Please make it so!
  7. I am looking for detailed information on Leadwerks::Sound. There are a couple of variables I am not sure about. float length; Is length in seconds (ie: 1.0f = 1 sec) or is it number of samples? Also I wonder about format. int format; Is one of those "static const int" below? Lastly I would like to know if I could/should use BankStream to update Bank* data if I get audio stream from a video decoder?
  8. I have been trying to learn about how TheoraPlay handles sound and found out the sound data is within struct packets called THEORAPLAY_AudioPacket. But so far I haven't figured out how to implement this with Leadwerks. I have looked at Leadwerks header files: Sound.h and Bank.h but seems like "Bank* data" is holding all sound data. My problem is I am not sure how to append more sound data as new sound packets are arriving from TheoraPlay. audio = THEORAPLAY_getAudio(decoder); if (audio) { printf("Got %d frames of audio (%u ms)!\n", audio->frames, audio->playms); // <------ How do I add sound data to Leadwerks::Sound ? THEORAPLAY_freeAudio(audio); } // if
  9. After reading Game Coding Complete v4 (GCC4), on page 100 the author describes what I find to be a good way to structure the game project. I wish Leadwerks could let me do this because right now I sorta got a ProjectRoot mixed with GameRoot and Assets. So it is not scalable if more people (5+) where to work on a game project. /ProjectRoot + /Assets <---------------------- Folder for raw arts and blender files etc.. (artists got their own version of Source folder) +++ /Art ... +++ /Models +++ /Sounds + /Docs <----------------------- Here goes any documentations and game design docs + /Game <---------------------- This would be the game-root directory (latest release) +++ /Data <----------------------- Main folder for (finalized) game assets +++ /Redist ... + /Lib <----------------------- 3th party libraries + /Source <---------------------- This is the root folder for cpp/h-files + /Temp <---------------------- When compiling the project, messy temp files and what not.
  10. WOOOHHOOOO!! I got it playing with Big Buck Bunny, only need to play it with correct speed and audio
  11. I have tryied to get TheoraPlay to work with Leadwerks. I do get pixel data but when trying to assign that data to Leadwerks::Texture then I get a run-time error. How do I remedy this? Only thing I can think of now is to iterate through each pixels but that would probably be slow as turtle. void TestState::Enter() { //bunny.ogg: 720x400 const char* filename = "bunny.ogg"; int video_w = 720; int video_h = 400; texture = Texture::Create(nextPow2(video_w), nextPow2(video_h), Leadwerks::Texture::RGB); THEORAPLAY_VideoFormat vidfmt = THEORAPLAY_VIDFMT_YV12; // <----- Probably wrong format. VLC reports YUV THEORAPLAY_Decoder *decoder = NULL; const THEORAPLAY_VideoFrame *video = NULL; const THEORAPLAY_AudioPacket *audio = NULL; decoder = THEORAPLAY_startDecodeFile(filename, 20, vidfmt); while (THEORAPLAY_isDecoding(decoder)) { video = THEORAPLAY_getVideo(decoder); if (video) { printf("Got video frame (%u ms)!\n", video->playms); texture->SetPixels((const char*)video->pixels); // <------- Runtime error: "Unhandled exception" THEORAPLAY_freeVideo(video); } // if audio = THEORAPLAY_getAudio(decoder); if (audio) { printf("Got %d frames of audio (%u ms)!\n", audio->frames, audio->playms); THEORAPLAY_freeAudio(audio); } // if if (!video && !audio) Sleep(10); } // while if (THEORAPLAY_decodingError(decoder)) printf("There was an error decoding this file!\n"); else printf("done with this file!\n"); THEORAPLAY_stopDecode(decoder); } howtovideo.txt
  12. I am not sure how I would implement this with Leadwerks. How do I put video frame onto a Leadwerks::Texture ?
  13. Weird but can't download those files. "Sorry, you don't have permission for that."
  14. Unfortunately TheoraPlay is based on C code, after digging around the net I found something called libtheoraplayer which is C++ based and so far looks good.
  15. I think Leadwerks should have a video player for the purpose to show intro video and game scenes. Yesterday I did make short intro video (6 sec, compressed AVI, ~2 MB) in Blender that was good but did not have an easy way to play this intro when game start. I suggest having a Cinema class that play a video in window/fullscreen with Play/Stop. Cinema* intro = new Cinema("Video/intro.avi"); if(intro->isLoaded()) intro->Play(); intro->Unload(); delete intro; As a temporary solution I made a cinema class and all works pretty well, except for that it takes about ~500 MB. And it uses *.tex files as each frame (0001.tex -> 0099.tex in my case). Cinema.txt
  16. I like how it is done in Visual Studio where it is just a filter, a sort virtual folder if you like. Best part of it is that it has no impact on the CSG it self.
  17. this will come in handy, thanks
  18. SilentBang, I am curious about how you attached your images. Where did you upload it to?
  19. It still freezes when going to Library->All software, but if I search for Leadwerks and then click on the "PLAY NOW" button it starts. This is how I installed it by searching for it. Luckly desktop shortcut works.
  20. Duuuhh!! I forgot to assign camera, now it runs the map normally. Thanks Rick. Map::Load("Maps/level2.map"); _camera = Camera::Create(); _camera->Move(0, 2, -5);
  21. After peppering the code to figure what it does I realized that Game::Exit() never was called. I did fix that but now I got an error after using _world->Clear() and then crashes on next _camera statement (when starting the map second time). _camera->Move(strafe, 0, move); EDIT: How can I reset camera?
  22. I have a created a sample project to replicate the error at Map::Load(). I noticed that different map files gave different results so I decided to include two map files (one that works and one that don't). Also noted that the skybox wasn't showing on one of them. Look in Game.cpp at Game::Start() where Map::Load error occurs. If someone spots something bad/odd/weird code I would like to know so I could improve my code. I have uploaded it here (look at the top of page to get download link): http://speedy.sh/bCaPE/CrashMapLoad.zip
  23. I ran into a problem with loading map as I use a state machine to switch in and out between main menu and game level. First I didn't notice that the map wasn't unloaded as I thought it was unloaded when that state exited. But when I try to go back second time from menu it crashes and debugger points at Map::Load(..). But how do I unload the map (when unloading state) so it could load another map later? I have tryied with world->Clear() and world->Release() but without luck. How can I overcome this problem?
  24. Wow that was lean code. Thanks!
×
×
  • Create New...