Game Development Community

Highlight selectable grid system.

by Nathan Tran · in Torque Game Engine · 01/23/2005 (9:48 pm) · 3 replies

Hi all,

I've been running this through my head. The game I'm making is a farming simulator (Harvest Moon like). The player can indicate where to plant crops by laying down an arbitrary sized, rectangular grid on the terrain. I want to be able to select/highlight a portion of that grid to plant seeds, water, weed, etc...How best to implement this land grid? Should I use multiple dts, one for each grid section? Or maybe one big dts that represents the dirt and then some how work with in the confines of the dts shape's perimeter to divide it into a grid system. I plan to spawn diferent plant types, through their growth cycles from seed to harvestable produce, in each selectable grid block. I basically want a tile system on the terrain. Terrain must be flat in the area of the grid of course.

Any idea is appreciated.

Nathan.

#1
01/24/2005 (5:14 am)
You will need an array to keep track of what crop and how much of it should be growing in each grid block. The actual plants are fxfoliage.

The RTS starter kit does the sort of mouse selecting that you're talking about. However, it shouldn't be too hard to reinvent that particular feature using containerraytraces since your needs sounds pretty simple.

There is no need for flat terrain. Visually it might be nicer with some hills.
#2
01/24/2005 (1:14 pm)
@Eric,

On your recommendation, I applied the new FxfoliageReplicator resource to my game. Upon trying it out, I find that the replicator doesn't fit my needs. I need to interact with individual blocks within the grid. Instead of trying to describe what I am trying to accomplish, I'll just post a screenshot instead.

nathantran.homeip.net:8080/images/torque/fields.png
Nathan.
#3
01/27/2005 (5:30 pm)
@Nathan - That is the desired effect?

If it's relatively small scale like that, I'd suggest simply having the plants spawned by script as needed, using TSStatic or similar. Use a SimSet/SimGroup to keep track of them.