Super cool. I played around with adding a filter effect, e.g. pixelate, to the global snapshot.
I too am a little confused. Don’t get me wrong, it’s all very impressive work - but if you’ve got the technical know-how to do this sort of stuff, then why not just use Unity and not have to worry about making your code super-efficient just to get a half-decent framerate with SNES graphics?
Just remember if you are applying pixelate to a snapshot, you are likely better off creating a smaller snapshot and just enlarging it onscreen - this way you don’t need the over head of the filter, and you actually speed things up as you are asking for lower fill-rate. See my section about pixelate here, about 1/4 of the way down the document: https://docs.google.com/document/d/168-Rp86pioZM-e0QM0GBb2eeBUasXAHPYm-iGu1xjLI/edit?usp=sharing
I should point out that if you are distorting the overall snapshot first, then my suggestion likely won’t have the intended effect. Just realised that and I will test it out and add it to the above doc to alert people to this!
Why bother creating 2D games when the biggest selling games are nearly always 3D behemoths?
Firstly there’s the sense of a challenge, secondly there’s the question of whether 3D actually benefits some genres - I personally prefer old-school SNES Mario Kart to any of the subsequent 3D versions.
G2.0 gives us the technology and freedom to do this kind of game, something that just wasn’t possible beforehand - so surely that’s a good thing? The advent of technology doesn’t necessarily deem all games to the dustbin of time - hence the rise in the last few years of retro, pixellated games.
There’s also the fact that to create semi-decent 3D models is a particularly time-consuming task as well.
Perhaps you just need to be an old git like me to appreciate the opportunity to recreate Mode-7 nostalgia?
P.S I’ve just re-found an excellent site on Mode 7 that I remember from a few years back, might be of some use to anybody who’s contemplating it:
I’ve said myself repeatedly that in some sense I am doing a disservice to Corona by releasing this stuff.
Corona isn’t and isn’t ever likely to be a 3D engine.
Why did I do these things? Initially technical curiosity, followed by simply realising *some* 3D stuff is possible. Within limitations you can do fast 3D things, and in some cases, easier than in Unity (Retro Racer is an example of something that would be a pain to code in Unity but a breeze here. Dungeoneer is a sort of ‘meh’ case, because while the scenery itself is really rather easy to do, monsters and their animation will be annoying as they’ll use a lot of VRAM.
And mode 7? Well, who doesn’t have a soft spot for it? For the sake of an evening’s coding, I see no harm in it, as long as people don’t start wanting too much - I’d never recommend Corona for a full 3D environment naturally.
There’s also a lot to be said about being comfortable in an environment. Being able to add simple 3D things into an SDK you already know well is certainly no bad thing, and it seems people agree with me.
Bottom line: If you can do it in corona and it isn’t too complicated, there’s no reason *not* to do it. As far as 3D goes, people just need to plan according to what is possible, and be honest about it to avoid running into problems later on when you ask for something beyond the means of Corona.
What about my question? How to add objects on the track?(Trees, signs, etc.)
What you’d need to do is come up with a calculation that converts from the 2D coordinates of the Tiled level, via the 3D transform of the snapshot, back into a pair of 2D screen coordinates.
Normally this wouldn’t be too tough to achieve, but since I hacked this code together it isn’t gonna be really easy.
If I get time next week I’ll update the demo to use proper 3D transforms, which would make it easier to calculate.
Very nice indeed! Your other demos also look very nice, especially with threes in the car-demo. Are those threes flat 2D or do you model them as textured surfaces?
The reason I ask is that I have been planning a game in which threes and plant modeling would be necessary to get it going. Leaves are always a problem (you kind of end up with too many textures), so it hasn’t been possible in Corona.
What is you impression with respect to performance as for zooming in on objects? (E.g. driving towards them). In pre-graphics 2.0 it is very slow, especially for large objects.
Best,
Renato
PS: I used to make 3D games in the old days were 3D->2D transforms were the “normal way”. I don’t see why you have to go both ways as you could keep all the game mechanics in the 3D universe and only use the 2D transform for showing things on screen?
Zooming large objects isn’t much fun (and yes the trees are just a 2D image). I took out most of the overhead banners in the racing demo because up close each one was essentially a full screen or bigger sprite.
Trees get pretty big, but since they are never in the road, they get clipped and culled which helps a great deal.
For this demo you’d want to go 2D->3D->2D because the base information isn’t in 3D - it is a 2D Tiled map.
So what people would need is a way to take a 2D point in the Tiled level, and end up with a 2D point in screen space (but with a third component - the depth in 3D space so they would know how much to scale the object and how to depth sort).
So you’d go:
2D->3D (Tiled level position to 3D position on the road in perspective)
3D->2D (The 3D position to screen coordinates)
cool demo, but
I don’t get the benefit of emulating 3D in a 2D projection of a real 3D environent, besides retro mode7 coolness.
Isn’t it more complicated to manage all the perspective transformations instead of using a z-Buffer?
I too am a little confused. Don’t get me wrong, it’s all very impressive work - but if you’ve got the technical know-how to do this sort of stuff, then why not just use Unity and not have to worry about making your code super-efficient just to get a half-decent framerate with SNES graphics?
Why bother creating 2D games when the biggest selling games are nearly always 3D behemoths?
Firstly there’s the sense of a challenge, secondly there’s the question of whether 3D actually benefits some genres - I personally prefer old-school SNES Mario Kart to any of the subsequent 3D versions.
G2.0 gives us the technology and freedom to do this kind of game, something that just wasn’t possible beforehand - so surely that’s a good thing? The advent of technology doesn’t necessarily deem all games to the dustbin of time - hence the rise in the last few years of retro, pixellated games.
There’s also the fact that to create semi-decent 3D models is a particularly time-consuming task as well.
Perhaps you just need to be an old git like me to appreciate the opportunity to recreate Mode-7 nostalgia?
P.S I’ve just re-found an excellent site on Mode 7 that I remember from a few years back, might be of some use to anybody who’s contemplating it:
I’ve said myself repeatedly that in some sense I am doing a disservice to Corona by releasing this stuff.
Corona isn’t and isn’t ever likely to be a 3D engine.
Why did I do these things? Initially technical curiosity, followed by simply realising *some* 3D stuff is possible. Within limitations you can do fast 3D things, and in some cases, easier than in Unity (Retro Racer is an example of something that would be a pain to code in Unity but a breeze here. Dungeoneer is a sort of ‘meh’ case, because while the scenery itself is really rather easy to do, monsters and their animation will be annoying as they’ll use a lot of VRAM.
And mode 7? Well, who doesn’t have a soft spot for it? For the sake of an evening’s coding, I see no harm in it, as long as people don’t start wanting too much - I’d never recommend Corona for a full 3D environment naturally.
There’s also a lot to be said about being comfortable in an environment. Being able to add simple 3D things into an SDK you already know well is certainly no bad thing, and it seems people agree with me.
Bottom line: If you can do it in corona and it isn’t too complicated, there’s no reason *not* to do it. As far as 3D goes, people just need to plan according to what is possible, and be honest about it to avoid running into problems later on when you ask for something beyond the means of Corona.
This is great addition to my toolkit. The more tools in my box the more creative my solutions can be. I needed a small 3D embellishment for one of my apps and was playing around with ray casting but this is much more simple (and better looking than my current solutions). Thanks for sharing!
Jonathan
This is great addition to my toolkit. The more tools in my box the more creative my solutions can be. I needed a small 3D embellishment for one of my apps and was playing around with ray casting but this is much more simple (and better looking than my current solutions). Thanks for sharing!
Jonathan
Has anyone figured out how to add objects to the track? such as trees/signs/buildings?
I’ve been playing around with the code for awhile and am having difficulty adding objects to the world, they end up flat on the tiles.
Any help would be great!
I think you’d have to do it differently ; your Mode7 tiles are flat projected, your sprite images are projected using the same positional calculations but are sprites scaled for distance - for simplicity they might look the same from any direction.
Did you know ; the first “Mode 7” console was built in the early/mid 1970s, but never released ?
Do you have an example of how to do that using the Mode7 Demo? I’ve been trying but have had no luck.
No, I haven’t ever played with it.
The hard bit is figuring out where the bottom middle of each tile is. For simplicity, initially, you would want to put each object in the centre of each tile. This probably is in the Mode 7 code somewhere. Then you have your sprite image - a tree say - arrange this so its anchor point is at the middle bottom and move it to the position on that tile, scaling it by perspective distance based on the 3D coordinate not the mapped 2D one. This might well be extractable from the tiles 2D coordinates, this tile’s display size should be scaled the same as the objects on it pretty much - tiles further away are smaller too.
Visibility of objects could be done using visibility of tiles - if you can see a tile you can see an object on it. Not 100% accurate, but probably good enough.
Objects would probably look the same from any direction. If you wanted to have something like (say) cars spinning as on Mario Kart, it would be easier to do this as a sprite that is animated to look that way rather than actually trying to do real 3D calculations.
Have a look at https://www.youtube.com/watch?v=n5luQlkfWhI which is a run through of the 1982 Vectrex game “Dark Tower” or https://www.youtube.com/watch?v=hF0Cd-aKIWM (the 1983 Sinclair Spectrum game “Death Chase”) - these are both examples of fake 3D gaming produced in this sort of fashion. What you want to do is take this approach and put it on top of the Mode7 graphics. Corona would look much better as its a bit more powerful than a Speccy or a Vectrex
The Mode7 demo is awesome, but there’s a degree of practicality in it. If you really want 3D, something more than (say) Mario Kart or Wolfenstein or Knight Lore, but real 3D, Corona is (at present) the wrong tool, for all its many strengths as a 2D tool.
Those are some good examples!
I finally figured it out myself, after playing around with code for hours lol. Now I have the ground plus Objects that give off the appearance of true 3D, and my whole faux 3D world is setup, never thought I would be able to do this with corona!
Thanks for the input.