Author Topic: sgdk for rpg/sim-development?  (Read 11181 times)

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: sgdk for rpg/sim-development?
« Reply #15 on: 2008-02-20, 08:01:26 AM »
i wouldn't know how to start, how to do and how to end such a thing...

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: sgdk for rpg/sim-development?
« Reply #16 on: 2008-03-07, 10:35:26 PM »
Again Asking- Putting this back out there... Anyone know how to Make RPG styled battles with the SGDK2?

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: sgdk for rpg/sim-development?
« Reply #17 on: 2008-03-08, 09:56:36 AM »
You have to be more specific.  What have you tried and what are you having trouble with?  There are dozens of elements to a battle system, and they can't all be explained in a forum post.  A system could be devised with SGDK2, but it's going to take some work because SGDK2 is not RPG maker.

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: sgdk for rpg/sim-development?
« Reply #18 on: 2008-03-27, 04:17:55 AM »
The problem with time-based operations is that it runs differently on different machines.  Assume I record a script where the sprite moves down 4 pixels in 0.1 seconds and then I press right to go into a narrow passageway.  Now if I take the same script to another computer, maybe it's a slower computer, so the sprite moved down 6 pixels in 0.15 seconds instead of moving down 4 pixels in 0.1 seconds.  Now I can't press right at the correct time to get into the passageway.  The rest of the recording will play completely differently due to one slight mis-calculation.

about that problem. it could be easier to record only these things: sprite 1 at x;y starts to walk down. after reaching x2;y2 it stops. it walks then to the right to x3;y3.
see? no sprite missing a passage, no king jumping off a cliff.
for times when nothing happens, e.g. someone ist waiting between two messages, that could be framebased or timebased or whatever. it is not so important, as long as there is a pause.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: sgdk for rpg/sim-development?
« Reply #19 on: 2008-03-27, 05:42:45 AM »
That seems more complicated, not easier.  The easiest thing is to just record the inputs on the sprite (which is what I have done in the past)  For X frames, the input bits on this sprite are Y.  Repeat until end of input.  Very simple.

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: sgdk for rpg/sim-development?
« Reply #20 on: 2008-03-27, 06:04:18 AM »
oh. okay, right, because of the recording.
the other option would be to script those cut scenes. better than not having one.

what about a simple cut scene-editor. in that you could give every sprite "moving orders". right-click on a sprite, choose "walk", and then an arrow occurs, which head is under the mouse. click somewhere onto the ground, and the sprite is walking to that point. you could change the walking mode into running mode, if the sprite can run.
in that right-click menu or with interface buttons one could choose for example "talk, attack, do special animation" and so forth.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: sgdk for rpg/sim-development?
« Reply #21 on: 2008-03-27, 09:15:34 AM »
Those actions are very specific to an RPG with sprites defined with specific states.  The closest I could think of would be to change states at given points to whatever you specify.  What you're describing though, is something like the predefined paths that already exist.  You can have a specific action occur when a sprite reaches any point on the path, and there already exist functions to have sprites follow paths.
Edward Dassmesser

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: sgdk for rpg/sim-development?
« Reply #22 on: 2008-03-27, 10:48:34 AM »
ah, the paths. i forgot them. that may be because i only thought of all that stuff, and didn't try to make it, actually.
let's see what happens when someone really starts to work on such a thing.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: sgdk for rpg/sim-development?
« Reply #23 on: 2008-03-27, 03:13:04 PM »
I think the best option is this:

Each sprite is related to a specific plan that describes its overall movement throughout the cutscene.  If this gets too messy on a playing map, you could always create a copy of the map just for the cutscene.

Each plan contains code to control the sprite related to it.  To start a sprite moving immediately, just use the PushSpriteTowardCoordinate.  To make a sprite move until it reaches the point, use something similar to CheckNextCoordinate, but it doesn't need to actually set the next coordinate.  It can just return true if it's within range.  Then, if it is, set a map flag that tells all the plans that this sprite is where it needs to be.  The plan itself can check any flag to start or stop moving, or do anything it wants.

The sprite itself should control all of the state switching.  Depending on the direction it's moving (its dx and dy) switch it to the correct state, and if it's dx or dy is large enough, switch to the running state, etc.  The plan would take care of special cases like crouching or firing, etc., and it might want to let the sprite know to stop trying to switch states on its own with a sprite parameter.
Edward Dassmesser