PDA

View Full Version : Connection to other modules?



Michael Hartlef
10-08-2007, 14:05
Hi Eros,

I not sure if you remember, but at one time we talked about the subject that it would be nice if you can call functions from other modules inside a module.

Is this allready possible? if not; Is it still planned?

Michael

ErosOlmi
10-08-2007, 14:14
I think Roberto talket about that in order to be able to gain some coding time and lines.
So far it is not possible other than knowing exact function numeric enumerator.

What idea do you have? Maybe I can do something (not in the short time).

Ciao
Eros

Michael Hartlef
10-08-2007, 14:21
An example, mmmh?

Petr's TBGL module is great. As an old Blitz3D user I love Blitz3D's entity system. When you say renderworld, it does all the dirty transformation job for you. With one set of functions, you HANDLE CAMERAS; LIGHTS; MESHES.
So for an example, some kind of module that does that. Connects to TBGL, and calls these functions that are needed to render a complete scene.

Petr Schreiber
10-08-2007, 14:31
Or introduce render-scene-nodes in TBGL :) ?

I was thinking of it too as it could save another parsing time. Cannot promise anything now, but ...


Thanks,
Petr

ErosOlmi
10-08-2007, 14:42
Well, the idea seems fantastic but modules were not designed for this purposes. Modules talk with Core and Core talks with modules. That was the original idea.
Also considering the way module functions have to call Core functions to parse script code ... I wonder how to do it other than developing:
1. all the needed functions inside the module as native script keywords
2. develop general purpose dll exporting functions

In any case, request is quite interesting. We need to share / shake some more our brain cells. Any idea is welcome.

ErosOlmi
10-08-2007, 15:30
An example, mmmh?

Petr's TBGL module is great. As an old Blitz3D user I love Blitz3D's entity system. When you say renderworld, it does all the dirty transformation job for you. With one set of functions, you HANDLE CAMERAS; LIGHTS; MESHES.
So for an example, some kind of module that does that. Connects to TBGL, and calls these functions that are needed to render a complete scene.


Mike, this suggestion is worth a new TBGL specific request. The idea of the world is really powerful because you move a lot of the script complexity directly inside TBGL module leaving to programmer the duty to deal with more high level details. So this is something Petr will for sure take into account. Please open a new request in TBGL dedicated forum.

Back to your request, a possible example I can think: the DATE module contains a lot of date manipulation functions used by module internal keywords functions. If you develop another module and needs some specific date function why reinvent the wheel, just get them from DATE module. The same for other aspects like math or stats I suppose.

Well, there can be some different roads. I can see two right now.

export from modules those functions that are enough generic to be used separately from the rest
export from modules a new dedicated function to be used to create a bridge between internal generic fucntions and external modules in need of such functionalities


Just thinking in public ...

Michael Hartlef
10-08-2007, 17:07
Ok, I will make a request to Petr then.

kryton9
10-08-2007, 23:24
I don't know if you guys used Aurora, but in their the 3D is similar it sounds like to what Mike is describing in Blitz Basic. But since that was object oriented I didn't know if the same sort of system could be done in tbgl.

I am months from being able to add anything useful to thinBasic with my powerBasic studies. I realize I have way more to learn than I thought. Starting with the api programming, that will take a couple of months to get through and then to learn the sdk's that Jose has converted. But it will pay off in the end.

In the meantime it will be interesting to see what you guys come up with.

Michael Hartlef
11-08-2007, 00:07
No, AURORA is different.

kryton9
11-08-2007, 09:31
Well now I am intrigued by the Blitz method, will have to read more in depth. Thanks Mike.

Michael Hartlef
11-08-2007, 10:45
When you create/load a mesh/camera/light it turns into an entity. Blitz3D stores all the entity informations like position/rotation/etc. for you. You have one ENTITYMOVE command, which can be used on lights/cams/meshes. And so the picture goes on.

If no movement is inside a loop, your renderloop would look like:

while blablabla

renderworld()
flip()

endwhile


That's it. Blitz3D does all the dirty transformations and positioning for you.

I started something like this for the IBasic Pro 3D pak when this was in development.

Cheers
Michael

ErosOlmi
11-08-2007, 11:06
Mike,

this is a great idea and would speed up a lot script execution because all the info and data is directly maintained / handled by the engine, that is compiled code and not interpreted at avery frame.
As I said, it is worth a specific discussion in TBGL forum, so Petr can follow and people can express their idea adding comparisons with others engines around. If you are in short time (today is your son day if I remeber well) I can add a request for you. A specific post is much better to follow also for people looking at this forum but not partecipating. Let me know.

Remain here your clever idea on how it can be possible to re-use code from one module to the other.

Ciao
Eros

Michael Hartlef
11-08-2007, 11:12
Sorry Eros for that I got offtopic. I will make the request myself.