Game Maker's Garage Forum

Game Creation => SilverCreator => Topic started by: Gan on June 20, 2008, 10:40:55 AM

Title: V6 Engine
Post by: Gan on June 20, 2008, 10:40:55 AM
Hey, the Sc forums are down, so I am wondering. Does anyone have the v6 engine?


Thanks,
-Gandolf
Title: Re: V6 Engine
Post by: Silverwind on June 20, 2008, 12:22:36 PM
http://www.gamemakersgarage.com/cgi-bin/yabb/YaBB.cgi?board=gametime;action=display;num=1204661470

I'll release an actual demo engine when I finish QoM. It'll also contain the NPC routine, so you guys can churn out QoM style games as well. ;) (I'm tired of me being the only making Yipe! style games. We should all be making Yipe! style games... forever!)
Title: Re: V6 Engine
Post by: Tireas Dragon on June 20, 2008, 01:31:46 PM
When I finish Labyrinth I plan on making a Yipe Style Game. If GM 4 comes out quick enough I will be able to insert a text field as well.
Title: Re: V6 Engine
Post by: Silverwind on June 20, 2008, 04:08:40 PM
Quote
When I finish Labyrinth I plan on making a Yipe Style Game.
Hurray! Any ideas on it so far?

Quote
If GM 4 comes out quick enough I will be able to insert a text field as well.
Different to the default field you mean? In what way?
Title: Re: V6 Engine
Post by: Tireas Dragon on June 21, 2008, 12:06:24 AM
On the bottom of the screen going all the way from left to right.

Title: Re: V6 Engine
Post by: Silverwind on June 21, 2008, 02:51:53 AM
Ooohh, nice.

Hey Al, will it be possible to have different text field positions on each card?
Title: Re: V6 Engine
Post by: Al Staffieri on June 21, 2008, 07:18:08 AM
Quote
Hey Al, will it be possible to have different text field positions on each card?

Yes
Title: Re: V6 Engine
Post by: Gan on June 22, 2008, 06:14:47 PM
Anyone have the Sc version of V6?

-Gandolf
Title: Re: V6 Engine
Post by: Tireas Dragon on June 22, 2008, 10:40:24 PM
Quote
Anyone have the Sc version of V6?
I am sure somebody in the world has it.
Title: Re: V6 Engine
Post by: Silverwind on June 23, 2008, 01:30:28 AM
Quote
Anyone have the Sc version of V6?

-Gandolf
Is there a SC version of V6? I think Eq said he was gonna work on one, but I'm not sure if it was finished.
Title: Re: V6 Engine
Post by: EqwanoX on June 23, 2008, 08:49:07 AM
i never released it because i couldnt get it to work
Title: Re: V6 Engine
Post by: Tireas Dragon on June 23, 2008, 09:22:19 AM
SC and GM has a similar code structure so it wouldn't be hard to get it to work. You could probably copy most of the code and get it to work.
Title: Re: V6 Engine
Post by: Gan on June 23, 2008, 10:04:28 AM
It probably would work, but Sc doesn't have a contain feature. Could anyone post a working v6 gm source file? I will see if I can convert it.


-Gandolf
Title: Re: V6 Engine
Post by: Silverwind on June 23, 2008, 11:29:22 AM
Here's a half finished conversion. I think the sprite and keydown commands are the only things left to convert. I'm still kinda hazy on those.

Code: [Select]
LET gridlayout$ = "" 
LET northcard = 0
LET southcard = 0
LET eastcard = 0
LET westcard = 0
LET playerY = gridY * 44
LET playerY = playerY - 39
LET playerX = gridX * 44
LET playerX = playerX - 39
LET moveY = gridY
LET moveX = gridX
 
SPRITE 15 playerX playerY $playersprite$$
 
'----PLAYER CODE-------------------------------------------------------------------- ------------  
ON KEYDOWN
LET newtile$ = "empty"
IF keydown$ = "UPARROW" THEN LET moveY = gridY - 1
IF keydown$ = "DOWNARROW" THEN LET moveY = gridY + 1
IF keydown$ = "LEFTARROW" THEN LET moveX = gridX - 1
IF keydown$ = "RIGHTARROW" THEN LET moveX = gridX + 1
'----GRID CODE-------------------------------------------------------------------- ---------------  
LET moveXY = 0
LET moveXY = 7 * moveY
LET moveXY = moveXY - 7
LET moveXY = moveXY + moveX
LET newtile$ = MID$ gridlayout$ moveXY 1
IF newtile$ = "0" THEN LET newtile$ = "empty"
IF newtile$ = "1" THEN LET newtile$ = "wall"
IF newtile$ = "2" THEN LET newtile$ = "portal 1"
'---/GRID CODE-------------------------------------------------------------------- ---------------
IF moveY < 1 THEN
  LET gridY = 7
  GOTOCARD northcard
END IF
IF moveY > 7 THEN
  LET gridY = 1
  GOTOCARD southcard
END IF
IF moveX > 7 THEN
  LET gridX = 1
  GOTOCARD eastcard
END IF
IF moveX < 1 THEN
  LET gridX = 7
  GOTOCARD westcard
END IF
IF newtile$ = "portal 1" THEN
  LET gridY = 0
  LET gridX = 0
  GOTOCARD 0
END IF
IF newtile$ = "empty" THEN
  IF keydown$ = "UPARROW" THEN LET playerY = playerY - 44
  IF keydown$ = "DOWNARROW" THEN LET playerY = playerY + 44
  IF keydown$ = "LEFTARROW" THEN LET playerX = playerX - 44
  IF keydown$ = "RIGHTARROW" THEN LET playerX = playerX + 44
  LET gridY = moveY
  LET gridX = moveX
END IF
IF newtile$ = "wall" THEN
  LET moveY = gridY
  LET moveX = gridX
END IF
 
SPRITE 15 playerX playerY
END KEYDOWN
'---/PLAYER CODE-------------------------------------------------------------------- ------------
Title: Re: V6 Engine
Post by: Gan on June 23, 2008, 01:44:27 PM
Thanks, is anything in this script on a timer?

-Gandolf

P.S. Here is the code a little more converted. Also I'm a little confused by a certain part of the script. It says, LET playerY = gridY * 44 but gridY isn't defined as a variable yet. So how does that work? (And also, if you could explain what each section of code is suppose to do, that will help a lot.) :)

Code: [Select]
LET gridlayout$ = ""  
LET northcard = 0  
LET southcard = 0  
LET eastcard = 0  
LET westcard = 0  
LET playerY = gridY * 44  
LET playerY = playerY - 39  
LET playerX = gridX * 44  
LET playerX = playerX - 39  
LET moveY = gridY  
LET moveX = gridX  
  
CREATESPRITE 15, "player"
MOVESPRITE 15, playerx, playery  
  
'----PLAYER CODE--------------------------------------------------------------------  ------------  
ON KEYDOWN  
LET newtile$ = "empty"  
IF keydown$ = "UPARROW" THEN
LET moveY = gridY - 1  
END IF
IF keydown$ = "DOWNARROW" THEN
LET moveY = gridY + 1  
END IF
IF keydown$ = "LEFTARROW" THEN
LET moveX = gridX - 1  
END IF
IF keydown$ = "RIGHTARROW" THEN
LET moveX = gridX + 1  
END IF
'----GRID CODE--------------------------------------------------------------------  ---------------  
LET moveXY = 0  
LET moveXY = 7 * moveY  
LET moveXY = moveXY - 7  
LET moveXY = moveXY + moveX  
LET newtile$ = MID$(gridlayout$, moveXY, 1)
IF newtile$ = "0" THEN
 LET newtile$ = "empty"  
END IF
IF newtile$ = "1" THEN
LET newtile$ = "wall"  
END IF
IF newtile$ = "2" THEN
LET newtile$ = "portal 1"  
END IF
'---/GRID CODE--------------------------------------------------------------------  ---------------  
IF moveY < 1 THEN  
  LET gridY = 7  
  GOTOCARD northcard  
END IF  
IF moveY > 7 THEN  
  LET gridY = 1  
  GOTOCARD southcard  
END IF  
IF moveX > 7 THEN  
  LET gridX = 1  
  GOTOCARD eastcard  
END IF  
IF moveX < 1 THEN  
  LET gridX = 7  
  GOTOCARD westcard  
END IF  
IF newtile$ = "portal 1" THEN  
  LET gridY = 0  
  LET gridX = 0  
  GOTOCARD 0  
END IF  
IF newtile$ = "empty" THEN  
  IF keydown$ = "UPARROW" THEN
LET playerY = playerY - 44  
END IF
  IF keydown$ = "DOWNARROW" THEN
LET playerY = playerY + 44  
END IF
  IF keydown$ = "LEFTARROW" THEN
LET playerX = playerX - 44  
END IF
  IF keydown$ = "RIGHTARROW" THEN
LET playerX = playerX + 44  
END IF
  LET gridY = moveY  
  LET gridX = moveX  
END IF  
IF newtile$ = "wall" THEN  
  LET moveY = gridY  
  LET moveX = gridX  
END IF  
  
MOVESPRITE 15, playerx, playery
END KEYDOWN  
'---/PLAYER CODE--------------------------------------------------------------------  ------------  
Title: Re: V6 Engine
Post by: Silverwind on June 23, 2008, 02:18:38 PM
Quote
Thanks, is anything in this script on a timer?
Nope. The NPC script (which isn't included) can run on a timer or keydown with minimal difference in code. It'll be included when I release the demo engine.

Quote
I'm a little confused by a certain part of the script. It says, LET playerY = gridY * 44 but gridY isn't defined as a variable yet. So how does that work?
That variable needs to be set before entering a card. Here's a few of the variables I set in the New Adventure button in QoM for example:
Code: [Select]
gridY = 4
gridX = 4
moveY = gridY
moveX = gridX
playerY = 137
playerX = 137

NPCspeed = 50
NPCgridY = 4
NPCgridX = 4
NPCspriteY = 137
NPCspriteX = 137

moveup$ = "moveup "
movedown$ = "movedown "
moveleft$ = "moveleft "
moveright$ = "moveright "
Quote
And also, if you could explain what each section of code is suppose to do, that will help a lot.) :)
I'll do that when I release the demo engine. I doubt I'll be releasing it anytime soon though with all of these projects. Here's a quick rundown:

Code: [Select]
LET gridlayout$ = ""  
LET northcard = 0  
LET southcard = 0  
LET eastcard = 0  
LET westcard = 0  
LET playerY = gridY * 44  
LET playerY = playerY - 39  
LET playerX = gridX * 44  
LET playerX = playerX - 39  
LET moveY = gridY  
LET moveX = gridX
 
Sets the computer's bearings so that it knows what cards are North, South, East and West of the current card. Then positions the player sprite according to the GridX and GridY variables.

Code: [Select]
'----PLAYER CODE--------------------------------------------------------------------  ------------   
ON KEYDOWN  
LET newtile$ = "empty"  
IF keydown$ = "UPARROW" THEN
LET moveY = gridY - 1  
END IF
IF keydown$ = "DOWNARROW" THEN
LET moveY = gridY + 1  
END IF
IF keydown$ = "LEFTARROW" THEN
LET moveX = gridX - 1  
END IF
IF keydown$ = "RIGHTARROW" THEN
LET moveX = gridX + 1  
END IF
'----GRID CODE--------------------------------------------------------------------  ---------------
Detects which arrow button the player presses, so that the computer knows which way to attempt to move the player in.

Code: [Select]
LET moveXY = 0  
LET moveXY = 7 * moveY  
LET moveXY = moveXY - 7  
LET moveXY = moveXY + moveX  
LET newtile$ = MID$(gridlayout$, moveXY, 1)
The core of the engine. This is the magic that makes collision happen. Limitless collision classes... massive storage space... oh yeah...

Code: [Select]
IF newtile$ = "0" THEN
 LET newtile$ = "empty"  
END IF
IF newtile$ = "1" THEN
LET newtile$ = "wall"  
END IF
IF newtile$ = "2" THEN
LET newtile$ = "portal 1"  
END IF
Determines which collision class the space the player is trying to move onto is.

Code: [Select]
IF moveY < 1 THEN  
  LET gridY = 7  
  GOTOCARD northcard  
END IF  
IF moveY > 7 THEN  
  LET gridY = 1  
  GOTOCARD southcard  
END IF  
IF moveX > 7 THEN  
  LET gridX = 1  
  GOTOCARD eastcard  
END IF  
IF moveX < 1 THEN  
  LET gridX = 7  
  GOTOCARD westcard  
END IF  
IF newtile$ = "portal 1" THEN  
  LET gridY = 0  
  LET gridX = 0  
  GOTOCARD 0  
END IF
IF newtile$ = "empty" THEN  
  IF keydown$ = "UPARROW" THEN
LET playerY = playerY - 44  
END IF
  IF keydown$ = "DOWNARROW" THEN
LET playerY = playerY + 44  
END IF
  IF keydown$ = "LEFTARROW" THEN
LET playerX = playerX - 44  
END IF
  IF keydown$ = "RIGHTARROW" THEN
LET playerX = playerX + 44  
END IF
  LET gridY = moveY  
  LET gridX = moveX  
END IF  
IF newtile$ = "wall" THEN  
  LET moveY = gridY  
  LET moveX = gridX  
END IF
References the properties of collision classes.
Title: Re: V6 Engine
Post by: Gan on June 23, 2008, 06:52:15 PM
nvm.


-Gandolf
Title: Re: V6 Engine
Post by: Gan on June 23, 2008, 07:08:24 PM
Hah! I did it! I converted the v6 Engine to Sc successfully! It works perfectly. :D

Here is a link: http://www.mediafire.com/?wwgmm3mxshd

Sc doesn't have the word command so I substituted it with NTHFIELD.

Sc can now make v6 games.


-Gandolf
Title: Re: V6 Engine
Post by: Swamp7hing on June 24, 2008, 08:48:40 AM
Quote
Hah! I did it! I converted the v6 Engine to Gm successfully! It works perfectly. :D

Here is a link: http://www.mediafire.com/?wwgmm3mxshd

Sc doesn't have the word command so I substituted it with NTHFIELD.

Sc can now make v6 games.


-Gandolf

You do mean I converted it to SC, right? :D
Title: Re: V6 Engine
Post by: Gan on June 24, 2008, 09:24:18 AM
Haha, Sorry  ;D


-Gandolf
Title: Re: V6 Engine
Post by: Tireas Dragon on June 24, 2008, 11:05:42 PM
Ya it kinda confused me too.

Title: Re: V6 Engine
Post by: Gan on June 25, 2008, 09:02:21 AM
I'm thinking. How would we change the grid system to support 30 pixel tiles instead of 44 pixel?


-Gandolf
Title: Re: V6 Engine
Post by: HarryCaray on June 25, 2008, 12:59:48 PM
Quote
I'm thinking. How would we change the grid system to support 30 pixel tiles instead of 44 pixel?


-Gandolf

Instead of pushing the sprite 44 pixels push it 30? Then redraw your map to support 30x30 tiles?
Title: Re: V6 Engine
Post by: Gan on June 25, 2008, 03:30:14 PM
:D I did it. I have much more move space too. From 49 tiles on the map to 81.

-Gandolf
Title: Re: V6 Engine
Post by: Silverwind on June 25, 2008, 04:43:28 PM
Quote

Instead of pushing the sprite 44 pixels push it 30? Then redraw your map to support 30x30 tiles?
Yeah, it's fairly straightforward. You'd have to change the core as well:

Code: [Select]
LET moveXY = 0   
LET moveXY = 7 * moveY  
LET moveXY = moveXY - 7  
LET moveXY = moveXY + moveX  
LET newtile$ = MID$(gridlayout$, moveXY, 1)

Would become:

Code: [Select]
LET moveXY = 0   
LET moveXY = 9 * moveY  
LET moveXY = moveXY - 9  
LET moveXY = moveXY + moveX  
LET newtile$ = MID$(gridlayout$, moveXY, 1)
Title: Re: V6 Engine
Post by: Gan on June 25, 2008, 06:28:50 PM
Do, you think it would be hard to make a direction block?

Like, lets say you have a tree that is in the middle of two squares. Could you have it so you could walk on one of the squares the tree is on but not be able to go through the tree to the next square the tree is on?

So if you're on a certain square, you cannot go a certain direction.


-Gandolf
Title: Re: V6 Engine
Post by: Tireas Dragon on June 25, 2008, 11:46:18 PM
Ya you make a special tile so that if you try to move on a certain direction on that special tile it doesn't work.
Example:
y = 9 * ManV
y = y - 9
y = y + ManH
x$ = MID$ gridlayout$ y 1
ON KEYDOWN
  IF keydown$ = "RIGHTARROW" THEN
    IF x$ <> "a" THEN
     do move
    END IF
  END IF
END IF
Title: Re: V6 Engine
Post by: Gan on June 25, 2008, 11:54:43 PM
Thanks.  ;)

I'm going to look more into this.


-Gandolf
Title: Re: V6 Engine
Post by: Silverwind on June 26, 2008, 12:31:54 AM
Quote
y = 9 * ManV
y = y - 9
y = y + ManH
x$ = MID$ gridlayout$ y 1
ON KEYDOWN
  IF keydown$ = "RIGHTARROW" THEN
    IF x$ <> "a" THEN
     do move
    END IF
  END IF
END IF
Um... yeah, I suppose... but why not just make a collision class? That's what V6 is all about:

Code: [Select]
IF newtile$ = "left side wall" THEN
  LET newtile$ = "empty"
  IF keydown$ = "RIGHT ARROW" THEN LET newtile$ = "wall"
END IF
Title: Re: V6 Engine
Post by: Tireas Dragon on June 26, 2008, 01:04:01 AM
That works too.