Author Topic: A clean game  (Read 40364 times)

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: A clean game
« Reply #15 on: 2009-06-08, 06:15:08 PM »
This is a good idea that has huge potential. Perhaps water could give plants a boost in growth speed for a period of time, fire/explosions could destroy them (certain species would drop their seeds when burnt(good idea tanja)), the player could have some way to impact it as well, such as wielding a chainsaw.

The plan is to make water cause a seed to sprout, otherwise all the plants will just grow right away as you see in the demo.

To make this even better, players should be able to stand on top of the plants, to warrant strategic growth to try and reach secret areas just out of reach.

The plan is to make the plants like ladders and the branches like platforms.

tprime

  • Fanatic
  • ***
  • Posts: 395
    • View Profile
    • Email
Re: A clean game
« Reply #16 on: 2009-06-08, 09:38:33 PM »
Wow, runs real great. I can't even get mine to do that. I'm able to do graphics if you want. I don't have too much programming skill, but I can serve with graphics!  ;)

You can't get yours to do what?

If you are able to change only the graphics sheet to improve the graphics, I can import better graphics at any time.  If you'd like to change more than the graphics sheet in order to improve the graphics, let me know and maybe we can coordinate our updates so that it won't be too difficult to merge our changes.  Of course I can add your name to the credits too assuming I decide to use the graphics.

I can't get any of my games to run. But probally because of my programming skill. XD

It depends, on how I do it. I'll get on it soon. Any particular date?

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: A clean game
« Reply #17 on: 2009-06-09, 05:26:17 AM »
There's no specific date or plan for this project.  Just working on it as I have ideas.  But I hope I can release a Linux version when I'm done too.

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: A clean game
« Reply #18 on: 2009-06-09, 10:26:48 AM »
what about an biological level? one that refrains from classical in the air floating platforms, replacing it with growing plants. the user will have to act a little bit tactical to make some sections grow as he wants to go further. some other sections have to be destroyed because they are in the way.
and i would make some parts of the plants thorny. maybe even as an tactical element. plant sections, which are several times burned or bombed, grow again, but this times with thorns to prevent more danger. this would make them indestructible.
there could be situations, in which the user has to move a few times through the level, maybe coming from diverent directions, gathering things or so. while doing so, he passes some spots over and over, sometimes he has to grow himself a way, on the way back he has to destroy this section. but if he is without plan, this causes the plants to develop thorns or just get hard shelled.

maybe some he has to grow needed items by himself, because all items are born from seeds or so.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: A clean game
« Reply #19 on: 2009-06-10, 04:59:23 AM »
It's hard to figure out how to make it work with all these considerations:
1) The plants shouldn't be able to grow *anywhere* otherwise the player would be able to freely travel anywhere and there would be no way to block the player.
2) But they shouldn't be limited to very specific places either, otherwise there's no strategy involved.
3) Does the player have some control over the shape of the plants? (maybe picking the right seed grows the right plant?)
4) If the player picks the wrong plant it could make it impossible to play any more; I want to avoid this.  Most games prevent the player from getting into a dead end and having to start the game over now.

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: A clean game
« Reply #20 on: 2009-06-10, 05:40:04 AM »
1. Different type of floor surfaces could indicate "fertility" and allow plants to grow fast/slow/not at all. Plants don't grow on concrete right? :)
3. Perhaps watering the left side could allow it to grow faster, or standing on one side could prohibit that sides growth so the other side gets ahead.
4. The player could have a flamethrower/chainsaw/sword to remove plants that are getting in the way.

SmartBoy16

  • Contributor
  • Fanatic
  • **
  • Posts: 587
  • Looking for inspiration.....
    • View Profile
    • Email
Re: A clean game
« Reply #21 on: 2009-06-10, 09:42:48 AM »
1. have plants that grow specificaly to one direction (one only grows up, another grows more to the left)
2. some how cross pollinate plants to have different growing properties. (cross Up with Left to grow an upper left, cross left with fire to grow on fire to the left)
3. have mulch that makes plants grow slower, faster, or produce more seeds (like on Pok
Looking to the skies.....

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: A clean game
« Reply #22 on: 2009-06-14, 10:07:25 AM »
I'm not going to put too much effort into the plants; this game isn't going to be just about growing plants :).  I've set that aside for the moment and implemented the ability to climb (plants) and the ability to crouch.  While crouching you can move (more slowly) and perform an extra-high jump.  It's possible to walk on the branches of a plant using a new tile shape called "TopSolidMidShape".  This shape is like top-solid except the solid part starts in the middle of the tile instead of on the top.  By pressing down or up you can resume climbing.  But that also means you can't crouch while walking on branches, which probably makes sense because you maybe shouldn't be able to perform an extra high jump from such a precarious location.  I suppose if you're crouching and you fall you could end up crouching on a branch.  I wonder if the player should automatically stop crouching if it turns out he's got nothing solid supporting him (switch to a falling state maybe).

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: A clean game
« Reply #23 on: 2009-06-14, 02:28:26 PM »
you could handle it like the mario games: on ladders/twines you can only climb up or down. hm, i don't remember so really if you could jump out of this. i think yes. but because of the jump Mario had left gone of the twine, so you could jump upwards and just fall down all the way. if you pressed up while being in front of a ladder, you grabbed a hold.
but crouching was only possible on horizontal things.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: A clean game
« Reply #24 on: 2009-06-22, 05:29:19 AM »
I've spent a number of hours trying to figure out how to make pushable sprites.  I've created a "package" sprite to represent a pushable object. Requirements:
1. The packages must be pushable by the player.
2. The packages must not be allowed to move through each other (they should repel other packages).
3. The player should be able to push more than 1 package at once -- push a row of 3 packages for example.
4. The player should not be able to move through packages -- they should push back the player if they can't move any farther.

It's very tricky to allow the player to push a row of 3 packages, but make them all stop when the last one hits a wall.

I think I managed to fulfill all those requirements, but it's much bouncier than I wanted.  The packages keep pushing back the player and other packages when they don't need to.  It's also not possible to push a package going the wrong way on a conveyor belt.  I continue to work on it using various ideas to process rules in the right order to try to make the pushing more smooth without breaking any of the requirements.

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: A clean game
« Reply #25 on: 2009-06-22, 05:41:58 AM »
Sprite collisions such as this should be implemented as preset sprite rules in SGDK2. That's the only thing I believe the engine is missing and as you've said, very hard to implement yourself.

Vincent

  • SGDK2 Addict
  • Expert
  • Fanatic
  • *****
  • Posts: 612
  • Legacy of Kain: Revival is completed!!!
    • View Profile
    • Chivalrous Games
    • Email
Re: A clean game
« Reply #26 on: 2009-06-22, 07:19:08 AM »
Good point Jam0864! 

I did a part of what Bluemonkmn is doing in my game.  It's not as complicated in my game (no pushing), it's just door sprites that won't allow the player to pass through until the door is opened.  This "solid" sprite behavior would really be an asset if it was a preset rule. :)
Legacy of Kain: Revival completed!
http://lokrevival.webs.com

See also my company website:
http://chivalrousgames.com

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: A clean game
« Reply #27 on: 2009-06-23, 05:15:44 AM »
Yes, I was kind of surprised to realize that I neglected to include these as pre-defined rules.  For anyone who's interested, here's a couple pieces of what I am using to allow sprites to push each other, but has to be called in the right order if you want more complex pushing to work well.  Alone, it should work well to treat sprites as solid, though.  Fortunately, it's easy to add this to your own projects even though it doesn't come with the engine, but I will try to remember to add it in the next release.  If you add this in a custom code file, it adds two functions for all sprite rules.  I think ReactToPush is the one you'd want to use from a simple sprite rule (it calls the other).

Code: [Select]
using System.ComponentModel;
using System.Diagnostics;

public abstract partial class SpriteBase : GeneralRules
{
   /// <summary>
   /// Alter the velocity of TargetSprite to plan to move out of the way of this sprite.
   /// </summary>
   /// <param name="TargetSprite">Sprite whose velocity may be affected.</param>
   /// <returns>True if the sprite was pushed, false otherwise.</return>
   [Description("Alter the velocity of TargetSprite to plan to move out of the way of this sprite.")]
   public bool PushSprite(SpriteBase TargetSprite)
   {
      Debug.Assert(this.isActive, "Attempted to execute PushSprite on an inactive sprite");

      int x1 = PixelX;
      int w1 = SolidWidth;
      int x2 = TargetSprite.PixelX;
      int w2 = TargetSprite.SolidWidth;
      int y1 = PixelY;
      int h1 = SolidHeight;
      int y2 = TargetSprite.PixelY;
      int h2 = TargetSprite.SolidHeight;

      int pushright = x1 + w1 - x2;
      int pushleft = x2 + w2 - x1;
      if ((pushright > 0) && (pushleft > 0))
      {
         int pushx;
         pushx = (pushright < pushleft) ? pushright : -pushleft;
         int pushdown = y1 + h1 - y2;
         int pushup = y2 + h2 - y1;
         if ((pushup > 0) && (pushdown > 0))
         {
            int pushy = (pushdown < pushup) ? pushdown : -pushup;
            if (System.Math.Abs(pushx) > System.Math.Abs(pushy))
            {
               if (!double.IsNaN(TargetSprite.LocalDY))
                  TargetSprite.LocalDY += pushy - TargetSprite.dy;
               TargetSprite.dy = pushy;
            }
            else
            {
               if (!double.IsNaN(TargetSprite.LocalDX))
                  TargetSprite.LocalDX += pushx - TargetSprite.dx;
               TargetSprite.dx = pushx;
            }
            return true;
         }
      }
      return false;
   }

   /// <summary>
   /// Alter the velocity of this sprite to plan to move out of the way of sprites in Pushers.
   /// </summary>
   /// <param name="Pushers">Sprites that can push this sprite.</param>
   /// <returns>True if the sprite was pushed, false otherwise.</return>
   [Description("Alter the velocity of this sprite to plan to move out of the way of sprites in Pushers.")]
   public bool ReactToPush(SpriteCollection Pushers)
   {
      if (!isActive)
         return false;
      bool result = false;
      for (int idx = 0; idx < Pushers.Count; idx++)
      {
         SpriteBase TargetSprite = Pushers[idx];
         if ((TargetSprite == this) || (!TargetSprite.isActive))
            continue;
         result |= TargetSprite.PushSprite(this);
      }
      return result;
   }
}

SmartBoy16

  • Contributor
  • Fanatic
  • **
  • Posts: 587
  • Looking for inspiration.....
    • View Profile
    • Email
Re: A clean game
« Reply #28 on: 2009-06-23, 11:51:43 AM »
on my ranat game i was able to have the player push a boulder without pushing back at you using the script. ill post the code i use later (when i get to a computer, right now im using my phone)
Looking to the skies.....

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: A clean game
« Reply #29 on: 2009-06-24, 04:56:57 AM »
Making the player push sprites is easy.  Making them push back is easy too (as shown above).  The hard part is doing both while making sure all the sprites push against each other too without bouncing all over.