• Advertisement
Sign in to follow this  

Unity Sport management game - what's best for both menu and 2D design?

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

Hi All,

 

I'm an experienced c# (pirmarily winforms) developer. I've built some small sport management games in winforms with the "race" or "game" part just text based like the old football manager games. so there was no need for 2D/3D functionality.

 

Today I'd like to create a new sport management game where I want to represent the race part of the game in 2D.

But I'm not sure at what framework is the way to go. since this is a sport management game I still need to be able to create rich menus where you can see driver stats, chamionship rankings, do contract negotiatons etc... (that part was easy in winforms, but offcourse it's not the way to go if I want to have a nice 2D part as well).

 

So I'm wondering what you guys can recommend me to create my game in, monogame?, unity?, something else?

 

In short: Looking for an environment where I can code in C#, that is good for 2D functionality but also let's me create rich menus for the non-2D part of my game

Share this post


Link to post
Share on other sites
Advertisement
Good question. I'd love to recommend Unity BUT I've found the UI is woefully poor for layout-heavy UIs, with little support for anything beyond the real basic controls. However, they are working on it, for example the list view they announced this week: https://labs.unity.com/article/list-view-framework

Share this post


Link to post
Share on other sites

Good question. I'd love to recommend Unity BUT I've found the UI is woefully poor for layout-heavy UIs, with little support for anything beyond the real basic controls. However, they are working on it, for example the list view they announced this week: https://labs.unity.com/article/list-view-framework

 

Is it possible to create the UI in winforms, and for the 2D part of my game I created it in Unitiy and I run this inside a Unity container or so in winforms? Or do you lose alot of performance this way?

Share this post


Link to post
Share on other sites

I would recommend the c# binding of SFML.  I have used it in conjunction with Winforms before.  You can just throw a control on your winform (I choose a Panel) to represent the area on your form you want to draw the graphics.  You then pass in the control.Handle in when creating a RenderWindow.

 

Then you will override the OnPaint and OnPaintBackground events/functions of your control.  In the OnPaint you will do all your SFML drawing.  In the OnPaintBackground dont do anything (prevent it from painting background of the actual control).  This will redraw when the control detects it needs to like something covering the window then uncovering it.  If you need to continually redraw then you can do something like override the Idle function/event of the Form and call the Invalidate of the control from there to force a redraw.  Or setup a Timer and call invalidate when the Timer fires.

 

 How to use SFML is documented on their website on how to go from there.  No real documentation on the embedded thing but on how to draw with SFML. http://www.sfml-dev.org/

Share this post


Link to post
Share on other sites

Are you planning to stick with Windows PC?  Or are you going to go multiplatform ever?  I haven't used Xamarin, but it might be the way to go, at least for having a rich UI and multiplaftorm.  If not, then I agree with most folks here, mix WinForms with something else.  That said, WinForms has a certain dated look to it, and doesn't handle a lot of things that it's successor XAML / WPF does.  Like DPI.  Though it can be a bit intimidating to dive into a new language/technology and make a new game.

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 Manuel Berger
      Hello fellow devs!
      Once again I started working on an 2D adventure game and right now I'm doing the character-movement/animation. I'm not a big math guy and I was happy about my solution, but soon I realized that it's flawed.
      My player has 5 walking-animations, mirrored for the left side: up, upright, right, downright, down. With the atan2 function I get the angle between player and destination. To get an index from 0 to 4, I divide PI by 5 and see how many times it goes into the player-destination angle.

      In Pseudo-Code:
      angle = atan2(destination.x - player.x, destination.y - player.y) //swapped y and x to get mirrored angle around the y axis
      index = (int) (angle / (PI / 5));
      PlayAnimation(index); //0 = up, 1 = up_right, 2 = right, 3 = down_right, 4 = down

      Besides the fact that when angle is equal to PI it produces an index of 5, this works like a charm. Or at least I thought so at first. When I tested it, I realized that the up and down animation is playing more often than the others, which is pretty logical, since they have double the angle.

      What I'm trying to achieve is something like this, but with equal angles, so that up and down has the same range as all other directions.

      I can't get my head around it. Any suggestions? Is the whole approach doomed?

      Thank you in advance for any input!
       
    • By khawk
      Watch the latest from Unity.
       
    • By GytisDev
      Hello,
      without going into any details I am looking for any articles or blogs or advice about city building and RTS games in general. I tried to search for these on my own, but would like to see your input also. I want to make a very simple version of a game like Banished or Kingdoms and Castles,  where I would be able to place like two types of buildings, make farms and cut trees for resources while controlling a single worker. I have some problem understanding how these games works in the back-end: how various data can be stored about the map and objects, how grids works, implementing work system (like a little cube (human) walks to a tree and cuts it) and so on. I am also pretty confident in my programming capabilities for such a game. Sorry if I make any mistakes, English is not my native language.
      Thank you in advance.
    • By Ovicior
      Hey,
      So I'm currently working on a rogue-like top-down game that features melee combat. Getting basic weapon stats like power, weight, and range is not a problem. I am, however, having a problem with coming up with a flexible and dynamic system to allow me to quickly create unique effects for the weapons. I want to essentially create a sort of API that is called when appropriate and gives whatever information is necessary (For example, I could opt to use methods called OnPlayerHit() or IfPlayerBleeding() to implement behavior for each weapon). The issue is, I've never actually made a system as flexible as this.
      My current idea is to make a base abstract weapon class, and then have calls to all the methods when appropriate in there (OnPlayerHit() would be called whenever the player's health is subtracted from, for example). This would involve creating a sub-class for every weapon type and overriding each method to make sure the behavior works appropriately. This does not feel very efficient or clean at all. I was thinking of using interfaces to allow for the implementation of whatever "event" is needed (such as having an interface for OnPlayerAttack(), which would force the creation of a method that is called whenever the player attacks something).
       
      Here's a couple unique weapon ideas I have:
      Explosion sword: Create explosion in attack direction.
      Cold sword: Chance to freeze enemies when they are hit.
      Electric sword: On attack, electricity chains damage to nearby enemies.
       
      I'm basically trying to create a sort of API that'll allow me to easily inherit from a base weapon class and add additional behaviors somehow. One thing to know is that I'm on Unity, and swapping the weapon object's weapon component whenever the weapon changes is not at all a good idea. I need some way to contain all this varying data in one Unity component that can contain a Weapon field to hold all this data. Any ideas?
       
      I'm currently considering having a WeaponController class that can contain a Weapon class, which calls all the methods I use to create unique effects in the weapon (Such as OnPlayerAttack()) when appropriate.
  • Advertisement