Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → A bit of a challenge...
A bit of a challenge...
2003-11-17, 3:04 PM #1
I need some help with conceptualizing this COG (and some code help would be appreciated as well).

[http://www.sestus.net/gris/board.jpg]

The objective of this puzzle is for the player (whose walkplayer will be replaced with that of a knight in plate armor) to get to the square wreathed in gold by using only the 'L' moves of a knight. I'll slow the player down enough so to make movement easier and more comprehensive (as the controls are reminiscent of Grim Fandango).

The question is, how exactly do I go about this? I'll define all the square surfaces in the cog, and it will be simple to kill the player if he moves onto an incorrect square (and I could even change the mat of those squares that he ahs moved on that turn). To make the puzzle slightly more complicated, I could perhaps place enemy models that move at pulses, and do touch damage, to add an air of urgency.

How do I calculate possible legal moves, though? Is there a specific manner in which I should number the squares, or perhaps some sort of algorithm that I should employ?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2003-11-18, 2:49 PM #2
Uh, I've got no idea about the cog, but to finish the puzzle you just move along the left edge, moving all the way to the space next to the left corner, then just head for the gold corner. Simple. I think you should have blocking spots every 2nd square around the edges.

Also, you might want to try looking at ID_Junkguy's Checkers Level.

JediKirby

------------------
"I was driving along listening to the radio, when Judas Priest comes on. It was 'You've got another thing coming.' All of a sudden, I enter 'VICE CITY RAMAGE MODE' and nearly ran some guy over"
- ]-[ellequin
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2003-11-18, 5:10 PM #3
You could try toggling adjoins to limit movement to legal moves.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-11-18, 5:54 PM #4
Eh, the player merely dies when stepping on a wrong square.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2003-11-18, 11:51 PM #5
Hi there [http://forums.massassi.net/html/smile.gif]

This is indeed a tricky one, and make no bones about it - chess board piece algorithms are especially tricky when coding up AI for a reasonable game, but mercifully, you're not going for opposition [http://forums.massassi.net/html/wink.gif]

I've found a site that may[/i] be of some use for you, in terms of algorithms. From a personal perspective (of one who enjoys a good game of chess [http://forums.massassi.net/html/wink.gif]) attempting to calculate the possible moves of a knight board piece are incredibly complex, given that there can never be a "wrong" square to land on (so to speak - because of the "L" shape move patttern, means every square is reachable... *see the link provided below*), but only a "correct" square to land on, as a result of the previous move.

Therefore in essence, I guess I'm trying to say that if you're trying to kill the player if they step on a wrong square, then you'd have to recalculate every valid move-square after the player's previous move.

Equally (on a level editing note), how big are the squares? I'm thinking in terms of "could the player jump to the correct square, or would he have to move in the "L" shape, attached to the board surface? I only wonder about this because if you're dividing up the surface into squares andadopting an "L" shape move interface, then you'd also have to calculate the number of valid intermediary steps (ie - the steps that form a valid "L" shape, as well as the "final" correct square. But seeing as more than one can exist... well I'm sure you've got my message by now [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/redface.gif])

Oh - and here's the link:
http://www.delphiforfun.org/Programs/knight's_tour.htm

I hope this has (somewhat) helped [http://forums.massassi.net/html/biggrin.gif]. I feel an eek ( [http://forums.massassi.net/html/eek.gif] ) is truly called for, with this daring puzzle - I wish you good luck !!!

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-11-19, 9:01 AM #6
"You could try toggling adjoins to limit movement to legal moves."

Yeah, now, make those adjoins have cog that kill player once crossed. Should be helpfull

------------------
The miners of Kiith Somtaaw sacificed much, and risked all. For their efforts they were brought into the inner most circle of Hiigaren power. Naabal, S'jet, and Sobanii bowed before them. And from that day to this, Somtaaw's children have been known to one and all as Beastslayers..
2003-11-19, 2:45 PM #7
Oh, I misunderstood you, Grismath. In that case, you just kill when walking on the surface, which is what I think you were saying. Entered gets triggered when you walk on something, like a surface or thing.

This would be really easy if you could make real arrays, because that would let you make matrices, which would be perfect for this. Hmm...

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-11-19, 4:58 PM #8
Hmmm indeed, Emon.

I brought this up to a friend the other day, and he proposed an interesting manner of going about it.

The squares would be defined in an x/y pattern, and then the knight could move in an x+1, x+1, x+1/y+1 (or y+1, y+1, y+1/x+1, as well as the negatives) manner. The cog can then check the x and y values and from these (since there is a luckily very finite number of squares) correlate the desired position on the board. The area around the board kills the player by falling, so leaving the chessboard will not be a problem. If the player does not move in a cross, cross, then perpendicular line fashion, he will be killed.

[http://forums.massassi.net/html/redface.gif] I had to modify his plan asI typed it, because I began to realize several shortcomings. Its current manifestation is dirty but doable.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2003-11-19, 7:17 PM #9
if you still need help i may be of some use.
i made a chess game for JK so i know a way this could be done.

i can try and explain how you could do it if you want, but it would be kind of long and hard to explain. and i dont want to try typing it all out if you dont need it (lazy me [http://forums.massassi.net/html/smile.gif] ). so if you still need it just ask and ill do my best to help.

or if you want you could look at the chess mod i made and see how it could be done, its called JK CHESS. but the cogs in it may be hard to understand (depending on your cogging experience and if i wrote them clear enough to be understood [http://forums.massassi.net/html/redface.gif] ).

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."

↑ Up to the top!