I want to create game similar to original DOOM in Unity (using 2017.2). I'd like to make it possible to load entire levels from file, but I don't really want to write my own level editor that would serialize and deserialize Unity objects.

I'd like to allow the player base to create new levels using blender, without them needing to use Unity: all the logic and shapes should come from that single blender file.

I'm wondering how it could be possible to create levels in blender with some additional data, that could be processed from the Unity game. Just simple markers, for example stepping on platform A will open door B.

  • \$\begingroup\$ mods are for modifications of existing games, I think you meant models, which are about 3d graphical representation of objects. Also, "is it possible" questions are not a very good fit for this site, we prefer "how is it possible to..", which will help you a bit better in the end :) \$\endgroup\$ – Vaillancourt Nov 13 '17 at 13:42
  • \$\begingroup\$ Actually, I meant mods - the whole purpose of my question was to see if it's possible, to add content (levels) to exising game in a way I've imagined. \$\endgroup\$ – dargemir Nov 13 '17 at 13:45
  • 1
    \$\begingroup\$ Oh! That's not reflected at all in the question. You should edit the question expand on that. Mods related question are generally related to how to architecture the game in a way that will be easily moddable by the community, or how you could mod a specific game. Are you asking about a data-driven approach? \$\endgroup\$ – Vaillancourt Nov 13 '17 at 13:49
  • 3
    \$\begingroup\$ Ok, so just to be clear: You're thinking about creating a game similar to DOOM with Unity, and you want to allow your player base to create new maps using blender, without them needing to use anything from Unity or it's tools, is that it? \$\endgroup\$ – Vaillancourt Nov 13 '17 at 14:48
  • \$\begingroup\$ That's exactly what I want. \$\endgroup\$ – dargemir Nov 13 '17 at 15:09

This is not going to be as easy as you think it would be, because only the Unity Editor can load Blender files. When you import a Blender file, it is converted to Unity's internal format. This is the only format which the actual game engine can read. The built game does not include any Editor-specific program code, including the code which imports assets from 3rd party formats. That means when you want to allow the built game to read .blend files at runtime, you need to include your own parser for the .blend file format. And if you go that far, then you can just load any meta-data from the Blender file you want, for example in form of a text datablock created with the text editor.

But note that there are games which built thriving modding communities of people who use the Unity Personal Edition to create asset bundles which the base game can then load as mods. Kerbal Space Program, for example. This makes modding a lot easier than using Blender, because you can release a pack of handy editor scripts and other assets which help your modders to perform common tasks.

Another positive aspect of using Unity is that the full power of the Unity scripting system is at their disposal for adding new game features. But that does of course also give great potential for abuse.

  • \$\begingroup\$ Thank you for pointing that I can't load blender file in runtime, it's something I totally forgot about. Asset bundle as mod, you say... That's totally worth trying, thanks! It would actually require releasing Unity scene templates and API in public, am I right? \$\endgroup\$ – dargemir Nov 14 '17 at 12:57
  • \$\begingroup\$ @dargemir That depends on implementation details of your modding interface, but I doubt you will get around giving them at least something. \$\endgroup\$ – Philipp Nov 14 '17 at 13:05

Well, I don't think blender can do logic, but it can do animating. You can animate a door opening and making it an animation in Unity as well. You can add a Collider and enabling the Trigger in front of the door to make it open. Making a map in blender isn't really efficient but it works. Just add a Mesh Collider to it without checking 'Convex' and it should automatically add colliders to it according to its shape.

The thing is, I'd like to put all the level logic and shape in one file.

Thats what scenes are for.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.