Ambrosia Garden Archive
    • Rat Race


      Hi.

      For my game, I'm making a rat race through a maze so that the Player can have fun gambling. When the Player bets and hits begin, the engine will randomize and select one of two sets of rats, one slower than the other and they're off. What I've done is to make the rats as NPCs and in the NPC window, telling it to try to reach a specific cell. Then under Target Reached, I have an engine freeze of all characters and a sound to end the race. Everything works except that when the rat reaches the target cell, nothing happens, not even the sound. I've been trying all sorts of things, including making the rats have stamina. There's nothing wrong with the map. They are not going after the same cell. Is this a bug?

      I'll probably abandon the NPC rat idea and make several very precise animations and see if I can't launch stamps when they begin.

      But the Target Reached in the NPC window does not seem to work very well. It's probably just me.

    • This has happened to me a few times. In my experience, using "Proximity Reached" or "Target Proximity" (whatever it is) works. It will basically do it when theyre 1 cell away from the finish, and hopefully the rat race won't be THAT close.

      Anyway, hope it works.

    • I have an NPC who "kills himself" when he reaches a target square. That is, he disappears off the screen when he enters his house. For some reason I've never figured out, there is always a delay before he fades out. To mask this, I placed the door on the north side of the house where the NPC is hidden by the house roof when he gets to the door.

      With your rat race, I'd try removing the freeze, and placing an NPC Control in the "target reached" event which adds a new "rat 2" (which has zero movement) at the co-ordinates of original "rat 2" and deletes the original "rat 2." You will need globals to track your rats. This would stop the other rat from running when the winner gets to the target. If you haven't done so, make your "we have a winner" sound the first item in the target reached event.

      I don't need to tell you that you'll need to mirror this for "rat 1" in case "rat 2" reaches his target first.

      If the maze has twists and turns, how do you keep the rats going to the target? I've found that an NPC will often stall if it cannot find a straight line path to the target.

      IDEA # II: Script the whole race with two animations which have different winners and let the random choice pick which animation to run. This would permit first one rat to take the lead, and then the other, adding some excitement to the outcome. The race course would be a large stamp animation which overlays on your map. The contestants (rats) could slow down and speed up during the race. You could then have your rats "get lost" in the maze by taking the wrong turn and having to correct themselves.

      P.S.: To cut down on work with no detriment to the final result, the first 3/4 of the race animations could be identical with the winner only evident in the last few frames of each animation. If you like the work, you could create additional animations to make the race seem more random in outcome.

      P.P.S.: If you're really the wicked one you have claimed to be ( 😛 ), you could pre-determine the outcome of the race by checking the player's stats and wager, and weighting the chances of success on how decent a fellow the player is deemed to be.

    • Wicked? Me? :ninja:

      Yes, for the NPC, I had to make the maze pretty straight. I tried a series of delete/place rats via NPC control once they got to a target cell, but that didn't work well at all. Actually, I'm glad it didn't work out the way I wanted, because the animations are SO much better! I'm making several animations of both the red and blue rats (they have a mark on their backs) and will place in a random as to which animations run. It has to be slow enough to be fun and fast enough not to be boring. I think I've got the right speed to the finish. And, yes, many animations show the rats getting lost in the maze a little .... enough to slow them down to the finish. I'll probably place in at least one animation for each rat where he totally gets lost in the maze.

      The maze isn't very big because I've made the map just wide enough that it doesn't move. I've also needed to make the space in the maze two movement tiles wide. And the maze itself takes up one movement tile.

      I plan to place one in all 20 towns, probably linked to the tavern interiors. That way, the money bets can be different from town to town. But since I have quite a lot connected to Player stats, I think I won't do that here.

      Kills fade, delete doesn't.

    • It sounds like you were already into animations before I wrote my reply. Either that, or you've done nothing but animate for the last five hours. If you can work that fast, I'm surprised we don't have SW ready for market.

    • Well, I've had the flu that lasts 7 to 10 days. I'm on day 7 and the last two days I've been well enough to work quietly on my game in front of the tv. (Any other way to do it?) Not well enough to get in to work. (No, not faking it!) I just finished making the 20 animations -- 10 for each rat -- and tested it all. Now it's to the conditionals and globals and money, etc. -- the fun part. I've already made the graphics and chosen the sound. Then I need to tie it into the maps.

      I keep adding this stuff into my game, and it'll NEVER get done! A whole lot of my time is in testing, as I build and test in stages. Less of the alpha tester to do. I mean, really, you gotta think it's perfect before the tester gets ahold of it!!

      I'm still wondering if there's a bug in the target reached option of the NPC window.

    • Yes, as far as I can tell "Target Reached" doesn't do a thing. I have run it to this several times and I always solved it with "Target Proximity".

      Quote

      I keep adding this stuff into my game, and it'll NEVER get done!

      I'm doing the same thing with Anira, exept I have been working on for a shorter time. it's fun to have a million fun little things, though. 🙂