Jump to content
  • Advertisement
Sign in to follow this  
KiroNeem

Unity Building a level builder

This topic is 3625 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

  • Similar Content

    • By ethancodes
      I'm working on a system for my game that will allow the player to stack pick ups in a queue. As one pick up expires, the next automatically activates. I'm having an issue though where if I pick up the first one, it activates fine, but if i pick up a second directly after it, it overrides the first one, activates the second one, and then once it has run it's course, everything goes back to normal gameplay, no first pick up. I'm not sure why this is happening. Hopefully someone can spot what I'm doing wrong in my code.
      Here is the code for the pick up manager:
      // Update is called once per frame void Update () { if (pickUpQueue.Count != 0 && !pickUpActive) { pickUpActive = true; pickUpQueue[0].ActivatePickUp(); } DeactivatePickUp(); } void DeactivatePickUp () { if (pickUpQueue.Count != 0 && pickUpActive) { Destroy (pickUpQueue [0]); pickUpQueue.RemoveAt (0); pickUpActive = false; } } And here is the PickUp:
      public override void ActivatePickUp () { ball.GetComponent<Ball>().Speed = 2.0f; //increase ball speed... ball.GetComponent<Ball>().StartCoroutine(timer); //...set time that power up is active }  
      There is also a Base Pick Up:
      public void OnCollisionEnter2D (Collision2D collision) { Vector2 tweak = new Vector2 (Random.Range(0f, 0.2f),Random.Range(0f, 0.2f)); this.gameObject.GetComponent<Rigidbody2D>().velocity += tweak; //if the pickup makes contact with the paddle or ball.... if (collision.gameObject.tag == "Paddle" || collision.gameObject.tag == "Ball") { GameObject.FindObjectOfType<GameManager>().GetComponent<PickUpManager>().pickUpQueue.Add(this); Destroy(gameObject); //...and finally destroy power up object } } As a side note, I am trying to find a solution to this that will work for all of my pickups. Some pickups are ammo based, some are timed. 
    • By D34DPOOL
      Edit Your Profile D34DPOOL 0 Threads 0 Updates 0 Messages Network Mod DB GameFront Sign Out Add jobEdit jobDeleteC# Programmer for a Unity FPS at Anywhere   Programmers located Anywhere.
      Posted by D34DPOOL on May 20th, 2018
      Hello, my name is Mason, and I've been working on a Quake style arena shooter about destroying boxes on and off for about a year now. I have a proof of concept with all of the basic features, but as an artist with little programming skill I've reached the end of my abilities as a programmer haha. I need someone to help fix bugs, optomize code, and to implent new features into the game. As a programmer you will have creative freedom to suggest new features and modes to add into the game if you choose to, I'm usually very open to suggestions :).
      What is required:
      Skill using C#
      Experience with Unity
      Experience using UNET (since it is a multiplayer game), or the effort and ability to learn it
      Compensation:
      Since the game currently has no funding, we can split whatever revenue the game makes in the future. However if you would perfer I can create 2D and/or 3D assets for whatever you need in return for your time and work.
      It's a very open and chill enviornment, where you'll have relative creative freedom. I hope you are interested in joining the team, and have a good day!
       
      To apply email me at mangemason@yahoo.com
    • By davejones
      Is there a way to automatically change the start position of an animation? I have a bunch of animations set up on 3D models in unity. The issue is that I need to move the 3D models, however when I do so the animation start positions are not updated and I have to do it manually.

      Changing the transform of key frames is time consuming with the amount of animations I have, so I was wondering if there was a way to do it automatically?
    • By MoreLion
      hey all! We are looking for members for our Unity horror game! 
      Here’s the story:
      After a deadly virus plunges the world into chaos killing 85% of the human population there are now what they call “zones” these zones are watched very closely by the surviving government, people are checked every day for the virus, even if you touch the spit or any human waste or fluids of the victim who is infected, you will die. But one day, people in the west zone start to go missing, 1 woman goes outside the walls to uncover the mystery, is there more to the virus than meets the eye?, That is where your story starts.
      This game is not a long development game, I have loads other game ideas,
      I will also allow you to have a bit of creative freedom if you wish to add or share a idea!
      And no, it’s not a zombie game lol I feel like zombie games are too generic, in this game you will encounter terrifying beasts!
      There is some concept art one of our concept artists have made
      If interested email liondude12@gmail.com
    • By Canadian Map Makers
      GOVERNOR is a modernized version of the highly popular series of “Caesar” games. Our small team has already developed maps, written specifications, acquired music and performed the historical research needed to create a good base for the programming part of the project.

      Our ultimate goal is to create a world class multi-level strategic city building game, but to start with we would like to create some of the simpler modules to demonstrate proof of concept and graphical elegance.

       

      We would like programmers and graphical artists to come onboard to (initially) create:

      A module where Province wide infrastructure can be built on an interactive 3D map of one of the ancient Roman Provinces.
      A module where city infrastructure can be built on a real 3D interactive landscape.
      For both parts, geographically and historically accurate base maps will be prepared by our team cartographer. Graphics development will be using Blender. The game engine will be Unity.

       

      More information, and examples of the work carried out so far can be found at http://playgovernor.com/ (most of the interesting content is under the Encyclopedia tab).

       

      This project represents a good opportunity for upcoming programmers and 3D modeling artists to develop something for their portfolios in a relatively short time span, working closely with one of Canada’s leading cartographers. There is also the possibility of being involved in this project to the point of a finished game and commercial success! Above all, this is a fun project to work on.

       

      Best regards,

      Steve Chapman (Canadian Map Makers)

       
    • By Scouting Ninja
      So I have hundreds of moving objects that need to check there speed. One of the reasons they need to check there speed is so they don't accelerate into oblivion, as more and more force is added to each object.
      At first I was just using the Unity vector3.magnitude. However this is actually very slow; when used hundreds of times.
      Next I tried the dot-product check:  vector3.dot(this.transform.foward, ShipBody.velocity) The performance boost was fantastic. However this only measures speed in the forward direction. Resulting in bouncing objects accelerating way past the allowed limit.
       
      I am hoping someone else knows a good way for me to check the speed with accuracy, that is fast on the CPU. Or just any magnitude calculations that I can test when I get home later.
       
      What if I used  vector3.dot(ShipBody.velocity.normalized, ShipBody.velocity)?
      How slow is it to normalize a vector, compared to asking it's magnitude?
    • By Ds ds
      Hi, my name is Andres, I'm a programmer with a technician degree and a Diploma in C#, looking for a project in Unity to start my career in game development. I don't do it for a paid but a recognition and start a portfolio, preferably a 2D game. Thanks for read, have a nice day. 
       
    • By Victor Rodriguez
      Hi there! Is the first time that I'm posting here so I'm sorry if I'm doing it wrong ha. 
      So here it comes, my doubt is, I'm doing a game with different levels, each of these levels in one different scene. Each scene contains to cameras that you can change pressing a button. Everything works fine. 
      The only problem is that I would like it to look a bit more professional, and I would like that if you finish the level with camera2, the next level start the same way. I've been thinking about using dontdestroyonloadon both cameras, but obviously this cameras need to be attached to the player to make the movement work, what do you recommend? Sorry If I've explained it in a messy way, and feel free to dm me for anything. Thanks in advance! 
    • By Ike aka Dk
      Hello everyone 
      I am a programmer from Baku.
      I need a 3D Modeller for my shooter project in unity.I have 2 years Unity exp.
      Project will paid when we finish the work 
      If you interested write me on email:
      mr.danilo911@gmail.com
    • By markoal
      Hi,
      I'm Unity developer from Croatia and I'm looking to work on the paid project in my spare time.
      I have 5+ years of experience in Unity and I'm familiar with almost anything, including all platforms (also Switch, PS4 and Xbox).
      Feel free to contact me.
  • Advertisement
  • Popular Now

  • Forum Statistics

    • Total Topics
      631372
    • Total Posts
      2999627
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!