Vulcan
-
Posts
92 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Vulcan
-
-
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); ...
-
You probably want to look at this: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitygetkeyvalue-r773
-
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?
- 2
- Memory leak (please help with this issue)
-
Thanks!
-
How do I stop the sound? I can not find any Stop().
Sound* sound; sound = Sound::Load(wav_file); sound->Play();
-
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!
-
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?
-
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
-
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.
-
WOOOHHOOOO!! I got it playing with Big Buck Bunny, only need to play it with correct speed and audio
-
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); }
-
I am not sure how I would implement this with Leadwerks. How do I put video frame onto a Leadwerks::Texture ?
-
Weird but can't download those files. "Sorry, you don't have permission for that."Speaking of Theora, this was done for LE2:
http://www.leadwerks.com/werkspace/files/file/89-letheorazip/
Maybe you can adapt it.
Also this:
http://www.leadwerks.com/werkspace/files/file/395-video-rendering-with-directshow/
-
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.Have a look at this;
https://icculus.org/theoraplay/
Theora migth not be the best format - but it's defintiviely better than 500mb for 6 sec of video and it's unencumbered by patents
-
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).
-
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.
-
this will come in handy, thanks
-
SilentBang, I am curious about how you attached your images. Where did you upload it to?
-
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.
-
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);
- 1
-
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?
-
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):
-
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?
-
Wow that was lean code. Thanks!Thanks, that's exactly what I was looking for!
I've added a build target switch, so console window will only appear on debug build:
#ifndef DEBUG #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") #endif
I've put that on top of main.cpp.
Vibrating player
in Programming
Posted
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 ?