Creating a similar effect to the "Zerg creep" found in SC

PureSlate

  • *
  • Posts: 8
Has anybody thought of any good ways to go about creating something similar to the creep used for the zerg in SC?

For reference, it's basically a self-spreading ground cover that appears to be "on the ground" and can be interacted with by units (ie: the player.) It speeds up zerg units on it, for example.

The approach I've thought about using to create a similar modifiable terrain relative thing is trying to actually set tiles to what they would need to do, but I honestly have no idea how to approach something like this in Stencyl. I was hoping to be able to make something flow (like water) in a 2d environment without having to use actors like particles (repulsing each other and such)

t4u

  • Posts: 418
Is it self spreading or does it spread as you add more building?
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

PureSlate

  • *
  • Posts: 8
The creep spreads only with buildings, but I was thinking self spreading (with limits).

t4u

  • Posts: 418
(Probabyl bad for performance)
Solution using actor as tiles for fragment of infected space. Self-spreading infecting 4 tiles around itself

[Start]
    1. Create Base actor (first building) - source of infection
    2.  Add infected tiles around base
    3. Adding infection tiles add its coordinates to the list
   
[Infection step]
    4. For each coordisnate in the list check 4 tiles around it to see if there are not infected tiles.
    5. If there is not-infected tile around current coordinate create infected tile actor.
    6. After checking set of coordinate rmeove it form the list


0- not infect
1 - base
2 - infected

Start:

0 0 0 0 0 0
0 0 0 0 0 0
0 0 1 0 0 0
0 0 0 0 0 0

Add infected tilesa around base

0 1 2 3 4 5
-------------
0 0 0 0 0 0  |0
0 0 2 0 0 0  |1
0 2 1 2 0 0  |2
0 0 2 0 0 0  | 3

Edge List : (2,1); (1,2); (3,2); (2,3) //List contains tiles on the edge of infeciton

[Infection step]
3 - newly infected tiles


0 1 2 3 4 5
-------------
0 0 3 0 0 0  |0
0 3 2 3 0 0  |1
3 2 1 2 3 0  |2
0 3 2 3 0 0  | 3

Create New Edge list = empty list

For coordinate #0 in Edge list
Check if 1,1 infected - no then create infected tile at position and add coordinates to New Edge list
Check if 2,0 infected - no then create infected tile at position and add coordinates to New Edge list
Check if 3,1 infected - no then create infected tile at position and add coordinates to New Edge list
Check if 2,2 infected - yes do nothing

Repeat for all elements in Edge list:
Edge list = New edge list

Edge list after first infection step: (1,1); (2;0);(3,1); (0,2); (4,2); (1,3); (4,3)

For enchanced effect change animation of tiles based tiles in neighbour hood.
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

t4u

  • Posts: 418
PS. If you want it I can do it for my blog. The question is if your question was out of pure curiosity or do you actually need it.
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

PureSlate

  • *
  • Posts: 8
I was originally wanting to use it, but for my purposes right now self repulsing actors will work. Ideally I would want one that you could interact with, but just curious at this point.

Thanks for the input!

t4u

  • Posts: 418
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/