roguelike using php?

C++, C#, Java, PHP, ect...
Post Reply
Age of Fable
Posts: 54
Joined: Fri Feb 19, 2010 6:37 am

roguelike using php?

Post by Age of Fable »

I found a reference on roguebasin to roguelikes made using php.

I know a bit of php (used it for the game in my sig), but I have no idea how you'd do this (other than having the screen reload each time anything moved or changed).

Can anyone help me?
Easy to play - hard to survive. http://www.ageoffable.net
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: roguelike using php?

Post by Jackolantern »

Keep in mind that since roguelikes use ASCII characters to represent the map, provided you do not use a web page design that is heavy in graphics, your reloads would be very fast since there would only be a (relatively) small amount of text being transmitted. If you absolutely want to go no-reloads, you could look into using AJAX techniques to transmit the map, since, again, all you are needing to transmit is ASCII characters.
The indelible lord of tl;dr
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: roguelike using php?

Post by Callan S. »

It depends if there's PVP or not. If not, you don't really need to keep an eye on every other character's every movement.

I've been thinking about unreal world and some sort of php game...
Fight Cycle : My latest Browser game WIP
Driftwurld : My Browser Game WIP
Philosopher Gamer : My Blog
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: roguelike using php?

Post by Jackolantern »

Ahhh, yeah. Forgot that roguelikes typically display the other players, too. That would actually be pretty neat to have a roguelike map generator PHP script for use in AJAX calls.
The indelible lord of tl;dr
Age of Fable
Posts: 54
Joined: Fri Feb 19, 2010 6:37 am

Re: roguelike using php?

Post by Age of Fable »

Do you know of an introductory page about using Ajax?
Easy to play - hard to survive. http://www.ageoffable.net
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: roguelike using php?

Post by hallsofvallhalla »

i built this, a quick demo. All the players are players who logged in, but I have not made the characters remove once logged out, if they move if will update. When you lumber it hits a database and in realtime and updates without refresh.

This is basically a sound start for a good game.

http://indie-resource.com/projectbattle/login.php

it updates using ajax, i i will release source today or tomorrow with some videos.;
Age of Fable
Posts: 54
Joined: Fri Feb 19, 2010 6:37 am

Re: roguelike using php?

Post by Age of Fable »

Does this site work in a similar way?
Easy to play - hard to survive. http://www.ageoffable.net
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: roguelike using php?

Post by hallsofvallhalla »

hmm i cant tell where they are getting the scenes, if it is PHP before hand or if they are using ajax.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: roguelike using php?

Post by Jackolantern »

Age of Fable wrote:Does this site work in a similar way?
Nope, that site is just using regular Javascript techniques (non-AJAX) to show and hide page elements. If you look at the page source, you will see a huge pile of ASCII characters. It is sending all of the characters ahead of time, and then using JS to animate them. That could possibly work as well for your game, and then you just use AJAX to tell where other players are, tell the server what the player is doing, get updates, etc. That way, if the player edited the ASCII in the JS on their end, they would just be giving themselves a disadvantage since they would no longer be able to see the "real" state coming from the server.
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: roguelike using php?

Post by hallsofvallhalla »

ah i didnt see the ASCII characters, was wondering where they were pulling them from.
Post Reply

Return to “Coding”