Game Maker's Garage Forum

Game Creation => SilverCreator => Topic started by: Teruri on August 12, 2008, 09:05:01 AM

Title: Need bug/lag testers
Post by: Teruri on August 12, 2008, 09:05:01 AM
Hello, I'm new to this board.
Becouse there is a spam bot on the SC board, I taught it would be saver for me to not visit it for a few days.

Anyway, I'm working on a board game. It's like checkers. I made the first version of the engine (very basic).
But there is a lot code to check if the player can move the piece they want. This might lag on some computers. This is were you come in, could you please download my test version and play around with it? If you find anything weird, make a screenshot/screencap and post it here.
The download:
http://www.megaupload.com/?d=44AOE6QF

Please, don't note my english. I'm Dutch and it isn't my first language.
Title: Re: Need bug/lag testers
Post by: Gan on August 12, 2008, 09:06:05 AM
Sure, I will test.

What's the point of the game? All I did was re-arrange the game pieces. What's it about?


-Gandolf
Title: Re: Need bug/lag testers
Post by: Teruri on August 12, 2008, 09:14:47 AM
Quote
Sure, I will test.

What's the point of the game? All I did was re-arrange the game pieces. What's it about?


-Gandolf

It's just an test version (made it yesterday, so haven't really worked on it). I have to make the real goals, but I wanted to know if the game lags, or not. If the game lags, I could change the code so it doesn't lag.
Title: Re: Need bug/lag testers
Post by: Gan on August 12, 2008, 09:16:25 AM
Ah :)

It's pretty fast. No lag on my G4 mac.


-Gandolf
Title: Re: Need bug/lag testers
Post by: Charlo on August 12, 2008, 02:28:32 PM
I can't download it right now because I just downloaded something off of megaupload.  http://www.mediafire.com/ seems to be pretty popular on these boards, I would use that instead of megaupload.

I will download and comment as soon as I can.  It sounds interesting.   ;)
Title: Re: Need bug/lag testers
Post by: Teruri on August 12, 2008, 02:34:16 PM
The code used in that test doesn't work when I want to code "hopping" over pieces.
So I'm coding it again, using another way. And hopefully, cutting alot of the code.
Title: Re: Need bug/lag testers
Post by: Gan on August 12, 2008, 02:36:28 PM
I can help. One way that cuts down code and really helps me is fake arrays.

If you need any help, just ask.


-Gandolf
Title: Re: Need bug/lag testers
Post by: Tireas Dragon on August 12, 2008, 09:00:54 PM
Runs just fine I experienced no lag.
Title: Re: Need bug/lag testers
Post by: Teruri on August 13, 2008, 09:44:28 AM
Quote
I can help. One way that cuts down code and really helps me is fake arrays.

If you need any help, just ask.


-Gandolf

I'm probably going to stick with that. I tried using invisible sprites and spritouching but two for loops screw each other up so it didn't really work. :(
Title: Re: Need bug/lag testers
Post by: Gan on August 13, 2008, 09:58:16 AM
I can help you do anything you need. Just ask what you want done.


-Gandolf
Title: Re: Need bug/lag testers
Post by: Teruri on August 13, 2008, 02:54:45 PM
Quote
I can help you do anything you need. Just ask what you want done.


-Gandolf
Some help would be nice.

In the opencard I made these two strings:
Code: [Select]
LET locations$ = "1:3:5:7:9:16:17:18:19:20:21:22:23:24:25"
LET board$ = "1:0:1:0:1:0:1:0:1:0:0:0:0:0:1:1:1:1:1:1:1:1:1:1"

In the mousedown, I made a script that locates the sprite the player clicked on. This shows the red border around the right piece, etc.
But it also gets the players location in the two strings above.

Code: [Select]
LET currlocation$ = NTHFIELD$(locations$,":",spriteselected)
               LET location = val(location$)
               LET left$ = ""
               LET right$ = ""
               LET up$ = ""
               LET down$ = ""
              
               IF NTHFIELD$(board$,":",location - 1) = "1" then
                  LET left$ = "block"
               END IF
              
               IF NTHFIELD$(board$,":",location + 1) = "1" then
                  LET right$ = "block"
               END IF
              
               IF NTHFIELD$(board$,":",location + 5) = "1" then
                  LET up$ = "block"
               END IF
              
               IF NTHFIELD$(board$,":",location - 5) = "1" then
                  LET down$ = "block"
               END IF

Becouse there are 15 sprites and 15 numbers in the location string, the number in currlocation$ is the number of the square you are on. This then is converted to an integer to do some math with it to check if there are pieces that block the players piece.
This all works.

But the pieces aren't static so I have to update the strings.
Example:
If I move sprite two from square 3 to 2 (one to the left):
LET locations$ = "1:3:5:7:9:16:17:18:19:20:21:22:23:24:25"
becomse
LET locations$ = "1:2:5:7:9:16:17:18:19:20:21:22:23:24:25"

And

LET board$ = "1:0:1:0:1:0:1:0:1:0:0:0:0:0:1:1:1:1:1:1:1:1:1:1"
becomse

LET board$ = "1:1:0:0:1:0:1:0:1:0:0:0:0:0:1:1:1:1:1:1:1:1:1:1"

I tried to use this code:http://www.silvercreator.net/cgi-bin/yabb/YaBB.pl?board=sccode;action=display;num=1215970619
to do this but the strings become messed up.
Could any of you help me with updating these two strings?
Title: Re: Need bug/lag testers
Post by: Gan on August 13, 2008, 04:35:41 PM
First one bit confuses me.
Code: [Select]
      LET location = val(location$) 
The var location$ isn't in the script, so I have no idea how that affects the code.

Second I've ran into problems with changefield too but I figured a better way to get what I need done.
Instead of using changefield I put a number in front of each number and use the replace command.

Code: [Select]
LET locations$ = "1;1:2;3:3;5:4;7:5;9:6;16:7;17:8;18:9;19:10;20:11;21:12;22:13;23:14;24:15;25"
LET board$ = "1;1:2;0:3;1:4;0:5;1:6;0:7;1:8;0:9;1:10;0:11;0:12;0:13;0:14;0:15;1:16;1:17;1:18;1:19;1:20;1:21;1:22;1:23;1:24;1"

If I wanted to change the first number of locations$ to 2, I would do this:
Code: [Select]
PRINT "Before : " + locations$
LET changelocplaceto = 1
LET changenumberto = 2
LET data$ = STR$(changelocplaceto) + ";" + STR$(changenumberto)
LET locations$ = REPLACE$(locations$, NTHFIELD$(locations$, ":", changelocplaceto), data$)
PRINT "After : " + locations$

The outcome would appear like this:
Quote
Before : 1;1:2;3:3;5:4;7:5;9:6;16:7;17:8;18:9;19:10;20:11;21:12;22:13;23:14;24:15;25
After : 1;2:2;3:3;5:4;7:5;9:6;16:7;17:8;18:9;19:10;20:11;21:12;22:13;23:14;24:15;25

It changes the number of changelocplaceto. If you would change that var to any other number, it would still work.



-Gandolf
Title: Re: Need bug/lag testers
Post by: Teruri on August 13, 2008, 04:45:20 PM
Quote
First one bit confuses me.
Code: [Select]
      LET location = val(location$) 
The var location$ isn't in the script, so I have no idea how that affects the code.
I changed location$ to currlocation$ to avoid confusion, but forgot to change it everywhere.

I'll try your way of changing the numbers.
Title: Re: Need bug/lag testers
Post by: Gan on August 13, 2008, 04:49:35 PM
Okay. :) My way may be a bit confusing, if you run into any more trouble, just ask.



-Gandolf
Title: Re: Need bug/lag testers
Post by: Teruri on August 13, 2008, 05:13:47 PM
The change works in location but with board it is a bit confusing.

Code: [Select]
LET board$ = "1*1:2*0:3*1:4*0:5*1:6*0:7*1:8*0:9*1:10*0:11*0:12*0:13*0:14*0:15*1:16*1:17*1:18*1:19*1:20*1:21*1:22*1:23*1:24*1:25*1"

What the code has to do is:

If I move a piece from sqaure 3 to 1 it has to replace 2*0 with 2*1 and 3*1 with 3*0. However, I can't seem to get it work. It just changes the first 1 it encounters. =/

I can't answer. It's past midnight here so I have to get some sleep.
Title: Re: Need bug/lag testers
Post by: Gan on August 13, 2008, 05:18:29 PM
Alright, I'm kinda lost, I don't quite understand what you
are trying to do. Though you should get some sleep. Ask tomorrow.


-Gandolf
Title: Re: Need bug/lag testers
Post by: Teruri on August 14, 2008, 04:59:00 AM
Nevermind, changed something in the code and it works now. Now I can move on and code the rest of the game.
Title: Re: Need bug/lag testers
Post by: Gan on August 14, 2008, 07:24:25 AM
Alright.  :)


-Gandolf
Title: Re: Need bug/lag testers
Post by: Teruri on August 14, 2008, 10:21:49 AM
Argh I hate arrays. I have to recode everything (again) I'm afraid. Everything works with the moving but the piece on the first sqaure is bugged. I came op with a solution placing a ":" before the array but this screws up the math that already was in the game. I have to redo every math thing in the game and that's not a thing i'm looking forward to...

Or I could change the arrays:

[1]:[3]:[4]: this way I could do:

let randomarray$ = REPLACE$(randomarray$,[1],[2]) and it wouldn't screw up if, let's say, 21 comes before 1 and I want to replace the 1 with a 2 (21 becomse 22 then, and the 1 stays a 1).
This is prettymuch what I already did but I used the : characters and infornt of the first value, there is no :. So yeah, I'm probabbly going to stick with this solution.
Title: Re: Need bug/lag testers
Post by: Gan on August 14, 2008, 10:27:05 AM
Sc needs some real arrays. If it had those, it would be super easy to make whatever you need made.



-Gandolf
Title: Re: Need bug/lag testers
Post by: Teruri on August 14, 2008, 01:34:28 PM
Finally! The movement script is done. I tried it but haven't really tested it good. Could you help me with bug testing the movements? I coded the normal movement and the jumping over pieces.
http://www.mediafire.com/download.php?3ymaun0mebl

Next thing to do: programming an ai (gee, I'm really looking forward to it (NOT)).
Title: Re: Need bug/lag testers
Post by: Gan on August 14, 2008, 03:22:48 PM
Works great for me. Both jumping and moving. Good job Teruri. :)
Can't wait to see the Ai.


-Gandolf
Title: Re: Need bug/lag testers
Post by: Tireas Dragon on August 14, 2008, 10:55:24 PM
I found a glitch there is an invisible piece on row 3 column 5.
Title: Re: Need bug/lag testers
Post by: Teruri on August 15, 2008, 05:01:18 AM
Quote
I found a glitch there is an invisible piece on row 3 column 5.
Modified but it doesn't really matter because I'm going to change how the pieces are set up.  ;)
Title: Re: Need bug/lag testers
Post by: Teruri on August 15, 2008, 09:44:25 AM
Found and fixed another bug.

As you can see in this little demo video I just made I began coding the ai.
http://screencast.com/t/yEQYrC0M8D

The objective of the player: jump over 10 pieces to win the game.
The objective of the computer: block the player while doing this.

I only programmed the first level of ai: place random pieces on the board and if he can't, it just skips it turn. As you can see, after you win the title screen messes up because I haven't written the killsprite lines yet. xD

What do you think of the game so far? And If you wondered what was up with the title screen?

Pai sho is a game played in the nickeldeon show called "Avatar: the last airbender" it's my favorite show. It's a fun show to watch (even for grown ups and adults!) so I recommend to watch the show :P.
So this game is based on the game played in the show, but it’s somewhat different so thats why I changed the name to Balance Pai sho (I hope it’s correct english!) and because all the written text in that avatar show is chinese I asked someone to translate the game name in chinese. However Pai Sho isn’t a real chinese word so he/she used the word checkers instead. It’s fine for me.
Title: Re: Need bug/lag testers
Post by: Teruri on August 16, 2008, 04:38:30 PM
I just wanted to let you know I’ve been working on the AI now. There are 3 levels intelligence right now:
1. Beginner, places tiles randomly on the board. It choses a square it wants to place a tile on, and if isn’t possible it doesn’t place any tile on the board.
2. Somewhat smarter beginner, also places tiles randomly on the board but at least checks for other options. At the end, however, he might stress and skip a turn.
3. This is somewhat stupid it follows a set pattern. There are 2 patterns and it is pretty hard to stop these from completing if you don’t know how.

However the opponents aren’t very smart yet and they don’t change tactics if you are about to win. So that’s what I’m going to do next: coding the expert players.

(Also I made some sprites for the players, you probably don’t know them but it was fun to sprite them so they are in it anyway.)

And I made a skip turn button. If you don’t want to move any piece in that turn you can press it. It is stupid to do it more then trice, because when you do it the fourth time: *game over*. The basic AI’s described above don’t do anything with the skipped turns but some players might get a bit more reckless when you skip more turns... but that are just plans for the future! I’m 80% sure this game is going to finish so... keep tuned (always wanted to say of write or whatever that!).