PDA

View Full Version : level editor questions/ideas


bluetechnx
July 9th, 2005, 05:31 PM
Hello,

I have been looking around the net for packaging ruby files and also into the the level editor details. I was wondering if you had any ideas how to begin a level editor.

I suppose that for a tile-based approach have tiles of certain sizes (8x8, 16x16,32x32..ect) and have a map canvas (grid layout) to place tiles into...

So once that is done though, how do you encode data like "this is a wall" or "asteroid" and the ship can't pass through say this region which is 16x16: [[8,8][24,24]] to create what is typically called a .lvl file (bmp + this "objects" data).

Also, how would using tiles allow for pixel collesion. So say you have a wall in a tile (that isn't the WHOLE tile)...encoding that tile as a wall would be a bad thing because on the screen you'd hit an invisible wall....

Anyways...perhaps somebody could help enlighten me. Also what would you guys use for a gui toolkit in this case? Having used a fair bit of Java Swing...I just don't relish using any Ruby gui toolkits....perhaps I'm wrong...

steve_d555
July 9th, 2005, 05:48 PM
We could use some sort of xml file and parse it in the beginning. You could either go the route of making a background with objects embedded into the bmp file and telling the program where the objects are (boundaries, etc.) or you could have to program do the drawing and get where the objects should be placed from a text file. I think the latter might be easier but I'm not completely sure.

As for GUI's... I'm not entirely sure, if we do go the way of text files, we can just have people edit them by hand in the beginning and then if we want, find some easier way for people to make levels.

I don't know, I've never done a project quite like this, so if my ideas seem stupid, sorry :o

steve_d555
July 10th, 2005, 11:45 PM
Just flipping through the Programming Ruby book and came across YAML. Completely forgot about it. That should be a very easy way to include configuration files. And about the half-tiles, I think we should find a way to get full tiles to work before we even begin to think about that.

mserms
July 11th, 2005, 01:21 PM
My only real experience (still fairly limited) using Ruby GUIs has been with Qt. It's an excellent toolkit and seems every bit as well thought out and powerful as Swing (IMO). AFAIK the Ruby bindings for the newly released Qt 4.0 will be out very soon.

I think the choice is whether to make the level editor do the work of creating code that insI ferts the objects (baddie ship, obstacles, mountains, whatever) or make the actual game do the parsing and creating. eel it would be better to make the editor do it, and make the editor output a ruby file that the game can include. The file would just create a 'Level' object (with a chosen background image) and then make a bunch of function calls on it which add baddies, obstacles whatever to it. The game code can (or at least should ;)) handle different sizes of objects and stuff, so it all should 'just work' (yeah, right!).

Adding new baddies and stuff is just a case of subclassing the already existing ones.

bluetechnx
July 11th, 2005, 11:23 PM
any idea when Qt 4.0 bindings will be out? ...will it use native widgets?

I was trying to code up an MVP library for WxWidgets and Ruby but there isn't any concrete Wx::Object class as far as I can tell...until Wx-swig version is more done...

I'm looking into either VisualWx (a RAD tool) or perhaps libGlade and GTK+...