Game locations and interaction.

For discussions about game development that does not fit in any of the other topics.
Post Reply
User avatar
Ravinos
Posts: 281
Joined: Tue Sep 15, 2009 4:14 pm

Game locations and interaction.

Post by Ravinos »

I want to pose a question from a design standpoint. Would it be better to have one massive script that Morphs to the information in the database or make each location it's own script? I'm asking this because as I try to add more and more advanced features to my game the script is getting bigger and bigger. Right now it's sitting around 90kb. I've recently started breaking down the script into more specialized files for each location. These files are included whenever you begin combat. These files range from 10kb to 20kb in size but there are 15 of them right now.

The plus side to breaking them down is that I can now make very specific changes to each location in regards to special features and events for each zone.

What do you guys think? Is there a better way to go about this?
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: Game locations and interaction.

Post by Xaleph »

Size does not matter on the server. Unless you are trying to load in >2mb every page request. ( your server will die, soon) Other then that, it`s all cool. Mostly because the file be cached soon. But its always a good idea to seperate code in to seperate files. Its better for maintaining and organising.
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: Game locations and interaction.

Post by Callan S. »

I think if you can find similarities in various areas, you should look at how you might standardise those bits of code. If only for your own future sanity.

But for nuances and quirks of various areas, having their own code, it probably makes the game more unique and likeable! A bit of off standard is fun!
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Game locations and interaction.

Post by hallsofvallhalla »

Functions and classes!

Heheh i too worry about the same thing. Sometimes my ideas are bigger than the page and I worry if it is too much. Guess testing is the best way to get your answer.
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: Game locations and interaction.

Post by SpiritWebb »

I personally would go with each location a new one...just imo
Image

Image
User avatar
Nexus
Posts: 293
Joined: Sat Jun 18, 2011 10:42 pm

Re: Game locations and interaction.

Post by Nexus »

the way our game handles locations is a bit of both really...the index grabs the description of the location and we post it and we have if( ) statements for each location the player could be at with an include_once( ) function including say you have a location name Forest, we have a unique locations sidebar with each place you could go in to in the overall huge location and we name that sidebar forest.php. simple really but thats how we roll :)
Post Reply

Return to “General Development”