Excal's Forum Posts

    This is something I just wanted to bring up, as it has been lingering in my mind for some time - is it possible for a user to mess with the JavaScript in a C2 game and alter the game (cheat)?

    I understand C2 encrypts things, but anyone who understands how trainer programs work should be able to figure out something given time and change.

    Take for example a game where I have a weapon with 10 bullets. I do a JavaScript search for the number 10 and keep track of all instances where 10 shows up. I then fire a bullet and have 9. I then search each of those instances in the JavaScript code and figure out which ones changed to 9. If there are multiples, I fire again and figure out which one changed to 8. Eventually I have the number that is keeping track of my ammo and will be able to edit the JS to give me, say, 1000.

    This problem is easily mitigated by releasing as an app, but what if I don't want to do that? If I am legitimately releasing a browser game, what is the possibility of cheating and what measures does C2 take to prevent that?

  • TELLES0808, how does your example apply to multiple player objects? I think your implementation is probably the best one for my usage but I'm having issues adapting it for multiple entities owned by the player.

    And I definitely agree with your suggest to ASHLEY.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • zatyka, I think the issue here is the assumption I have a pathfinding object that is moving.

    Since I am trying to find the closest object that can be pathed to, I would probably have to path to all four corners of the board to determine which object is closest along any path.

    Running a pathfinding object four times will take time (possible noticeable game lag) and CPU :(

  • makotto, here you go: BoardGame.capx

  • TELLES0808, I think a big WHOOSH just happened.

    My first post explains how I cannot use the distance function to do this.

  • Here's the .capx if anyone has the time to take a look. The .capx as a whole is pretty complex, but the relevant part is shown in the screenshot above and most of the events are commented.

    BoardGame.capx

  • If you have your tiles saved in an array, you could work with that, identify adjacent tiles, add them to another array and check those adjacent tiles for objects.

    the other array could look like this:

    each x -> one tile

    y=0: x coordinate in tile-array

    y=1: y coordinate in tile-array

    y=2: status (0 = searched for object, 1 = searched for adjacent tiles)

    okay let's say you are at a junction at 5,5. You run your function.

    The function will return

    (4,5), (6,5), (5,4), (5,6). It didn't find an object, so it will look further. For each x in the array where at(curx,2) = 0 -> run the function again.

    The function should only add coordinates if they are not already in your array (to prevent from going back, searching fields twice). After every adjacent tile was checked for (4,5), its y2 is set to 1.

    The search/loops are stopped once an object was found or no new adjacent tile was added to the array. After that the array is cleaned up (set size to 1,1,1 I guess).

    This makes sense. I'm using a recursive function to do this, but I think I've created an endless loop, because the preview tends to crash.

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

    The values in the BoardSpaces array contain the UID of the grid tiles. It's -1 if it doesn't exist.

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

    My goal is to have the function recursively loop through the squares until it finds a player object, in which case ComputerTarget is set to that UID and the function should stop running. However, in my testing I get an endless loop and the program crashes.

  • Can you elaborate a bit more on how I would use nodes?

  • This is more of a general question.

    Suppose I have a grid with walls. I have several objects within the grid. What's the best way to find which object is closest to another object based on path and not distance? I can't use the distance function because the closest object (based on actual distance) may not be the closest object due to walls, and another object may actually be 'closer' based on path.

    Does anyone know of how I might accomplish this?

  • Bump. This is the problem I've been struggling with for a month or so now.

    The link above should be updated with the latest version.

    The pathfinding grid shows up whenever a pathfinding object appears, but the problem of diagonal pathfinding (even when diagonals are turned off) still appears.

    I'm starting to think I need a mathematical way to determine paths without using the pathfinding object. If anyone has the time to take a look at this somewhat complicated matter, that would be great.

  • You might be interested in my thread here then.

  • retrodude

    Thanks for the compliments on the game development so far. The AI is really the last portion I need done before it's in a playable demo state.

    I would be interested in working with you once you are free again. I have a gist of what I want for the AI already implemented - it's just a matter of working out small issues with it to make it work as intended. I am willing to spend up to $500 for this work, but for that rate I would want not just a fixing of the current AI implementation but also an implementation of combat (which is also partially implemented already).

  • The AI is semi-working, and I suppose I should clarify a bit for those who haven't been following the project.

    Here's what I want the AI to do:

    1. Find the closest player object that can be reached. I used pathfinding to determine this because the closest player object is not necessarily the closest one that can be reached due to holes in the grid that prevent movement.

    2. Move towards the closest player object that can be reached, and then deal damage.

    I've been using the pathfinding object for this. Right now I have a pathfinding object move from the computer object to the closest player object that can be moved to, and each grid tile the pathfinding object moves through gets 'tagged'. After the pathfinding object reaches the closest player object that can be pathed to, I highlight the grid of possible tiles the computer object can move, then create a second pathfinding object that starts from the furthest grid tile that is both tagged by the first pathfinding object and highlighted by the movement grid, and this object moves to the computer program and builds a list of squares for the computer object to move.

    Kind of complicated, but it's commented in the .capx. The main issue I'm having is skips in movement along with the pathfinding object moving diagonally even though I have diagonals turned off (not sure why this is happening).

  • Bump.

  • Darklinki, it's for my board game.

    I've tried to implement an AI system that utilizes the pathfinding behavior, but it's not quite working for me.