Graphics questions

Hello. I want to build an app but I’m not sure if Corona is what I should be going for. The apps I want to make are with graphics very similar to the ones used in the games “Hop” and “Spiral”. Corona on the other hand is a 2D engine and I’m not sure if I can make an arcade game like the two I mentioned. They aren’t really 3D (?), their graphics are just polished and really good looking, they aren’t too complex. Is it possible to build games like those two in Corona? 
Thanks.

  1. Would you know how to make similar games in another engine?

  2. Hop - Yes, you could make a game like this in Corona.

  3. Spiral - Maybe you could make a game like this in Corona.  It depends on how you approach the art.

PS - When referencing anything (games, etc.) always provide links to save us doing the lookup you already did.

Okay great, this means I’m sticking to Corona. Still, what is the difference between the two examples that makes you say that Spiral could possibly be done in Corona? What type of 3D graphics can it support?

Thanks. 

Corona is not 3D.  

However Spiral could be (and likely was made with a 2D engine (Build Box right?)

The major differences is that Hop is basically shapes that are scaled as they come towards you,  Spiral is simulating the effects of rotating about a point which is much more involved/technical to simulate in 2D.

Spiral has two major factors:

  • Simulate the visuals of rotating, scaling, and layering.
  • Simulate the interaction of a 3D object in a 2D space.

I personally would use a 3D engine to make spiral, but that is because I’m too lazy to pour a lot of effort into such basic looking game that has already been made in multiple variations.

Hop is doable with scaling and the right graphics… Spiral is asking for trouble and will really need something like Unity really

Okay, so Corona is mostly a 2D software? Can it use very simple 3D assets like a small moving/spinning cube?

Corona is purely 2D if you want your game on all mobile platforms.  There is a plugin for iOS for simple 3D using native iOS.

Most people create sprites to simulate 3D.

Riiight… so if I want to make a small cube in Illustrator I will not be able to make it move around? I don’t think sprites is appropriate for this.

@ Alinor

Hi.

What sort of game mechanics do you have in mind? Since you brought up two rather different examples I’m guessing these were only meant to convey the look and feel. What sort of constraints will the objects have on their positions, movements, etc.?

Whatever approach you take is likely to require some math on your end. Are you familiar with any of it? If so, and your game idea is fairly simple, you could get away with just grinding it out and manually placing polygons, meshes, distorted rects, etc. Will there be times when it’s messy to figure out what object is in front? This goes back to the question of constraints, and is more or less the dividing line between “convenient and / or useful” and “necessary” when it comes to a dedicated 3D engine.

Likewise you can slap custom shaders onto rects (which would just be placeholders for the effect) and get decent results, again if you’re willing to do some math. See for instance the various distance functions Inigo Quilez lists here.

(This is the plugin Sphere Game Studios alluded to above. I’ve also recently made something that will draw a batch of triangles onto an image, for some experiments building textures from OBJ files. It’s strictly software rendering with no real optimizations, so I doubt it will scale terribly well, but in a smallish game it might be enough. Anyhow, I’ve yet to submit it as a plugin owing to some stability problems–I think I know when these happen, but not why–but could make desktop previews if there’s any interest.)

The mechanics would be very simple, just a simple cube rotating around, maybe hitting somewhere and breaking apart, just simple stuff really. 

Will there be times when it’s messy to figure out what object is in front? No, not at all.

If Corona cannot handle such stuff could you perhaps recommend an alternative suitable for beginners? I am still going to learn Corona for different apps, but for ones with simple 3D I may be needing something else. 

Thanks. 

Note: It is always a telling sign when a poster uses the word ‘simple’.

This typically means “I don’t know how to do it, therefore it must be easy.”  

Corona can ‘do’ a number of things.  However, 3D anything is not one of them.  

Again, Corona is strictly* a 2D game development platform.  An incredibly functional and poweful one, but still 2D.

* No I’m not counting the features in the aforementioned plugin, just the core features.

I don’t know how to do it yet, but the mechanics behind a rotating cube would really be easy to make. 

I will still be learning Corona for 2D apps, but will also be looking for another alternative with 3D support. Any suggestions and recommendations would be much appreciated. 

Thanks. 

Anything can be “simple” when you know how to do it…

The top two suggestions I’d give you are:

  1. Corona for 2D games.

  2. Unity 3D for 3D games.

Warning: Depending on your experience level, learning to use Unity 3D is a bit of a rough ride.  You’ll need to choose and learn a programming language, learn the ‘Unity game loop’, learn to use the Unity editor, learn the concepts and some mathematics behind 3D (not simple), and then there are all the feeder tools for assets.  i.e. There is a huge load of ‘other stuff’ you have to learn too.

Whatever you choose to do, remember, there is a TON of side knowledge and many other skills involved in making games.

Unless you have a competent and well oiled team,  you are the artist, sound designer, level designer, programmer, tester, business manager, web designer, backend developer (for games with servers), marketer, customer support, publisher, … the list goes on and on.

This is one of the reasons why I tell new developers to start super small and to use Corona.  Corona rocks, and by starting small you can avoid having ‘to know’ or worse ‘to learn’ everything at once.

Final ‘insight’ then I’ll shut up.  Be aware, 3D is not 50% harder than 2D.  It is easily 400% more work.  I’ve done both professionally and written about it (1, 2).  I’m sure others here have too and will back me up.  

You’ve landed in just the right place.  I’d stick with Corona and learn all you can here.  I assure you, you have years of learning ahead of you in the 2D arena alone.

This is quick, so might have mistakes, but demonstrates the basic ideas you’d be dealing with (most of these will show up in some form or another in any engine):

local CX, CY = display.contentCenterX, display.contentCenterY -- Height and radius of our diamond. local Height, Radius = 150, 120 -- Incoming light direction, normalized. local LightDirection = { x = -1, y = -1, z = -1 } local len = math.sqrt(LightDirection.x^2 + LightDirection.y^2 + LightDirection.z^2) LightDirection.x = LightDirection.x / len LightDirection.y = LightDirection.y / len LightDirection.z = LightDirection.z / len -- Vertices of our diamond... the interior points' x and z values will be filled in per update. local verts = { { x = 0, y = Height, z = 0 }, -- top point { y = Height / 2 }, { y = Height / 2 }, { y = Height / 2 }, { y = Height / 2 }, -- interior points { x = 0, y = 0, z = 0 } -- bottom point } -- Which vertices does each face see? local faces = { { 1, 2, 3 }, { 1, 3, 4 }, { 1, 4, 5 }, { 1, 5, 2 }, { 6, 3, 2 }, { 6, 4, 3 }, { 6, 5, 4 }, { 6, 2, 5 } } -- Diffuse color of diamond. local color = { r = 1, g = 0, b = 1 } -- Current diamond object. local Object -- Spin! Runtime:addEventListener("enterFrame", function(event) display.remove(Object) -- throw away the old one, if any -- Find the current angle and use it to position the interior vertices. local angle = event.time \* math.pi / 2300 for j = 2, 5 do local vangle = angle + (j - 2) \* math.pi / 2 -- 90 degree increments verts[j].x, verts[j].z = math.cos(vangle) \* Radius, math.sin(vangle) \* Radius end -- With our vertices ready, let's assemble our faces. Object = display.newGroup() for \_, face in ipairs(faces) do -- Which vertices does this face have? local v1, v2, v3 = verts[face[1]], verts[face[2]], verts[face[3]] -- Take the cross product of two sides. local dx1, dy1, dz1 = v2.x - v1.x, v2.y - v1.y, v2.z - v1.z local dx2, dy2, dz2 = v3.x - v1.x, v3.y - v1.y, v3.z - v1.z local nx, ny, nz = dy1 \* dz2 - dz1 \* dy2, dz1 \* dx2 - dx1 \* dz2, dx1 \* dy2 - dy1 \* dx2 -- Is it facing towards us? (If not, we can't see the face.) if nz \> 0 then -- Put down the triangle for that face. local xmin, xmax = math.min(v1.x, v2.x, v3.x), math.max(v1.x, v2.x, v3.x) local ymin, ymax = math.min(v1.y, v2.y, v3.y), math.max(v1.y, v2.y, v3.y) local cx, cy = (xmin + xmax) / 2, (ymin + ymax) / 2 local tri = display.newPolygon(Object, CX + cx, CY + cy, { v1.x, v1.y, v2.x, v2.y, v3.x, v3.y }) -- Normalize the cross product. local nlen = math.sqrt(nx^2 + ny^2 + nz^2) nx, ny, nz = nx / nlen, ny / nlen, nz / nlen -- How lined up is it with the incoming light direction? (Negated since the cross product points -- out.) The greater the angle (via the dot product), the darker the face will be. local intensity = math.max(-(LightDirection.x \* nx + LightDirection.y \* ny + LightDirection.z \* nz), 0) tri:setFillColor(color.r \* intensity, color.g \* intensity, color.b \* intensity) end end end)

Or render a cube in blender and use that to create a sprite and then import into Corona

Thank you all very much for the answers. Unity is not something I could handle right now, so I’m sticking with Corona, it seems to be the best place to start from. 

  1. Would you know how to make similar games in another engine?

  2. Hop - Yes, you could make a game like this in Corona.

  3. Spiral - Maybe you could make a game like this in Corona.  It depends on how you approach the art.

PS - When referencing anything (games, etc.) always provide links to save us doing the lookup you already did.

Okay great, this means I’m sticking to Corona. Still, what is the difference between the two examples that makes you say that Spiral could possibly be done in Corona? What type of 3D graphics can it support?

Thanks. 

Corona is not 3D.  

However Spiral could be (and likely was made with a 2D engine (Build Box right?)

The major differences is that Hop is basically shapes that are scaled as they come towards you,  Spiral is simulating the effects of rotating about a point which is much more involved/technical to simulate in 2D.

Spiral has two major factors:

  • Simulate the visuals of rotating, scaling, and layering.
  • Simulate the interaction of a 3D object in a 2D space.

I personally would use a 3D engine to make spiral, but that is because I’m too lazy to pour a lot of effort into such basic looking game that has already been made in multiple variations.