Jump to content
dreamhead

what do you want see in leadwerks 3.0

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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 :) )

Share this post


Link to post

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.

Share this post


Link to post

Ahh, my brains :)

 

Anyway, how can i load dynamic objects then without pauses in main loop?

Share this post


Link to post

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.

Share this post


Link to post

Anyway, how can i load dynamic objects then without pauses in main loop?

 

Callbacks :)

Share this post


Link to post

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.

Share this post


Link to post

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)

Share this post


Link to post

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.

Share this post


Link to post

- 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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post
Guest
This topic is now closed to further replies.
×
×
  • Create New...