Architecture, for the beginner

creyecreye Member, BASIC Posts: 16

Hi,

I'm a new user of GS and obviously have a lot to learn. With this thread I just want to ask about the architecture, if I may call it that, of the game - what dos and donts there are.

So, a few questions, feel free to elaborate on whichever in whatever sense. Links to good tutorials are of course also welcome.

  • My current first project Im working on is a game based on progress based on levels which are built on 1 scene each. Is this a stupid way to build it? I will end up with maybe 100+ scenes before I'm done, is that ok or do the GS gods recommend against it?

  • How "code efficient" do I have to be? I realize its a bit of a stupid question since the answer usually is "as much as possible", but still. Will 10 rules for an actor which gets the job done make the app a lot slower or heavier than 5 really smart rules?

Appreciate any input. Have a good one!

Br
T

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @creye said:

    • My current first project Im working on is a game based on progress based on levels which are built on 1 scene each. Is this a stupid way to build it? I will end up with maybe 100+ scenes before I'm done, is that ok or do the GS gods recommend against it?

    Stupid? No. Inefficient, Yes. Build a single scene instead and use actors that can be modified (typically through the use of actor "self" attributes or even game attributes). Without knowing what kind of game you're making, it's hard to offer specifics but one example would be a rule in each actor that says "When game.level=1 change attribute self.hitPoints to 25" and a rule that says "When game.level=2 change attribute self.hitPoints to 45."

    • How "code efficient" do I have to be? I realize its a bit of a stupid question since the answer usually is "as much as possible", but still. Will 10 rules for an actor which gets the job done make the app a lot slower or heavier than 5 really smart rules?

    As much as possible. ;) Don't expect to have efficient code when you make your first game with GameSalad. It'll take a few tries to get the hang of it. There are very good tutorials available (I typically just Google a keyword plus "gamesalad" but you can also start with http://learn.gamesalad.com).

    From the sounds of it, there are definitely going to be ways to simplify what you're doing. If you find yourself thinking "hmm, the next thing I have to do is add this one rule to 85 different actors" or "hmm, the next thing I have to do is add 52 of the same actors to this scene" stop and ask for advice again. There's probably a quicker way to achieve the same thing. This is a very helpful community. Welcome!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • creyecreye Member, BASIC Posts: 16

    @tatiang said:

    Stupid? No. Inefficient, Yes. Build a single scene instead and use actors that can be modified (typically through the use of actor "self" attributes or even game attributes). Without knowing what kind of game you're making, it's hard to offer specifics but one example would be a rule in each actor that says "When game.level=1 change attribute self.hitPoints to 25" and a rule that says "When game.level=2 change attribute self.hitPoints to 45."

    As much as possible. ;) Don't expect to have efficient code when you make your first game with GameSalad. It'll take a few tries to get the hang of it. There are very good tutorials available (I typically just Google a keyword plus "gamesalad" but you can also start with http://learn.gamesalad.com).

    From the sounds of it, there are definitely going to be ways to simplify what you're doing. If you find yourself thinking "hmm, the next thing I have to do is add this one rule to 85 different actors" or "hmm, the next thing I have to do is add 52 of the same actors to this scene" stop and ask for advice again. There's probably a quicker way to achieve the same thing. This is a very helpful community. Welcome!

    Again, thanks for the reply, @tatiang . And yes, this community seems really helpful, and at first glance you play a big part in it.

    I'm gonna go ahead and describe my concept a bit. Basically it's a puzzle/quiz game, in which every puzzle is simple but unique. Like puzzle no 3 might be a simple riddle in text, but no 7 maybe a simple puzzle with mechanics, to move wooden pieces or whatever. So apart from some generic actors for level change, "correct answer icons" etc, every level would be quite unique. Meaning I most likely wont re-use a majority of the actors.

    I guess I can see how 1 scene can be used for hundreds of actors, but my gut feeling is I don't understand layers, popping in and out actors from a scene, etc, good enough yet to mak that a reality.

    While reading and writing right now I realized a way to optimize away at least half of the level scenes, though. So that's good. :)

    If you feel to elaborate based on the above concept, would be much appreciated!

  • -Timo--Timo- Member Posts: 2,313

    I have a game with 50 levels and only use 2 scenes. Putting it all in 1 made the game way too slow. 2 scenes were easily able to handle the amount of actors. Also if you use a lot of different scenes there is a lot of loading needed if you change scenes. For my game it only needs to load once. For your game it seems possible to use the same strategy. So just change the camera pos if you go to a different level.

    It's your first game? I would suggest you to start small. You learn while you use gamesalad and everytime you find ways to do things better. So first make sure you understand gamesalad before working on really big projects.

  • creyecreye Member, BASIC Posts: 16

    @-Timo- said:
    I have a game with 50 levels and only use 2 scenes. Putting it all in 1 made the game way too slow. 2 scenes were easily able to handle the amount of actors. Also if you use a lot of different scenes there is a lot of loading needed if you change scenes. For my game it only needs to load once. For your game it seems possible to use the same strategy. So just change the camera pos if you go to a different level.

    It's your first game? I would suggest you to start small. You learn while you use gamesalad and everytime you find ways to do things better. So first make sure you understand gamesalad before working on really big projects.

    Interresting. You have me alot to think about, alright. :) Thanks a lot!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I think if your levels are different enough from each other, you'll need to create a separate scene for each one. A single scene game would be more appropriate for something like Wordgraphy in which the structure is identical but the words change from level to level.

    And yeah, as @-Timo- suggested, it's possible to create all of your levels in a single scene with each level full-sized but in a different camera position. I'll tell you from experience it's a major pain to edit the scene that way because of the lack of functionality in the GameSalad editor (e.g. no zoom, no window memory, etc.).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • creyecreye Member, BASIC Posts: 16

    @tatiang said:
    I think if your levels are different enough from each other, you'll need to create a separate scene for each one. A single scene game would be more appropriate for something like Wordgraphy in which the structure is identical but the words change from level to level.

    And yeah, as @-Timo- suggested, it's possible to create all of your levels in a single scene with each level full-sized but in a different camera position. I'll tell you from experience it's a major pain to edit the scene that way because of the lack of functionality in the GameSalad editor (e.g. no zoom, no window memory, etc.).

    The way @-Timo- suggested I will get rid of a bunch of scenes for sure. And it will become a bit messy, but I think as I (we, actually, me and my brother) progress - those generic actors will be prototypes and added as the last thing on each scene. So it's all good.

    I was wondering, what kind of loading time is there in a scene change? I assume the amount of active actors from the start plays a role, but still... is there a general estimate?

    And another question (and I think this would be really educational for any newbie of GS): is there somewhere an example of a published app for iOS or Android for which I could also download the project files for? Ie see both sides of the coin, so to speak.

    Thanks a lot for all the replies so far.

    BR
    T

Sign In or Register to comment.