Excal's Recent Forum Activity

  • Make the game and see for yourself.

  • makotto, that does it, thanks!

    <img src="http://i.imgur.com/MtArfvA.png" border="0" />

    I've also confirmed the array contents in the debugger.

    I'll get to work on the default behavior next and let you know if I have any issues. AI is a tough subject!

  • I understand I have to store an ID of the family instance.

    However, in terms of the comparison, how would I reference two objects within a family in the same block of code?

  • This is awesome!

  • This is for my board game. I am now at the final stage before it can be considered a working prototype. This is also the hardest stage: creating the computer behavior.

    I've created AI systems in the past, and computer behavior is an area that greatly fascinates me. Here are my notes regarding how the computer should behave.

    Computer program selection order:

    1. Computer uses programs in order of highest range (ComputerPrograms.Range) to shortest range.

    Priority order:

    1. Destroy player programs if they are in range and capable of being killed by a computer program this turn.

    2. (Default) Move toward and attack the nearest player program.

    Local variables:

    TargetPlayerProgram: The UID of the player program targeted by the computer program.

    Destruction potential check:

    1. Loop through each player program and compare its active parts (PlayerPrograms.PartsActive) to the currently selected computer program's damage (ComputerPrograms.Damage).

    2. If a player program is able to be killed by the currently selected computer program (PlayerPrograms.PartsActive = ComputerPrograms.Damage), then set its UID to TargetPlayerProgram.

    Highlight all movable squares (call function "HighlightMove") and pick the highlighted square closest to the player program, then do a range calculation for X and Y (squares are 64px in size, so closest square X + ComputerPrograms.Range * 64 >= PlayerPrograms.X OR PlayerProgramParts.X; repeat for Y).

    3. If no player program is able to be killed this turn, proceed to 'Default behavior'

    4. If range calculation succeeds, then move computer program to nearest square and attack.

    5. If range calculation fails, then proceed to 'Default behavior'

    Default behavior:

    1. Loop through each player program and compare distance along X and Y axes (distance(PlayerPrograms, ComputerPrograms)). Set closest player program to TargetPlayerProgram.

    2. Move computer program to the closest square.

    3. Try to attack the player program. Call 'AttackHighlight' and check if target program is overlapping an attack indicator.

    If so, then deal damage. If not, then do nothing (set ComputerPrograms.Finished = true).

    This thread is intended to keep all my questions in a single location instead of spreading them out over several 'How To' posts in the forum.

    First issue: How do I pick the program with the highest range? In the case of conflicts, I am seeking to just pick randomly among the ones that are tied for the highest.

    <img src="http://i.imgur.com/kzSfBUF.png" border="0">

    BoardGame.capx

    Basically you have to compare the variable ComputerPrograms.Range. ComputerPrograms is a family, and Range is a family instance variable. I'm having trouble figuring out how I would compare family members against each other.

  • All issues concerning player program movement and parts orientation are now fixed.

    I've also implemented program attacking, although you won't be able to test it due to the computer not having any behavior right now.

    <img src="http://i.imgur.com/HZWD5tD.png" border="0" />

    I've also deleted an entire family, reorganized code, added some functions to replace repeated tasks, and more. The .capx should be slightly easier to understand for people who might be trying to use it as a reference.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Will the player understand that his decision to wait for the correct weather is why he was able to solve a problem?

    You never want the player to think he just got lucky and that's how he solved a problem. In fact, the player may even feel cheated if he believes he didn't solve the problem himself.

  • Damnit vee41, I was trying all sorts of complicated things and all you did was fix things by removing one line...

  • I've discovered something peculiar. There is a definite problem for the space to the right of another square, and I don't exactly know why.

    <img src="http://i.imgur.com/wmOCt54.png" border="0" />

    <img src="http://i.imgur.com/0P7KsBj.png" border="0" />

    <img src="http://i.imgur.com/Rtz48d6.png" border="0" />

    This is the relevant code:

    <img src="http://i.imgur.com/C3fI0qL.png" border="0" />

    Time to figure out why...

  • There are games that take you back to the main menu, yes, but I have yet to play an HTML5 game that exits the game entirely.

    You might want to consider just returning to the main menu.

    Also, please do a forum search before posting threads. This question has been asked numerous times.

  • vee41, do you have skype? I'm going to go insane...

  • cvp, how close is vee41's implementation to what you had in mind?

Excal's avatar

Excal

Member since 9 Mar, 2013

Twitter
Excal has 1 followers

Connect with Excal

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies