Camera and Enemy actor AI movement
Hi Gamesaladers, I'm working on a new game after a hiatus, but very frustrated with my first time trying a larger scene and camera controls!
I've read a lot of posts regarding this and watched the tutorials, but still need help. The game is a real time strategy (you collect resources, spawn workers and an army, enemy does the same, you conquer the world).
The problem I'm having is that the enemy actors become high on peyote once you scroll the scene either way. Right now they have a simple move to based on table cell values(which are fixed). Starts out well, but once the camera moves, they forget where they are going and will move in that direction indefinitely, but won't stop. Tried saving the coordinates and loops and timers-same result.
My camera is controlled by an invisible actor and 2 arrow buttons to scroll (interpolate)left or right. I wanted to have the selected actor (out of many) always controlling the camera, but gave up on that. Scene is 768X2048. I also gave up on a larger scene due to the camera issues (or my issues).
Using the camera seems to effect actors movements in weird ways. I've got the players actors moving to where they're told, after a lot of the same issues. Lots of trial and error. You select one actor (touch) then touch the screen and they move there.
Havent seen this same problem in the posts, anyone got any tips?
Cheers,
Jason
Comments
Update: so i've tried turning the camera control off and instead constraining camera origin to my camera actor. So...the enemy actors now go where theyre told and stop. But now my player actors won't move off the original screen!! (with touch).
Crazy. I know it is something to do with offset, but I can't fix it...
Constrain camera origin is set (currently) to camera actor x-1024, y-384 (half the scene size?)
And the actors I'm trying to move with touch are offset by +camera origin x,y (constrained to attributes)
Age of Dominion RTS for iOS
Age of Dominion RTS for Android
Making progress...I'll post my solutions for others if I get there! Seems to be problematic for many...
Age of Dominion RTS for iOS
Age of Dominion RTS for Android
Hilarious! Alas, I don't have any good advice. Just here to comment on that line.
Our games http://Donkeysoft.ca