Calculator for Map Editors like BZEdit

Discussion, updates, modifications, etc for the various map editors...
Post Reply
User avatar
Dervish
Private First Class
Private First Class
Posts: 651
Joined: Thu Dec 05, 2002 12:39 am
Location: public void

Calculator for Map Editors like BZEdit

Post by Dervish »

I'm currently working on a calculator for finding points, sizes, etc., of various boxes and pyramids to make specific shapes in a BZFlag map.

I'm already working on the algorithms for quite a few shapes, but if anyone has any suggestions, please let me know here. To give you an example, I currently have these shapes planned for the calculator...
  • square box
  • square box with 4 corner boxes
  • pentagonal box
  • hexagonal box
  • heptagonal box
  • octagonal box
  • nonagonal box
  • decagonal box
These shapes use boxes to create the outter edges, making the inside hollow. If you were to view these boxes from directly above, they'd appear as the designated shapes.

Any other suggestions? Nothing super complex, please (ie: Geodesic dome) ;)

Once released, future versions could include more and more shapes.
protected object myTank(){
foreach(noob in this.game){return frag(noob);}}
Image
User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak »

Rather than having built-in shapes, it might be more flexible to let it create a "hollow box with x sides" and a "solid box with x sides" (that's the other suggestion: make it able to fill in the middle; might require some weird math or lots of boxes tho). Then instead of having to hard-code all of the shapes it could compute the shape based on the number of sides. There are theorems around for calculating the angles and sizes that would be necessary for an 'n' sided box (er, prism).
User avatar
Dervish
Private First Class
Private First Class
Posts: 651
Joined: Thu Dec 05, 2002 12:39 am
Location: public void

Post by Dervish »

DT,

Good idea. I did consider that earlier, and I am definitely going to use a variable for the number of sides instead of hard-coded sections.

I'm just listing the shapes it will currently work with, because having a shape with n sides requires the GUI to display n * 2 output fields. This may require quit a lot of output if n=100 or some number greater than say 10.

I had to put a reasonable limit at 10, but this may be altered in future versions if I decide to take on a greater challenge.

10 seems to be a decent limit as it looks somewhat like a circle on radar, even at large values of X and Y. Also, my little calculator will draw the shape and give output inside color-coordinated boxes, so making this virtually unlimited would be just too great a challenge for me now. I'm still an amateur programmer. :)

Thanks for the input!

As for shapes, I hope someone can give me a few shapes they'd like to see as hollow objects. Such as a cross, or a star, where tanks can explore inside.
protected object myTank(){
foreach(noob in this.game){return frag(noob);}}
Image
User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak »

Rather than having the GUI display the output, couldn't you make the program output a basic world file with just that shape in it (or have the option to do so)? The user could then open the resulting map file and manipulate the shape and build the rest of the world around it, or copy the shape into an existing map file.

Yes, 10 sides is probably reasonable. But in your list, you left out the triangle (you are going to have a triangle, right?). :)

I still think it would be a nifty feature to generate solid shapes, as well as hollow ones. Might be a tad tricky, though.

As for stars and so on, any concave shape would have to be pretty big for a tank to be able to move/shoot/dodge shots inside of adequately. Might have to experiment with this.
User avatar
Dervish
Private First Class
Private First Class
Posts: 651
Joined: Thu Dec 05, 2002 12:39 am
Location: public void

Post by Dervish »

DT,

The triangle isn't included because anything more acute than a 90 degree angle means that boxes don't meet at the edges very well. With 4 sides or more, angles meet at 90 degrees or more obtuse, offering the ability to hide the box edges that meet.

As for the output, yes, the calculator has an "export" function to dump it to a text file by BZFlag map standards. I still want to leave thr GUI side, since I think the majority of players using this app will want them there to cut/paste or enter them into a map editor by hand.
protected object myTank(){
foreach(noob in this.game){return frag(noob);}}
Image
trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Post by trepan »

Hi Dervish,

Just found this site, but I'm glad to see that someone
else was thinking the same as me. Check out bzmapper
in the SourceForge patches directory... See watcha think.
User avatar
Terminator
Private First Class
Private First Class
Posts: 45
Joined: Mon Dec 23, 2002 10:05 pm
Location: England

Post by Terminator »

hmm in futre bzflag version could the client know certain shapes, e.g cylinder, square, triangle. then in the map it would specify what sort of shape and then give the client the x y and z to strech the object to (and rotation). I know it is possible to make a cylinder with dup and.... but you get about 10 seconds of lag but then again i'm not sure wether the client having the cylinder shape already would help with that.
Astalavista baby!

and I'll be back!
User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak »

There are already several feature requests for more basic shapes and curves on SourceForge. I don't know if anything is being done about them or not, but there were some concerns about collision detection
User avatar
Dervish
Private First Class
Private First Class
Posts: 651
Joined: Thu Dec 05, 2002 12:39 am
Location: public void

Post by Dervish »

My guess would be not in the next major version change ( 1.8 ), but rather possibly in 1.9. That would be quite a distance down the road.
protected object myTank(){
foreach(noob in this.game){return frag(noob);}}
Image
Post Reply