Best Approach for Orthogonal Environment

Hello, I’m in need of some advice.



I’m working on a tycoon-eque sort of game. The whole thing takes place ona great big 2d plane which is sliced up into a grid of tiles. The player plops things down on this grid, stuff happens, and hopefully it will be fun. :slight_smile:



Anyhow, I’m new to scene graphs, and I’d like some advice on a good way to approach this.



So, I could have one enormous quad for my plane, however, when I want to do some tile-selection with picking it’s a pain. So, every tile of my game will get a quad, picking becomes trivial. So I’ve decided to have a whole pile of quads.



Now, if this plane starts sprawling, obviously it shouldn’t be all on the same node. Would organizing the tiles (and whatever sprites are sitting on them) into a quad tree of nodes be a good way of doing this?



[edit] Maybe some hack with the terrain system?



Since everybody loves screenshots (well, I do anyway :slight_smile: ) here are some shots of my last attempt at this using C++. You see, it’s just stuff on a grid plane. I was tring to build my own engine at the time, and got frustrated after skeletal animation.



A wobbling stove

Ok to drop thing

Not ok to drop thing



Thanks!

Rob

It’s sort of a question of personal design. Your decision to go with individual tiles instead of a large quad is probably for the best because you will get better lighting results and have an easier time doing picking. As for a quad tree, that’s not a bad idea. You might tweak Terrain as you suggested, but I’d personally roll my own recursive method to systematically plop down tiles in subgroups of subgroups… etc. (Because I’d want the control and to avoid any potential legacy issues - whatever those might turn out to be.)



Sorry if that’s not much help. I generally try a few PoCs on different approaches and then build off the best one.

"renanse" wrote:
... I'd personally roll my own recursive method to systematically plop down tiles in subgroups of subgroups.. etc. (Because I'd want the control and to avoid any potential legacy issues - whatever those might turn out to be.)

I don't think I follow. You mean, roll your own as opposed to using the existing scenegraph with nested bundles of tiles? Is the scenegraph prone to strange legacy hiccups? I understand the method for drawing subgroups of subgroups, but would you also do the frustum culling?
"renanse" wrote:
Sorry if that's not much help. I generally try a few PoCs on different approaches and then build off the best one.

No! That's great. I'll take what I can get... I was just worried that in two months somebody would ask why I didn't just overload SimpleMonkeyTycoonGame ;)

Rob