Jump to content

what do you want see in leadwerks 3.0


dreamhead
 Share

Recommended Posts

Leadwerks.Net already has events that fire when a model is Activated or Updated physically. This may help.

 

What do you mean by activated? I assume updated is the entity update callback that is part of LE. If so that's not really what I meant. What I meant was to have the TModel loaded in thread B and when it's fired a callback in fired on thread A where the TModel is passed in so thread A could then do a simple and fast memory copy into an object that resides in thread A.

Link to comment
Share on other sites

Would you guys really want to deal with threaded loading yourself, hard-coding each instance? Wouldn't it be better to have a mechanism built into the engine so that static models could be loaded in the background in very large worlds? This would only work with non-moving non-interacting models, like big buildings and stuff.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

The best would be of course if the engine would automatically load and remove models in a seperate thread which are not in camera range, or a bigger custom range optionally.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

callbacks would be nice so we can know when a model is loaded. I always wrap LE models in my own classes because I wrap other variables and functionality with them and would need a way to know when a certain model got loaded.

 

So I would need a callback that passes the loaded entity into it that I can then store in my class instance. If you can make that entity on the main thread by that time then even better but I need to know when and what model just got loaded by the engine.

 

Why would it mater if it's static or animated? I would want animated models also.

Link to comment
Share on other sites

Wouldn't it be better to have a mechanism built into the engine so that static models could be loaded in the background in very large worlds?

That would be nice, but don't make this only automatic, it would be as bad as automatic garbage collector.

I'd prefer to control, which models to load in background in certain moment of time.

 

This would only work with non-moving non-interacting models, like big buildings and stuff.

Sounds not good, really. What if i have a lot of dynamic objects?

 

Lets rollback to the past: some time ago i had an idea of something like LoadModel(name, parent, thread = false) - if i want to load model in main thread, i set this to false, if i would like to load in another thread( independent from main loop), i just set this to true.

 

Another idea is a separate function LoadModelBackground(name, parent) - and this works like singleton: when i first ask LoadModelBackground("barrel"), i got null and model goes to list for loading. If i call it twice (or more), it just returns null and model is still in that list. In one moment of time, it returns pointer and thats it.

 

Pay attention that those solution dont allow to user to work with threads, they just load models separately from main loop.

Working on LeaFAQ :)

Link to comment
Share on other sites

I think we have two things going on.

 

1) Models loading automatically from an sbx file based on a camera value.

2) Users loading models themselves outside of an sbx file.

 

 

For 1 I would love to have a callback that passes in the loaded entity that is on the same thread (or I can copy) for me to do what I want with. At that point it would be no different really then what we do today. We could read keys on that entity that were in the sbx file and decide what to do with it.

 

2 seems like it presents a different issue and a callback might not be the best way, unless we can maybe attach other data that will get passed to the callback with the entity once it's loaded so we know what loaded and when.

Link to comment
Share on other sites

Sounds not good, really. What if i have a lot of dynamic objects?

So if you have a character offscreen that is far away, that you are controlling, and he walks through where a dynamic object would be if it had been loaded yet (but it hasn't), what should occur? That's just one example. You put constraints on a system when you try to do these type of things, and it gets much harder to work with, with lots of caveats and exceptions.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Well, i just wanted to say that only automatic way is not good: sometimes programmers would like to control world streaming by themselves. If a player would fall down through still-not-loaded-model, its programmer's headache:

- he can say to load models earlier

- he can make a function, which would check if a new location is loaded (if location is still loading, show splashscreen "Loading")

- he can use your automatic mode ^^ and doesn't load models manually at all. Just make some triggers and load animated models while event is rising. And this leads again to the beginning: what if programmer want to load animated model of enemy without stopping main loop? (Rick, for example, and me, of course :) )

Working on LeaFAQ :)

Link to comment
Share on other sites

Yes, options are always the best option. But there should still be the option not to use the optional option, as opposed that you have to write it yourself. However, sometimes there are no options, as it would be too difficult to implement an optional or non-optional feature.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

With multithreading you can do anything, even disk I/O and the main loop won't stutter a millisecond. There's no magic using multithreading in C++, but in BlitzMax it's not possible, partly because it uses GC.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

With multithreading you can do anything, even disk I/O and the main loop won't stutter a millisecond.

Callbacks :)

 

I know that :)

Question was to Josh, as he wants to hide multithreading from programmer and make automatically loader of static meshes.

Working on LeaFAQ :)

Link to comment
Share on other sites

I think the engine doing automatic loading is fine as long as it tells me about it in a callback :)

 

Both load and unload (I want the actual entity before it gets unloaded in that callback so I can relate it back to the class object I'll have tied to it. that way I can tell that instance to chill until it's model gets loaded again)

Link to comment
Share on other sites

There is a huge difference between running a single self-contained process on another thread and designing a command set that can just be called in any order at any time. Even if I locked the threads in every single call (which would eliminate any speed gains you might get from multithreading) there's still a ton of errors the user can cause themselves.

 

Loading models on threads is one thing, but like mentioned earlier, there's several things that threaded environment is great for:

 

- fetching online highscore and...

- refreshing master server and..

- joining multiplayer games!

 

And I suppose many other features that are related to non-core of the game (I guess you could do global chats, buddy systems and whatnot... but most important ones were already listed: online highscore, fetching servers, joining multiplayer games.

Intel Dual Core 3GHz / GeForce GTS 450 - 1024 MB / Driver ver 267.59 / 8 GB RAM / Win 7 - 64 bit / LE2.50 / BMAX 1.48

game producer blog - Dead Wake Zombie Game powered by Leadwerks Engine

Twitter - Unfollow me

Link to comment
Share on other sites

- fetching online highscore and...

- refreshing master server and..

- joining multiplayer games!

 

These are all things raknet can do currently. You have to code them, but if you coded them using raknet it meets all those criteria while being multithreaded.

Link to comment
Share on other sites

  • 2 weeks later...

Would it be possible to add a check box for any material that would be considered a walkable surface in the material editor? That way we could have one to many different files to designate footsteps or perhaps even other object impacts. We could then have several different checkboxes for 'Random Order', 'In Order', etc. That way we could have alternating foot step sounds/impact sounds.

Link to comment
Share on other sites

That seems like it would still require code to look up this value and play the right footstep noise. In that case couldn't you just do the same thing where you raycast down to see what surface you hit and get the material and play the sound based on that? Seems you'd basically have to do the same thing anyway.

Link to comment
Share on other sites

Would it be possible to add a check box for any material that would be considered a walkable surface in the material editor? That way we could have one to many different files to designate footsteps or perhaps even other object impacts. We could then have several different checkboxes for 'Random Order', 'In Order', etc. That way we could have alternating foot step sounds/impact sounds.

Not for models, because visual geometry != physics geometry.

 

Stuff like this is possible with CSG geometry because visual geometry == physics geometry.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...