Jump to content
  • Advertisement
Sign in to follow this  
Simagery

Unity What gamedev can learn from the web

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

I've been wrestling recently with crafting a framework for gamedev. One of the things that struck me was how awkward it was to prototype ideas quickly. I found this to be an incredibly odd aspect of a creative medium. I spend a lot of time doing web dev stuff for fun (used to professionally), and it struck me that HTML/etc. is a very prototype-friendly context for development. In fact, I started thinking about how the current "web 2.0" model has all of the aspects of gamedev: structure (XHTML), behavior (javascript), aesthetics (CSS). I thought, why is there no equivalent in gamedev? Some may suggest that there is: game engines. But that's not quite it. Game engines would be the equivalent of a CMS app in webdev (Blogger, Wordpress, GoLive, etc.) Game engines are pre-defined structures in which you pump content. That's not what I'm looking for. I'm thinking of something more like XAML, but directed at games. I would think this would be incredibly useful as a large aspect of gamedev is interface design (as an extension of interaction design), and markup languages have proven themselves to be very applicable to this job -- or at the very least, there's a lot of intuition out there due to their use on the web. With the "web" model (for lack of a more appropriate term), you have the classic three components: HTML/CSS/DOM. HTML defines structure, CSS defines "look-n-feel" or aesthetics, and the DOM represents programmatic manipulation, i.e. behavior. So, the model is structure/aesthetics/behavior. This, to me, feels fairly complete as it maps very cleanly to a proven architecture: model/view/controller. Hmm... I need to give this some more thought as I'm really just making stuff up as I write... I'd be very interested in hearing what other folks out there have to think about this, though.

Share this post


Link to post
Share on other sites
Advertisement
I think SHilbert has been looking into the Model/View/Controller pattern as a means of game development.

Share this post


Link to post
Share on other sites
I've talked a lot about using MVC for gamedev, but I'm more interested in the actual tools for implementing that pattern. Namely, an XML-like language for strucutre, a CSS-like language for aesthetics, and a javascript-like language for behavior. Something along the lines of XML/OpenGL/Python or something...

Share this post


Link to post
Share on other sites
Quote:
Original post by Alpha_ProgDes
could you consider a scripting language (python, lua) to be a controller?


Yes, definitely. A scripting language (or even compiled code) is used to author the game's behavior, which is equivalent (in part) to the controller in the MVC model. Of course, behavior is also an aspect of the model as well (simulation), so what I'm talking about isn't a strict 1-to-1 correspondance with MVC.

Share this post


Link to post
Share on other sites
Quote:
Original post by Simagery
Quote:
Original post by Alpha_ProgDes
could you consider a scripting language (python, lua) to be a controller?


Yes, definitely. A scripting language (or even compiled code) is used to author the game's behavior, which is equivalent (in part) to the controller in the MVC model. Of course, behavior is also an aspect of the model as well (simulation), so what I'm talking about isn't a strict 1-to-1 correspondance with MVC.


it seems like the most simplistic view is: programming languages, graphics api, scripting languages

Share this post


Link to post
Share on other sites
Quote:
Original post by Alpha_ProgDes
it seems like the most simplistic view is: programming languages, graphics api, scripting languages


I'm not looking for the most simplistic view. What you listed are all elements to the implementation of what I'm looking for. To further elaborate:

There are several major divisions to the work that goes into developing a game. These divisions are nearly orthogonal (though games are a callobrative medium, so not completely orthogonal in the mathematical sense).

First, you have the "gameplay" or the model of the game. This would be the rules, the tokens, the verbs and nouns, the simulation that constitutes your game. This is the part of the game that can be designed as a board game (however tedious it may be to play) and can be described completely in a design doc.

Second, you have the representation of the game, the view onto the gameplay. This is an incredibly important aspect of electronic games. In traditional board games, the view was closely tied to the model due to the practical limitations. It's not fun to move around stuff that doesn't have any gameplay impact. In electronic games, we have a lot of "view" or aesthetics to the game that aren't directly related to the gameplay model, or simply provide "softer edges" on the underlying gameplay model.

Finally, you have the player-computer interaction, the controller for the gameplay. This is where the interaction between user and game is defined and implemented. This is another area where electronic games differ quite a bit from traditional board games. Automation can be introduced into the interaction, which allows gameplay where, for example, hundreds or thousands of soldiers can be moved independently with little effort (whereas a board game would require an incredible amount of tedium to accomplish the same end results).

Now, what I just described is a decomposition of a game into a Model/View/Controller pattern. I've seen elsewhere that some game academics have labelled this, in the context of game design, as Dynamics/Aesthetics/Mechanics. The Dynamics/Aesthetics/Mechanics suggestion is new to me, so I'll continue to use the MVC pattern as I'm more comfortable with its connotations.

The web is a different medium, one resulting primarily from the goal to present information. Interaction is not a fundamental, defining characteristic of the web, though it is largely becoming a critical element of "web 2.0." Regardless of fashion, though, the web is not defined by interactivity in the same way that games are defined by interactivity.

The webdev circles, particularly those in the "semantic web" camp (of which I'd count myself), like to decompose a webpage into three components: HTML, CSS and DOM, or roughly, structure, styling and behavior. I'm seeing some interesting parallels with what I want to do when developing (or at least prototyping) a game.

Structure is quite clear: games, as beasts of interactivity, are necessarily "software programs" and thus benefit from well-defined structure. More specifically, games have well-defined states and logical organization, even if it's as simple as Menu -> Game -> Scores. That would be a good example of the temporal structure of the game, but there's also the obvious spatial structure of the game, both screen relative (high score in the top-left corner, current score in the top-right corner, gameplay in the background) or gameplay relative (a house here, a road here, a car parked here, the bad guy is in here).

Styling, or aesthetics, is the difference between Wolfenstein 3D, Doom, and Doom 3. Or, more critically to the development phase, it's the difference between placeholder art with a diffuse shader and finished models with normal-mapping goodness.

And behavior, well, that's the interaction in the game, the give-and-take between user and computer simulation. Everything from the actual ruleset being played out to the way a unit is moved from point A to B or how a widget in the UI reacts when clicked.

And this raises an interesting deviation between the web model and the game model. The web model isn't focused on what would be considered the server-side, or backend, of websites. It's primarily focused on the presentation and interaction with the user. For gamedev, the model would need to be a slight hybrid that would incorporate the backend and the frontend into a cohesive whole. As a result, you'd have structure and behavior intermingled at both lower and higher levels of the design.

Again, just some more thoughts, all being made up as I go...

Share this post


Link to post
Share on other sites
I'm actually concerned with the difficulty of prototyping stuff. The MVC stuff Ravuya mentioned was more tied to doing stuff like networking and persistence (e.g. doing it at the model level and having the display be just a 'filter' or 'view' of the model info.) I think it (or something like it) could offer some benefits for prototyping, though.

Basically, your game world would be "domain model stuff" (e.g., World, Player, Enemy, Item, Weapon, etc.) and rendering would just be a "styling" of that information (of course, the trick is making it efficient so you're not just looping through every single thing in your game model each frame.) So, conceivably your game *view* could just be a hierarchal property/value dump, or a very skeletal stick-person/debug art/whatever view, and the game code itself would be fairly agnostic of that.

Anyway, the interesting thing is that if you could work on the stylings independent of a running game, you could develop the style for "drawing an enemy of type X" entirely separate from an actual running model of that enemy type; you could develop the style itself while running it off dummy data that just conforms to the same basic interface as a "real" game entity.

Anyway, I'm sure this is all very vague, and I'll try and organize it after I get some sleep, but it's definitely something to think about. Getting gameplay up and running ASAP (ideally with code you won't have to throw away later) is really important to any project.

Share this post


Link to post
Share on other sites
Quote:

I'd be very interested in hearing what other folks out there have to think about this, though.


Web apps have grown from two basic bases. The first is a simple, extendable networking protocol. The second is a common, dead-simple client rendering engine. The sheer variety and demand of modern video games means that even basic infrastructure such as this cannot be simple and ubiquitous. Simple and ubiquitous barely supports things as simple as static webpages.

Personally, I'm looking for someone to create a rule modelling language that is as expressive for gameplay states as regular expressions are for text description.

Share this post


Link to post
Share on other sites
Quote:
Original post by SHilbert
I'm actually concerned with the difficulty of prototyping stuff...


Yeah, I'm definitely more interested in the prototyping aspect, or what I'd consider "lightweight" game development.

Quote:

Basically, your game world would be "domain model stuff" (e.g., World, Player, Enemy, Item, Weapon, etc.) and rendering would just be a "styling" of that information (of course, the trick is making it efficient so you're not just looping through every single thing in your game model each frame.) So, conceivably your game *view* could just be a hierarchal property/value dump, or a very skeletal stick-person/debug art/whatever view, and the game code itself would be fairly agnostic of that.


Exactly what I was expressing. For a slightly better formation of my thoughts, I'd point folks over to my blog.

Quote:

Anyway, the interesting thing is that if you could work on the stylings independent of a running game, you could develop the style for "drawing an enemy of type X" entirely separate from an actual running model of that enemy type; you could develop the style itself while running it off dummy data that just conforms to the same basic interface as a "real" game entity.


Yeah, I mention this in my blog post and in the other thread I've got going on a gamedev framework. That's exactly my intent.

Share this post


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

  • Advertisement
  • Advertisement
  • Popular Tags

  • Similar Content

    • By Alexander_Vovk
      Hello Guys!
      Please share your experience, where is it better to find sales manager  specialists for indie team of 6 + people(remotely)?
      Maybe someone has a good experience of cooperation with finding projects through sale managers(USA and Canada)?
        
      In our team more than 6 developers. We are working since 2014 now we are looking for projects mainly on upWork and Unity Connect.
      But that's not enough 
      This is the site of our team https://www.sixteensq.com/             
                                                 https://www.behance.net/Dezignw136f
      Thank you
      Best Regards
      Alex Vovk
      Co-Founder of Sixteen Squares
      Alexander_Vovk@outlook.com
       
    • By JoshuaFraser
      Hi and thanks for reading, I have an issue with this reactive crosshair script, everything works fine until I start changing the offset. Give the script a go and you will see what I mean, when I do SetOffset(0f); it doesnt always set back to the origional state, if anyone can spot a fix I'd be super appreciative!
      using System.Collections; using System.Collections.Generic; using UnityEngine; public class ReactiveCrosshair : MonoBehaviour { [SerializeField] GameObject c_limb_prefab; private float center_offset = 0f; private float current_offset = 0f; private float max_offset = .5f; private int number_of_limbs = 4; private float limb_length = .05f; private float limb_width = .005f; private List<GameObject> c_limbs = new List<GameObject>(); public void SetupCrosshair(){ for (int i = 0; i < number_of_limbs; i++) { GameObject line_go = (GameObject)Instantiate (c_limb_prefab); line_go.transform.SetParent (this.transform); Vector3 limb_pos = new Vector3 (0f,0f,0f); //line_go.transform.position = limb_pos; line_go.transform.localPosition = limb_pos; LineRenderer line = line_go.GetComponent<LineRenderer>(); line.startWidth = limb_width; line.positionCount = 2; line.SetPosition (0, line_go.transform.localPosition + new Vector3(center_offset, 0f, 0f)); line.SetPosition (1, line_go.transform.localPosition + new Vector3(center_offset + limb_length, 0f, 0f)); line.useWorldSpace = false; c_limbs.Add(line_go.gameObject); } if (c_limbs != null) { OrientLimbs (); SetOffset (0f); } } public void OrientLimbs(){ for (int i = 0; i < c_limbs.Count; i++) { float rotation_step = 360f / (float)c_limbs.Count; c_limbs [i].transform.RotateAround (c_limbs[i].transform.position, c_limbs[i].transform.forward, 90f + (rotation_step * (float)i)); } } public void SetOffset(float _current_spread){ float offset = Mathf.Lerp (0f, max_offset, _current_spread); for (int i = 0; i < number_of_limbs; i++) { if (offset > current_offset) { Vector3 pos = c_limbs [i].transform.position + (c_limbs [i].transform.TransformDirection (Vector3.right) * offset); c_limbs [i].transform.position = pos; } if (offset < current_offset) { Vector3 pos = c_limbs [i].transform.position - (c_limbs [i].transform.TransformDirection (Vector3.right) * offset); c_limbs [i].transform.position = pos; } } Debug.Log ("SetOffset() offset: " + offset.ToString () + " _current_spread: " + _current_spread.ToString() + " localPos: " + c_limbs[1].transform.localPosition); current_offset = offset; } }  
    • By Erik Nivala
      So, as the title says i am trying to figure out a good way sync all that information with other players in Unity. My problem is that i can't come up with a good solution since i am used to creating classes for everything e.g. attachments are its own class and then the weapon would save a reference to that attachment. But since you can't send custom classes over [Command] & [ClientRPC] i am a little stuck. A solution for this would be giving each attachment for a slot a unique ID and then passing the ID to other player but i feel like that is very error prone if other ppl add a new attachment or the IDs get mixed up.
      Is there a "standard" way that this is usually done that i am missing?
      I am fairly new to programming so any help is appreciated!
    • By MintyLyton
      I'm looking for any team / people that need a programmer for their project. I'm looking to expand my portfolio which you can see Here. I'm more experienced with Unity but I can spend the time to learn new Engines if that's your preference. I have worked on Unreal Engine 4 before but I might take some time to re-learn it, if the project requires it. Feel free to DM here or use the contact info on my website. 
    • 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?
  • Advertisement
  • Popular Now

  • Forum Statistics

    • Total Topics
      631383
    • Total Posts
      2999680
×

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!