If you've thought maybe you'd like to create a map...

General talk about the map making process.
Post Reply
User avatar
The Purple Panzer
Field Marshal
Field Marshal
Posts: 244
Joined: Tue Sep 23, 2003 8:13 pm
Location: Stonington, CT
Contact:

If you've thought maybe you'd like to create a map...

Post by The Purple Panzer » Thu Apr 10, 2008 1:34 pm

Over the years I've developed a map toolkit, using fairly simple scripting, which I use to generate most of my maps. I thought it might be good to make it generally available, particularly as it may make it easier for people who have never designed a map to get started.

I thought about posting this in the Mapmaking forum, but my goal is to offer a way for people who have never created a map to do so - and usually the readers of that forum are already well along with the process.

I use Microsoft Visual Basic for the scripting, running on Windows. One reason I've chosen to send this out now is that Microsoft has made "Visual Basic Express" availabel *for free* - so anyone may grab a copy and try it out. To get a copy, visit this site: http://www.microsoft.com/express/vb/

I've found VB to be good for map scripting because it's a fairly simple language, with a very helpful IDE. Ignoring all of the supporting machinery in the toolkit, a map script is just a sequence of calls to create objects and put them in various places. It's nice to script this, as you can use some easily-changed parameters to position objects, or guarantee that they line up in certain ways.

This toolkit lets you easily create the old Version 1 objects, such as pyramids and boxes, as well as Version 2 objects, such as meshboxes, arcs, cylinders, etc. I've also got code in there to generate meshes (I was never particularly good with Blender), that is to take a number of parameters and write out a mesh. One such piece will create smoothly-varying hills; another is kind of like a lathe, in that you specify a profile, and a 3D shape is created by rotating that about an axis. One Greek Temple object has code to create the columns and other parts of the structure.

In addition, I've put in an example script that has a number of objects - I always like to work from example, and this script has meshboxes and pyramids of varying colors and transparencies, a lot of trees that you may use, a road in the air, a hill - a fair number of elements (but by no means all that are in the toolkit). Along with this I've put in scripts for four of my maps, so that if you see something you like you can borrow it easily with an editor "copy/paste".

Essentially to use the toolkit you start up VB, then use the form that shows up to run a map script - and if you've set the link to the BZFlag installation directory, BZFS (the server) will then start up with that new map file (the toolkit writes a batch file with appropriate options and then runs it). You then use your client to connect to that server and see what it looks like. I usually note changes I'd like to make, exit out of the client, and go and edit the Visual Basic script to make them happen - then I repeat the cycle again. (You can kill the BZFS server by hand, or the app will do it for you when you next run). On the rare occasions when BZFS exits, you can run the batch file from a DOS window and see what errors show up.

If anyone gives it a try and needs help, I'll respond to questions (unless I'm deluged). If there is enough interest I'll create a sourceforge project for it, and then people can add their own objects, etc. Probably the biggest part of the learning curve is just getting used to the Visual Basic environment, but there is a lot of support out there for that too.

If you'd like a copy of the kit (which includes a readme file), you may grab it here:
http://www.bentz-engineering.com/VBExpressToolkit.zip (which *is* case sensitive, unfortunately. Ah, Unix.)

Bryan Bentz
"The Purple Panzer"

User avatar
blast
General
General
Posts: 4792
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast » Fri Apr 11, 2008 5:49 am

Might want to fix the bug where it gets into an infinite There is no directory "(Put the BZFlag installation directory here)" loop, preventing you from closing the application without using the task manager. I couldn't even click on the "Browse" button to pick the correct path.

And when you browse for an output map directory, it does not include a \ at the end of the path. Nor do you add one on when you write the file. So when you pick a path, such as C:\BZW, it saves the files as something like C:\BZWartmap.bzw for example.

Also, I don't think you can distribute binaries with the express versions of Visual Studio, but that might be specific to the C++ edition. I'd still recommend you check on that.

Did you know that there is already an application in the BZFlag SVN that can launch BZFS and a client automatically? It seems to already be further along than this thing. Maybe I'm just missing the point of what your tool is supposed to do?
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

User avatar
The Purple Panzer
Field Marshal
Field Marshal
Posts: 244
Joined: Tue Sep 23, 2003 8:13 pm
Location: Stonington, CT
Contact:

Post by The Purple Panzer » Fri Apr 11, 2008 7:10 pm

I've fixed the infinite loop problem, as well as the trailing slash issue. This started out as a VB 6 project, and the events fired by the textboxes have changed - my apologies.
Also, I don't think you can distribute binaries with the express versions of Visual Studio, but that might be specific to the C++ edition. I'd still recommend you check on that.
I don't need to check on it - I'm not distributing any binaries - it's all source code (and I point to microsoft.com for the VB Express download). If you want to compile it to an .exe you can, but that doesn't make a lot of sense.
Did you know that there is already an application in the BZFlag SVN that can launch BZFS and a client automatically? It seems to already be further along than this thing. Maybe I'm just missing the point of what your tool is supposed to do?
I think perhaps that you are missing the point - running BZFS automatically is just a convenience. The main point of the toolkit is to let you design maps via simple scripting in VB; the toolkit has a fair amount of support for that, and some objects that may be (functionally) re-used by anyone. The idea is that you can start either by modifying the Script_Example module to do what you want, or of course you can just add a module for a new map - but that usually requires a new button.

It (the toolkit) was very useful before the introduction of groups, as it allowed you to define a collection of Version 1 objects as a compound object, and then place it, scale it, etc., just like any other object.

Thanks for trying it to the extent you have.

User avatar
blast
General
General
Posts: 4792
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast » Fri Apr 11, 2008 9:55 pm

The Purple Panzer wrote:
Also, I don't think you can distribute binaries with the express versions of Visual Studio, but that might be specific to the C++ edition. I'd still recommend you check on that.
I don't need to check on it - I'm not distributing any binaries - it's all source code (and I point to microsoft.com for the VB Express download). If you want to compile it to an .exe you can, but that doesn't make a lot of sense.
There were (and still are) binaries inside the download you are providing.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

User avatar
The Purple Panzer
Field Marshal
Field Marshal
Posts: 244
Joined: Tue Sep 23, 2003 8:13 pm
Location: Stonington, CT
Contact:

They be gone.

Post by The Purple Panzer » Sat Apr 12, 2008 2:21 am

My oh my, you are (were) correct - probably old compiles I did as tests, or something the IDE does in the course of its incremental compiles - I took them out.

User avatar
The Purple Panzer
Field Marshal
Field Marshal
Posts: 244
Joined: Tue Sep 23, 2003 8:13 pm
Location: Stonington, CT
Contact:

Be sure to look at the Script_<mapname> modules

Post by The Purple Panzer » Tue Apr 15, 2008 4:01 pm

After thinking about the above discussion, maybe I wasn't clear (either here or in the readme file included) that the idea is that you look at the modules that create maps: script_example, script_bigmadcity, etc. You do this in the Visual Basic Express development environment.

Particularly for Script_example, you could just take what you like and replicate it, specify different coordinates, build interative loops to create more complex structures (e.g., steps), etc. Then you run the program in the development environment context to create the map (and, as a side effect if you like, start bzfs running with that map.)

Then you can use the client to examine the world from the inside, and go back and make whatever changes you like.

Post Reply