• Advertisement
Sign in to follow this  

Unity Building a level builder

This topic is 3476 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After looking at the different forum sections this seems like the most relevant, however if you feel this would better be placed elsewhere please feel free to let me know. So I'm at the point with my own project that I would like to build complex levels which define how my game plays. The game is a standard vertical shmup, so a lot of what I need to deal with is where enemies are and how they move. The major problem with this is that I'm unaware of any good generic applications that are a good solution for doing this. So like a true nerd I decided that I would need to build my own. I'm not trying to build this as a generic tool, but mainly a internal tool that I may use for my own games. However, I'm a big advocate of releasing source code so I will most likely let people dig through and use it without restrictions. Right now I'm in the beginning stages of this and am making a list of everything I would "like" to see in editor. I've come up with a bunch of ideas, though I'm not sure if I'm missing anything or if I might be thinking in things the wrong way. So below I have my initial design notes as both as something to share with the community and to get feedback from people. Sequences The editor and the game will be broken up into what I'm calling "Sequences". Each sequence is an data structure which will define what happens in the game when the sequence is run over time. A time line with keyframes will be able to be edited, telling the game what happens in the beginning, end, and anywhere in between. I will also want more game specific logic, for both in game decisions and different end sequence conditions. Examples of logic that might be useful. - Reaching a time limit - Death of all enemies on screen - Reaching a certain score - On player death - On certain enemies death - Etc... Sequences are the mid level building block of the game. Once a few sequences are built you can then link them together with something like a level file to define how the game is played. When the game begins you will start at the beginning sequence, when that sequence ends then you move onto the next one until the entire level is completed. Keyframes Each sequence has a time line with keyframes, when a certain keyframe is hit on the time line then something useful in the game will happen. Below are some examples of some keyframes. - Play an animation - Spawn an enemy - End a sequence - Modify something on the player - Play a sound or switch to a different music track - Change the background Entities Each thing which exits in the game is an entity of some sort, a player, an enemy, a bullet, a static piece of the level, ect. In the editor you will be able to define entities and modify how they react in the game. You can create both generic entities that can be used several times, or you can create ones that are specific to a certain sequence. Entities have most of the same functionality that sequences do, such as a timeline and logic which can be applied to them. Below are some examples of keyframes that might be used. - Fire a bullet - Play an animation - Play a sound - Commit suicide Path/Spline Editing I have found that in shmups it is very easy to define how things work with splines. It can be used anywhere from how and enemy moves, what direction they are shooting, how bullets move though the air, ect. Therefore the editor will need the ability to edit splines and save them to the data it's related to. For my current needs I have found the Catmull Rom spline to be both good computational wise, easy to program, and have the ease of use modify on screen. Scripting Both sequences and enemies will be able to be scripted with a bit of logic to make their actions both more dynamic and sometimes easier to reuse. The scripting language I'm using is similar in structure to Bullet ML, however it has been written in c++. Also, the concept of how it works also differs in that it runs off of a input output design. To better explain I will give an example. I might want the enemy to move on a spline, so I will have a spline action which can be added to an enemy. That spline action does not modify the players position directly, instead it just calculates the current position in time without even knowing an enemy exists. I then add a output to that action telling it to copy the result to a particular enemies position. After each update the spline action will then run all of it's output commands which modifies the player's position. The purpose of this design in reuse. There could be millions of things I want a spline to control, but without this design I would need to code a specific case for each one. With the input output design I can easily link the action to the variable without worry. Now I can use the spline for controlling many things, enemies rotation, rate of fire for an enemy, speed of a bullet, ect... Inputs work in a similar way, the input it run every update before the logic and generally modifies something inside of the action from an outside source. An example of this might be me having a firing action and I want to input the angle of the enemy, or maybe just input the angle directly from the enemy to the player. Playback Part of editing anything is making a change and seeing how it looks, so it will be important to have a playback function. This will allow you to either jump into the actual game, or just do a pseudo playback of what would happen at any point in the timeline of a sequence. When you are done you can then go right back to editing and making tweeks as needed. Serialization Once you have all of this wonderful data in the game you will then need to save this information to disk to be loaded into the game or worked on later. This is a simple step, but a needed one. I already have a XML reader and writer so this will most likely be the format that I write to. I cringe every time I think about the size and speed overhead compared to a binary format. However for these kinds of top level data structures it proves to be the easiest to use, reuse, and the speed is not much of a concern. GUI The editor will need someway for the person to interact with the data, and this is where a GUI comes in. I have a personal OpenGL GUI that I have been working with and it has proven to work well for it's utilitarian purposes, so at the moment this is not a concern. Graphics Things will be drawn to the screen with OpenGL. I've chosen this and worked with it for several years now, so I have the most experience with it and it will allow me to compile my application on multiple platforms. Sounds At this point I don't see a need for sound in the editor, unless it was to be a feature of the playback system. I already have several code structures hooked up with OpenAL and the OGG format, so If it does need to be added it will be trivial. Final notes So that is my current plan on what I would "like" to see in the editor. Going into this my mentality is to build something that works for my purposes and nothing more. As time goes by I'm sure I will expand the project and it will grow into a more generic tool, though to move along I must be more focused on my game and less about making a tool. If you have anything to say, ideas, design concerns, ect, then please feel free to post back. I'm very open to hear what people think since I'm sure I'm not the only one who has had to think about this and/or make one of these before. - Kiro

Share this post


Link to post
Share on other sites
Advertisement
My first thought is that it looks more like a game builder than a level editor.

It looks like most of your game logic will be written in the level editor, which, depending on how you divide up the functionality between editor and game could make it a bit confusing, and possibly too tightly coupled to the specific game to be very reusable.
On the other hand, since it is a shmup, this style of editor seems like it could make it very easy to extend the game and easily add a lot of levels.

Also, it seems a little odd not to define and use sounds in the editor, since everything else is defined and built there.

Cheers

Share this post


Link to post
Share on other sites
"My first thought is that it looks more like a game builder than a level editor.

It looks like most of your game logic will be written in the level editor, which, depending on how you divide up the functionality between editor and game could make it a bit confusing, and possibly too tightly coupled to the specific game to be very reusable.
On the other hand, since it is a shmup, this style of editor seems like it could make it very easy to extend the game and easily add a lot of levels. "

I agree that this type of design is geared more towards shmups, and will most likely only be useful in that type of genre. Though within those bounds I see a builder like being able to be reused on multiple games since most of the generic concepts are there.

"Also, it seems a little odd not to define and use sounds in the editor, since everything else is defined and built there."

Well I want the capability of defining what sounds exist and allowing keyframes to trigger them. I'm not sure what else there is beyond that which needs to be integrated related to audio. Is that what you were mainly referring to?

- Kiro

Share this post


Link to post
Share on other sites
I am not entirely sure, however, my planning about the level editor is backwards from yours. I basically say: My level edito needs to be able to modify anything that is stored within a level file in a good way. That way, I reduced the problem of planning the level editor to plan the level file contents. Stepping onwards, the level file contents are defined by the level mechanics given. Thus, if you have planned the game mechanics, you basically planned the level editor mechanics except for the UI.

I don't know if this helps, but I somehow don't have this problem due to this reasons.

Share this post


Link to post
Share on other sites
So, many years ago I created a side-scrolling SHUMP. Mine wasn't near as detailed as your. My levels were basically all trigger by time. So, I had certain enemies, objects, and backgrounds items come on the game after a certain time period passes. Yours sounds a little better since there could be a time when one of my "sequences" hasn't ended yet, and a new one starts. Also, i never created a level editor, I basically just used text files to describe each level.

You can see my source here: [link]http://webpages.charter.net/wwjennings/AlphaSrc.zip[/link]

And the actual game here:[link]http://webpages.charter.net/wwjennings/Alpha.zip[/link]

It's very rough, I didn't go near as far with it as I wanted, but it's nice where it is.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By RoKabium Games
      Another one of our new UI for #screenshotsaturday. This is the inventory screen for showing what animal fossils you have collected so far. #gamedev #indiedev #sama
    • By eldwin11929
      We're looking for programmers for our project.
      Our project is being made in Unity
      Requirements:
      -Skills in Unity
      -C#
      -Javascript
      -Node.js
      We're looking for programmers who can perform a variety of functions on our project.
      Project is a top-down hack-and-slash pvp dungeon-crawler like game. Game is entirely multiplayer based, using randomized dungeons, and a unique combat system with emphasis on gameplay.
      We have a GDD to work off of, and a Lead Programmer you would work under.
      Assignments may include:
      -Creating new scripts of varying degrees specific to the project (mostly server-side, but sometimes client-side)
      -Assembling already created monsters/characters with existing or non-existing code.
      -Creating VFX
      -Assembling already created environment models
      If interested, please contact: eldwin11929@yahoo.com
      This project is unpaid, but with royalties.
       
      ---
      Additional Project Info:
      Summary:
      Bassetune Reapers is a Player-verus-Player, competitive dungeon crawler. This basically takes on aspects of dungeon crawling, but with a more aggressive setting. Players will have the option to play as the "dungeon-crawlers" (called the 'Knights', or "Knight Class", in-game) or as the "dungeon" itself (literally called the 'Bosses', or "Boss Class", in-game). What this means is that players can choose to play as the people invading the dungeon, or as the dungeon-holders themselves.
      Key Features:
      -Intense, fast-paced combat
      -Multiple skills, weapons, and ways to play the game
      -Tons of different Bosses, Minibosses, creatures and traps to utilize throughout the dungeon
      -Multiple unique environments
      -Interesting, detailed lore behind both the game and world
      -Intricate RPG system
      -Ladder and ranking system
      -Lots of customization for both classes s of customization for both classes
    • By RoKabium Games
      Custom coffee mugs have arrived... More caffeine!
      Have a great weekend everyone! 
      #gamedev #indiedev #sama #caffeine
    • By Atwo Studios
       
      Hey guys,

      Anthony here from Atwo Studios bringing you some new updates for the new year!
      In this video I go over our game ROY, the new games and some general updates to the company!

      If you have not checked out ROY feel free to give it a try! Many people have said they enjoyed the game thus far!
      ROY: https://goo.gl/o6JJ5P
       
    • By Affgoo
      https://play.google.com/store/apps/details?id=com.NE.Alien
      still a lot of work to do, but its pretty stable  please let me know what you think <3
      Atlas Sentry is a game of destroy everything. Using your turret, simply swivel and shoot your way to victory, upgrading your weapons to unleash destruction on the variety of spaceships. The bigger your combo’s the more score you get! Earn silver as you play and then purchase new weapons and abilities to better deal with your enemy. Different enemies use different tactics and weapons, work out your own priorities in their destruction order. 

      Features: 
      **2 different game modes 
      **A level select mode with 20 difficult levels including a final boss, can you defeat it? **Arcade mode of endless destruction, how long will you last? 
      **High scores to compete against others, see who can take the top spot. 
       
  • Advertisement