Enemy Tank AI

For questions about using Classic.

Post » Tue Feb 23, 2010 9:02 pm

[quote="Neo1000":1l3as5oa]Will you give me a lawsuit if my game is called "Tank Panic"? :P [/quote:1l3as5oa]
Of course not, that's NOTHING like Pank Tanic

Also - not sure about the copying thing, but here's a tank base and a top for more testing:

B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Tue Feb 23, 2010 9:30 pm

No, no. Graphics work fine.
But if I mark a object, like the Collission Arrow from your Example project, CTRL+C. Now I go to my project and press CTRL+V, then I get the plus sign (where to put the copied file). Then it gets stuck and at the end, it says the app crashed. Or once it crashed with another message.

Try to copy a object from one cap to another cap and see if it crashes to you too...

Anyway, I just made new sprites and added all the graphics and everything. Now it works perfectly. Now onto making the real game :wink:
B
7
S
1
G
2
Posts: 87
Reputation: 1,099

Post » Wed Feb 24, 2010 3:38 pm

I hope my Double Post doesn't kill someone :shock:
Anyway, yay for another problem. I found out how to make the distance without the big circle I previously made. Now, I want the enemy to follow the player, but with the limits to up, down, left, right and not in 360.

I tried with "random(4)*360" which wasn't really a good idea :?
And also used some other commands to make this happen.

Yeah! "tanks.cap" Link

As always, I really appreciate any help :wink:
B
7
S
1
G
2
Posts: 87
Reputation: 1,099

Post » Wed Feb 24, 2010 6:02 pm

Neo1000,

To stop the crashing, make sure you have both .cap files open in a SINGLE instance of Construct. If you have two "Contruct" apps in your taskbar, it will crash.

When you have them both open in a single instance, you can change between .cap files via the Project tab.
B
3
G
2
Posts: 27
Reputation: 729

Post » Wed Feb 24, 2010 6:12 pm

Ah, that makes sense. But with more instances, Windows 7 will show more projects on Aero Peek. :P
B
7
S
1
G
2
Posts: 87
Reputation: 1,099

Post » Wed Feb 24, 2010 6:47 pm

[quote="Neo1000":1ws86cpr]Ah, that makes sense. But with more instances, Windows 7 will show more projects on Aero Peek. :P[/quote:1ws86cpr]

I'm sure you'll survive. :P
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Wed Feb 24, 2010 7:15 pm

[quote="Neo1000":1ojoaeym]Ah, that makes sense. But with more instances, Windows 7 will show more projects on Aero Peek. :P[/quote:1ojoaeym]
And you're free to do that! Just don't copy anything from one project to another :-D
B
3
G
2
Posts: 27
Reputation: 729

Post » Wed Feb 24, 2010 9:21 pm

Great, I fail to do the timer settings, because all the tanks rotate at the same time. I know it has something to do with the "Turn" Private variable. The link to the cap is still the same.
B
7
S
1
G
2
Posts: 87
Reputation: 1,099

Post » Thu Feb 25, 2010 8:35 pm

If pathfinding is the problem then I would suggest giving the enemy tank the RTS behaviour, you can set it so it moves around solids and such. The only drawback is that it's cell sizes for the path finding seem to be increments of 10 rather than multiples of 2, so it wouldn't quite line up for 32x32 size tiles for example. In any case, experiment with the RTS behaviour, you can do some cool stuff
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Thu Feb 25, 2010 8:45 pm

[quote="Neo1000":3nhdawbs]Great, I fail to do the timer settings, because all the tanks rotate at the same time. I know it has something to do with the "Turn" Private variable. The link to the cap is still the same.[/quote:3nhdawbs]

Your event is picking all of the Tank instances. If you want each on it's own timer, then you should give each it's own timer.

Make a "myTimer" private variable. On start of layout, do "For Each tank -> Set 'myTimer' to random(however long)."

Then in the main movement loop do "For Each tank -> subract from 'myTimer' whatever amount." Then when the tank's timer is less or equal to zero, give the turn command and generate a new random amount for their timer.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests