- Home /
Making a room from image for a 2D game
bit of a weird question i know but what would be the best way to make a room with a 2D image as a reference as as actual object and the transparent color would be your area where u can move or something. otherwise would would be the simplest way to make a room for a 2D game if possible without using any 3D tools like blender cause im not great at em.
This sounds like an exercise in photogrammetry (= deducing 3D geometry from 2D images). Photogrammetry is a science that concerns itself with recovering depth information. Beware that this can quickly become pretty advanced stuff if you want it to work in arbitrary cases, but you can implement simple stuff if you allow yourself some basic assumptions. What are the 2D images like?
Actually, the recommendation then would be to do it in SketchUp, but I suspect he's not taking about that sort of reference image.
well SketchUp might help i think, im just wondering wats the easiest way to go at this; im guess making collisions from of 2D image would be too hard. i havent made the image yet but it was thinking if it was possible to draw the entire room(1 image) which isnt that big, and use some kind of colliders where the image isnt transparent. room can be something like this: http://videogameblogger.org/wp-content/uploads/2010/07/gravity-crash.png (collide on blue walls and rest is free area)
Answer by genetixsparkz · Aug 21, 2011 at 01:57 PM
height maps are INCREDIBLY easy to make.
watch this video
and the rest of course
basically you import a picture of what your level looks like in photoshop, you create a layer and draw right over the features only with color, you still get to see the image as your drawing so its basically put your mouse over the wall, ok now click, i have no artistic talent whatsoever but if you can draw a stickman you can make a good looking heightmap with some effort.
other than that yea of course you just make all terrain cause an on collision test, collision kills
Answer by genetixsparkz · Aug 20, 2011 at 10:42 PM
do you actually have to make it 2d? would the apperance be enough?
if you went into photoshop and imported an image like that, then made all collision edges a little less than solid black, the rest of the image solid black, you'd have a heightmap you could import for terrain where if you were careful you could basically make each edge like a 1 inch tall little wall that viewed directly from above would look like it was flat, (but it wouldnt be)
then if you constrained your players movement so he couldnt move along the depth axis they would run into the wall and you could test for that.
so ur saying i should put up a pic as a reference onto a terrain and raise terrain where i need collisions no? dont rly know how heightmap work, in fact hardly know wat it is.
the players movement doesnt allow u do move along the z-axis so its fine and its a different idea but dunno if thats the way i wanna go cause since its a spaceship(probably xD) it should crash and not stop moving... though; i guess if i set the tag of the terrain as a a death object it might work if the collision work properly. also other reason is the terrain tool in unity doesnt seem like its good for such precise work or maybe i just suck at using it.
i'll look over youtube for heightmaps tutorial so dont worry bout that and thx for the input
Answer by Waz · Aug 19, 2011 at 12:59 PM
Assuming you mean a 2D room, i.e. Plan view or Flatlander view, you could put the image on a Plane and then make a heap of stretched Cubes and manually align them with the walls drawn in the image.
Still sounds pretty painful to me compared to doing it in a modeling program.
cubes wouldnt work since it has odd shapes all over, just that i dont rly have any experience in 3D modeling programs apart from SketchUp which im rather rusty know.
Answer by DaveA · Aug 19, 2011 at 07:18 PM
Your best bet is to hire someone. Maybe you can trade or partner up. But there are some very interesting developments in photogrammetry. Try PhotoFly from Autodesk. It's free. http://labs.autodesk.com/technologies/photofly/
im making a simple indie game and cant afford/want to hire someone right now. and this seems like a bit of a mission to do and this is kinda another step from wat i was thinking; im looking at something much more simpler
yeaa, i just figured by 2011 that there would be something simpler, im sure there's a way cause clearly a lot of 2D games dont use 3D modeling software to do 2D backgrounds, just doesnt make sense. must be a way to convert an 2D image to a mesh to use for colliders, i've seen it b4 im just not quit sure how or where to look at.
I would have figured that by 2011 people would have stopped using 2D graphics for games. ;-) But seriously, it's called Unity3D, so you may have selected the wrong tool. I'm sure 2D game engines have exactly what you're needing.
2D games are awesome :P and im getting used to unity now, i find its the easiest for now + remember if u manage to make something good u can sell it for androids and iphones also which other Engines wont let u do. i've tried other softwares but they arent as good or user friendly as unity