Looking for World Editor

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

Looking for World Editor

Postby seed » Wed May 05, 2010 2:30 pm

In my normal re-invent the wheel way of doing things, I was writing a level editor for my game on the android from scratch. It actually isn't bad but I am hitting limitations.

So, I am going to scratch this approach, and am hoping to write a plugin for an existing free editor program to convert to my file format.

Basically, my format is just a collection of brushes. For each brush I need vertices, texture vertices, normals, and indices (basically a binary obj format). Additionally, for each brush, I also store a list of collision surfaces for each face. A surface needs an origin, a normal, and bounding points for the corners/edges.

Anybody have a good recommendation for an editor to start with. If the editor can work in convex brushes, it is a very good start. Also, I would like it to do some hidden face removal for brushes that butt up against each other. Seems like a quake level editor would be perfect starting point, maybe old quake1, but I need one that will allow me to write a plugin to write the data out in my file format and to pre-create my bsp.

Thoughts?

Thanks,
Seed
Visit Exit 4 Gaming - http://www.exit4games.com/
Home of LavaBall - http://exit4games.com/?page_id=3
Home of Rebound - http://exit4games.com/?page_id=138
Home of Tap Crazy - http://exit4games.com/?page_id=219
Download "Caveman Pool" From the Market Today!
seed
Senior Developer
Senior Developer
 
Posts: 103
Joined: Mon Mar 15, 2010 3:22 pm

Top

Postby seed » Wed May 05, 2010 5:02 pm

Sorry for posting before I think or do appropriate research. This is the plan. I am going to use QuArK. I will save my maps to quake1 map format. I will use my own program to convert from map format to my format, generating my bsp as I do so. This actually shouldn't be all that hard. I will likely keep the brush format in my files (in binary though), converting to my object format and collision surface format on loading. Since surfaces have a one to one coorespondence to brush planes, I can generate my collision bsp and save to the file, indexing it with the brush planes and maintaining that indexing to my collision planes in game. This should work well.

And... I get to write some C++ code again. Yeah!
Visit Exit 4 Gaming - http://www.exit4games.com/
Home of LavaBall - http://exit4games.com/?page_id=3
Home of Rebound - http://exit4games.com/?page_id=138
Home of Tap Crazy - http://exit4games.com/?page_id=219
Download "Caveman Pool" From the Market Today!
seed
Senior Developer
Senior Developer
 
Posts: 103
Joined: Mon Mar 15, 2010 3:22 pm

Postby seed » Thu May 06, 2010 5:33 pm

Wow, turning a brush into triangles is more of a pain in the butt than I thought it would be and I couldn't find any good web resources. That said, I think I have it now. I can make the vertices, normals, and indices, which was my main concern. Basically, since my engine uses bounded surfaces for collision, I just create an oversized surface on each brush plane and then subdivide it using the other non-parallel brush planes. At that point, surface to triangles is cake.

I am sure if I purchased your engine, Michael, I would have this code already, but it is fun to learn.

Quark is pretty easy to use. So, once this is done, creating levels should be a snap. I think I am going to aim for 5-10 free levels and 20-30 paid levels for my game with regular updates to the paid version to add new levels.
Visit Exit 4 Gaming - http://www.exit4games.com/
Home of LavaBall - http://exit4games.com/?page_id=3
Home of Rebound - http://exit4games.com/?page_id=138
Home of Tap Crazy - http://exit4games.com/?page_id=219
Download "Caveman Pool" From the Market Today!
seed
Senior Developer
Senior Developer
 
Posts: 103
Joined: Mon Mar 15, 2010 3:22 pm

Postby seed » Wed May 12, 2010 8:41 pm

I finally got this working. It took longer than I expected. Converting a brush to triangles is harder than I thought it would be. Now, I can create a level in Quark (quake map format), run a program to convert it to my format, put it in the assets of my apk, and load it dynamically. Very cool. Creating levels in quark is a heck of a lot easier than what I was doing before.

Of course, now that I can create more complicated level structures, I have exposed some new collision detection bugs in my app. One stuck bug that I can't explain and one through wall bug that I think has to do with multiple collisions with surfaces in close proximity at an angle of less than 90 degree to each other.

I am also working on creating the BSP ahead of time and putting it in my level file. This should be pretty straight forward, but I have said that before. Currently, I am creating the BSP in my app after I load the level. The BSP creation takes a few minutes, so startup is silly long. Pre-rendering the BSP will make level startup really fast.

There is really no point to this post. I was just kinda happy with myself.

EDIT: I changed to creating the BSP offline and saving in the lava ball map format. This went really quick (for once) and now a level loads in a second rather than a few minutes. I am having some problems with exceptions when loading levels. Funny, seems like the app has the exception every other time I run it, which is really odd because I am not saving any state data yet. I am just initializing and loading the level from the apk each time I run the app. And, when I run it from Eclipse, I don't get the exception ever. Very odd. I don't understand what could be carrying over. Maybe a process or thread is not properly shut down or something.
Visit Exit 4 Gaming - http://www.exit4games.com/
Home of LavaBall - http://exit4games.com/?page_id=3
Home of Rebound - http://exit4games.com/?page_id=138
Home of Tap Crazy - http://exit4games.com/?page_id=219
Download "Caveman Pool" From the Market Today!
seed
Senior Developer
Senior Developer
 
Posts: 103
Joined: Mon Mar 15, 2010 3:22 pm

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests