Jump to content

gamecreator

Members
  • Posts

    4,937
  • Joined

  • Last visited

Everything posted by gamecreator

  1. Go in editor and select perspective view (with a scene created or loaded). Hit Ctrl-S to save. Cancel (probably also works with Save). You'll be flying backwards until you hit S key again. Seems like Editor is taking Ctrl-S as you having hit S to go backwards in scene but then the dialog comes up and it never gets the release message so when the dialog is dismissed, it still thinks you're holding the S key.
  2. The example was flat out crashing for me, as reported in this bug report: https://www.leadwerks.com/community/topic/19037-setpixels-example-crashes/ There definitely seems to be something wrong.
  3. I wonder how many games just silently include it. It's not necessarily something you need to see in an options menu. And I don't think you should visually notice it in-game, if it's done right.
  4. Haha! I'm not sure I understand the second sentence. Does that mean that you couldn't turn shadows off on objects? All or nothing? Or can you maybe make some shadows so transparent as to be invisible? ... And come to think of it, from your recent blog, how would an item merely emitting light, like a ball of light, work? Would it cast a shadow too?
  5. It's been just over a year since I posted this so time for it again. ?
  6. Looks fun. I hope you made it so you can change the variables in-game, to speed up testing.
  7. Thanks. As usual for sample code, I tried to make it as short and straightforward as possible, avoiding functions and classes and such. I'm hoping it's not too hard to translate to Lua since I used Leadwerks functions where possible. cout can be replaced with System:Print or removed altogether (it's just a sanity check).
  8. Since this was a hot topic recently, I've written code to preload model files from a map and display a progress bar. Then, when you load the map, it should load much faster since you already "preloaded" the models and the ones in the map will be instances (copies) of existing ones. This is an alternative to Map::Load's hook, which may be a better way to go about this. #include "Leadwerks.h" using namespace Leadwerks; std::string mapfile = "maps/map.map"; string model_file[100]; // Stores list of model files in map Model *preload_model[100]; // Array to preload model files to int modelcount=0; // Counts total number of models found in map file int main(int argc, const char *argv[]) { Leadwerks::Window* window = Leadwerks::Window::Create(); Context* context = Context::Create(window); // Load map as just a file Stream* stream = FileSystem::ReadFile(mapfile); if(stream==NULL) { cout << "Could not open map file to read." << endl; exit(1); } // Put MDL paths/files in a list and get count while(!stream->EOF()) { string line = stream->ReadLine(); // If what we read is a model line (ends with .mdl) if(line.size()>3 && line.compare(line.size() - 4, 4, ".mdl") == 0) model_file[modelcount++]=line; } stream->Release(); cout << "Number of model files in map: " << modelcount << endl; for(int i=0; i<modelcount; i++) { cout << "Preloading file #" << i << ":" << model_file[i] << endl << endl; preload_model[i]=NULL; preload_model[i]=Model::Load(model_file[i]); // You can check if model was properly loaded here (should not be NULL) preload_model[i]->Hide(); // Preload model should not be seen // Draw progress bar context->SetColor(0.0, 0.0, 0.0); context->Clear(); context->SetColor(1.0, 0.0, 0.0); float barwidth = (float)(context->GetWidth())-20.0; barwidth *= (float)(i+1); barwidth /= (float)modelcount; context->DrawRect(10, 10, (int)barwidth, 20); // Remove the below delay line. It's put in just to show progress bar effect Sleep(500); context->Sync(); } // You can then load the map here and it should be much faster // since you already loaded the models in it above // Map::Load(mapfile); // Game code here return 0; }
  9. It looks like map files store MDL folders and names as text (including normal models and vegetation) so you could theoretically scan the file for those and preload them.
  10. Can I ask why you wouldn't use the method I suggested above? You can load models one-by-one ahead of time to a model array (and hide them) and update a progress bar after each one. Then, when you load the map, since every model is already loaded, the map itself will load pretty fast. Maybe I should share a sample C++ code of this.
  11. I want to say that someone had a resolution issue with something I released as well but I couldn't find it just now. If I remember right, it made me look into a non-Leadwerks, Windows-specific function that returns the current resolution, which would typically be the desktop resolution (but I'm using C++). @Josh Is it possible to add a GetCurrentGraphicsMode function?
  12. Regarding the progress bar, you have two options: 1. Figure out how to use the hook in the Map:Load function (if it works). It's supposed to call a script every time an entity is loaded and you can display a progress bar there. 2. Preload everything yourself and display the progress bar as you do it. Meaning, if you 12 different trees and 8 textures and whatnot in your map, load those first, before you load your map. As pseudocode, it would look like this: preload_model[0] = Model::Load("tree1.mdl") update and show progress bar preload_model[1] = Model::Load("tree2.mdl") update and show progress bar preload_model[2] = Model::Load("tree3.mdl") update and show progress bar etc. That's pretty much how I do my loading screen.
  13. I hope that even if events were implemented, we were still left with at least the basic Down function we have now. It's great to have options but often simpler is better.
  14. gamecreator

    Evolution

    I'm the same. I gave up on the Leadwerks GUI because it's not documented and a question I asked wasn't answered clearly (and it's also more convoluted than I feel it needs to be. I just want to put down a button and detect if it's clicked on. This should be like 2 or 3 lines of code).
  15. I don't have multiple monitors so I never got to play with this but what would devs and users want to do? The dev should know about the monitors to start. int CountMonitors(); Put windows on the appropriate monitor(s)? Maybe window->SetMonitors(0); or more than one, left to right: window->SetMonitors(2, 0, 1); window->Create would then spread itself over the set monitors in full screen. What else would a user need?
  16. With the caveat that this is not exact. I don't know about the character controller (after the latest updates) but if you're coding your own character movement, you are better off using a fixed framerate, or things like jumps won't be the same height on all computers, as per here.
  17. If you give me a specific model with an animation (something basic, nothing fancy), I'm happy to test it for you using the program I set up in my other thread that I linked to above. I'm on a 780M right now.
  18. So what exactly is the problem now? I thought you said above that you could spawn more enemies once you switched to release.
  19. I do but I also use printf/cout to write to the console, which you can enable by right-clicking on your project name in the Solution Explorer, Properties, Configuration Properties, Linker, System, change SubSystem to Console.
  20. The character.fbx only has 25 bones, which is very reasonable. That shouldn't be the problem. https://www.leadwerks.com/community/topic/17544-character-fps-test/
  21. For my part (and I think some others who posted about this in the past) I would love a significant speed increase. It always feels like we're on a light/shadow/bone/quality budget so that we can get above 30fps once we start setting a scene up.
  22. You can put whatever texture on whatever face/triangle you want. I've attached a zip file with an FBX (also converted to MDL) and two textures as an example. twotextures.zip
  23. I don't use Blender so I can't help with the rest of your question but yes, Leadwerks supports multiple textures on a single model.
  24. If you have vegetation on your map, you can reduce the view distance and turn off shadows.
  25. I don't know Lua but it looks like you might sometimes trigger more than one PlayAnimation function per frame. Meaning, if you hold down both the W and D keys, the first if statement will be true and it will trigger that PlayAnimation AND the next if statement will also be true and will trigger its respective PlayAnimation. So I think you'd be blending two animations together. Look into using elseif statements. Something like this (again, I don't know Lua but this seems like it could work): if KeyDown(Key.W) and KeyDown(Key.D) then PlayAnimation(“^>”,0.02,100,0) elseif KeyDown(Key.W) and KeyDown(Key.A) then PlayAnimation(“^<”,0.02,100,0) elseif KeyDown(Key.W) PlayAnimation(“^”,0.02,100,0) end As for posting, if you have several questions at once, you probably want to use a single post for it. If it's two or three that are unrelated topics, you may want to split them up. But I'm not the Leadwerks police; that's just my preference. Ideally you also search the forums first and you might find something that already covers your question and you can just continue the conversation in that thread. That will help for anyone searching the forums for the same issue so they don't have to open 10 different threads to find their answer.
×
×
  • Create New...