Be a Supporter!

Advice for game design properties

  • 188 Views
  • 7 Replies
New Topic Respond to this Topic
coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Advice for game design properties 2013-12-03 19:42:33 Reply

So I currently have a file called GameData.as that the designers can access. I just need some advice on how to set up the variables so they make the most sense. Here's what I have right now:

var levelEnemyWaves:Array = [
	// LEVEL 1
	[ ['enemyWoodBoat', 0.0, 10, 2, [1.5, 2.5], 100, 10], ['enemyWoodBoat', 20.0, 10, 2, [2.0, 2.5], 100, 10],
	  ['enemyWoodBoat', 85.0, 10, 2, [1.5, 3.0], 100, 10], ['enemyWoodBoat', 145.0, 10, 2, [1.5, 3.5], 100, 10], 
	  ['enemyWoodBoat', 185.0, 20, 2, [1.0, 4.0], 100, 10],
	  ['enemyCanoe', 30.0, 8, 2.2, [2.0, 4.0], 200, 15], ['enemyCanoe', 110.0, 10, 2.2, [2.0, 4.0], 200, 18],
	  ['enemyCanoe', 185.0, 10, 2.5, [2.5, 5.0], 200, 15],
	  ['enemyKayak', 60.0, 15, 2.8, [4.0, 5.5], 300, 20], ['enemyKayak', 200.0, 10, 2.8, [2.5, 4.0], 300, 20] ],
	 // ....
];

Talk about obfuscation. Those numbers correspond to start delay, enemy count, speed, etc...
I'm just curious how to format this in the best way. I've tried individual variables, but it still seems hard to understand.


BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to Advice for game design properties 2013-12-03 20:24:32 Reply

At 12/3/13 07:42 PM, coln wrote: So I currently have a file called GameData.as that the designers can access. I just need some advice on how to set up the variables so they make the most sense. Here's what I have right now:

var levelEnemyWaves:Array = [
// LEVEL 1
[ ['enemyWoodBoat', 0.0, 10, 2, [1.5, 2.5], 100, 10], ['enemyWoodBoat', 20.0, 10, 2, [2.0, 2.5], 100, 10],
['enemyWoodBoat', 85.0, 10, 2, [1.5, 3.0], 100, 10], ['enemyWoodBoat', 145.0, 10, 2, [1.5, 3.5], 100, 10],
['enemyWoodBoat', 185.0, 20, 2, [1.0, 4.0], 100, 10],
['enemyCanoe', 30.0, 8, 2.2, [2.0, 4.0], 200, 15], ['enemyCanoe', 110.0, 10, 2.2, [2.0, 4.0], 200, 18],
['enemyCanoe', 185.0, 10, 2.5, [2.5, 5.0], 200, 15],
['enemyKayak', 60.0, 15, 2.8, [4.0, 5.5], 300, 20], ['enemyKayak', 200.0, 10, 2.8, [2.5, 4.0], 300, 20] ],
// ....
];

Talk about obfuscation. Those numbers correspond to start delay, enemy count, speed, etc...
I'm just curious how to format this in the best way. I've tried individual variables, but it still seems hard to understand.

I'm liking json a lot for stuff like this. I made a tutorial here, and there's a useful editor here.

I would format your stuff like:

levels array: [
   each level object
]

within each level object

{
   enemies array: [
      each enemy object
   ]
}

and within each enemy object

{
   "delay": 1.2,
   "damage": 15,
   etc
}
coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to Advice for game design properties 2013-12-03 20:35:16 Reply

At 12/3/13 08:24 PM, MSGhero wrote: I'm liking json a lot for stuff like this. I made a tutorial here, and there's a useful editor here.

Two things. First, if I put all of this in a text file, am I still able to export the SWF as one unit (for upload to a site like Newgrounds for example). Second, this will eventually make for a huge file that get's kind of daunting to maintain or edit or do anything with it, because there's a huge list of words for each enemy, multiple enemies per level, tens to hundreds of levels...is this a problem with usual game makers?

Thanks for your reply.


BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to Advice for game design properties 2013-12-03 20:45:02 Reply

At 12/3/13 08:35 PM, coln wrote: Two things. First, if I put all of this in a text file, am I still able to export the SWF as one unit (for upload to a site like Newgrounds for example). Second, this will eventually make for a huge file that get's kind of daunting to maintain or edit or do anything with it, because there's a huge list of words for each enemy, multiple enemies per level, tens to hundreds of levels...is this a problem with usual game makers?

Thanks for your reply.

You can embed the text file directly into your swf, so all the info will be contained in the swf. I use flashdevelop for this, I guess flash pro can, idk.

If you have hundreds of levels with multiple enemies per level, your data will be daunting no matter how you go about it. With the json editor, you can minimize the levels and enemies you don't want to look at and focus on the ones you do. The code to handle parsing the data should be generic enough that it can handle every level. Since they're in an array, you could have a currLevel counter; you would access the current level object using that and the array and parse its data when needed.

coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to Advice for game design properties 2013-12-03 20:48:31 Reply

At 12/3/13 08:45 PM, MSGhero wrote: If you have hundreds of levels with multiple enemies per level, your data will be daunting no matter how you go about it. With the json editor, you can minimize the levels and enemies you don't want to look at and focus on the ones you do. The code to handle parsing the data should be generic enough that it can handle every level. Since they're in an array, you could have a currLevel counter; you would access the current level object using that and the array and parse its data when needed.

Honestly, parsing the data wasn't an issue, I was just trying to make it as daunting-less for the desiger as possible, haha. I'm starting to like json though. I haven't used it yet before, but with a json editor this sounds pretty good.

Thanks again for your reply.


BBS Signature
MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to Advice for game design properties 2013-12-04 00:40:54 Reply

Use XML or JSON.

<enemy>
<delay>0</delay>
<power>3</power>
</enemy>

You say you're not having problems parsing the data, your parsing method innately requires a unorganized system.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature
PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Advice for game design properties 2013-12-04 05:34:32 Reply

At 12/4/13 12:40 AM, MintPaw wrote: Use XML or JSON.

I would definitely suggest XML. JSON isn't really too comfortable for human editing, XML is much clearer in this respect, even when using any plain old text editor.

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to Advice for game design properties 2013-12-04 10:02:46 Reply

Another vote for XML here. JSON is fine but if you're just giving it to somebody with zero experience, they'll pick up XML much quicker.