Author Topic: Thoughts of a newcomer  (Read 11567 times)

Joe

  • Visitor
  • *
  • Posts: 10
    • View Profile
    • Email
Thoughts of a newcomer
« on: 2008-03-06, 07:23:02 PM »
First: It is cool. Don't get me wrong... Its just not very easy for newcomers. Let me explain

Well, first, it is for making Scolling Games... the first tut only tells you how to make some flying triangle game... and it only scrolls left and right. What if I want to go up? Thats easy enough to figure out... but what if I don't want a flying triangle? What if I want... I don't know, a scrolling game like Mario or Knytt or Earthworm Jim or something... you know... kind of like what I think when I think of scrolling games. You know, a platformer.

Shouldn't there be a tutorial on how to make a platforming game? I know I can import sprites, but when i try to import the SHFL character I always get errors about platforms definitons and such... Well, I don't want platforms anyway... but I do want to jump around. but I can't see how. The closest I could come was, well, what I thought was right ended up being not able to control the character.

There should be a way to make a simple platforming game - left-right player & floor. Then the next step should explain an item and inventory. The next step should explain enemies... like simple walking back and forth on the ground enemies. They hurt you and take away health.

I just think its a bit overwhelming to be dumped in a blank environment like SGDK on startup and be asked to make a decent platformer, or even a simple one, for that matter.

Sorry if I'm coming across as a bit rough, but this is from a person who hasn't used it before and i thought I should mention it just so other people dont just give up, you know... so yeah... a bit of that stuff would be nice.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Thoughts of a newcomer
« Reply #1 on: 2008-03-06, 10:14:34 PM »
Yes, I had to severely limit the number of tutorials I wrote because I'm only one person and can't do so much in such a limited time.  If I had tried to write all the tutorials you're talking about before releasing it, nobody would probably get to use SGDK2 until next year.  But yes, I realize there's lots of room for expanding the documentation.  The good news is, all the people who say that SGDK2 looks really complicated to start with and almost give up... they end up saying that it's much easier than they expected (if I recall correctly... any of those people care to comment?).  I have already written and released a couple of the most critical tutorials that were requested but not included.  But it all takes time, and there are trade offs.  If I'm working on documentation, then I'm not working on features, so everyone has to decide what's more important.  The intention was that the sample project could take the place of a number of tutorials.  It's much easier to create a project that demonstrates how to do all sorts of things than it is to write book-fulls of documentation describing how it was done (and probably easier to read that way too).  So hopefully if nothing else, you can use the sample game as a source of information until more tutorials come along.

Currently I'm working on upgrading SGDK2 to OpenGL because I hope that it will allow SGDK2 to run on more video cards and maybe even run faster (some things were simplified), but most importantly, it will bring SGDK2 one step closer to being portable to other platforms.  Other open source developers will also see SGDK2 in a better light if it's based on OpenGL, and I might actually get some help around here so that we can have two or more people working on features and/or documentation instead of one.  Although I do have to give durnurd credit... he has written some great video tutorials based on the written tutorials.

Joe

  • Visitor
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Thoughts of a newcomer
« Reply #2 on: 2008-03-06, 11:13:52 PM »
I didn't want to make it sound critical, but just voice my surprise at what is given to begin with

It seems strange to me that the sample project is a platformer but the tutorial is a flying triangle game. Or that it has a rotating sprite wizard but not a left-right sprite wizard... or even instructions to make a left-right sprite. I figured that would be the main focus of the Kit and judging by what I see of sgdk1 projects, its what the thing was used for...

[edit] I suppose what it boils down to is, I just want to make a normal game, you know? I know how to make walls and pick-up items, but I don't know how to make a character that runs on the ground and jumps. As a newcomer, I would like to know.
« Last Edit: 2008-03-07, 12:01:53 AM by Joe »

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Thoughts of a newcomer
« Reply #3 on: 2008-03-07, 02:39:18 AM »
for that problem with the platforms: just create a new Tile Category which is called exactly like the error message says.
for the left/right sprite: create a new sprite definition. look at the "player" sprite within the sample game. you will see how it is with states and rules. if you don't need a climbing sprite, you can use only a few rules out of that "if climbing" tree. you can copy the rules and insert them into your own sprite.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Thoughts of a newcomer
« Reply #4 on: 2008-03-07, 06:03:09 AM »
I didn't want to make it sound critical, but just voice my surprise at what is given to begin with

Well, then , let me see if I can explain, because I think there are good reasons behind most of those decisions:

It seems strange to me that the sample project is a platformer but the tutorial is a flying triangle game.
The tutorial project is much simpler than the sample project because it's designed around the idea of creating a game from scratch rather than creating a typical game.  The intention is to get familiar with all the aspects of SGDK2, not to create a game the way you normally would create a game (if you want to do that, see the tutorial about importing sprites).  If I were to create a tutorial that designs a platformer from scratch, it would be pages longer than this tutorial, which is already hard to follow.  If what you really want to do is create a platformer, I suggest looking at the sample game, now that you have a basic understanding of all the concepts in SGDK2 from going through the triangle game tutorial.

Or that it has a rotating sprite wizard but not a left-right sprite wizard... or even instructions to make a left-right sprite.
The only reason the rotating sprite wizard exists is because it's very hard to create 360 perfectly rotated states manually.  If all you want is a left-right sprite, you can easily import one of those and modify it to your liking, deleting the rules you don't care about.  But a rotating sprite can be based on 360 states, 180 states, 72 states, 36 states... whatever... I didn't want to create separate templates for all those.  I'm just trying address the most critical usability issues first, and having to manually create rotating sprites would be a serious usability problem without this wizard (more so than left-right sprites at least).

I figured that would be the main focus of the Kit and judging by what I see of sgdk1 projects, its what the thing was used for...

Yes, I too believe that left-right sprites will be the most common type of sprite in SGDK2.  That's why most of the available sprite templates are for left-right type sprites.

I suppose what it boils down to is, I just want to make a normal game, you know? I know how to make walls and pick-up items, but I don't know how to make a character that runs on the ground and jumps. As a newcomer, I would like to know.
You were on the right track by importing a player sprite.  You just need to make a few adjustments after you import the sprite (and I need to document them):
1) Either add a Ladder tile category to your project, or disable all rules that refer to the Ladder tile category in the Player sprite's rules.
2) Either add a Platform sprite category to your project or disable all rules that refer to Platrofm sprite category in the Player sprite's rules.
3) Adjust the graphics associated with the player sprite if you want it to look different.

Hopefully the error messages that you get when you try to run or build the project guide you in the right direction at least.  But as I said, I do need to document that part better.  Durnurd has suggested a feature that allows more thorough documentation of sprite templates so that people importing them know how to use them better, and I agree.  Anyway, I hope this helps and is enough to get you moving along on your project.

Joe

  • Visitor
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Thoughts of a newcomer
« Reply #5 on: 2008-03-08, 04:13:33 AM »
Alright, so I tried... I really did... I found gravity and took the "if moving left" rules from SHFL... I've tried as hard as I can...

I renamed the triangle's Norm0 to Right and picked one where the triangle points left and renamed it Left. That makes the "if moving left" and "if moving right" rules from SHFL work... I think.

At first I added the gravity rule. The triangle sat on the floor and didnt move. That meant gravity worked... so to get it to move, I added the jump rule. Jump it did. I'm not sure how well, as it just hit the roof (not far away) but that seemed to be OK. The sprite didn't rotate or move left/right anymore, so I put in the two rules mentioned above, "if moving left" and "if moving right" thinking that would work, but I go press F5 and look:

Code: [Select]
tuttuttut\Sprites\Player.cs(202,15) : error CS1502: The best overloaded method match for 'SpriteBase.IsMoving(SpriteBase.Direction)' has some invalid arguments
tuttuttut\Sprites\Player.cs(202,29) : error CS1503: Argument '1': cannot convert from 'SpriteBase.InputBits' to 'SpriteBase.Direction'

I'm so close, I can feel it... please my friends, help a fellow SGDKer out ! ! !

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Thoughts of a newcomer
« Reply #6 on: 2008-03-08, 07:32:03 AM »
do you have already PolarAcceleration active? take this: AccelarateByInputs
the error message is somehow saying that it was getting something like "Key A is pressed" instead of "go left"... somehow.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Thoughts of a newcomer
« Reply #7 on: 2008-03-08, 10:16:44 AM »
Did you review the rule that had the error.  The error is saying that you have at least one rule that is calling the "IsMoving" function.  Have you checked all the rules in your sprite that use the IsMoving function?  One of them apparently has a parameter specified that was not valid.  Did you paste something in that was not from the drop-down list for the first parameter?  That would cause this kind of error.  If you can't see the problem, show us what all your IsMoving rules look like.

Joe

  • Visitor
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Thoughts of a newcomer
« Reply #8 on: 2008-03-08, 03:22:01 PM »
Keep in mind I am using the tutorial project and have simply renamed the states Norm0 to Right and Norm60 to Left, just i case you were wondering...

if moving left: if IsMoving SpriteBase.Direction.Left
and facing right: and IsInState (int)Sprites.Player.State.Right (int)Sprites.Player.State.Right
then face left: Do SwitchToState (int)Sprites.Player.State.Left RelativePosition.CenterMiddle

if moving right: if IsMoving SpriteBase.Direction.Right
and facing left: and IsInState (int)Sprites.Player.State.Left (int)Sprites.Player.State.Left
then face right: Do SwitchToState (int)Sprites.Player.State.Left RelativePosition.CenterMiddle

As I was typing I realised the last bit of "then face right" should have "State.Right" in it. So I changed it, hoping that would fix the problem, but the same error came up.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Thoughts of a newcomer
« Reply #9 on: 2008-03-08, 08:58:02 PM »
Well, that's obviously not the problem then.  The problem lies elsewhere, then.  Could you open the file Player.cs, and look around line 202 (in notepad just hit CTRL+G to go to a line) and see the comment directly above that line, which is the name of that rule.  Look in that rule and see if there's a problem.  If you don't notice anything, post line 202 plus a few lines on either side (5 or 10) and I might be able to see the problem.

One other thing I thought of is to select the "Delete all output files" option from the File menu.  I doubt that would help, but if nothing still looks wrong, then that may fix it,
Edward Dassmesser

Joe

  • Visitor
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Thoughts of a newcomer
« Reply #10 on: 2008-03-08, 10:28:05 PM »
Line 202:    /// <item><term>O</term><description><see cref="key_button2"/></description></item>

Code: [Select]
   /// <item><term>Numeric Keypad 7</term><description><see cref="key_button4"/></description></item>
   /// </list>
   /// Default set number 3 is mapped as follows:
   /// <list type="table">
   /// <listheader><term>Key</term><description>Mapped to</description></listheader>
   /// <item><term>I</term><description><see cref="key_up"/></description></item>
   /// <item><term>J</term><description><see cref="key_left"/></description></item>
   /// <item><term>L</term><description><see cref="key_right"/></description></item>
   /// <item><term>K</term><description><see cref="key_down"/></description></item>
   /// <item><term>U</term><description><see cref="key_button1"/></description></item>
   /// <item><term>O</term><description><see cref="key_button2"/></description></item>
   /// <item><term>M</term><description><see cref="key_button3"/></description></item>
   /// <item><term>,</term><description><see cref="key_button4"/></description></item>
   /// </list>
   /// </param>
   public KeyboardPlayer(int defaultSet)
   {
      switch(defaultSet)
      {
         case 0:
            InitializeKeys(

I don't think I'm doing this right... should it always be this hard?

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: Thoughts of a newcomer
« Reply #11 on: 2008-03-08, 11:18:34 PM »
once you know how to do it, it becomes easy. Just takes a while to get used to. :D

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Thoughts of a newcomer
« Reply #12 on: 2008-03-08, 11:40:39 PM »
You looked in the wrong file. You need to look in the file specified by the error. Specifically, tuttuttut\Sprites\Player.cs(202,15).  That is, find your SGDK2 file, go in to the tuttuttut directory, then into the Sprites directory, and open the Player.cs file.
Edward Dassmesser

Joe

  • Visitor
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Thoughts of a newcomer
« Reply #13 on: 2008-03-09, 04:58:15 AM »
Line 202:          if ((this.IsMoving(SpriteBase.InputBits.Right) && this.IsInState((int)Sprites.Player.State.Left, (int)Sprites.Player.State.Left)))

Code: [Select]
      protected override void ExecuteRules()
      {
         // if moving left
         if ((this.IsMoving(SpriteBase.Direction.Left) && this.IsInState((int)Sprites.Player.State.Right, (int)Sprites.Player.State.Right)))
         {
            // then face left
            this.SwitchToState((int)Sprites.Player.State.Left, RelativePosition.CenterMiddle);
         }
         // if moving right
         if ((this.IsMoving(SpriteBase.InputBits.Right) && this.IsInState((int)Sprites.Player.State.Left, (int)Sprites.Player.State.Left)))
         {
            // then face right
            this.SwitchToState((int)Sprites.Player.State.Left, RelativePosition.CenterMiddle);
         }
         // if player is pressing up
         if (this.IsInputPressed(SpriteBase.InputBits.Up, false))
         {
            // accellerate
            dy = -10;
         }
         // Rule 1
         this.AlterYVelocity(0.1);
         // react to solidity

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Thoughts of a newcomer
« Reply #14 on: 2008-03-09, 07:50:19 AM »
Line 202:          if ((this.IsMoving(SpriteBase.InputBits.Right) && this.IsInState((int)Sprites.Player.State.Left, (int)Sprites.Player.State.Left)))

wasn't there supposed to be a direction instead of an input?