Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Making a FB game...

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 25th Jun 2010 01:36
I am trying to construct a FB game like MyTown called eCity in Flash MX 2004 with AS2. I need some tips. Below in a code snippet are my questions. If any of them can be answered please be so kind to do so.



I know these are a lot of questions, I am not asking for code, I am asking for tips on this. This is possibly my biggest project ever that I am wanting to be serious about. So any tips or help is greatly appreciated and you will be credited when the game is released on FB.

Thanks!
Zeus

It's over Shadowtroid!
Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 25th Jun 2010 04:49 Edited at: 25th Jun 2010 04:51
I don't mean to come off as harsh, so take me with a pinch of salt, but...

It appears you need to increase your knowledge of Actionscript (again, Read my above sentence). You need to find out how to store values and where to keep them inside facebook, so the player can save the city, this will include storing building locations, population, needs and wants etc.
I'll quickly answer a few questions as roughly and half arsed as i can

1.) I'd set it out into tiles like a chessboard, simple keep the location of the building (also useful for saving the data out) in a grid format, using letter or number values. Ie. City Hospital takes up grid space 12,51, this can be stored and then loading back up if someone comes to visit your town.

2.) Not a feature request, but a request for you. Play Sim City and analyse the hell out of it.

3.) A levelling system in a city based game would have to rely on the state of your city, this means your level would fluctuate though. So if you only unlock certain abilities during a higher level, if your city starts to drop in quality then you will lose those abilities, thus entering the slippery slope of your city becoming a slum.

4.) If you're working on real life time, then just check for the last date the taxes were paid and how long it has been, then increase the players money based on the number of residents.

5.) The first step would be to build a road and have people inhabit the squares around the road. Lets say every hour you run a piece of code that checks for roads and the space around them, if there is space then a new resident comes to build a house. Obviously there will be some sort of randomisation or logic based on the area of town (industrial, business etc) and the state of the city itself but over time people should come to live there.

6.) Use a sim city style radius for schools and public services, if a certain amount of people are out of the radius then increase a bar in your stats and have warnings come up when it reaches a certain level. Have a limit on how many people each service can handle, if there are over, say, 100 people inside the radius for the service then increase it that way. Same with roads. Just say that only 12 people per road square, check for the amount of road squares to the amount of people and increase traffic flow based on how close it is to the limit.

7.) I'm not entirely sure what you mean here, is it the relationship between your citizens? I'd check for population again, if a place is too overcrowded then it will lower the general happiness of the town. Along with how dirty your city is.

8.) Plan, prototype, test, fix, test, move on to the next feature. I have something on my blog that i wrote in the forums that you might want to take a look at. I really just rant about how i like to do things but it might help with getting a decent plan down.
I would recommend after getting a good plan together that you rapid prototype something in DBPro or another easier language, if not just to test how well features work, or just as a starting point for porting to flash.

Same rules apply for a rubbish around the city, have the garbage dumps only support a certain amount of people and a certain area, when they are overworked, decrease moral of workers, increase the rubbish around the town, decrease city happiness, all based over time.

Like i've said i'm not sure this will be the best way to do this, i'm just thinking out loud.

Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 25th Jun 2010 04:57
well first you are going to create alot of problems using as2, the FB API is AS3. You can still wrtie in 2 but you are going to need to make all the calls to FB manually and updating pages with notifications etc becomes a pain.

you are obviously going to need to do a lot of PHP and MySQL work

for #4 you will need to timestamp the DB for the last time an action was performed then when the player or a visitor enter the area you will need to calculate what would have happened during the time between last log and now.

ex if every 5 minutes the player earns $5 and the player logs in 300 minutes after the last time stamp in the db your AS will need to give them the money for each unit of time and then set a new time stamp in the DB

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 25th Jun 2010 16:37
Thanks guys, I will get a rough and quick prototype running in DBP and then see if maybe I can get AS3, if not, I will use AS2. Thanks for the help!

It's over Shadowtroid!
Satchmo
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 26th Jun 2010 05:21 Edited at: 26th Jun 2010 05:22
Zeus you should make corporate world-facebook edition.

BearCDP
15
Years of Service
User Offline
Joined: 7th Sep 2009
Location: NYC
Posted: 26th Jun 2010 22:58
Just use Flash Builder 4 (free for students or people not employed as software developers), or FlashDevelop (free) with the Flex SDK. Unless you need the features in the actual Flash IDE that make it easier to animate & whatnot, no need to pay for it. AS3 is rather nice to use.

Check out this WIP flash game from the Global Game Jam!
Bugsy
16
Years of Service
User Offline
Joined: 24th Nov 2008
Location: another place in time
Posted: 28th Jun 2010 06:53
Quote: "I am trying to construct a FB game like MyTown called eCity in Flash MX 2004 with AS2. I need some tips. Below in a code snippet are my questions. If any of them can be answered please be so kind to do so. "


skype me.

imageflock.com/img/1272671763.jpg[/img]
skype = isaacpreston. I want to talk to YOU
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 30th Jun 2010 06:13
@Satchmo: Great idea!

@BearCDP: Thanks! I will look into that. I really need AS3 for this to be easier.

@Bugsy: I would if I had a webcam and microphone. I will get Skype when I get my new Alienware.

It's over Shadowtroid!
Bugsy
16
Years of Service
User Offline
Joined: 24th Nov 2008
Location: another place in time
Posted: 30th Jun 2010 06:37
@Bugsy: I would if I had a webcam and microphone. I will get Skype when I get my new Alienware.


we can text chat on skype.

imageflock.com/img/1272671763.jpg[/img]
skype = isaacpreston. I want to talk to YOU
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 30th Jun 2010 08:19
Oh.

It's over Shadowtroid!

Login to post a reply

Server time is: 2025-05-24 01:05:12
Your offset time is: 2025-05-24 01:05:12