Hello everyone.
I'm looking for some advice. I have a lot of underwater environments in the project I'm working but at the moment it's very bare and lacking sea life. My question is what would be the best/simplest way (I'm a medium level coder with AGS and wouldn't call myself advanced) to achieve shoals of fish that randomly swim about the room? Not neseceraly in groups.
I did think about just creating a lot of fish characters and have them move to a random x, y from 0 to the max room size, but creating all those characters seems like an awful lot of work, and I don't really want my project cluttered with an army of fish characters. I did look at the steering behaviour plugin but I couldn't really understand it although it sounded perfect for what I want to do (no example project files). So I pose the question? How would you approach this problem?
Any help would be appreciated.
You could implement your own fish struct (to group together variables for current and target coordinates, state, sprite slot, etc.)
Then you update the coordinates in repeatedly_execute_always and draw the sprites to the background manually.
The downside of this approach is that your fish become part of the background graphic, meaning they'll appear behind everything else. Depending on the perspective of the sea floor you could have some fern or whatever appear in between by including that in the drawing order of the fish though (i.e. you'd have to depth sort everything before drawing it).
The bottom line: the better you want this to look, the more complex it'll be to code.
Captain D did this in a game recently: https://captaind.itch.io/shoaly-you-cant-be-serious-mags-version
That's impressive erico, not sure how you created the effect but it's food for thought. Khris, my environments are like top down, orthographic. So like the old Zelda games, so drawing to the background wouldn't really work especially with other objects scattered about the place.
I'll keep exploring. I was just curious how other people may have tackled the issue.
(it's not my game! It's from Captain D (nod))
In that case: yes, you can also create a bunch of dummy characters and use those. You can use character[i] in your code where i is a variable to iterate over them.