C# and Unity for 2D Side Scroller

Started by
15 comments, last by Eck 7 years, 11 months ago

Good Evening All,

Firstly, I'm new here - so Hi All :) I'm Alex, from London.

I am a developer by trade (for the last 15 years), however I write boring-business and database type software and Windows Services in C# and the like - so whilst I am not new to Programming, I am very very new to Game Development.

I understand the theory of the gaming loop and such, and have implemented very very basic stuff in C# but thwarted by the way it renders graphics, and the dreaded flickering - even if I blit the image its still not cool.

So this brings me on to using an engine (I Think? Correct me if I'm wrong)

i want to write a 2D side scroller (think Super Mario for the NES) for a Windows Platform. I am going to buy the assets - I've found cheapy pleasnt looking ones where by the each action is between 3 and 12 frames (walking is 12 frames, dying is 3). Any, I am getting ahead of myself. That's the background.

In short, how do I do this? Is Unity a suitable engine? In fact how do engines work - do I still use Visual Studio? Does unity integrate with Visual Studio or do i do all programming within the Unity environment.

Finally, can anyone recommend a good up to date book on the matter?

I am really only interested in 2D game programming as its purely a hobby and not a career move. And I am rather nostalgic about such - I might like to branch out in a old fashioned command and conquer type game... one day.

Any thoughts guys?

Cheers

Alex

Advertisement

LINK for Unity 2D .

I cannot remember the books I've read any more than the meals I have eaten; even so, they have made me.

~ Ralph Waldo Emerson

When using Unity you will work in the editor as well as Visual Studio. In the editor you place your Assets and build your Level. Also you can create C# Scripts and attach them to your objects. In Visual Studio you then write your Code.

Unity can do this, but if you are truly only interested in 2d, you may be better suited to GameMaker: Studio. It is more geared to 2d and has more features suited for 2d that Unity does not have, including a multi-layer tile system, 2d pathfinding, and others. But the caveat that exists is if you are ever going to be interested in anything beyond straight up 2d, you may as well have spent the time working with Unity. GMStudio is basically crap for 3d. If your 2d games want any 3d elements, you are going to suffer in GMStudio.



Unity can do this, but if you are truly only interested in 2d, you may be better suited to GameMaker: Studio. It is more geared to 2d and has more features suited for 2d that Unity does not have, including a multi-layer tile system, 2d pathfinding, and others. But the caveat that exists is if you are ever going to be interested in anything beyond straight up 2d, you may as well have spent the time working with Unity. GMStudio is basically crap for 3d. If your 2d games want any 3d elements, you are going to suffer in GMStudio.

He could also look into godot engine, opensource, free and has dedicated 2d & 3d so if he did want to focus on 3d at some point its open for him without limiting him in 2d games.

Unity can do this, but if you are truly only interested in 2d, you may be better suited to GameMaker: Studio. It is more geared to 2d and has more features suited for 2d that Unity does not have, including a multi-layer tile system, 2d pathfinding, and others. But the caveat that exists is if you are ever going to be interested in anything beyond straight up 2d, you may as well have spent the time working with Unity. GMStudio is basically crap for 3d. If your 2d games want any 3d elements, you are going to suffer in GMStudio.

He could also look into godot engine, opensource, free and has dedicated 2d & 3d so if he did want to focus on 3d at some point its open for him without limiting him in 2d games.

You are quite right there. I don't think GODOT's 2d is advanced as GMStudio's, but it is still a valid point. It is hard to suggest it though simply because it doesn't have the maturity of either GMStudio or Unity, but the really big advantage is the open source, total freedom part, which neither of the other two can claim.



?

Unity is overwhelmingly superior to GM in my opinion. You have more to learn with Unity, but that's only because much more is made available to you.

Additionally, Unity's tutorials are more comprehensive.

I am curious about why OP had trouble rendering in 2D though. Were you trying to use GDI or something? If so then maybe take a look at Monogame as well.
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

?

Unity is overwhelmingly superior to GM in my opinion. You have more to learn with Unity, but that's only because much more is made available to you.

Additionally, Unity's tutorials are more comprehensive.

I am curious about why OP had trouble rendering in 2D though. Were you trying to use GDI or something? If so then maybe take a look at Monogame as well.

For the sake of discussion...what exactly is it about Unity that is "overwhelmingly superior" to GM? I'm referring to only the 2d side of things, as I made it quite clear above that for 3d, GM is basically crap. Of course, I can concede the point about the tutorials, but I'm referring to the software itself.



Not having to learn a made up ecmascript variant is a start. The d-n-d editor is a joke if you plan to make anything more complicated than a dead-simple platformer. GM is terribad for working in teams as well, whereas Unity has settings that make it play nice with version control. Unity has nice tools for automating animation via state machines, good physics and collision that can be fine-tuned as you desire, and works with external editors so you can code in your own environment. The component-styled UI is powerful, and the way it exposes public script members so they can be edited from the UI - even during debugging - is great. The canvas system is more powerful for making and tweaking in-game menus and HUD elements. Unity supports custom shaders without tomfoolery. Both support a kind of object hierarchy, but Unity's is similar to a scene graph, which ends up being much more convenient.

Unity also has never decided to simply disable previous PAID versions of their software, leaving people stranded and unable to continue their work unless they upgrade to the new version and deal with the massive slew of breaking changes involved in that process.

GM can be used as a tool for people that are code-phobic so that they can overcome that phobia, and it's decent for prototyping, but for serious projects I'm just picturing hours upon hours of opportunity cost.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

Not having to learn a made up ecmascript variant is a start.

Ironically, Unity does include an (optional) made up ecmascript variant! :lol: :P

On topic, but just anecdotal: I know dozens of local indie studios that use Unity, but none that use GM.

This topic is closed to new replies.

Advertisement