User Tag List

Results 1 to 6 of 6

Thread: My big thread of questions

  1. #1
    No Products Registered

    Join Date
    May 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    My big thread of questions

    Hello everyone. I'm working on an arcade dungeon crawler game. And I'm having a few problems figuring things out, so I'll be asking alot of questions, so I thought I'd keep all the questions in 1 thread so I don't flood the forums, hehe.

    Question number 1:
    I have 25 spawnpoints that are randomly chosen so the player and all the other objects are randomly placed each time the frame is visited. The problem I'm having is that sometimes 2 or more objects spawn at the same spawnpoint. How do I prevent this?


    Question number 2: I wish that a random amount of objects could be spawned. For example, at one time 5 gold pieces is spawned at the spawnpoints, another there might be 20. Tips on how to get the game to pick a random amount of objects to be spawned would be great. And perhaps even having the game picking the objects at random too. Example: At the start of the frame, the game decides it will only spawn 5 objects - 2 gold pieces and 3 skeletons.


    Question number 3: I have an idea about a combat system. When the player is next to an enemy, they simply stand next to each other and take turns attacking, this is done automatically, and there is 3 stats: Health, Defence and Attack. Example: The player starts with 100 in health, 10 in attack and 10 in defence. The player encounters a skeleton that has 50 in health, 15 in attack and 5 in defence. When the player attacks, he only does 5 in damage due to the account that the skeleton has 5 in defence, so the skeleton absorbs half of the damage. How would I go about making this happen?

    I'm from Sweden, so please excuse me if my way of explaining things are a bit strange.

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: My big thread of questions

    For your first question, you could try using a fastloop. I would approach it like this:

    +Start of Frame
    --Set SpawnPoint Flag 0 OFF
    --Start Fastloop "PlaceSpawnPoint" -1 times [This runs the loop infinitely, until you tell it to stop]

    +On Loop "PlaceSpawnPoint"
    +Pick (SpawnPoint) at Random
    +Flag 0 (SpawnPoint) is OFF
    --Create enemy at (0,0) SpawnPoint
    --Set Flag 0 (SpawnPoint) ON
    --Increase Counter by 1

    +On Loop "PlaceSpawnPoint"
    +Counter = 25
    --Stop Loop("PlaceSpawnPoint")

    The idea is that you use Flag 0 to mark which SpawnPoint objects are not used yet. When you run the fastloop, it will choose a SpawnPoint at random, but only if it also has Flag 0 OFF (meaning it is not picked yet). Then it spawns your enemy and changes the SpawnPoint's flag 0 to ON, so it can't be picked again. Each time you create an enemy, you increase a counter to keep track of how many have been created. When the Counter reaches the max number of enemies you wanted to spawn, you stop the loop.

    Keep in mind that you need to run the loop infinitely, because MMF's "Pick object at Random" function can try and select ANY of the SpawnPoints, but only seems to check the Flag 0 condition once the SpawnPoint has been selected. So the infinite loop will keep trying to pick SpawnPoints until it eventually does find one that also has Flag 0 OFF.

    As for your other questions, maybe someone else can lend a hand. ^_^

    Mobichan

  3. #3
    No Products Registered

    Join Date
    May 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: My big thread of questions

    Cheers, that helped alot! =D

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: My big thread of questions

    Quote Originally Posted by mobichan
    Keep in mind that you need to run the loop infinitely, because MMF's "Pick object at Random" function can try and select ANY of the SpawnPoints, but only seems to check the Flag 0 condition once the SpawnPoint has been selected.
    That's only because you put the "pick one" condition above the "is flag 0 off?" condition.
    If you just switch the two conditions, it will only ever pick an object with its flag off.


    The other two problems, I think are actually quite a lot more complicated than you realize.

    You can't just pick a random object to create - you need a level variable, and you need to make the strength and number of enemies proportional to it. Otherwise, the player will get more powerful as he gains experience and items, but the enemies will stay the same - meaning the game gets progressively easier, not harder.

    Similarly, your proposed combat system would not work.
    It's too basic, and there needs to be some random element to it. Otherwise, the player will eventually become invulnerable to the weaker enemies, whereas there should always be at least a very small chance of them inflicting a small amount of damage.

  5. #5
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: My big thread of questions

    Bonewave, there is an open source roguelike dungeon crawl on my website. It may help you understand what must have to happen:

    Dungeon Dash
    http://www.castles-of-britain.com/mmf2examplespage23.htm

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: My big thread of questions

    @MuddyMole: Wow. I had no idea the condition order made any difference at all. Thanks for the tip. It makes me wonder how many other instances of my own code could be simplified.

    In that case, you can just run the loop 25 times and remove the counter and "stop loop" code entirely.

Similar Threads

  1. The questions thread
    By J3sseM in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 8th May 2013, 01:42 PM
  2. Replies: 0
    Last Post: 29th April 2013, 08:25 PM
  3. Yet another RPG help thread...
    By RickyRombo in forum Multimedia Fusion 2 - Technical Support
    Replies: 16
    Last Post: 12th May 2008, 12:02 AM

Posting Permissions

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