0 Favourites

Solid doesen't feel solid

  • I haven used Constructor two moths actively, and i have started making simple & small RPG-like game. No-turn based, my skill isn't enough for that. (yet?)

    Anyway, when i made my version of line of sight to orc. As I dont have perfect english, i didn't uderstand articel about "line of sight" well, i tried to make my own version.

    Shortly My Line Of Sight:

    Every tick -> orc spawn lineOfSight

    Orb -> is overlapping player

    add 1 to orc.seesplayer

    Seesplayer 1 or more ->

    change axis to Player

    move orc by (orc.seesplayer/10)

    Every 0.5 second & orc.seesplayer 1 or more ->

    remove 1 orc.seesplayer

    and also logic that lineOfSight is destroyed when it's overlapping wall.

    The Broblem Itself

    all orcs have behavior "solid", but in this mechanism, if they see me, they can overlap each other! what can i do to fix that?

  • It's hard to tell from what you posted here but from what I understand you are trying to spawn an object in the players line of sight? If this is it and they are overlapping it is because you don't have a detection in place to ensure they don't spawn on top of another instance of that object. Best way to do this is create an invisible spawn object, have it move to where you want when the player has line of sight and then spawn the object on the spawner's location. Have the spawn object check for collisions first before spawning making sure it isn't overlapping another object or the player. There are a few posts on the forum if you search for spawn an object near player.

    Also what language do you speak naturally? I know two other languages and can explain in another if you can't understand. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Naturally i speak Finnish. (ta-da-daah)

    i tell cleary that again.

    orc spawn his line-of-sight, like bullet, every tick. those disappear after certain distance moved.

    If player overlaps that line-of-sight-bullet, orcs change their angles to player's direction, and they start moving. this means that orcs move to your direction, seeking you.

    orcs move faster if they have "seen" you more. They stop seeking you if they dont see you within a certain period of time.

    there is also small broblem, ALL orcs in the level will notice player, if one does. this means they all start moving, if they notice you... <img src="smileys/smiley5.gif" border="0" align="middle" />

    so, if orcs start to seek you, they can overlap each other if they suddenly move into same point!

  • Why not give the orcs the built in line of sight behaviour and move the orc with a movement behaviour?

    for each orc

    orc has line of sight to player

    system compare two values: distance(orc.x, orc.y, player.x, player.y)<200

    -orc set orc.seesplayer : orc.seesplayer+1

    -orc set bullet angle : angle(orc.x, orc.y, player.x, player.y)

    orc has not line of sight to player

    -orc set orc.seesplayer : orc.seesplayer-1

    for each orc - orc set bullet speed: orc.seesplayer/10

    set the bullet behaviour to bounce of solid and there you go!

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Thanx!

    But the core thing is not fixed yet! Orcs can still freely move across solid objects, even though themselves are solid objects.

    I have no idea how to fix this.

  • I would have to see your capx to help you any further.

    If you don't want to share tyour complete capx, please provide a capx in which only the events relevant to the issue are present.

  • Are you thinking that solid should stop one solid crossing through another solid object?

  • Hey, another Finn here - PM me your question in Finnish and I will try to help you!

  • okei (huokaus) kirjoitan nyt suomeksi;

    kun (kiinte�) �rkki seuraa sinua, se voi menn� kiinteiden kappaleiden l�pi. wtf?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
37 4,505
JackieChan's avatar
JackieChan
Unread hot topic
46 17,520
ex32's avatar
ex32
Unread hot topic
29 1,194
OrionUK's avatar
OrionUK