# Thread: Isometric Tank Engine (Real Movement) collide problem

1. ## Isometric Tank Engine (Real Movement) collide problem

Isometric Tank Engine (Real Movement)

This game engine is using s a big map by 2000 * 2000 pixels.
By Pressing "1" you add a Tank. You add as many you wanted, it can control up to 8 Tanks controlled by a pathfinder system. The rest of the tank will

+ Isometric Tank Engine
+ 2D/3D example (2D Topview movement is hidden)
+ Tank Movement (Real movement , not overlap each other)
+ Up to 8 Tanks can be moved by a pathfinder (add more)
+ Mouse Drag - Select Tanks

Control:
+ Left Click = Move Army
+ Right Click = Shoot in direction of 360 / Deselect Tank

Patrice Cervellin - Clic+Path - RPG starter Kit from clickstore
I use this pathfinder from Clic+Path

Thanks to Nivram, fredetmumu and Patrice Cervellin

Think Tank af Audionautix er licenseret under en Creative Commons – tilskrivning 4.0-licens. https://creativecommons.org/licenses/by/4.0/
Kunstner: http://audionautix.com/

Collide problem:

I have 4 objects that must be deleted each time you hit at mine!. When you hit a Tank some turrets from other tank
go below the tank itself!. It reorder the system when delete a four object at same time?

2. Nice work!
As for the turret destruction problem, it's easiest to just use Fusion's built-in object pairing system, instead of messing around with spread values etc.

+ tankHull overlapping mine
-> tankHull: Subtract 1 from armour
-> mine: Destroy

+ Armour of tankHull <= 0
-> Start ForEach loop "destroyTank"

+ On ForEach loop "destroyTank"
+ Pick tankTurret at random
-> tankHull: Destroy
-> tankTurret: Destroy

+ Always
-> tankTurret: Set X to X("tankHull")
-> tankTurret: Set Y to Y("tankHull")

Note that it doesn't matter which turret object gets destroyed, because Fusion will automatically position one turret on each hull. A ForEach loop is needed because there's always the chance that two or more tanks might get destroyed at exactly the same time.

And then for your detectors, you would just say something like:

+ Always
-> detectorLeft: Set position relative to tankHull
-> detectorLeft: Set obstacleDetected to 0

+ detectorLeft is overlapping obstacle
-> detectorLeft: Set obstacleDetected to 1

+ Always
-> tankHull: Set obstacleDetectedLeft to obstacleDetected("detectorLeft")

This way, all of your object data is stored in one object (the tankHull), so you never have to worry about which turret/detector belongs to which tank - only that you always have the same number of each.

A few other thoughts:
- Shadows under the tanks, shipping containers, etc would really improve the look of the game a lot.
- The way you're using physics to push the tanks apart, so that they don't overlap, looks bad, as they start to drift sideways - it would be much better to use "flocking" (see also: "boids"), so that they naturally separate, but always move only in the direction they are facing.

3. MuddyMole I agree with you, I use now flocking engine , much better, big thanks

How will you solved the shadow effect, should it be an image that follow or use Shadow Plugin, but I can't get them in multi objects?

4. Originally Posted by warlords
How will you solved the shadow effect, should it be an image that follow or use Shadow Plugin, but I can't get them in multi objects?
Using a separate layer would probably be best.
Layer 1: Map terrain
Layer 2: Shadow objects (give the whole layer a "subtract" or "multiply" shader effect, and each foreground object has a matching shadow object)
Layer 3: Foreground objects (the tanks, buildings, projectiles, etc)
Layer 4: User interface

The advantage of a separate shadow layer is that you can have multiple shadows overlapping, but you still only have one level darkness (the shadow doesn't get darker, the more shadow objects overlap).
I don't think it's worth making the buildings cast shadows on the tanks, but you could. Really, I think you just want a simple effect that makes the foreground objects feel like they are part of the same environment, and not kind of floating in space.

5. Create a new app, use shadows object plugin, hit space and try to create shadow object anywhere. The Icon is gone, You can't pick any icon? if you say create at ... you can see the icon!

6. I've never tried the shadow extension, but it does say that it's not compatible with Direct3D (ie. it only works in the "standard" software runtime, not DX9 or DX10), so that's probably the issue. I'd just use actives instead. Since you're using pre-rendered 3D models, that ought to make it easier to generate the shadow graphics.

7. I use flocking engine and now a small shadow. Multi select army...

Shadow Engine ver. 1.0 by Andreas Orgetas
===========================
Q - rotate shadow angle CounterClockwise
E - rotate shadow angle Clockwise

W - rotation Radius increase (increase _sh_R)
S - rotation Radius decrease (decrease _sh_R)

Arrow keys to move

To use the engine

1. Copy paste the two actives:
- ShEng_trigger v1.0
2. Add qualifier "0" to the object you want to be able to produce automatically a shadow, among with the Alterable Values and Flags at the side of this frame.
3. Tune _sh_R value for each object
4. Shadows will be placed on Layer 1, all other objects must be set to higher LAyers
5. Set Layer 1 like the screenshot at the side

Is it possible to change the code to another image that draw shadow without qualifer? I did try to copy 3 objects from here into my game, but it will not work. Can someone explain why what is happening!
I also wanted a backdrop image behind the shadow? I need to create at layer 2 instead of layer 1. But Qualifer I think will not work right.

9. All the engine does is create copies of each object (with "0" qualifier) then set their position accordingly. All the code is in the "shadow engine v1.0" objects behavior. It's set up in a way to manipulate shadows for dynamic lights. For your purposes I think it would be better to use purpose specific shadow objects and for any moving object just pair them using the same method as with the turrets.

Though imho, judging from your shadowed version tanks, the quickest easiest way would be to just prebake the shadows in the tank sprite using alpha channel. I don't think overlaps would be that noticable. For the other movable objects such as the crates you'd need separate shadow objects for each (else break collisons).

What method are you using for flocking btw?

10. In fact, it is a top view game that has been converted into an Isometric game.

I have to try more with alpha shadows and yes I forgot my turrets

I hope I have answered well enough

Many thanks for the help, I got a lot to think about

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•