Author Topic: Map Features  (Read 1191 times)

Offline FirePenguins

  • Level 10
  • *
  • Posts: 59
  • Reputation: +0/-0
    • View Profile
    • The Iron Helm
Map Features
« on: January 21, 2009, 09:16:02 PM »
So I've created the basic browser based game map that is a 10x10 square of image inputs so that when you click on one of them stuff happens.  Eventually I hope to learn more about ajax and make the whole map more ajax based so that it doesn't reload the whole page every time you click on a square.  If anyone knows of any resources that might be helpful for this that would be great!  My main question though is that I also eventually want the map to have a variable size to where when a new player joins a little chunk of the map is created and added on to the edge where that player would start.  I don't really have any good ideas for ways to do this though so if anyone has any thoughts?

Offline nicmo

  • Game Owner
  • Level 5
  • *
  • Posts: 17
  • Reputation: +0/-0
    • View Profile
Re: Map Features
« Reply #1 on: February 07, 2009, 09:38:38 AM »
as far as i know, you must create the entire grid from start and thats the way everyone else does... when someone new joins, you assign them a X, Y Position for thier home base.
http://www.bulletdrive.com/ A Street(ish) Racing Game

Offline Scion

  • Level 27
  • **
  • Posts: 402
  • Reputation: +11/-0
    • View Profile
Re: Map Features
« Reply #2 on: February 07, 2009, 12:15:32 PM »
for just displaying the map...you could stick with the 10*10 grid but have all the squares that they cant see dispay a fog image, untill they have visited the neighbouring tile.

unless im mis-understanding what your wanting to achieve.


Offline FirePenguins

  • Level 10
  • *
  • Posts: 59
  • Reputation: +0/-0
    • View Profile
    • The Iron Helm
Re: Map Features
« Reply #3 on: February 19, 2009, 10:34:43 PM »
as far as i know, you must create the entire grid from start and thats the way everyone else does... when someone new joins, you assign them a X, Y Position for thier home base.

This is what I have done now :)  Got it working with a 100 x 100 that displays 10x10 at a time and then you click on arrows to move 10 over or down.  Not ajaxed yet though so it's not very smooth.

for just displaying the map...you could stick with the 10*10 grid but have all the squares that they cant see dispay a fog image, until they have visited the neighbouring tile.

That's basically what I've done (no fog of war yet though) I was just thinking it would be nice if the map size adjusted itself to accommodate the current number of players.  To solve this I just have it set up to where it places a new player at the edge of current players so that a new player does not start off in the middle of no where.

Offline Sraet

  • Level 6
  • *
  • Posts: 24
  • Reputation: +0/-0
    • View Profile
Re: Map Features
« Reply #4 on: February 19, 2009, 11:00:47 PM »
So what you are looking for is a way to search the 100x100 grid and find a place thats empty but within X of another player or three?

Offline lolninja

  • Level 19
  • *
  • Posts: 194
  • Reputation: +5/-0
  • BSc powered Programmer
    • View Profile
    • HTTPmmo
Re: Map Features
« Reply #5 on: February 20, 2009, 07:22:05 AM »
When I was working on a tile backed game I came to the conclusion that to make it easily tileable its best to make groups of map sections, for example you say you have already created a 100x100 block of map, what you could do is reduct this to say 25x25, by make a fair few of them, then tiles theres, for example you make a 25x25 block of terrain that has a few mountains in, then another 25x25 block that has a lake.
Then you tile these groups in you main game, this allows you to easily expand the game area, without adding thousands of rows into a database.
As for player placement you could assign a number of players to a given tile group, say 5 players per 25x25 block, then when a 6th player comes along create a new 25x25 block, located in an area which has an average level that is low enough so they dont get picked on to much.

Offline Sraet

  • Level 6
  • *
  • Posts: 24
  • Reputation: +0/-0
    • View Profile
Re: Map Features
« Reply #6 on: February 20, 2009, 01:54:21 PM »
Take a look at this post http://community.bbgamezone.net/index.php?topic=1863.0 as I think you are both asking the same question, and I answered it a bit more over there (I am not making that diagram again... hehe)

Offline FirePenguins

  • Level 10
  • *
  • Posts: 59
  • Reputation: +0/-0
    • View Profile
    • The Iron Helm
Re: Map Features
« Reply #7 on: February 23, 2009, 09:08:47 PM »
Thanks for the tips :)

I've got a map that is working great and has all of the basic features I want now.  However, I'm now in the process of using ajax (js and httpRequest) to update the map as the player moves around on it and update the player's resources and other information without the player having to refresh the page every time.  Is the best way to this just to take the main chunk of code for the map and put it in a separate php file that takes two variables (x and y coordinates) and then call this every time the user tries to scroll the map and set the innerhtml of a div = to that file?  I've done a large project with ajax just little things like clock and form validation check before the user submits it.  Thanks!

Offline Sraet

  • Level 6
  • *
  • Posts: 24
  • Reputation: +0/-0
    • View Profile
Re: Map Features
« Reply #8 on: February 24, 2009, 06:12:10 AM »
I am not so goodly with the ajax, sorry. Something I am picking up on as well but you sound ahead of me :)

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal