Jump to content

Trying to decide on a level format for my game.


Inside

Recommended Posts

Hey guys, I'm working on a ball game and I'm just wondering how I should represent my level format -- I don't want to really use any existing level formats because the engine I'm using Ogre3D probably doesn't have an importer for it and if I'm going to write a level importer, I might as well have my own level format that does everything I want how I want it.

Basically, the game currently doesn't have a name (it was called "Rollout" prior, but I've cut ties with the people who suggested that name so I don't feel right using it), but it's a ball-controlling game ala Super Gerbil Ball/Marble Madness, and so on. I want to have a lot of moving platforms and similar so this is why I feel I need to have my own level format.

You can see an older video here

. It's pretty old and the level is hard coded in so it's not much more than a concept demo. I'm in the process of rewriting code and so am in a decision stage.

The static geometry for the level will be loaded from XML.











You can choose whether the geometry being loaded in has a collision or not, I suppose this could be used to place some models away from the center of game play, for example on a large castle level there could be distant castle walls and spires that don't incure any additional cost for the physics simulation by being there. The dynamic moving objects are going to be defined in LUA -- I'm in the process of wrapping my classes and creating an interface for moving objects and so on and was wondering if something like this would be a bit too much for a mapping person to learn to do.
module platform1{}


platform1:onstartup()

   platform = createPlatform("platform1", 0,0,0, "SmallPlatform.mesh")

   platform:addPrimitive( MoveToPrimitive( 10,10,10) )

end


platform1:OnGameTick()

   platform = ObjectManager:GetObjet("platform1")

   if( platform:position() == position(10,10,10) )

      platform.addPrimitive( MoveToPrimitive( 0,0,0) )

   else if ( platform:position() == position(0,0,0) )

      platform.addPrimitive( MoveToPrimitive( 10,10,10 ) )

end

   

Basically, that code will create a platform that'll move from point A(0,0,0) to point B(10,10,10) in a straight line. More statements can be added to move the platform to different locations and additional "primitives", as I'm calling them for now, can be specified such as rotating the platform.

Also, using LUA I was figuring I could add in further hooks to allow things like the script taking control from a player for a small period of time to do something like rotate the camera around a certain point (on level load, perhaps) and then adding in triggers for game events ( if myBoundingBox:inside( game:getPlayerPosition ) ) ) or in a more ambitious move, do something like in Mario64 with the cannon that shoot the player ball around the map :)

I was going to work on a level editor once I've added enough functionality to the game, but other than positioning static geometry, lighting, sky boxes, particle effects and so on, I can't really figure out how I'd integrate writing of scripts into the editor. Any ideas?

Thanks for your time.

Link to comment
Share on other sites

Looks like a very thought design to me.

I was going to work on a level editor once I've added enough functionality to the game, but other than positioning static geometry, lighting, sky boxes, particle effects and so on, I can't really figure out how I'd integrate writing of scripts into the editor. Any ideas?

Well, i suggest that you can choose for every node (/object) a script, where you can create and edit trough the editor. For example, you can open a property dialog for a node, where you can edit basic properties and scripting for an object. To edit a script, you need to click on a button or something and the button opens a built-in text-editor with the script.

Wfr, Sindwiller

Link to comment
Share on other sites

  • Mapcore Discord

  • Mapcore Supporters

    Our incredible Patreon supporters keep Mapcore's lights on. If you'd like to donate, check out our Patreon announcement.

    Note: This is brand new! The format will be tweaked and rolled out to more pages soon.

×
×
  • Create New...