Text Based Browser Game map

I am making a browser game but got some problems making the map.

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

32 Replies - 8499 Views - Last Post: 08 July 2010 - 03:02 AM Rate Topic: -----

#1 silencewar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 15-June 10

Text Based Browser Game map

Posted 15 June 2010 - 03:42 AM

Hi,

I am making a texted based browser game based in the time of the roman empire.
But I am totally lost making my map for it.

I don't know if any of you know games like TribalWars, Travian, Ikariam etc., but they got the overlook (seeing the world divided in continents - and the villages divided in coordinates like (354|465) (x|y).
I would like something like that.

I would like to divide my own graphic into grids - load some information from my MySQL Database (to collect the info about my locations of the villages) - and then show it on my page.

Oh, and my problems is like.. They do only show their map in a 7*7 grid of squares or something like that - like a zoom into the villages.

Do anyone got something about this? Got a question about anything?
Í would apreciate any help! Thank you!

Available:
MySQL
ASP
Javascript
etc.
(not PHP)

Thanks again!

Regards
SilenceWar


EDIT: By the way, I found this page
DreaminCode - Best Way to make map for browser game

It is actually something like that - but I can't get this one to work unfortunately. :s

This post has been edited by silencewar: 15 June 2010 - 03:44 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Text Based Browser Game map

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9088
  • View blog
  • Posts: 34,139
  • Joined: 12-June 08

Re: Text Based Browser Game map

Posted 15 June 2010 - 07:22 AM

So.. what's the problem then? You have information stored in arrays.. arrays that have data stored in the database. Each magnification of the graphic sums or displays the data in a specific way.

Quote

It is actually something like that - but I can't get this one to work unfortunately. :s

What didn't work?
Was This Post Helpful? 0
  • +
  • -

#3 silencewar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 15-June 10

Re: Text Based Browser Game map

Posted 15 June 2010 - 01:16 PM

View Postmodi123_1, on 15 June 2010 - 06:22 AM, said:

What didn't work?


The thing that didn't work was the translation of the PHP code (I got some danish people to do that).
Unfortunately I am not good enough at PHP to translate it properly into ASP.

You are telling me something about some arrays? How do I make it work and make my graphics into grids? I am totally lost, I am sorry.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9088
  • View blog
  • Posts: 34,139
  • Joined: 12-June 08

Re: Text Based Browser Game map

Posted 15 June 2010 - 03:00 PM

View Postsilencewar, on 15 June 2010 - 02:16 PM, said:

View Postmodi123_1, on 15 June 2010 - 06:22 AM, said:

What didn't work?


The thing that didn't work was the translation of the PHP code (I got some danish people to do that).
Unfortunately I am not good enough at PHP to translate it properly into ASP.

You are telling me something about some arrays? How do I make it work and make my graphics into grids? I am totally lost, I am sorry.


Okay.. let's back up here for a minute. How old are you, what's your level of programming experience, what languages are you proficient in, and how are you doing this project?

I need to know how to tailor my response and help. It sounds like you are attempting to build a game using stuff cobbled from other parts of the internet?
Was This Post Helpful? 0
  • +
  • -

#5 silencewar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 15-June 10

Re: Text Based Browser Game map

Posted 15 June 2010 - 03:18 PM

View Postmodi123_1, on 15 June 2010 - 02:00 PM, said:

Okay.. let's back up here for a minute. How old are you, what's your level of programming experience, what languages are you proficient in, and how are you doing this project?

I need to know how to tailor my response and help. It sounds like you are attempting to build a game using stuff cobbled from other parts of the internet?


I'm 21 years old. My level of programming is not too low - but not too high either.

I'm Danish and are fluent in both Danish and English.
- But I'm only coding ASP, MySQL and Javascript at my game.

I'M NOT copying other guys material and are completely done with my building-system...
But.. As you see.. I'm VERY soft on this spot - making any map at all. That's why I am asking for help.

SilenceWar
Was This Post Helpful? 0
  • +
  • -

#6 silencewar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 15-June 10

Re: Text Based Browser Game map

Posted 20 June 2010 - 09:09 AM

I would really apreciate some help!
At least a translation of the code from the other part of Dreamincode.net?

The one I made a link of above..?

- SilenceWar
Was This Post Helpful? 0
  • +
  • -

#7 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Text Based Browser Game map

Posted 20 June 2010 - 10:30 AM

I'm sorry but we're not going to just write the code for you. Asking someone to translate the code from PHP to ASP is asking someone to write your code for you, and that's just not the type of service we offer here, well unless you're wanting to pay someone to do it then we can move this to the Post A Job forum
Was This Post Helpful? 0
  • +
  • -

#8 silencewar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 15-June 10

Re: Text Based Browser Game map

Posted 20 June 2010 - 10:41 AM

View PostPsychoCoder, on 20 June 2010 - 09:30 AM, said:

I'm sorry but we're not going to just write the code for you. Asking someone to translate the code from PHP to ASP is asking someone to write your code for you, and that's just not the type of service we offer here, well unless you're wanting to pay someone to do it then we can move this to the Post A Job forum


Well, the other members in here wouldn't help me to understand what I should do - therefore I saw the only option to get a translation.
I am sorry.

But no thanks - I do not want to pay for a translation. I'll just try another site until someone wants to help me understand.
Thanks for now.
Was This Post Helpful? 0
  • +
  • -

#9 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Text Based Browser Game map

Posted 20 June 2010 - 10:46 AM

So you'll just keep posting until someone at some site will write it for you, way to go. Why not try translating it yourself, then when you run into problems ask for help to get a better understanding of what's going on. How do you expect to ever get anywhere if you're so unwilling to put forth any effort yourself, people aren't going to do your work for you your entire life man.

At some point you're going to have to man up and try some things on your own. There's noting wrong with asking for help, but it's a cop-out to say No one would help me so I'll go elsewhere until someone does, sounds a lot like a kid who gets mad then takes his toys and goes home.

You say no one would help you, I have yet to see you put forth a single iota of effort, so what's there to help with? What you're looking for is someone to do it for you, not for help so at least own that part
Was This Post Helpful? 0
  • +
  • -

#10 silencewar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 15-June 10

Re: Text Based Browser Game map

Posted 20 June 2010 - 11:07 AM

No way - I just told the other guy as well.

But I need help understanding the meaning in: "You got your data in arrays and graphic etc."..
That is not help - I am asking HOW to do it, but I did not ask anyone TO do it.
If I do not understand what the so called "help" means, I asks.
But I guess that if I do not understand what he says I am way to bad at programming and therefore he would not help me..

Then again. I did not say I would ask anyone else on other sites to make it for me. But help me understanding the meaning in how to make such system. I am so sorry I tried asking for help instead of reading 1000 of pages to learn it by my self.
It wont happen again.
Was This Post Helpful? 0
  • +
  • -

#11 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Text Based Browser Game map

Posted 20 June 2010 - 11:12 AM

All we got from you want

Quote

It didnt work


Well how did it not work? What did it do versus what you needed it to do? You're being very vague and not to straightforward and that makes it extremely hard to help anyone.

Quote

I would really apreciate some help!
At least a translation of the code from the other part of Dreamincode.net?


That says "I need someone to take this code and write it in a different language for me", and you're just going to have a very hard time finding anyone to do that for you, especially not being paid for it.

What exactly aren't you understanding? Have you tried writing the code in the link you provided in ASP? Or did you just look at it and say it didnt work?
Was This Post Helpful? 0
  • +
  • -

#12 silencewar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 15-June 10

Re: Text Based Browser Game map

Posted 20 June 2010 - 12:46 PM

Okay. Here is a full description - including what I found out, vs what I need.

First of all. I am working on a text based browser game - based in the time of the roman empire.
I have made a village system for my game but to navigate from village to village I need a map.
I am by the way all crazy about the way Tribalwars.net have done:

Posted Image

The big map at the left making different kinds of images of villages - but also images like forests and such.
Not the least I can see this map is made of grids to split the graphic (1 grid with a village and another for a forest).

Personally I think this effect is made of Javascript - but here is what I got.

I corrected a translation I got for about 3 month ago and got this result:

<%
For y = 40 To 1 Step -1
  For x = 1 To 40
  
      Set rs = Server.CreateObject("ADODB.Recordset")
      rs.Open "SELECT * FROM map WHERE x = '" & x & "' AND y = '" & y & "'",Net
      Do While Not rs.EOF
        Response.Write "<img src=""images/harta/lan_" & rs("tip") & rs("subtip") & ".gif"">"
        rs.MoveNext
      Loop
      Set rs = Nothing 

  Next
Next 
%>
<br> 
<br>



<%
If Request.ServerVariables("REQUEST_METHOD") <> "POST" Then
    For y = 40 To 34 Step -1
        For x = 1 To 7
      Set rs = Server.CreateObject("ADODB.Recordset")
      rs.Open "SELECT * FROM map WHERE x = '" & x & "' AND y = '" & y & "'",Net
      Do While Not rs.EOF
        Response.Write "<img src=""images/harta/lan_" & rs("tip") & rs("subtip") & ".gif"">"
        rs.MoveNext
      Loop
      Set rs = Nothing 
		   
        Next
    Next
    Response.Write "<div style=""margin-top: 380px;"">"
    Response.Write "<form method=""POST"" action=""index2.asp"">"
    Response.Write "x: <input type=""text"" style=""width:50px;"" name=""x""><br>"
    Response.Write "y: <input type=""text"" style=""width:50px;"" name=""y""><br>"
    Response.Write "<input type=""submit"" name=""submit"" value=""Cauta!""><br>"
    Response.Write "</form>"
    Response.Write "</div>"
Else
    cx = Request.Form("x")
    cy = Request.Form("y")
    cy1 = cy + 3
    cx1 = cx - 3
    cy2 = cy - 3
    cx2 = cx + 3
    For y = cy1 to cy2 Step -1
        For x = cx1 To cx2

      Set rs = Server.CreateObject("ADODB.Recordset")
      rs.Open "SELECT * FROM map WHERE x = '" & x & "' AND y = '" & y & "'",Net
      Do While Not rs.EOF %>
        <a href="http://dk1.btworldwars.com/index.asp?village=<%=RS("byinfoid")%>"><img src="http://gfx.dk1.btworldwars.com/map/option<%=rs("tip")%><%=rs("subtip")%>.0.jpg">""</a>
		<%
        rs.MoveNext
      Loop
      Set rs = Nothing 
			
			
        Next
    Next
    Response.Write "<div style=""margin-top: 380px;"">"
    Response.Write "<form method=""POST"" action=""index2.asp"">"
    Response.Write "x: <input type=""text"" style=""width:50px;"" name=""x"" value=""" & Request.Form("x") & """><br>"
    Response.Write "y: <input type=""text"" style=""width:50px;"" name=""y"" value=""" & Request.Form("y") & """><br>"
    Response.Write "<input type=""submit"" name=""submit"" value=""Cauta!""><br>"
    Response.Write "</form>"
    Response.Write "</div>"
End If
%> 



And the visual result made it clear that it would be a lot of hard work even to put this together in grids (with this code (if even possible)), because... If I should make just a forest here and there and if I should make a worldmap I would have to make several of thousands database rows to fill out each coordinate on the map.
Please ask if you have question even this far..


The problem for me is that getting this far have been a strugle. And I don't have a clue on how to make these grids and how to choose which grid being villages and which being forests or such things.
I am working on getting x and y coordinates like the codes above just got great!
As said before I am using ASP, Javascript and a MySQL database.

Would apreciate any advise and please ask! :)
Thanks in advance
Was This Post Helpful? 0
  • +
  • -

#13 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5801
  • View blog
  • Posts: 12,636
  • Joined: 16-October 07

Re: Text Based Browser Game map

Posted 20 June 2010 - 01:52 PM

You'd probably have better luck if you were using something more current. ASP hasn't really had much of following since IIS 5.0 and Microsoft only marginally supports it anymore. Seriously, I think your code gave me a flashback.

As to approach, you have a grid on a web page, 40x40. First off, you need to make a web page with 40x40 cells. Maybe table with images. Also, the cell should have an id, something like:
<td id="gtd_05_34">
<a href="click.aspx?id=gtd_05_34"><img id="gimg_05_34" src="blank.png" /></a>
</td>



AJAX is probably the way to go if you want anything that doesn't refresh to the point of annoyance. So maybe forget the hand written cell and generate it with Javascript. JSON is a good choice. Our JSON challenge had some good code. I have an entry in there with dynamic table updates, which is kind of what I'm thinking.

Before you do anything else, make a static HTML page that shows what you'd want a screen shot to look like. If you can't do that, you're heading in the wrong direction anyway.

Good luck.
Was This Post Helpful? 0
  • +
  • -

#14 silencewar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 15-June 10

Re: Text Based Browser Game map

Posted 20 June 2010 - 02:28 PM

View Postbaavgai, on 20 June 2010 - 12:52 PM, said:

You'd probably have better luck if you were using something more current. ASP hasn't really had much of following since IIS 5.0 and Microsoft only marginally supports it anymore. Seriously, I think your code gave me a flashback.

As to approach, you have a grid on a web page, 40x40. First off, you need to make a web page with 40x40 cells. Maybe table with images. Also, the cell should have an id, something like:
<td id="gtd_05_34">
<a href="click.aspx?id=gtd_05_34"><img id="gimg_05_34" src="blank.png" /></a>
</td>



If I am doing it this way and want to cover a map actually 500*500 grids, this would be a "slow" solution, or?


View Postbaavgai, on 20 June 2010 - 12:52 PM, said:

AJAX is probably the way to go if you want anything that doesn't refresh to the point of annoyance. So maybe forget the hand written cell and generate it with Javascript. JSON is a good choice. Our JSON challenge had some good code. I have an entry in there with dynamic table updates, which is kind of what I'm thinking.


Yeah AJAX. I know Tribalwars are using that too. I have not seen the link yet, but thanks :) At least this far..
I do actually think I understand it.. some of it..

I do have a question though.
This total map, shouldn't I even make one of those? Just a table as big as the one that should be shown for the users, like 9*9 grids?? And then every grid (in this case <td's>) got a picture-code or something like that. How to I tell the map that: "now it's a village and now it's a forest"?
Like the map to the right in tribalwars - You can see how the map is far away and it never changes. Like it have been made allready before the world begins..? Hope you understand what I mean and I am sorry if this is answered in the link you gave me. I will take a look at it right away.

View Postbaavgai, on 20 June 2010 - 12:52 PM, said:

Before you do anything else, make a static HTML page that shows what you'd want a screen shot to look like. If you can't do that, you're heading in the wrong direction anyway.


Yes I know. (you mean the images and the design of the tables, right?)

Thanks.
Was This Post Helpful? 0
  • +
  • -

#15 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5801
  • View blog
  • Posts: 12,636
  • Joined: 16-October 07

Re: Text Based Browser Game map

Posted 20 June 2010 - 03:33 PM

View Postsilencewar, on 20 June 2010 - 03:28 PM, said:

If I am doing it this way and want to cover a map actually 500*500 grids, this would be a "slow" solution, or?


You offer code for a 40x40 grid and now you want 500x500? Sorry, I think we're both confused on this one.

I just looked at TribalWars, which seems to be the established game you're intent on ripping off. I assume what you have in mind is the "graphic village overview"?

They did this by just supplying a base image and using map tags for the roll overs. Pure web sites are easy to look at because they must supply the source to the browser. It is the game engine, the stuff that runs on the server side, that is obfuscated.

TribalWars doesn't seem to have that many tricks going on. It is a good example of a basic browser game. It takes advantage of the medium and most clickable elements result in a simple page request and a new web page. The only AJAX I saw was the map nav screen. The detail map was 7x7, the world map was just a single graphic.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3