Welcome Guest [Log In] [Register]
Posted Image

Username:   Password:
Add Reply
Community interest in cloning LostMagic?; probably as an HTML5 game
Topic Started: May 3 2014, 03:37 PM (2,594 Views)
Draayder
Member Avatar
King DeDeDe
Fun fact: If you search 'Lost Magic Sprite Sheet' and old RM thread from 2009 is actually the first result (you results may vary). I was able to find this one http://spritedatabase.net/files/ds/42/Spri...stMagicHero.png but idk if it's any more helpful. I might try fixing the Isaac sprites at least if that one doesn't work out, I should be able to do it in gimp (I have to do it for my tilesets so I'm used to it).
Posted Image
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
Draayder,May 14 2014
12:53 AM
Fun fact: If you search 'Lost Magic Sprite Sheet' and old RM thread from 2009 is actually the first result (you results may vary). I was able to find this one http://spritedatabase.net/files/ds/42/Spri...stMagicHero.png but idk if it's any more helpful. I might try fixing the Isaac sprites at least if that one doesn't work out, I should be able to do it in gimp (I have to do it for my tilesets so I'm used to it).

Unfortunately not really. I'm unsure if Phaser can handle 2d spritesheets, but handing long spritesheets with only one line seems pretty easy so I'd prefer if it was like that. Don't have this as a top-priority thing, I'm still pretty far away from needing to put in animations.
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
Hey

Not really any updates that you can actually like, see, but I have done a bit of stuff. Mostly lots of research into node.js and socket.io, which will be by far the hardest part of this.

Anyway, here are some images I threw together in 5 minutes that I envision the various menus looking like.

Posted Image

Yeah, there's no password, you can jack anybody's name. I'll probably fix that whenever I can get around to implementing a MySQL backend, but that is waaaaaay down the line. Also this mean that there won't be stat tracking for a while, because there's no way of knowing who is who.

Posted Image

Main lobby place, which is where you go after you "login." On the left you have all the games with what map it is (picked by lobby host), the player who is hosting the game, and a join button.

At the bottom right you have what your current team is. "Monster" is the monster's name and "Item" is the item's name. "Edit Team" is a button that will take you here...

Posted Image

This the team creation screen. "Name" and "Item" are clickable buttons that let you select the monster and item you want for that monster. Stats, pretty picture, and current points change based on what monsters you have selected, and "Done!" is a button to save the changes, and will take you back to the main lobby.

Posted Image

This is what the lobby looks like. "Start" and "Map" are only visible to the host.

Thoughts?
PM Offline Member Quote Post Goto Top
 
Odysseus
Member Avatar
PRRRROMOTION

I think any sort of lobby-based system is awesome, given that the old Nintendo WFC for LostMagic was that dumb "Friend Duel," Rival Duel," and "Duel with Anyone" setup.

Good work so far!
Posted Image
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
Odysseus,May 25 2014
06:03 PM
I think any sort of lobby-based system is awesome, given that the old Nintendo WFC for LostMagic was that dumb "Friend Duel," Rival Duel," and "Duel with Anyone" setup.

Good work so far!

Yeah, I never liked that and see no reason to keep it. It was designed that way probably because it used a peer-to-peer multiplayer system, which is balls. Since I'm implementing a client-server architecture I see no reason to keep that way of getting matches, so I'm going to go with lobbies and stuff.

Unfortunately, I don't have a lot of experience with setting up a real-time multiplayer game. If anybody has any experience in this let me know; I need some help. I'm slowly chugging along with Node.js and Socket.io (I made a chat server!), but I'm going to be going a bit slower until I figure out how to make this work. I have some ideas which will probably work, but I'm not entirely sure.

Also, I have finals this week, so I'll be doing less until they're done.
PM Offline Member Quote Post Goto Top
 
Odysseus
Member Avatar
PRRRROMOTION

I don't know if any of us here have any experience with multiplayer games a la netplay. The only people I could think of would be Custard or Yashichi.
Posted Image
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
Hrm, well if they want to help I'd be very, very happy to get them onboard.

Also, school's over for 2 week! No updates today, but there should be some coming soon this week. Probably like a fun little chat server for starts (important for both the game, and it's teaching me networking with socket.io), then once I figure that out the rest should be much, much easier.
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
I have a chat server made in Node.js! So cool. Also the server I jacked got reclaimed, so I commandeered another. I updated the OP.

You can use /name <name> to change your name. I'll implement whispering to only one person soon™.

So this was a pretty huge step forward in learning networking with socket.io. I have a much better understanding of what I can do now, and I can probably start working on the actual game now, between this little chat server and the fiddling around I did with Phaser. More stuff will probably come soon™.

Here's the magical chat box if you want to mess around with you. You can open up multiple tabs and chat with yourself, as well as, obviously, with other people. Assuming anybody else is ever on at the same time as you, lol.

EDIT: I neglected to post the server-side source, but that's just because it's more work and nobody seems interested in helping. If anybody wants me to I will, but unless somebody asks I'll just not bother.
PM Offline Member Quote Post Goto Top
 
Odysseus
Member Avatar
PRRRROMOTION

Nicely done! So you coded this thing from scratch?
Posted Image
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
Odysseus,Jun 3 2014
05:15 AM
Nicely done! So you coded this thing from scratch?

I used this as a baseline, but I implemented a lot more than what's there. I'll paste the source and edit this post whenever I get home. I still need to somehow figure out how to not make it explode, because it will eventually. It keeps adding the clients to an array and never deletes them, so when lots of people join eventually it'll get slower until it eventually crashes, depending on how big arrays in Javascript can get.

EDIT:
Server
Client
Jade page

I didn't comment things particularly well, but if anybody has questions just ask and I'll explain. Except for the Jade shit. I just kind of bumbled around until I got it right. Kind of hate it.
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
Alright guys... I'm stuck. If somebody knows how to do this, let me know, because I'm stuck.

On page 3 are the various states that the game needs to go through. For instance:
Login
Menu
Lobby
Actual game

And I have no idea how to cycle through these instances. I could just rewrite the inner HTML of a tag and change it that way, but that seems clumsy and stupid. I could just redirect them to a new page, and that's what I'm currently leaning towards, but then how do I keep JS variables between pages? Maybe I can write important things (socket ID, for example) to cookies to keep them persistent, but then how can I make sure that the next time that person connects the cookie is wiped?

Note that I'm entirely sure most of these problems are easily solvable by people who truly know what they're doing, but I'm just breaking into HTML5 dev. If anybody knows anything, hit me up.
PM Offline Member Quote Post Goto Top
 
Draayder
Member Avatar
King DeDeDe
Could you write the variables to a session instead of cookies? Then you could start a new session whenever someone hit login, I know how to do it in php at least. Alternatively having the game set cookies to NULL at the login (or whatever they'll always be going to first) and then remaking them as needed would work.

You could probably do it all in a single page but it might get really cluttered, I think separate pages would be easiest/cleanest.
Posted Image
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
Draayder,Jun 8 2014
05:35 PM
Could you write the variables to a session instead of cookies? Then you could start a new session whenever someone hit login, I know how to do it in php at least. Alternatively having the game set cookies to NULL at the login (or whatever they'll always be going to first) and then remaking them as needed would work.

You could probably do it all in a single page but it might get really cluttered, I think separate pages would be easiest/cleanest.

I've messed with PHP like, once, in my entire life is the only problem :/. I know even less about that than I do about JS. I think I'll just have to figure out how cookies work; setting everything to NULL should actually just work fine.

My Node.js app is gonna get pretty cluttered, but I think I can make it work; there will be much fiddling to do.


EDIT:
Alright, I'm gonna ramble here about how I think the easiest way to do things is, in the hopes that is anybody knows better they'll correct me.

So here's the plan. You go to [website]:4242, are met with a login-style page (first concept image I posted). When you click Submit, things happen.

1. Player object is created server side, which has the following variables attached to it:

  • id (socket id, a magical socket.io thing that makes it work. This is the UID)
  • name (username, should probably also be unique, but it's not necessarily unique)
  • lobbyid (maybe? Honestly, I have no idea how the lobby system would work. I'm thinking that this is a variable that the player object has that indicates which lobby the player is in)
  • monsters[3] (array of monsters the person has in their team. Monster itself is also probably an object with stuff like HP, item, etc)
2. You are redirected to /lobby.html, which has basic lobby stuff (second image I posted).

Everything should be a page, and when you click on something you're redirected to that page. So team creation would be like /team.html. And when you make a lobby it magically generates a new page, like /lobby65465415321.html, or something. That part I'm not entirely sure about.

Then when you start a game I think I should separate the people-in-lobby from the people-in-game, so maybe I have a second Node.js app running and pass all the variables off to second app? Or should I do it all in one? Dunno.

Cookies weren't half as hard as I thought, so thanks Draaydar for pushing me in that direction.
PM Offline Member Quote Post Goto Top
 
Draayder
Member Avatar
King DeDeDe
Well I've still got all my old php notes and stuff, sessions aren't that hard and I could send you some files if you want them. I also know how to do cookies (again in php but I figure JS is p similar).

I'm Draayder on skype as well if you want to talk that way.
Posted Image
PM Offline Member Quote Post Goto Top
 
Pandemic21
No Avatar
Shog
Draayder,Jun 9 2014
02:57 PM
Well I've still got all my old php notes and stuff, sessions aren't that hard and I could send you some files if you want them. I also know how to do cookies (again in php but I figure JS is p similar).

I'm Draayder on skype as well if you want to talk that way.

I'm Pandemic21 on skype, but I'm about to go to bed (I work overnight). When I get home (0900 EST tomorrow) I'll probably put some time into it at some point. I'd love to actually talk to somebody, because I'm kind of drawing blanks as to what to do next. Apparently the socket object that's created can't get passed to another web page, or if it can I can't figure out how, so I'm looking into AJAX to change the current page. That's a *lot* of work though, so I might do it sloppily and either just make everything on one page (which would look like poop) or just change the inner HTML of the body tag (which would look better to the user but poop on the backend).
PM Offline Member Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · General Discussion · Next Topic »
Add Reply