level_ent min, max?

Posted By: Redeemer

level_ent min, max? - 09/08/11 00:50

Hi guys,

So I'm doing a large overhaul of the collision code in GRUNTS, and there's some level information that I need. Specifically, the collision surface with the greatest/least X value, the collision surface with the greatest/least Y value, etc. At first I thought that the min and max vectors for level_ent might provide me this information, but it seems that they only return the largest valid coordinate in the level, which is either 5000 or -5000 depending upon whether you're reading from the max or min vectors, respectively.

Anyway, does anyone know if/where the engine stores this information?
Posted By: Superku

Re: level_ent min, max? - 09/08/11 01:31

It seems to me as if one level dimension does not exceed the absolute value of 5000, the respective level_ent.min/max will stay at -5000/5000.
Seems like a bug to me, too.
The obvious solution is to add, f.i. one dummy entity per level that contains the information. You/ sPike has to enter it in WED manually, of course.
Posted By: Redeemer

Re: level_ent min, max? - 09/08/11 01:46

Quote:
The obvious solution is to add, f.i. one dummy entity per level that contains the information. You/ sPike has to enter it in WED manually, of course.

That involves more human interaction than I'd like this system to rely on, but I suppose it'll have to do.
Posted By: Superku

Re: level_ent min, max? - 09/08/11 02:01

Can I ask why you need that information?
Posted By: Redeemer

Re: level_ent min, max? - 09/08/11 02:20

I plan to implement my own engine's collision system into GRUNTS, because I know mine works very, very well. But my system requires that the data is in a special format whereby columns of obstacles are packed into a grid. Therefore I will have to generate my own collision map for a level before I can put my code to work.

I'm sure this sounds like quite a clumsy process, but Gamestudio gives me little raw data to work with, and I know this will work quite well once I get it all plugged in.
Posted By: Superku

Re: level_ent min, max? - 09/08/11 14:29

I've once coded my own AABB movement function for my sidescroller with box and polygonal collision detection on models as well as polygonal block detection.
All you need to know/ use is "ent_buffers". Using this function you could easily loop through all blocks (and their vertices) to calculate the information you need (min/max) manually.
Posted By: Redeemer

Re: level_ent min, max? - 09/08/11 15:28

Hmm. I was unaware that such a function existed.

Thanks for the advice, Superku! It's much appreciated. laugh
© 2024 lite-C Forums