Using unity as a render engine for 2D games - c#

Is it possible to use Unity as a render engine? I have a game which is written in C# and I would very much want to rewrite it to use Unity because of it's portability and use of C#. The game itself is a 2D maze game (think Pac-man).
I read alot of tutorials for using Unity for 2D games but all of them used almost only menus and editors which embedded in Unity and used only small portion with C# or other programming language. If I'm going to go down this road it means I need to "rewrite" my whole game logic with Unity's editors/menus/managers etc...
I'm looking to use it like the XNA library for example. Is there any way to achieve that with Unity? If not, is there another game engine/library using C# which is cross-platform and canm be run under mobile devices?

I made Fangz (https://www.youtube.com/watch?v=x6-5D6IkD5E) using Unity. If that doesn't prove that a complex 2d game can be made in Unity, I don't know what does :).
You can use Unity like XNA, but that would deny you from Unity's strengths. Once you get used to visualising your member variables in an editor in a custom way (via inspector editor scripts) it'll be hard to go back :).
Furthermore Unity now has native 2d support, which is as good is not better as 2d Toolkit, once of the most well designed 2d packages I've had the pleasure of working with.
Another advantage of Using Unity is that you'll be able to easily add animations to your 2d game. Just add an animation component, press record and move.
All in all I find myself thinking the other way around: how can anyone do a 2d game in anything other that Unity :).

Related

Why is MapBox lagging in Unity VR?

I am trying out the MapBox SDK for Unity.
https://www.mapbox.com/unity/
This provides a 2D map where you can zoom in and out to preview
different levels of detail.This honestly works like a charm.
I am trying to get this 2D map working in Virtual Reality.
The only problem is that it is lagging since the VR camera moves a
lot.
I am using either SteamVR Player or CameraRig.
Does someone know how to improve the MapBox performance for Virtual Reality?
At this point, my unity is just freezing.
I am looking forward for any advice / insight

Unity for 3D Simulation?

My team currently needs to create a visual simulator for some track hardware that we have.
We tried using X3DOM, but the amount of data we were sending it proved to be more than it could take. (I ended up refreshing every 3 seconds.)
We are currently looking for a replacement that can handle a fairly significant input stream.
Unity 3D came up as a possibility. However, I know that it is usually used for games.
I will not need any kind of Physics Engine or other similar features.
I will feed all the coordinates into it and then want it to show these objects moving on a track too the coordinates I specify.
Does unity fit for that?
Yes, you can input those coordinates in Unity and then track those objects. My team is currently using Unity3D for something similar and we input complex data structures with pose matrices, etc..
You can import your 3D objects into Unity as well. I import .obj into Unity.

What is the best template to use in C# Visual Studio 2008 for a 2D game?

Is it WPF? WFA? A custom template?
I currently use WFA, and it just doesn't seem anywhere near optimal. And no, I'm not asking for a referral to DirectX, or another language.
Thanks.
Do you want it to be really 2D, or you you want a "2.5D" game where 3D objects move in 2D?
For most basic 2D, like turn-based games or simple animation where very fine human input control is not necessary, the System.Drawing tools used in a WFA will probably be fine. You have access to a lot of the tricks, like using small images as sprites, rendering vector graphics, as well as the must-have elementary shape-drawing functions. You can use Image objects like Bitmaps to simulate page-flipping (create a Bitmap, draw the shapes on it, then call Graphics.DrawImage()), or simply use SetRedraw(false) on the control you're using as the Graphics pane to freeze what's there while you're drawing the next window.
WPF has some tools that are a major leap forward. Look at the System.Windows.Media.Media3D namespace; it has tools for 3D vector algebra and geometric primitives, allowing you to create 2.5D games with vertex shading and all the tricks. The basic structs can be referenced and used for their mathematical power, or you can build a WPF application that will integrate them into a graphics pane. You'll have to research this yourself; I'm a lightwight with WPF.
If you want your game to really get some FPS, you're going to have to use an accelerated platform like DirectX. XNA Game Studio is a free .NET-compatible API that wraps a lot of the DirectX functionality, allowing you to create .NET apps with accelerated graphics without requiring messy native code hookups. Creating and running apps on just about any .NET-compatible platform (including Windows) is free; you have to pay a fee and join the "XBox Creator Network" to publish even free games for XBox 360.
XNA, and the Box2D.XNA physics engine if your game requires 2D collision detection and physics. XNA takes care of hiding all that crazy DirectX stuff from you. It has a great content pipeline, which lets you add content to your game very easily. My favorite framework for small games.

XNA C# 2D Platformer Game

I'm trying to make (figure out how to..) a 2d platformer in XNA.
I know how to create a tile grid and how to perform collision detection.
I perform collision detection on the 9 bounding tiles of the player, but I'd like to know if there's a better way to perform collision detection.
I've read Braid doesn't use tiles but pieced images or something, how do you perform collision detection on those? and is that better than using tiles?
Assuming you don't mind using a third party tool to do the majority of the work for you, you may be better off using something like Box2D for C#.
http://www.box2d.org/
http://code.google.com/p/box2dx/
This library will give you collision detection and physics capabilities.
If you're going for a retro style then it's certainly fine to use tiles! However, if you want something more "modern", then you can go with a more conventional physics engine. Farseer Physics is a great engine, and several people have used it to make platformers. It's based on Box2D and similar engines, but offers a simpler API and several unique features (like texture to geometry) and i myself can testify to it's niceness having played around with it a bit.
You probably need a bit more than collision detection for a game like Braid. I would assume that you also need a physics engine. I would recommend that you take a look at Farseer Physics engine, which is 2D engine that works very well with XNA. It supports a number of different techniques for collision detection.
Have you checked the examples in the collision serie on the XNA creators club, in particular the pixel-collision sample?

Silverlight C# Game or Graphics Engine?

Are there any good C# Silverlight Graphics or Game engines currently? I am planning to create a game with it (either 2d or 3d) but are there already usable frameworks or should I expect to have to build everything myself?
At the moment, probably the most well known graphics engine is:
Balder
Managed GameEngine with both 2D and 3D
support targetting Silverlight 2/3,
Xna and OpenGL.
There is also:
Kit3D
Kit3D is a 3D graphics engine for
Microsoft Silverlight.
As far as Game Engines go, there is:
PlayBits Engine
Although PlayBits is not yet available, and will not be free.
If you're targeting both XNA and Silverlight for 2D games you can use the SilverSprite library at http://silversprite.codeplex.com and it may also be useful if you're used to a traditional game loop and draw calls.
For simple games it is fairly easy to make you own game Silverlight game engine. This tutorial here shows you how to get started.
Probably the most enhanced 3D engine for Silverlight so far is Silvermotion
It has some quite impressive demos and looks more like a high tech DirectX engine than the usual stuff and runs quite well.

Categories