The Grid... a catch-22... too many rules or too many actors

PhoticsPhotics Member Posts: 4,172
edited November -1 in Working with GS (Mac)
Imagine you have a grid... 5 boxes by 7 boxes. That's 35 boxes. Right away, you're already making GameSalad angry. The more actors you have on the screen, the more the game slows down.

Now imagine there are circular actors that drop into those boxes... some red... some blue.

How do you get the circular objects to react to one another? I thought about making something like a database, with attributes!

A1 = Red
A2 = Blue
A3 = Empty
A4 = Blue

The problem is that I cannot change an attribute dynamically. I can only use expressions on the right side, not the left.

...actually... I'm just thinking out loud right now... I'm going to check something. Maybe I can edit the files manually to do what I want.

Comments

  • PhoticsPhotics Member Posts: 4,172
    OK... I went to check something out...

    It was this...

    game.attributes.id634103

    ...but that might not make a lot of sense to anyone. So, I'll explain :)

    I went to edit the XML file in order to trick GameSalad into doing what I wanted. Basically I was thinking of making a pseudo-database. In order to optimize the interaction between actors, I was thinking on making 35 attributes so that the data could be more efficiently shared between the actors. But unfortunately, it seems that I'd need A LOT of rules to change the "database" based on actor positions in the grid.

    I can't use expressions to change target attributes dynamically, as the XML file lists Game Attributes by ID, not by name.

    If this doesn't make sense to anyone, that's cool. Simply put, I'm trying to figure out a workaround to the limitations of GameSalad.
  • rebumprebump Member Posts: 1,058
    "How do you get the circular objects to react to one another?" - Photics

    How do you want them to react to one another? What do you want them to do?
  • PhoticsPhotics Member Posts: 4,172
    They should change color based on rotation, position and adjacent actors.

    Imagine if a red piece touched a blue piece. The blue piece should turn red. But if I did that with collision detection, all the pieces on the board would turn red. So, I have to do it with a certain bit of logic.

    I could do it with rules, but then I'd have hundreds of rules and that's not going to play well.

    Sometimes I just sit quietly, staring out into space, trying to figure out a way around this issue. The battle wages... back and forth... do I use logic or do I use collision detection? Do I use a combination of both?

    I was thinking if I could create a grid, that would help with the problem. But unfortunately, attributes don't update that way. I thought I figured out something cool, but it didn't work. That pretty much ruined the idea that I had for this thread.
  • netdzynrnetdzynr Member Posts: 296
    Right, you can't use variables to reference actors. Things would be a hundred times easier in GS if you could. That said, could tags be a way to do what you want? Granted, they're essentially like attributes, but since the collide behavior responds to tags, maybe there's something you can use there. Just thinking out loud.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    It sounds like you are making something like Ataxx or Othello?

    You could do it like this:

    No physics, no collisions.

    1. Keep track of the current color.
    2. As soon as you move your piece, spawn a larger "collider" piece in the exact same spot.
    3. The collider will be invisible. Just a box that will overlap the adjacent squares. Destroy it in 0.1 seconds.
    4. In all of the pieces, have a Rule that says: If I collide with the collider, change my color to the current color.
  • PhoticsPhotics Member Posts: 4,172
    netdzynr said:
    could tags be a way to do what you want?

    I was thinking about Tags, but unfortunately I don't know how it would work for my game idea. Because it's a combination of three elements... position, rotation and "color" ...tags would still require lots of rules.
    firemaplegames said:
    It sounds like you are making something like Ataxx or Othello?

    No, it's not those games. Heh... but I think that GameSalad developers might be able to make a decent clone, if they could figure out how to add Artificial Intelligence.
    spawn a larger "collider" piece in the exact same spot.

    Good idea... but I tried that before. I called them sensors. Great minds think alike. I later found an example of a Bejeweled clone. (I think it was by CodeMonkey.) When you move a piece, you can see it spawn red dots. That works well for that example, but the game I'm working on is a bit different. I would need constant checking. Spawning too many actors at once cripples the frame rates.

    I might make it an iPad only game. But while the processing power of the iPad is mighty, I don't know if it could handle the spawning of 70-140 "sensor" actors every second.

    Heh... so basically I could give up and work on two different game ideas... a Hexxagon clone or a Bejeweled clone... but I'm still thinking of a way to figure out this. I had a new idea this morning. Maybe a minor adjustment to the game play might make things work.
  • PhoticsPhotics Member Posts: 4,172
    It seems that the forums are hiding my posts again.
Sign In or Register to comment.