Archived

This topic is now archived and is closed to further replies.

boolean ops. support needed, but can't use BSP, any other suggestions???

This topic is 5822 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i am making a small 2d game, it's called war worms (http://www.warwormsdev.f2s.com/). it will feature real-time changed maps, and that's where i'm having trouble. for example, you start out with a small underground cave, but with every explosion, or bullet, hitting the ground, it will eat some, and leave a "crater". next time u open the map it will be the same cave again. for easy real-time collision detection, i will use polygons made of "line-strips" kind of structure. that means, that if there's a cave, a square based one (4 straight lines) 4 easy understanding. then u'd have a list of points, where 1st point is 1st vertex of the top line, and last point in list, will be 2nd vertex of 3rd line (not 4th, since i know it will be a connected loop, so it'll make the last line from 1st point in list, and last one). i will not use bsp, because it seems to be to be uneffective, because my maps will not be square. so here's the idea, where i need help, some suggestions of HOW TO GO about doing it. see how the explosion "mask" is applied over? i need to "SUBTRACT" it! :D but i don't know how... i've looked it up, and it's called boolean operations, and i need to know how to do: -subtraction -addition that's it! what i'm trying to get from above pic is this. i really need help with this, because i can't find anything that would help me, and no1 i know knows how to help me so any help would be very greatly appreciated! thanks in advance! thanks, shurcool Edited by - shurcool on January 3, 2002 4:55:56 PM

Share this post


Link to post
Share on other sites
Err... I wouldn''t use polygons. It would be better to use a single bitmap as a background, and one as a level, with the alpha channel to decide where you can walk. An explosion simply erases a circle out of the level-bitmap, and adjusts the alpha channel. Just like the real wormds

-Maarten Leeuwrik
"Some people when faced with the end of a journey simply decide to begin anew I guess."

Share this post


Link to post
Share on other sites
If you need to do 2d boolean operations, I *strongly* recommend the GPC boolean library by Alan Murta. It is small, fast, easy to use and extremly stable - the best free 2d boolean lib you can find.

It supports union, difference, intersection and XOR operations on any (concave and complex) polygon sets.

http://www.cs.man.ac.uk/aig/staff/alan/software

A.H aka Blueshift

Share this post


Link to post
Share on other sites
hi,
i see what you mean, and i have considered the option, but i want to do it the way i described above, because it adds some nice features that i really need. i knew it''d be hard, that''s why i need a "push" in the right direction...

i also noticed that my images r down (stupid host), so i''ll fix that.

thanks,
shurcool

Share this post


Link to post
Share on other sites
quote:
Original post by Blueshift
If you need to do 2d boolean operations, I *strongly* recommend the GPC boolean library by Alan Murta. It is small, fast, easy to use and extremly stable - the best free 2d boolean lib you can find.

It supports union, difference, intersection and XOR operations on any (concave and complex) polygon sets.

http://www.cs.man.ac.uk/aig/staff/alan/software

A.H aka Blueshift


thank you very much, that''s exactly what i was looking for! you''ve saved my life! thanks a lot.

thanks,
shurcool

Share this post


Link to post
Share on other sites