Different Objects

BlitzMax Forums/BlitzMax Beginners Area/Different Objects

Grovesy(Posted 2005) [#1]
Hi,

As some of you may know from my previous posts recently, im creating a new game with an editor. My question is whether i should create 2 object types for each object, one for use in the game, and one for use in the editor.

What are your thoughts?


Dreamora(Posted 2005) [#2]
Depends if the object in editor has fields that are of no use in game ... then yes.

Otherwise I don't think so (you could use the same bmx import then)


ImaginaryHuman(Posted 2005) [#3]
Ideally if your editor is highly WYSIWYG then editing the game will be very little if any different from playing it. It depends how advanced you want to get. Making the game editable in its playable form means having all the data/parameters/object details present at gameplay time.


The r0nin(Posted 2005) [#4]
I'll tell you what I am doing. I am building a 2d/top-down turn-based strategy game. The map is a scrolling tilemap, for which I have built an editor. So far, I found it much easier to simply create a separate .bmx file for the type (tilemap) and include every method, field, and function that I'll ever want that map to be capable of in that one type declaration file. Then all I do is include that one file, and I know my map will work in both programs (because I'm using the exact same load, save, draw, etc. methods). So long as I don't write a call to it, none of the methods, etc. that I don't want are ever used in the other programs. This has been much easier than trying to write two separate types and then try to reconcile all the different functions, field names, etc.

Unless you are going to have a HUGE amount of additional stored information (to slow down the program or greatly increase its memory footprint), I don't see any reason not to just write one type and not pass any of the info to a program that doesn't use it.


Scott Shaver(Posted 2005) [#5]
One other possibility is to write the Type that you need for the game and then inherit it for a new Type with the extra stuff you need in the editor. That way the same methods are available but the extra editor stuff isn't in the way in the game.


The r0nin(Posted 2005) [#6]
Ooooh! He's right, extending the Type is an even better solution. Crap, now I've got to recode all that...