Page 1 of 1

Easiest Approach to classic Trigger/Event Maps

Posted: Tue Sep 03, 2013 6:01 pm
by KyleHarrison
I used to be an old school Quake2 mapper,m and pretty much just want create with that classic way, and I just noticed (and was disappointing to see) that BSP loading doesn't support entities of any kind

I am aware of IrrEdit though I haven't tried it yet.

What I want to know is: how difficult is it to add Entity support to BSP loading? Or should I stick with IrrEdit to create .irr scenes and use Squirrel for scripting sequences?


Thanks!

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Tue Sep 03, 2013 6:07 pm
by Cube_
How difficult? Difficulty is inherently based on your skill level, I cannot accurately answer your question without knowing how good of a programmer you are nor can I estimate the time it would take for a skilled programmer as I do not know the definition of the bsp format and I would have to research it to figure it out.

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Tue Sep 03, 2013 7:03 pm
by KyleHarrison
Fair enough!

Im new to IrrLicht, but I'm a fairly competent programmer, just not in the field of Game Development or real time simulation. I've written C++ apps for Windows, Mac and Linux, and Objective-C apps for iOS and Mac, and C# based tools and programs for WIndows. However that all said, my profession is currently Web Development (PHP)


Im not looking into time it takes, im looking into whats worth my time exploring. I can use Radiant or QuArK to create basic Quake3 BSP's with entities and triggerable events (like invisible brushes collision triggers). But those triggers and entities are not supported in IrrLicht, and would have to be added manually.

But I have absolutely never used IrrEdit before and I do not understand it's full capability. All I know is it creates IrrScene files, and supports Squirrel Script.


My project, is intended to be SUPER simple. I want to be able to walk to an area (like inside an invisible brush), and trigger a function in the host program.

Very specifically: I am in first person. I walk into a room. The software uses cURL to check into and parse from an online API I have written to get basic stats about that room ID.

I just need to be able to trigger that function somehow, and figured Quake3 BSP would be a fairly easy approach until I found out IrrLicht doesn't support them natively.


Le Sigh. (Thats french for "sigh" lol)

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Tue Sep 03, 2013 8:19 pm
by sudi
You are forgetting that irrlicht is only a rendering engine. If you want trigger areas you first have to programm them before you can load them from a file. Irrlicht BSP loader is fully featured it supports loading entities from bsp files but of course you have to programm those entities first.

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Tue Sep 03, 2013 9:15 pm
by KyleHarrison
Only a rendering engine? You mean like Ogre3D?


So the BSP loader does see "entities", I just need to inform the engine of those entities and what they do? I have no problems with that, from what I was reading, I was under the impression it just loaded geometry and texture data from a BSP and that was it

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Tue Sep 03, 2013 9:42 pm
by sudi

Code: Select all

 
scene::IQ3LevelMesh* mesh = (scene::IQ3LevelMesh*) smgr->getMesh(mapname);
 
//the you can access the entities by
scene::quake3::tQ3EntityList& entities = mesh->getEntityList();//that list is actually a core::array< scene::quake3::IEntity >
 
//now you can also in case those entities are brush entities get their corresponding mesh
scene::IMesh* brushMesh = mesh->getBrushEntityMesh(entity);
 
and no its not as simply as to just say what it does. you have to code collision response and everything.
and yes like ogre3d.

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Tue Sep 03, 2013 10:34 pm
by Cube_
And as usual the experts provided a better response than mine >.>
Anyway, my reply was pretty much meant in the same way as Sudi's reply in the sense that I wouldn't know which to recommend based on not knowing which would be easier for you, experience wise that is. It seems, based on your experience, that you would probably want to program the entities yourself rather than learn a new format as you seem to have sufficient skill to do so without any issues.

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Tue Sep 03, 2013 11:25 pm
by KyleHarrison
It's something to contemplate for sure

Thanks Sudi for the code sample, that helps me visualize :)

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Wed Sep 04, 2013 2:44 pm
by hendu
There's a brush entity example in the patches tracker, it shows an automatic door.

Yo CuteAlien, add the example already, we have people thinking it's not possible since it's hidden in the tracker ;).

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Wed Sep 04, 2013 6:26 pm
by CuteAlien
*sigh* you should really get svn access.

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Thu Sep 05, 2013 7:03 pm
by KyleHarrison
Quick Q about that example, does it use Quake3 BSP or IrrScene?

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Thu Sep 05, 2013 8:05 pm
by CuteAlien
It uses Quake3 bsp.

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Thu Sep 05, 2013 8:18 pm
by sudi
KyleHarrison wrote:Quick Q about that example, does it use Quake3 BSP or IrrScene?
IrrScene does not support stuff like "entites" only scenenodes. You though create your own scenenode type which is basicly just an entity placeholder that you could place in the scene.

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Wed Sep 25, 2013 8:06 pm
by christianclavet
Hi, What you could use is "irrlicht nodes" instead of "quake entities".

You could create a "CUBE" node that you give a specific name ("trigger") (You can take IRRedit to place the cube node)

For loading back a .IRR scene producted by IRRedit, Use the .IRR scene loader example to see how it work.
Then in code (C++) check for that CUBE node and check the distance from that CUBE node from the FPS Camera.
When you launch your application, just set the cube scene node to invisible like node->setVisible(false);

Once you got the distance you need, then you can trigger what you wanted to do.
To get the distance you simply need to get the "cube" position and the camera position. There is a specific function to check that.

Re: Easiest Approach to classic Trigger/Event Maps

Posted: Thu Sep 26, 2013 8:15 pm
by xt_hydra
you can check if the animated mesh is intersecting against praticly everything by querying the "IMesh"
terrain->getMesh()->getBoundingBox().intersectsWithBox(sydney->getBoundingBox())

or like christian said... you can put invisible node....then check against distance or whatsoever